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) if(_removeBonusCallBack != nullptr)
_removeBonusCallBack(ObjectNameTag(tmp)); _removeBonusCallBack(ObjectNameTag(tmp));
break; break;
default: 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) if(player.first != senderId)
_socket.send(sendPacket, player.first); _socket.send(sendPacket, player.first);
} }
break;
case MsgType::Error:
break; break;
default: default:
throw std::logic_error{"Server::processCustomPacket: unknown MsgType"}; return;
} }
} }

View File

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

View File

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