diff options
| author | wewlad1 <30403438+wewlad1@users.noreply.github.com> | 2018-10-20 08:22:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-20 08:22:33 -0700 |
| commit | 2c5ef116ebc19e9b57d64a776172efea8d510cef (patch) | |
| tree | dc751162066c7a8b016f7b53c69a8c1220d736a9 | |
| parent | c3db67c64373bbb196aac5929525fd9dd10cce7b (diff) | |
| parent | 2ba3e86a1d617b2b3096f62f35e451b140604ffe (diff) | |
Merge pull request #7 from Iamgoofball/kick_reason
[Requires 2.6.0] Adds reason support for kicks and bans to the client.
| -rw-r--r-- | packet_distribution.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/packet_distribution.cpp b/packet_distribution.cpp index 6f29b2e2..cb486516 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -539,24 +539,22 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else if (header == "KK") { - if (courtroom_constructed && f_contents.size() > 0) + if (courtroom_constructed && f_contents.size() >= 1) { - int f_cid = w_courtroom->get_cid(); - int remote_cid = f_contents.at(0).toInt(); - - if (f_cid != remote_cid && remote_cid != -1) - goto end; - - call_notice("You have been kicked."); + call_notice("You have been kicked from the server.\nReason: " + f_contents.at(0)); construct_lobby(); destruct_courtroom(); } - } else if (header == "KB") { - if (courtroom_constructed && f_contents.size() > 0) - w_courtroom->set_ban(f_contents.at(0).toInt()); + if (courtroom_constructed && f_contents.size() >= 1) + { + call_notice("You have been banned from the server.\nReason: " + f_contents.at(0)); + construct_lobby(); + destruct_courtroom(); + } + } else if (header == "BD") { |
