[Gcblue-commits] gcb_wx/src/network tcMultiplayerInterface.cpp, 1.35, 1.36 tcNetworkInterface.cpp,
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:07
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/network Modified Files: tcMultiplayerInterface.cpp tcNetworkInterface.cpp Log Message: Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcMultiplayerInterface.cpp 21 Apr 2006 23:29:09 -0000 1.35 --- tcMultiplayerInterface.cpp 24 Oct 2006 01:34:05 -0000 1.36 *************** *** 455,459 **** } ! chatText.push(message); } --- 455,459 ---- } ! //chatText.push(message); // uncomment to echo to local console } *************** *** 544,553 **** static std::string s; ! const tcPlayerStatus& status = GetPlayerStatus(connectionId); ! wxString s2 = wxString::Format("%s (%d) ", status.GetName().c_str(), ! status.GetAlliance()); ! s = s2.c_str(); s += networkInterface->GetConnectionStatus(connectionId).c_str(); --- 544,560 ---- static std::string s; ! if (!IsConnecting()) ! { ! const tcPlayerStatus& status = GetPlayerStatus(connectionId); ! wxString s2 = wxString::Format("%s (%d) ", status.GetName().c_str(), ! status.GetAlliance()); ! s = s2.c_str(); ! } ! else ! { ! s = ""; ! } s += networkInterface->GetConnectionStatus(connectionId).c_str(); *************** *** 684,687 **** --- 691,702 ---- } + bool tcMultiplayerInterface::IsConnecting() const + { + if (IsServer()) return false; + + return (networkInterface->IsConnecting()); + } + + bool tcMultiplayerInterface::IsNewPlayer(int id) { *************** *** 702,706 **** * @return true if acting as a server */ ! bool tcMultiplayerInterface::IsServer() { return networkInterface->IsServer(); --- 717,721 ---- * @return true if acting as a server */ ! bool tcMultiplayerInterface::IsServer() const { return networkInterface->IsServer(); *************** *** 1934,1939 **** UpdateNewAndExistingEntities(id); ! fprintf(stdout, "Performed entity state update, conn %d, t: %d\n", ! id, t); } --- 1949,1954 ---- UpdateNewAndExistingEntities(id); ! //fprintf(stdout, "Performed entity state update, conn %d, t: %d\n", ! // id, t); } *************** *** 2129,2133 **** static unsigned lastUpdate = 0; unsigned currentTime = tcTime::Get()->Get30HzCount(); ! if (currentTime - lastUpdate < 240) return; lastUpdate = currentTime; --- 2144,2148 ---- static unsigned lastUpdate = 0; unsigned currentTime = tcTime::Get()->Get30HzCount(); ! if (currentTime - lastUpdate < 150) return; lastUpdate = currentTime; *************** *** 2141,2146 **** myName("Server"), evtHandler(0), ! entityUpdateInterval(50), ! sensorUpdateInterval(50), goalUpdateInterval(600), acceptAllClients(true) --- 2156,2161 ---- myName("Server"), evtHandler(0), ! entityUpdateInterval(0), ! sensorUpdateInterval(30), goalUpdateInterval(600), acceptAllClients(true) *************** *** 2168,2174 **** */ tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) ! : entityUpdateInterval(10), ! sensorUpdateInterval(50), ! goalUpdateInterval(600) { wxASSERT(false); --- 2183,2189 ---- */ tcMultiplayerInterface::tcMultiplayerInterface(const tcMultiplayerInterface& source) ! : entityUpdateInterval(source.entityUpdateInterval), ! sensorUpdateInterval(source.sensorUpdateInterval), ! goalUpdateInterval(source.goalUpdateInterval) { wxASSERT(false); *************** *** 2178,2182 **** { ClearMessageMap(); ! if (networkInterface) delete networkInterface; } --- 2193,2201 ---- { ClearMessageMap(); ! ! if (networkInterface) ! { ! delete networkInterface; ! } } Index: tcNetworkInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcNetworkInterface.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcNetworkInterface.cpp 23 Mar 2006 01:11:02 -0000 1.22 --- tcNetworkInterface.cpp 24 Oct 2006 01:34:05 -0000 1.23 *************** *** 406,409 **** --- 406,415 ---- } + + bool tcNetworkInterface::IsConnecting() const + { + return (connectState == IS_CONNECTING); + } + /** * @return true if this interface is acting as a server *************** *** 879,885 **** tcNetworkInterface::~tcNetworkInterface() { ! if (clientSock) {clientSock->Destroy();} ! if (serverSock) {serverSock->Destroy();} ! if (datagramSock) {datagramSock->Destroy();} } --- 885,892 ---- tcNetworkInterface::~tcNetworkInterface() { ! // if (clientSock) {clientSock->Destroy();} ! // if (serverSock) {serverSock->Destroy();} // crashes in debug ! // if (datagramSock) {datagramSock->Destroy();} ! } |