- fixed changing username in the lobby

This commit is contained in:
Mark Vejvoda 2011-03-26 16:51:26 +00:00
parent 5648080095
commit 8f2613e216
2 changed files with 8 additions and 0 deletions

View File

@ -737,6 +737,9 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
*(serverInterface->getSwitchSetupRequests()[factionIdx]) = switchSetupRequest;
this->playerStatus = switchSetupRequest.getNetworkPlayerStatus();
this->name = switchSetupRequest.getNetworkPlayerName();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] networkPlayerName [%s]\n",__FILE__,__FUNCTION__,__LINE__,serverInterface->getSwitchSetupRequests()[factionIdx]->getNetworkPlayerName().c_str());
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] factionIdx = %d, switchSetupRequest.getNetworkPlayerName() [%s] switchSetupRequest.getNetworkPlayerStatus() = %d, switchSetupRequest.getSwitchFlags() = %d\n",__FILE__,__FUNCTION__,__LINE__,factionIdx,switchSetupRequest.getNetworkPlayerName().c_str(),switchSetupRequest.getNetworkPlayerStatus(),switchSetupRequest.getSwitchFlags());
}

View File

@ -995,11 +995,16 @@ bool SwitchSetupRequest::receive(Socket* socket) {
data.selectedFactionName.nullTerminate();
data.networkPlayerName.nullTerminate();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] data.networkPlayerName [%s]\n",__FILE__,__FUNCTION__,__LINE__,data.networkPlayerName.getString().c_str());
return result;
}
void SwitchSetupRequest::send(Socket* socket) const {
assert(data.messageType==nmtSwitchSetupRequest);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] data.networkPlayerName [%s]\n",__FILE__,__FUNCTION__,__LINE__,data.networkPlayerName.getString().c_str());
NetworkMessage::send(socket, &data, sizeof(data));
}