[Opentnl-cvs] tnl/zap UIGame.cpp,1.1,1.2
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ben G. <s_a...@us...> - 2004-04-21 01:39:41
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12447/zap Modified Files: UIGame.cpp Log Message: Added connection status display. Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIGame.cpp 20 Apr 2004 04:27:19 -0000 1.1 --- UIGame.cpp 21 Apr 2004 01:39:32 -0000 1.2 *************** *** 95,98 **** --- 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() { *************** *** 109,113 **** glColor3f(1,1,1); drawCenteredString(290, 30, "Connecting to server..."); ! drawCenteredString(330, 20, "Press <ESC> to abort"); } --- 133,140 ---- glColor3f(1,1,1); drawCenteredString(290, 30, "Connecting to server..."); ! ! if(gClientGame->getConnectionToServer()) ! drawCenteredString(330, 16, connectStates[gClientGame->getConnectionToServer()->getConnectionState()]); ! drawCenteredString(370, 20, "Press <ESC> to abort"); } |