1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

change servercode to make it more robust

This commit is contained in:
Michael
2023-08-14 00:08:48 +02:00
committed by GitHub
parent ae63088564
commit 1d76f456ad
6 changed files with 80 additions and 10 deletions

View File

@ -86,6 +86,8 @@ template<typename T> class CApplyOnLobby : public CBaseForLobbyApply
public:
bool applyOnLobbyHandler(CServerHandler * handler, void * pack) const override
{
boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
T * ptr = static_cast<T *>(pack);
ApplyOnLobbyHandlerNetPackVisitor visitor(*handler);
@ -454,11 +456,11 @@ void CServerHandler::setPlayer(PlayerColor color) const
sendLobbyPack(lsp);
}
void CServerHandler::setPlayerOption(ui8 what, si8 dir, PlayerColor player) const
void CServerHandler::setPlayerOption(ui8 what, si16 value, PlayerColor player) const
{
LobbyChangePlayerOption lcpo;
lcpo.what = what;
lcpo.direction = dir;
lcpo.value = value;
lcpo.color = player;
sendLobbyPack(lcpo);
}