chore: improved legibility and logging in server
This commit is contained in:
parent
0703b30ed9
commit
a58196a04b
1 changed files with 6 additions and 4 deletions
|
|
@ -34,16 +34,18 @@ void handle_reveal_clue(zmq::multipart_t const &message) {
|
|||
|
||||
void handle_authorised_message(std::string_view const &sender, NetworkData::MessageType type, zmq::multipart_t &message) {
|
||||
switch (type) {
|
||||
default:
|
||||
print_line("Server: Encountered unknown message type, sending NOK_UNKNOWN_MSG");
|
||||
multipart(sender, NetworkData::MSG_NOK, NetworkData::NOK_UNKNOWN_MSG, message).send(*service->socket);
|
||||
return;
|
||||
case NetworkData::MSG_BEAT:
|
||||
print_line("Server: Received beat, storing timestamp");
|
||||
service->lastBeat = Time::get_singleton()->get_unix_time_from_system();
|
||||
return;
|
||||
case NetworkData::MSG_REVEAL:
|
||||
print_line("Server: Received revealed clue, ", (int)to_clue_id(message.at(2)));
|
||||
handle_reveal_clue(message);
|
||||
return;
|
||||
default:
|
||||
print_line("Server: Encountered unknown message type, sending NOK_UNKNOWN_MSG response");
|
||||
multipart(sender, NetworkData::MSG_NOK, NetworkData::NOK_UNKNOWN_MSG, message).send(*service->socket);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue