Made case announcement use netcode instead of calling tsuserver commands.

This commit is contained in:
Cerapter 2018-12-14 19:53:53 +01:00
parent a852ab504b
commit 9b8173a1f9
2 changed files with 15 additions and 16 deletions

View File

@ -19,7 +19,7 @@ AOCaseAnnouncerDialog::AOCaseAnnouncerDialog(QWidget *parent, AOApplication *p_a
ui_announcer_buttons->setOrientation(Qt::Horizontal);
ui_announcer_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(ui_announcer_buttons, SIGNAL(accepted()), this, SLOT(on_ok_pressed()));
QObject::connect(ui_announcer_buttons, SIGNAL(accepted()), this, SLOT(ok_pressed()));
QObject::connect(ui_announcer_buttons, SIGNAL(rejected()), this, SLOT(cancel_pressed()));
setUpdatesEnabled(false);

View File

@ -3438,29 +3438,28 @@ void Courtroom::on_casing_clicked()
if (ao_app->casing_alerts_enabled)
{
if (ui_casing->isChecked())
ao_app->send_server_packet(new AOPacket("CT#" + ui_ooc_chat_name->text() + "#/setcase"
+ " \"" + ao_app->get_casing_can_host_cases() + "\""
+ " " + QString::number(ao_app->get_casing_cm_enabled())
+ " " + QString::number(ao_app->get_casing_defence_enabled())
+ " " + QString::number(ao_app->get_casing_prosecution_enabled())
+ " " + QString::number(ao_app->get_casing_judge_enabled())
+ " " + QString::number(ao_app->get_casing_juror_enabled())
+ " " + QString::number(ao_app->get_casing_steno_enabled())
ao_app->send_server_packet(new AOPacket("SETCASE#\"" + ao_app->get_casing_can_host_cases() + "\""
+ "#" + QString::number(ao_app->get_casing_cm_enabled())
+ "#" + QString::number(ao_app->get_casing_defence_enabled())
+ "#" + QString::number(ao_app->get_casing_prosecution_enabled())
+ "#" + QString::number(ao_app->get_casing_judge_enabled())
+ "#" + QString::number(ao_app->get_casing_juror_enabled())
+ "#" + QString::number(ao_app->get_casing_steno_enabled())
+ "#%"));
else
ao_app->send_server_packet(new AOPacket("CT#" + ui_ooc_chat_name->text() + "#/setcase \"\" 0 0 0 0 0 0#%"));
ao_app->send_server_packet(new AOPacket("SETCASE#\"\"#0#0#0#0#0#0#%"));
}
}
void Courtroom::announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno)
{
if (ao_app->casing_alerts_enabled)
ao_app->send_server_packet(new AOPacket("CT#" + ui_ooc_chat_name->text() + "#/anncase \""
+ title + "\" "
+ QString::number(def) + " "
+ QString::number(pro) + " "
+ QString::number(jud) + " "
+ QString::number(jur) + " "
ao_app->send_server_packet(new AOPacket("CASEA#\""
+ title + "\"#"
+ QString::number(def) + "#"
+ QString::number(pro) + "#"
+ QString::number(jud) + "#"
+ QString::number(jur) + "#"
+ QString::number(steno)
+ "#%"));
}