remove conditions only works on v1/v2

This commit is contained in:
Martin Michelsen
2024-01-05 21:53:54 -08:00
parent d32c5f1d61
commit 3b9684d8ac
5 changed files with 4 additions and 19 deletions
+2 -2
View File
@@ -1513,7 +1513,7 @@ static void server_command_infinite_hp(shared_ptr<Client> c, const std::string&)
c->config.toggle_flag(Client::Flag::INFINITE_HP_ENABLED);
bool enabled = c->config.check_flag(Client::Flag::INFINITE_HP_ENABLED);
send_text_message_printf(c, "$C6Infinite HP %s", enabled ? "enabled" : "disabled");
if (enabled && l->is_game()) {
if (enabled && l->is_game() && is_v1_or_v2(c->version())) {
send_remove_conditions(c);
}
}
@@ -1524,7 +1524,7 @@ static void proxy_command_infinite_hp(shared_ptr<ProxyServer::LinkedSession> ses
ses->config.toggle_flag(Client::Flag::INFINITE_HP_ENABLED);
bool enabled = ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED);
send_text_message_printf(ses->client_channel, "$C6Infinite HP %s", enabled ? "enabled" : "disabled");
if (enabled && ses->is_in_game) {
if (enabled && ses->is_in_game && is_v1_or_v2(ses->version())) {
send_remove_conditions(ses->client_channel, ses->lobby_client_id);
send_remove_conditions(ses->server_channel, ses->lobby_client_id);
}
+1 -1
View File
@@ -1717,7 +1717,7 @@ static HandlerResult C_6x(shared_ptr<ProxyServer::LinkedSession> ses, uint16_t c
ses->floor = cmd.floor;
} else if (data[0] == 0x0C) {
if (ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) {
if (is_v1_or_v2(ses->version()) && ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) {
send_remove_conditions(ses->client_channel, ses->lobby_client_id);
send_remove_conditions(ses->server_channel, ses->lobby_client_id);
}
+1 -1
View File
@@ -1183,7 +1183,7 @@ static void on_received_condition(shared_ptr<Client> c, uint8_t command, uint8_t
auto l = c->require_lobby();
if (l->is_game()) {
forward_subcommand(c, command, flag, data, size);
if (cmd.client_id == c->lobby_client_id) {
if (is_v1_or_v2(c->version()) && (cmd.client_id == c->lobby_client_id)) {
bool player_cheats_enabled = l->check_flag(Lobby::Flag::CHEATS_ENABLED) || (c->license->flags & License::Flag::CHEAT_ANYWHERE);
if (player_cheats_enabled && c->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) {
send_remove_conditions(c);
-10
View File
@@ -5270,16 +5270,6 @@ I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-2 (Jess) (version=GC_V3 co
0000 | B0 00 24 00 00 00 00 00 00 00 00 00 09 43 36 49 | $ C6I
0010 | 6E 66 69 6E 69 74 65 20 48 50 20 65 6E 61 62 6C | nfinite HP enabl
0020 | 65 64 00 00 | ed
I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-2 (Jess) (version=GC_V3 command=60 flag=00)
0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4
0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 |
0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 |
0030 | 00 00 00 00 |
I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-5 (Jonah) (version=GC_V3 command=60 flag=00)
0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4
0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 |
0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 |
0030 | 00 00 00 00 |
I 94381 2023-12-29 15:39:51 - [Commands] Received from C-5 (Jonah) (version=GC_V3 command=60 flag=00)
0000 | 60 00 14 00 40 04 01 00 6D 1F 81 44 39 99 3B 44 | ` @ m D9 ;D
0010 | 00 00 00 00 |
-5
View File
@@ -1200,11 +1200,6 @@ I 49108 2023-05-26 16:19:14 - [Commands] Sending to C-2 (Jess) (version=GC comma
0000 | B0 00 24 00 00 00 00 00 00 00 00 00 09 43 36 49 | $ C6I
0010 | 6E 66 69 6E 69 74 65 20 48 50 20 65 6E 61 62 6C | nfinite HP enabl
0020 | 65 64 00 00 | ed
I 49108 2023-05-26 16:19:14 - [Commands] Sending to C-2 (Jess) (version=GC command=B0 flag=00)
0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4
0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 |
0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 |
0030 | 00 00 00 00 |
I 49108 2023-05-26 16:19:16 - [Commands] Received from C-2 (Jess) (version=GC command=06 flag=00)
0000 | 06 00 18 00 00 00 00 00 00 00 00 00 09 45 24 69 | E$i
0010 | 6E 66 74 70 00 00 00 00 | nftp