Code refactoring.

master
Vectozavr 2021-10-17 14:44:17 +07:00
parent 42b2dcd27c
commit 9356008258
4 changed files with 2 additions and 13 deletions

View File

@ -120,9 +120,8 @@ void Client::processCustomPacket(MsgType type, sf::Packet& packet) {
if(_removeBonusCallBack != nullptr)
_removeBonusCallBack(ObjectNameTag(tmp));
break;
default:
throw std::logic_error{"Client::processCustomPacket: unknown MsgType"};
return;
}
}

View File

@ -116,12 +116,9 @@ void Server::processCustomPacket(MsgType type, sf::Packet& packet, sf::Uint16 se
if(player.first != senderId)
_socket.send(sendPacket, player.first);
}
break;
case MsgType::Error:
break;
default:
throw std::logic_error{"Server::processCustomPacket: unknown MsgType"};
return;
}
}

View File

@ -120,10 +120,6 @@ bool ClientUDP::process()
processDisconnect(targetId);
break;
case MsgType::Confirm:
break;
default:
processCustomPacket(type, packet);
}

View File

@ -117,9 +117,6 @@ bool ServerUDP::process()
_socket.sendRely(sendPacket, client);
processDisconnect(senderId);
break;
case MsgType::Confirm:
break;
default:
processCustomPacket(type, packet, senderId);