Ticket #2676: NetServer.cpp.patch
File NetServer.cpp.patch, 1.0 KB (added by , 10 years ago) |
---|
-
NetServer.cpp
837 837 { 838 838 CSimulationMessage* simMessage = static_cast<CSimulationMessage*> (message); 839 839 840 // Ignore messages sent by one player on behalf of another player 841 PlayerAssignmentMap::iterator it = server.m_PlayerAssignments.find(session->GetGUID()); 842 if (it == server.m_PlayerAssignments.end() || it->second.m_PlayerID != simMessage->m_Player) 843 return true; 844 840 845 // Send it back to all clients immediately 841 846 server.Broadcast(simMessage); 842 847 … … 845 850 server.m_SavedCommands.resize(simMessage->m_Turn + 1); 846 851 server.m_SavedCommands[simMessage->m_Turn].push_back(*simMessage); 847 852 848 // TODO: we should do some validation of ownership (clients can't send commands on behalf of opposing players)849 850 853 // TODO: we shouldn't send the message back to the client that first sent it 851 854 } 852 855 else if (message->GetType() == (uint)NMT_SYNC_CHECK)