make some progress toward getting psogc to work again

This commit is contained in:
Martin Michelsen
2018-11-10 23:52:23 -08:00
parent 00bbd6a0a3
commit 833bf90333
20 changed files with 286 additions and 124 deletions
+5 -2
View File
@@ -31,13 +31,15 @@ struct ItemSubcommand {
void check_size(uint16_t size, uint16_t min_size, uint16_t max_size) {
if (size < min_size) {
throw runtime_error("command too small");
throw runtime_error(string_printf("command too small (expected at least %zX bytes, got %zX bytes)",
min_size, size));
}
if (max_size == 0) {
max_size = min_size;
}
if (size > max_size) {
throw runtime_error("command too large");
throw runtime_error(string_printf("command too large (expected at most %zX bytes, got %zX bytes)",
max_size, size));
}
}
@@ -64,6 +66,7 @@ void forward_subcommand(shared_ptr<Lobby> l, shared_ptr<Client> c,
}
send_command(target, command, flag, p, count * 4);
} else {
// TODO: don't send the command back to the client it originated from
send_command(l, command, flag, p, count * 4);
}
}