Update of /cvsroot/opentnl/tnl/zap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19428/zap
Modified Files:
UIGame.cpp game.cpp gameConnection.h main.cpp
Log Message:
Assorted fixes to enhance smoothness of load.
Added master server status display.
Index: gameConnection.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gameConnection.h 20 Apr 2004 04:27:20 -0000 1.1
--- gameConnection.h 21 Apr 2004 02:23:08 -0000 1.2
***************
*** 36,39 ****
--- 36,63 ----
{
+ static char *gConnectStatesTable[] = {
+ //NotConnected, ///< Initial state of a NetConnection instance - not connected.
+ "Not connected...",
+ //AwaitingChallengeResponse, ///< We've sent a challenge request, awaiting the response.
+ "Sending challenge request.",
+ //SendingPunchPackets, ///< The state of a pending arranged connection when both sides haven't heard from the other yet
+ "Punching through firewalls.",
+ //ComputingPuzzleSolution, ///< We've received a challenge response, and are in the process of computing a solution to its puzzle.
+ "Computing puzzle solution.",
+ //AwaitingConnectResponse, ///< We've received a challenge response and sent a connect request.
+ "Sent connect request.",
+ //ConnectTimedOut, ///< The connection timed out during the connection process.
+ "Connection timed out.",
+ //ConnectRejected, ///< The connection was rejected.
+ "Connection rejected.",
+ //Connected, ///< We've accepted a connect request, or we've received a connect response accept.
+ "Connected.",
+ //Disconnected, ///< The connection has been disconnected.
+ "Disconnected.",
+ //TimedOut, ///< The connection timed out.
+ "Connection timed out.",
+ ""
+ };
+
const F32 constantPi = 3.141592f;
const F32 radiansToDegreesConversion = 360.0f / (2 * constantPi);
Index: main.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** main.cpp 20 Apr 2004 23:44:25 -0000 1.4
--- main.cpp 21 Apr 2004 02:23:08 -0000 1.5
***************
*** 154,157 ****
--- 154,163 ----
UserInterface::current->render();
+ // Render master connection state...
+ if(gClientGame && gClientGame->getConnectionToMaster()
+ && gClientGame->getConnectionToMaster()->getConnectionState() != NetConnection::Connected)
+ UserInterface::drawStringf(10, 550, 15, "Master Server - %s",
+ gConnectStatesTable[gClientGame->getConnectionToMaster()->getConnectionState()]);
+
glFlush();
glutSwapBuffers();
Index: UIGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** UIGame.cpp 21 Apr 2004 01:39:32 -0000 1.2
--- UIGame.cpp 21 Apr 2004 02:23:08 -0000 1.3
***************
*** 95,122 ****
}
- static char * connectStates[] = {
- //NotConnected, ///< Initial state of a NetConnection instance - not connected.
- "Not connected...",
- //AwaitingChallengeResponse, ///< We've sent a challenge request, awaiting the response.
- "Sending challenge request.",
- //SendingPunchPackets, ///< The state of a pending arranged connection when both sides haven't heard from the other yet
- "Punching through firewalls.",
- //ComputingPuzzleSolution, ///< We've received a challenge response, and are in the process of computing a solution to its puzzle.
- "Computing puzzle solution.",
- //AwaitingConnectResponse, ///< We've received a challenge response and sent a connect request.
- "Sent connect request.",
- //ConnectTimedOut, ///< The connection timed out during the connection process.
- "Connection timed out.",
- //ConnectRejected, ///< The connection was rejected.
- "Connection rejected.",
- //Connected, ///< We've accepted a connect request, or we've received a connect response accept.
- "Connected.",
- //Disconnected, ///< The connection has been disconnected.
- "Disconnected.",
- //TimedOut, ///< The connection timed out.
- "Connection timed out.",
- ""
- };
-
void GameUserInterface::render()
{
--- 95,98 ----
***************
*** 135,139 ****
if(gClientGame->getConnectionToServer())
! drawCenteredString(330, 16, connectStates[gClientGame->getConnectionToServer()->getConnectionState()]);
drawCenteredString(370, 20, "Press <ESC> to abort");
}
--- 111,115 ----
if(gClientGame->getConnectionToServer())
! drawCenteredString(330, 16, gConnectStatesTable[gClientGame->getConnectionToServer()->getConnectionState()]);
drawCenteredString(370, 20, "Press <ESC> to abort");
}
Index: game.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** game.cpp 20 Apr 2004 19:25:48 -0000 1.3
--- game.cpp 21 Apr 2004 02:23:08 -0000 1.4
***************
*** 260,263 ****
--- 260,264 ----
Game::checkConnectionToMaster(timeDelta);
+
// only update at most MaxMoveTime milliseconds;
if(timeDelta > Move::MaxMoveTime)
|