opentnl-cvs Mailing List for Torque Network Library (Page 26)
Brought to you by:
mark_frohnmayer,
s_alanet
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(141) |
May
(232) |
Jun
(103) |
Jul
(36) |
Aug
(35) |
Sep
(19) |
Oct
(20) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(26) |
Mar
(2) |
Apr
(84) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ben G. <s_a...@us...> - 2004-04-22 07:35:55
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10267/zap Modified Files: UIGame.cpp UIGame.h ZAP.vcproj Added Files: quickChat.cpp quickChat.h Log Message: Added a tribes-style quick chat function, accessible via v. Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UIGame.h 21 Apr 2004 22:40:43 -0000 1.2 --- UIGame.h 22 Apr 2004 07:27:43 -0000 1.3 *************** *** 31,34 **** --- 31,35 ---- #include "point.h" #include "gameConnection.h" + #include "quickChat.h" namespace Zap *************** *** 57,60 **** --- 58,62 ---- PlayMode, ChatMode, + VChatMode, }; enum ChatType { *************** *** 68,77 **** ChatType mCurrentChatType; ! char mChatBuffer[50]; ! U32 mChatCursorPos; ! bool mChatBlink; ! U32 mChatLastBlinkTime; ! bool mInScoreboardMode; public: GameUserInterface(); --- 70,80 ---- ChatType mCurrentChatType; ! char mChatBuffer[50]; ! U32 mChatCursorPos; ! bool mChatBlink; ! U32 mChatLastBlinkTime; ! bool mInScoreboardMode; + VChatHelper *mVChat; public: GameUserInterface(); --- NEW FILE: quickChat.cpp --- //----------------------------------------------------------------------------------- // // Torque Network Library - ZAP example multiplayer vector graphics space game // Copyright (C) 2004 GarageGames.com, Inc. // For more information see http://www.opentnl.org // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // For use in products that are not compatible with the terms of the GNU // General Public License, alternative licensing options are available // from GarageGames.com. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //------------------------------------------------------------------------------------ #include "quickChat.h" #include "glutInclude.h" #include "gameType.h" namespace Zap { VChatHelper::VChatNode VChatHelper::mChatTree[] = { // Root node {0, ' ', true, "", ""}, {1, 'V', true, "Offense", ""}, {2, 'A', true, "Attack!", "Attack!"}, {2, 'W', true, "Wait for signal", "Wait for my signal to attack."}, {2, 'C', true, "Cease fire", "Cease fire!"}, {2, 'M', true, "Move out", "Move out."}, {2, 'R', true, "Retreat", "Retreat!"}, {2, 'H', true, "Hit deck", "Hit the deck!"}, {2, 'E', true, "Regroup", "Regroup."}, {2, 'V', true, "Cover me", "Cover me.."}, {2, 'G', true, "Going offense", "Going offense."}, {2, 'O', true, "Go on the offensive", "Go on the offensive."}, {2, 'J', true, "Capture the objective", "Capture the objective."}, {1, 'T', true, "Target", ""}, {2, 'A', true, "Target Acquired", "Target Acquired."}, {2, 'F', true, "Fire on my target", "Fire on my target."}, {2, 'N', true, "Target needed", "I need a target."}, {2, 'O', true, "Target out of range", "Target is out of range."}, {2, 'D', true, "Destroy Enemy Generator", "Destroy the enemy generator."}, {2, 'E', true, "Enemy Generator Destroyed", "Enemy generator is destroyed."}, {2, 'T', true, "Destroy Enemy Turret", "Destroy enemy turret."}, {2, 'S', true, "Enemy Turret Destroyed", "Enemy turret destroyed."}, {1, 'D', true, "Defense", ""}, {2, 'I', true, "Incoming Enemies", "Incoming enemies!"}, {2, 'A', true, "Attacked", "We are being attacked."}, {2, 'E', true, "Enemy Attacking Base", "The enemy is attacking our base."}, {2, 'N', true, "Need More Defense", "We need more defense."}, {2, 'T', true, "Base Taken", "Base is taken."}, {2, 'C', true, "Base Clear", "Base is secured."}, {2, 'Q', true, "Is Base Clear?", "Is our base clear?"}, {2, 'G', true, "Go On Defensive", "Go on the defensive."}, {2, 'D', true, "Defending Base", "Defending our base."}, {2, 'O', true, "Defend Our Base", "Defend our base."}, {1, 'F', true, "Flag", ""}, {2, 'G', true, "Flag gone", "Our flag is not in the base!"}, {2, 'E', true, "Enemy has flag", "The enemy has our flag!"}, {2, 'H', true, "Have enemy flag", "I have the enemy flag."}, {2, 'S', true, "Flag secure", "Our flag is secure."}, {2, 'R', true, "Return our flag", "Return our flag to base."}, {2, 'F', true, "Get enemy flag", "Get the enemy flag."}, {2, 'M', true, "Flag mined", "Our flag is mined."}, {2, 'C', true, "Clear mines", "Clear the mines from our flag."}, {2, 'D', true, "Mines cleared", "Mines have been cleared."}, {2, 'N', true, "Mine flag", "Mine the flag."}, {1, 'R', true, "Need", ""}, {2, 'R', true, "Need Repairs", "Need repairs."}, {2, 'A', true, "Need APC Pickup", "I need an APC pickup."}, {2, 'E', true, "Need Escort", "I need an escort back to base."}, {2, 'T', true, "Need Ammo", "Can anyone bring me some ammo?"}, {1, 'E', true, "Team", ""}, {2, 'W', true, "Watch Shooting", "Watch where your shooting!"}, {2, 'D', true, "Dont know", "I don't know."}, {2, 'Y', true, "Yes", "Yes."}, {2, 'N', true, "No", "No."}, {2, 'T', true, "Thanks", "Thanks."}, {2, 'A', true, "No Problem", "No Problem."}, {2, 'S', true, "Sorry", "Sorry."}, {2, 'Z', true, "Doh!", "Doh!"}, {2, 'O', true, "Oops!", "Oops!"}, {2, 'F', true, "Shazbot!", "Shazbot!"}, {2, 'Q', true, "Damnit!", "Damnit!"}, {2, 'C', true, "Ah Crap!", "Ah Crap!"}, {2, 'E', true, "Duh!", "Duh!"}, {2, 'X', true, "You moron!", "You moron!"}, {2, 'R', true, "Ready", "Ready."}, {2, 'B', true, "Belay order", "Belay order"}, {2, ' ', true, "Help!", "Help!"}, {1, 'S', true, "Incoming Enemies - Direction", ""}, {2, 'W', true, "Incoming North", "*** INCOMING NORTH ***"}, {2, 'A', true, "Incoming West", "*** INCOMING WEST ***"}, {2, 'S', true, "Incoming East", "*** INCOMING EAST ***"}, {2, 'Z', true, "Incoming South", "*** INCOMING SOUTH ***"}, {2, 'D', true, "Incoming HEAVIES", "*** INCOMING HEAVIES ***"}, {1, 'G', true, "Global", ""}, {2, 'Z', false, "Doh", "Doh!"}, {2, 'O', false, "Oops", "Oops!"}, {2, 'F', false, "Shazbot", "Shazbot!"}, {2, 'Q', false, "Damnit", "Damnit!"}, {2, 'C', false, "Crap", "Ah Crap!"}, {2, 'E', false, "Duh", "Duh."}, {2, 'X', false, "You moron!", "You moron!"}, {2, 'N', false, "No", "No."}, {2, 'Y', false, "Yes", "Yes."}, {2, 'D', false, "I don't know", "I don't know."}, {2, 'T', false, "Thanks", "Thanks."}, {2, 'A', false, "No Problem", "No Problemo."}, {2, 'H', false, "Hi", "Hi."}, {2, 'B', false, "Bye", "Bye!"}, {2, 'S', false, "Sorry", "Sorry."}, {2, 'W', false, "Whoohoo", "Woo-hoo!"}, {2, 'V', false, "Hmmmm...", "Hmmm..."}, {2, 'U', false, "Yeah!", "Yeah!"}, {2, 'R', false, "Rawr", "RAWR!"}, {1, 'R', true, "Reponses", ""}, {2, 'A', true, "Acknowledge", "Acknowledged."}, {2, 'Z', true, "Objective completed", "Objective completed."}, {2, 'I', true, "Unable to complete", "Unable to complete objective."}, {1, 'T', true, "Taunts", ""}, {2, 'Y', false, "Yoohoo!", "Yoohoo!"}, {2, 'H', false, "How'd THAT feel?", "How'd THAT feel?"}, {2, 'I', false, "I've had worse..." "I've had worse..."}, {2, 'M', false, "Missed me!", "Missed me!"}, {2, 'D', false, "Dance!", "Dance!"}, {2, 'C', false, "Come get some!", "Come get some!"}, // Terminate {0, ' ', false, "", ""} }; VChatHelper::VChatHelper() { mCurNode = &mChatTree[0]; mVisible = false; } void VChatHelper::render() { if(mVisible) { VChatNode *walk = mCurNode; U32 matchLevel = walk->depth + 1; walk++; S32 curPos = 600 - 20; const fontSize = 15; // First get to the end... while(walk->depth >= matchLevel) walk++; // Then draw bottom up... glColor3f(0.3, 1.0, 0.3); while(walk != mCurNode) { if(walk->depth == matchLevel) { UserInterface::drawStringf(20, curPos, fontSize, "%c - %s", walk->trigger, walk->caption); curPos -= fontSize + 4; } walk--; } // All done! } } void VChatHelper::show() { mCurNode = &mChatTree[0]; mVisible = true; } bool VChatHelper::isActive() { return mVisible; } void VChatHelper::processKey(U32 key) { // Escape... if(key == 27) { mVisible = false; return; } // Try to find a match if we can... // work in upper case... key = toupper(key); // Set up walk... VChatNode *walk = mCurNode; U32 matchLevel = walk->depth+1; walk++; // Iterate over anything at our desired depth or lower... while(walk->depth >= matchLevel) { // If it has the same key and depth... if(toupper(walk->trigger) == key && walk->depth == matchLevel) { // select it... mCurNode = walk; // If we're at a leaf (ie, next child down is higher or equal to us), then issue the chat and call it good... walk++; if(mCurNode->depth >= walk->depth) { GameType *gt = gClientGame->getGameType(); if(gt) gt->c2sSendChat(!mCurNode->teamOnly, mCurNode->msg); mVisible = false; return; } } walk++; } } }; Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UIGame.cpp 21 Apr 2004 22:40:42 -0000 1.5 --- UIGame.cpp 22 Apr 2004 07:27:27 -0000 1.6 *************** *** 53,56 **** --- 53,58 ---- for(U32 i = 0; i < 4; i++) mDisplayMessage[i][0] = 0; + + mVChat = new VChatHelper(); } *************** *** 126,129 **** --- 128,136 ---- glTranslatef(mMousePoint.x, mMousePoint.y, 0); + static U32 cursorSpin = 90; + cursorSpin++; + + glRotatef((cursorSpin % 720) * 0.9, 0, 0, 1); + glColor3f(1, 0, 0); glBegin(GL_LINE_LOOP); *************** *** 215,218 **** --- 222,228 ---- } #endif + + if(mVChat->isActive()) + mVChat->render(); } *************** *** 295,298 **** --- 305,313 ---- mCurrentMove.down = 0; break; + case 'v': + case 'V': + mVChat->show(); + mCurrentMode = VChatMode; + break; } } *************** *** 326,329 **** --- 341,351 ---- } } + else if(mCurrentMode == VChatMode) + { + mVChat->processKey(key); + + if(!mVChat->isActive()) + mCurrentMode = PlayMode; + } } --- NEW FILE: quickChat.h --- //----------------------------------------------------------------------------------- // // Torque Network Library - ZAP example multiplayer vector graphics space game // Copyright (C) 2004 GarageGames.com, Inc. // For more information see http://www.opentnl.org // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // For use in products that are not compatible with the terms of the GNU // General Public License, alternative licensing options are available // from GarageGames.com. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //------------------------------------------------------------------------------------ #ifndef _UIVCHAT_H_ #define _UIVCHAT_H_ #include "tnlNetBase.h" #include "UI.h" namespace Zap { class VChatHelper { private: struct VChatNode { U32 depth; U8 trigger; bool teamOnly; const char *caption; const char *msg; }; static VChatNode mChatTree[]; bool mVisible; VChatNode *mCurNode; public: VChatHelper(); void render(); void show(); bool isActive(); void processKey(U32 key); }; }; #endif Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ZAP.vcproj 20 Apr 2004 04:27:19 -0000 1.1 --- ZAP.vcproj 22 Apr 2004 07:27:43 -0000 1.2 *************** *** 213,216 **** --- 213,222 ---- </File> <File + RelativePath=".\quickChat.cpp"> + </File> + <File + RelativePath=".\quickChat.h"> + </File> + <File RelativePath=".\sfx.cpp"> </File> |
From: Ben G. <s_a...@us...> - 2004-04-22 05:26:47
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25886/zap Modified Files: moveObject.cpp Log Message: Tweaked sound gain. Index: moveObject.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/moveObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** moveObject.cpp 20 Apr 2004 19:25:48 -0000 1.4 --- moveObject.cpp 22 Apr 2004 05:22:32 -0000 1.5 *************** *** 299,303 **** { // Make a noise... ! SFXObject::play(SFXBounceWall, collisionPoint, Point()); Color bumpC(scale/3, scale/3, scale); --- 299,303 ---- { // Make a noise... ! SFXObject::play(SFXBounceWall, collisionPoint, Point(), getMin(1.0f, scale - 0.25f)); Color bumpC(scale/3, scale/3, scale); *************** *** 339,343 **** shipHit->mMoveState[stateIndex].vel += collisionVector * (v2f - v2i); ! SFXObject::play(SFXBounceObject, shipHit->mMoveState[stateIndex].pos, Point()); } --- 339,344 ---- shipHit->mMoveState[stateIndex].vel += collisionVector * (v2f - v2i); ! if(v1i > 0.25) ! SFXObject::play(SFXBounceObject, shipHit->mMoveState[stateIndex].pos, Point()); } |
From: Ben G. <s_a...@us...> - 2004-04-22 02:59:25
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7446/zap Modified Files: CTFGame.cpp CTFGame.h masterConnection.cpp Log Message: Updated game name to ZAP1.1 for sanity's sake. Updated scoring. Merged changes with Mark's fix to gameplay. Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** masterConnection.cpp 20 Apr 2004 23:37:26 -0000 1.2 --- masterConnection.cpp 22 Apr 2004 02:57:51 -0000 1.3 *************** *** 182,186 **** Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP"); // Game Name if(bstream->writeFlag(mIsGameServer)) { --- 182,186 ---- Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.1"); // Game Name if(bstream->writeFlag(mIsGameServer)) { Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CTFGame.h 22 Apr 2004 00:35:43 -0000 1.3 --- CTFGame.h 22 Apr 2004 02:57:51 -0000 1.4 *************** *** 39,42 **** --- 39,50 ---- class CTFGameType : public GameType { + enum Scores + { + KillScore = 100, + ReturnScore = 150, + CapScore = 500, + CapTeamScore = 250, + + }; public: void shipTouchFlag(Ship *theShip, CTFFlagItem *theFlag); *************** *** 52,56 **** static Vector<RangedU32<0, MaxPing> > mPingTimes; ///< Static vector used for constructing update RPCs ! static Vector<Int<9> > mScores; enum { --- 60,64 ---- static Vector<RangedU32<0, MaxPing> > mPingTimes; ///< Static vector used for constructing update RPCs ! static Vector<Int<24> > mScores; enum { *************** *** 63,67 **** TNL_DECLARE_RPC(s2cCTFMessage, (U32 messageIndex, U32 clientId, U32 teamIndex)); TNL_DECLARE_RPC(s2cKillMessage, (StringTableEntry victim, StringTableEntry killer)); ! TNL_DECLARE_RPC(s2cScoreboardUpdate, (const Vector<RangedU32<0, MaxPing> > &pingTimes, const Vector<Int<9> > &scores)); TNL_DECLARE_CLASS(CTFGameType); }; --- 71,75 ---- TNL_DECLARE_RPC(s2cCTFMessage, (U32 messageIndex, U32 clientId, U32 teamIndex)); TNL_DECLARE_RPC(s2cKillMessage, (StringTableEntry victim, StringTableEntry killer)); ! TNL_DECLARE_RPC(s2cScoreboardUpdate, (const Vector<RangedU32<0, MaxPing> > &pingTimes, const Vector<Int<24> > &scores)); TNL_DECLARE_CLASS(CTFGameType); }; Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CTFGame.cpp 22 Apr 2004 02:07:55 -0000 1.6 --- CTFGame.cpp 22 Apr 2004 02:57:51 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- #include "glutInclude.h" + #include <stdio.h> namespace Zap *************** *** 115,118 **** --- 116,120 ---- UserInterface::drawString(xl + 40, yt + 2, 30, mTeams[i].name.getString()); + UserInterface::drawStringf(xr - 140, yt + 2, 30, "%d", mTeams[i].score); *************** *** 124,128 **** { UserInterface::drawString(xl + 40, curRowY, fontSize, mClientList[j].name.getString()); ! UserInterface::drawStringf(xr - 140, curRowY, fontSize, "%d", mClientList[j].score); UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[j].ping); curRowY += maxHeight; --- 126,134 ---- { UserInterface::drawString(xl + 40, curRowY, fontSize, mClientList[j].name.getString()); ! ! static char buff[255] = ""; ! sprintf(buff, "%d", mClientList[j].score); ! ! UserInterface::drawString(xr - (120 + UserInterface::getStringWidth(fontSize, buff)), curRowY, fontSize, buff); UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[j].ping); curRowY += maxHeight; *************** *** 144,148 **** Vector<RangedU32<0, CTFGameType::MaxPing> > CTFGameType::mPingTimes; ///< Static vector used for constructing update RPCs ! Vector<Int<9> > CTFGameType::mScores; void CTFGameType::updateClientScoreboard(S32 clientIndex) --- 150,154 ---- Vector<RangedU32<0, CTFGameType::MaxPing> > CTFGameType::mPingTimes; ///< Static vector used for constructing update RPCs ! Vector<Int<24> > CTFGameType::mScores; void CTFGameType::updateClientScoreboard(S32 clientIndex) *************** *** 167,171 **** TNL_DECLARE_RPC_MEM_ENUM(CTFGameType, MaxPing); ! TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cScoreboardUpdate, (const Vector<RangedU32<0, CTFGameType::MaxPing> > &pingTimes, const Vector<Int<9> > &scores), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { --- 173,177 ---- TNL_DECLARE_RPC_MEM_ENUM(CTFGameType, MaxPing); ! TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cScoreboardUpdate, (const Vector<RangedU32<0, CTFGameType::MaxPing> > &pingTimes, const Vector<Int<24> > &scores), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { *************** *** 196,200 **** s2cCTFMessage(CTFMsgReturnFlag, cl.clientId, theFlag->getTeamIndex()); theFlag->sendHome(); ! cl.score += 2; } else --- 202,206 ---- s2cCTFMessage(CTFMsgReturnFlag, cl.clientId, theFlag->getTeamIndex()); theFlag->sendHome(); ! cl.score += Scores::ReturnScore; } else *************** *** 213,217 **** mountedFlag->dismount(); mountedFlag->sendHome(); ! cl.score += 5; } } --- 219,223 ---- mountedFlag->dismount(); mountedFlag->sendHome(); ! cl.score += Scores::CapScore; } } *************** *** 265,269 **** if(killerIndex != -1) { ! mClientList[killerIndex].score++; s2cKillMessage(mClientList[clientIndex].name, mClientList[killerIndex].name); } --- 271,280 ---- if(killerIndex != -1) { ! // Punish team killers slightly ! if(mClientList[killerIndex].teamId == mClientList[clientIndex].teamId) ! mClientList[killerIndex].score -= Scores::KillScore/4; ! else ! mClientList[killerIndex].score += Scores::KillScore; ! s2cKillMessage(mClientList[clientIndex].name, mClientList[killerIndex].name); } |
From: Mark F. <mar...@us...> - 2004-04-22 02:51:10
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6389/zap Modified Files: gameType.cpp Log Message: Fixed updating of scores too much Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gameType.cpp 22 Apr 2004 02:48:39 -0000 1.7 --- gameType.cpp 22 Apr 2004 02:50:53 -0000 1.8 *************** *** 147,150 **** --- 147,151 ---- cref.clientConnection = theClient; cref.score = 0; + cref.wantsScoreboardUpdates = false; countTeamPlayers(); |
From: Mark F. <mar...@us...> - 2004-04-22 02:49:04
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6063/zap Modified Files: gameType.cpp Log Message: Fixed updating of scores too much Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gameType.cpp 22 Apr 2004 00:35:44 -0000 1.6 --- gameType.cpp 22 Apr 2004 02:48:39 -0000 1.7 *************** *** 57,62 **** updateClientScoreboard(i); ! mTimeUntilScoreboardUpdate = 0; } } --- 57,64 ---- updateClientScoreboard(i); ! mTimeUntilScoreboardUpdate = 1000; } + else + mTimeUntilScoreboardUpdate -= deltaT; } |
From: Mark F. <mar...@us...> - 2004-04-22 02:08:26
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32366/zap Modified Files: CTFGame.cpp Log Message: Fixed score display Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CTFGame.cpp 22 Apr 2004 00:35:22 -0000 1.5 --- CTFGame.cpp 22 Apr 2004 02:07:55 -0000 1.6 *************** *** 123,129 **** if(mClientList[j].teamId == i) { ! UserInterface::drawString(xl + 40, curRowY, fontSize, mClientList[i].name.getString()); ! UserInterface::drawStringf(xr - 140, curRowY, fontSize, "%d", mClientList[i].score); ! UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[i].ping); curRowY += maxHeight; } --- 123,129 ---- if(mClientList[j].teamId == i) { ! UserInterface::drawString(xl + 40, curRowY, fontSize, mClientList[j].name.getString()); ! UserInterface::drawStringf(xr - 140, curRowY, fontSize, "%d", mClientList[j].score); ! UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[j].ping); curRowY += maxHeight; } |
From: Mark F. <mar...@us...> - 2004-04-22 00:56:52
|
Update of /cvsroot/opentnl/tnl/master In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21251/master Modified Files: main.cpp Log Message: Fixed arranged connection bug in Master server Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/master/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 20 Apr 2004 04:27:15 -0000 1.1 --- main.cpp 22 Apr 2004 00:56:23 -0000 1.2 *************** *** 397,401 **** // Get our address... ! Address theAddress = conn->getNetAddress(); // Record some different addresses to try... --- 397,401 ---- // Get our address... ! Address theAddress = getNetAddress(); // Record some different addresses to try... |
From: Mark F. <mar...@us...> - 2004-04-22 00:38:12
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18225/zap Modified Files: CTFGame.cpp CTFGame.h game.cpp game.h gameType.cpp gameType.h projectile.cpp ship.cpp ship.h Log Message: Added scoring for player kills Added scoring for CTF Added flag drop messages Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ship.h 21 Apr 2004 23:47:34 -0000 1.2 --- ship.h 22 Apr 2004 00:35:49 -0000 1.3 *************** *** 63,66 **** --- 63,67 ---- U32 lastFireTime; F32 mHealth; + StringTableEntry mPlayerName; Color color; // color of the ship *************** *** 69,74 **** bool hasExploded; - StringTableEntry mPlayerName; - Move lastMove; // last client input move for this ship --- 70,73 ---- *************** *** 79,83 **** Ship(StringTableEntry playerName="", Point p = Point(0,0), Color c = Color(), F32 m = 1.0); - void kill(); void emitMovementSparks(); void emitShipExplosion(Point pos); --- 78,81 ---- *************** *** 91,94 **** --- 89,93 ---- virtual void damageObject(DamageInfo *theInfo); + void kill(DamageInfo *theInfo); void processMove(Move *theMove, U32 stateIndex); Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gameType.cpp 21 Apr 2004 22:40:43 -0000 1.5 --- gameType.cpp 22 Apr 2004 00:35:44 -0000 1.6 *************** *** 144,147 **** --- 144,149 ---- cref.clientConnection = theClient; + cref.score = 0; + countTeamPlayers(); *************** *** 165,173 **** } ! void GameType::controlObjectForClientKilled(GameConnection *theClient) { spawnShip(theClient); } void GameType::addClientGameMenuOptions(Vector<const char *> &menuOptions) { --- 167,180 ---- } ! void GameType::controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject) { spawnShip(theClient); } + void GameType::controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject) + { + + } + void GameType::addClientGameMenuOptions(Vector<const char *> &menuOptions) { *************** *** 182,185 **** --- 189,213 ---- } + TNL_IMPLEMENT_NETOBJECT_RPC(GameType, c2sChangeTeams, (), + NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhostParent, 0) + { + if(mTeams.size() <= 1) + return; + + GameConnection *source = (GameConnection *) NetObject::getRPCSourceConnection(); + S32 clientIndex = findClientIndexByConnection(source); + + // destroy the old ship + GameObject *co = source->getControlObject(); + controlObjectForClientRemoved(source, co); + if(co) + getGame()->deleteObject(co, 0); + + U32 newTeamId = (mClientList[clientIndex].teamId + 1) % mTeams.size(); + mClientList[clientIndex].teamId = newTeamId; + s2cClientJoinedTeam(mClientList[clientIndex].clientId, newTeamId); + spawnShip(source); + } + TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cAddClient, (U32 id, StringTableEntry name, bool isMyClient), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) *************** *** 204,209 **** GameObject *theControlObject = theClient->getControlObject(); if(theControlObject) ! delete theControlObject; s2cRemoveClient(theClient->mClientId); --- 232,238 ---- GameObject *theControlObject = theClient->getControlObject(); + controlObjectForClientRemoved(theClient, theControlObject); if(theControlObject) ! getGame()->deleteObject(theControlObject, 0); s2cRemoveClient(theClient->mClientId); *************** *** 242,265 **** } - TNL_IMPLEMENT_NETOBJECT_RPC(GameType, c2sChangeTeams, (), - NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhostParent, 0) - { - if(mTeams.size() <= 1) - return; - - GameConnection *source = (GameConnection *) NetObject::getRPCSourceConnection(); - S32 clientIndex = findClientIndexByConnection(source); - - // destroy the old ship - GameObject *co = source->getControlObject(); - if(co) - getGame()->deleteObject(co, 0); - - U32 newTeamId = (mClientList[clientIndex].teamId + 1) % mTeams.size(); - mClientList[clientIndex].teamId = newTeamId; - s2cClientJoinedTeam(mClientList[clientIndex].clientId, newTeamId); - spawnShip(source); - } - void GameType::onGhostAvailable(GhostConnection *theConnection) { --- 271,274 ---- Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CTFGame.cpp 21 Apr 2004 22:40:40 -0000 1.4 --- CTFGame.cpp 22 Apr 2004 00:35:22 -0000 1.5 *************** *** 196,199 **** --- 196,200 ---- s2cCTFMessage(CTFMsgReturnFlag, cl.clientId, theFlag->getTeamIndex()); theFlag->sendHome(); + cl.score += 2; } else *************** *** 212,215 **** --- 213,217 ---- mountedFlag->dismount(); mountedFlag->sendHome(); + cl.score += 5; } } *************** *** 223,226 **** --- 225,280 ---- } + U32 CTFGameType::checkFlagDrop(GameObject *theObject) + { + Ship *theShip = dynamic_cast<Ship *>(theObject); + if(!theShip) + return 0; + + GameConnection *controlConnection = theShip->getControllingClient(); + S32 clientIndex = findClientIndexByConnection(controlConnection); + + if(clientIndex == -1) + return 0; + + ClientRef &cl = mClientList[clientIndex]; + + U32 flagCount = 0; + // check if this client has an enemy flag mounted + for(S32 i = 0; i < theShip->mMountedItems.size();) + { + Item *theItem = theShip->mMountedItems[i]; + CTFFlagItem *mountedFlag = dynamic_cast<CTFFlagItem *>(theItem); + if(mountedFlag) + { + s2cCTFMessage(CTFMsgDropFlag, cl.clientId, mountedFlag->getTeamIndex()); + mountedFlag->dismount(); + flagCount++; + } + else + i++; + } + return flagCount; + } + + void CTFGameType::controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject) + { + GameConnection *killer = killerObject ? killerObject->getControllingClient() : NULL; + S32 killerIndex = findClientIndexByConnection(killer); + S32 clientIndex = findClientIndexByConnection(theClient); + + if(killerIndex != -1) + { + mClientList[killerIndex].score++; + s2cKillMessage(mClientList[clientIndex].name, mClientList[killerIndex].name); + } + checkFlagDrop(clientObject); + spawnShip(theClient); + } + + void CTFGameType::controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject) + { + checkFlagDrop(clientObject); + } + static const char *CTFMessages[] = { *************** *** 228,231 **** --- 282,286 ---- "%s captured the %s flag!", "%s took the %s flag!", + "%s dropped the %s flag!", }; *************** *** 235,238 **** --- 290,294 ---- SFXFlagCapture, SFXFlagSnatch, + SFXFlagDrop, }; *************** *** 249,252 **** --- 305,315 ---- } + TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cKillMessage, (StringTableEntry victim, StringTableEntry killer), + NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) + { + gGameUserInterface.displayMessage(Color(1.0f, 1.0f, 0.8f), + "%s zapped %s", killer.getString(), victim.getString()); + } + TNL_IMPLEMENT_NETOBJECT(CTFFlagItem); Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** projectile.cpp 20 Apr 2004 22:17:42 -0000 1.5 --- projectile.cpp 22 Apr 2004 00:35:44 -0000 1.6 *************** *** 101,105 **** theInfo.damageAmount = 1; theInfo.damageType = 0; ! theInfo.damagingObject = this; theInfo.impulseVector = velocity; --- 101,105 ---- theInfo.damageAmount = 1; theInfo.damageType = 0; ! theInfo.damagingObject = mShooter; theInfo.impulseVector = velocity; Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameType.h 21 Apr 2004 22:40:43 -0000 1.2 --- gameType.h 22 Apr 2004 00:35:44 -0000 1.3 *************** *** 77,81 **** virtual void serverRemoveClient(GameConnection *theClient); ! virtual void controlObjectForClientKilled(GameConnection *theClient); virtual void spawnShip(GameConnection *theClient); --- 77,83 ---- virtual void serverRemoveClient(GameConnection *theClient); ! virtual void controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject); ! virtual void controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject); ! virtual void spawnShip(GameConnection *theClient); Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** game.cpp 21 Apr 2004 22:40:43 -0000 1.5 --- game.cpp 22 Apr 2004 00:35:43 -0000 1.6 *************** *** 197,206 **** } - void ServerGame::controlObjectForClientKilled(GameConnection *theConnection) - { - if(mGameType.isValid()) - mGameType->controlObjectForClientKilled(theConnection); - } - void ServerGame::addClient(GameConnection *theConnection) { --- 197,200 ---- Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** game.h 20 Apr 2004 19:25:48 -0000 1.3 --- game.h 22 Apr 2004 00:35:44 -0000 1.4 *************** *** 154,158 **** ServerGame(const Address &theBindAddress, U32 maxPlayers, const char *hostName); - void controlObjectForClientKilled(GameConnection *theConnection); void loadLevel(const char *fileName); void processLevelLoadLine(int argc, const char **argv); --- 154,157 ---- Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CTFGame.h 21 Apr 2004 22:40:42 -0000 1.2 --- CTFGame.h 22 Apr 2004 00:35:43 -0000 1.3 *************** *** 43,46 **** --- 43,49 ---- void renderInterfaceOverlay(bool scoreboardVisible); void updateClientScoreboard(S32 clientIndex); + void controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject); + void controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject); + U32 checkFlagDrop(GameObject *theObject); enum { *************** *** 55,61 **** --- 58,66 ---- CTFMsgCaptureFlag, CTFMsgTakeFlag, + CTFMsgDropFlag, }; TNL_DECLARE_RPC(s2cCTFMessage, (U32 messageIndex, U32 clientId, U32 teamIndex)); + TNL_DECLARE_RPC(s2cKillMessage, (StringTableEntry victim, StringTableEntry killer)); TNL_DECLARE_RPC(s2cScoreboardUpdate, (const Vector<RangedU32<0, MaxPing> > &pingTimes, const Vector<Int<9> > &scores)); TNL_DECLARE_CLASS(CTFGameType); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ship.cpp 21 Apr 2004 20:19:07 -0000 1.6 --- ship.cpp 22 Apr 2004 00:35:45 -0000 1.7 *************** *** 35,38 **** --- 35,39 ---- #include "UI.h" #include "UIMenus.h" + #include "gameType.h" #include <stdio.h> *************** *** 154,158 **** { mHealth = 0; ! kill(); } } --- 155,159 ---- { mHealth = 0; ! kill(theInfo); } } *************** *** 444,448 **** } ! void Ship::kill() { if(isGhost()) --- 445,449 ---- } ! void Ship::kill(DamageInfo *theInfo) { if(isGhost()) *************** *** 457,461 **** if(controllingClient) { ! gServerGame->controlObjectForClientKilled(controllingClient); } } --- 458,464 ---- if(controllingClient) { ! GameType *gt = getGame()->getGameType(); ! if(gt) ! gt->controlObjectForClientKilled(controllingClient, this, theInfo->damagingObject); } } *************** *** 578,583 **** // Make it a nice pastel ! glColor3f(color.r*1.2,color.g*1.2,color.b*1.2); UserInterface::drawString( UserInterface::getStringWidth(14, buff) * -0.5, 30, 14, buff ); } --- 581,591 ---- // Make it a nice pastel ! glEnable(GL_BLEND); ! glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ! glColor4f(1,1,1,0.55); ! //glColor3f(color.r*1.2,color.g*1.2,color.b*1.2); UserInterface::drawString( UserInterface::getStringWidth(14, buff) * -0.5, 30, 14, buff ); + glDisable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ZERO); } |
From: Ben G. <s_a...@us...> - 2004-04-21 23:50:59
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11362/zap Modified Files: main.cpp ship.h Log Message: Added a file logger. Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ship.h 20 Apr 2004 04:27:20 -0000 1.1 --- ship.h 21 Apr 2004 23:47:34 -0000 1.2 *************** *** 69,72 **** --- 69,74 ---- bool hasExploded; + StringTableEntry mPlayerName; + Move lastMove; // last client input move for this ship *************** *** 75,79 **** void render(); ! Ship(Point p = Point(0,0), Color c = Color(), F32 m = 1.0); void kill(); --- 77,81 ---- void render(); ! Ship(StringTableEntry playerName="", Point p = Point(0,0), Color c = Color(), F32 m = 1.0); void kill(); Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 21 Apr 2004 22:40:43 -0000 1.6 --- main.cpp 21 Apr 2004 23:47:34 -0000 1.7 *************** *** 176,179 **** --- 176,201 ---- } gStdoutLogConsumer; + class FileLogConsumer : public LogConsumer + { + private: + FILE *f; + public: + FileLogConsumer(const char* logFile="zap.log") + { + f = fopen(logFile, "w"); + logString("------ Zap Log File ------"); + } + + ~FileLogConsumer() + { + fclose(f); + } + + void logString(const char *string) + { + fprintf(f, "%s\r\n", string); + } + } gFileLogConsumer; + void hostGame(bool dedicated, Address bindAddress) { *************** *** 186,189 **** --- 208,212 ---- } + void joinGame(Address remoteAddress, bool isFromMaster, bool local) { |
From: Mark F. <mar...@us...> - 2004-04-21 22:43:59
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32291/zap Modified Files: CTFGame.cpp CTFGame.h UIGame.cpp UIGame.h game.cpp gameConnection.cpp gameType.cpp gameType.h main.cpp Log Message: Added scoreboard render call for game type Added client to server scoreboard update request Added CTF custom scoreboard rendering Added duplicate name checking on connect with .N appended for dupes Added -level command line argument for level loading Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gameConnection.cpp 21 Apr 2004 00:21:58 -0000 1.4 --- gameConnection.cpp 21 Apr 2004 22:40:43 -0000 1.5 *************** *** 180,185 **** return false; char buf[256]; ! stream->readString(buf); playerName = buf; return true; --- 180,202 ---- return false; char buf[256]; ! stream->readString(buf); + size_t len = strlen(buf); + + if(len > 252) + len = 252; + U32 index = 0; + + checkPlayerName: + for(GameConnection *walk = gClientList.mNext; walk != &gClientList; walk = walk->mNext) + { + if(!strcmp(walk->playerName.getString(), buf)) + { + dSprintf(buf + len, 3, ".%d", index); + index++; + goto checkPlayerName; + } + } + playerName = buf; return true; Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 21 Apr 2004 02:23:08 -0000 1.5 --- main.cpp 21 Apr 2004 22:40:43 -0000 1.6 *************** *** 52,55 **** --- 52,56 ---- const char *gMasterAddressString = "IP:master.opentnl.org:29002"; Address gMasterAddress; + const char *gLoadLevel = "level1.txt"; void reshape(int nw, int nh) *************** *** 178,181 **** --- 179,183 ---- { gServerGame = new ServerGame(bindAddress, gMaxPlayers, gHostName); + gServerGame->loadLevel(gLoadLevel); if(!dedicated) *************** *** 281,284 **** --- 283,291 ---- } } + else if(!stricmp(argv[i], "-level")) + { + if(hasAdditionalArg) + gLoadLevel = argv[i+1]; + } else if(!stricmp(argv[i], "-hostname")) { Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gameType.cpp 21 Apr 2004 20:19:07 -0000 1.4 --- gameType.cpp 21 Apr 2004 22:40:43 -0000 1.5 *************** *** 38,41 **** --- 38,42 ---- { mNetFlags.set(Ghostable); + mTimeUntilScoreboardUpdate = 0; } *************** *** 45,48 **** --- 46,64 ---- } + void GameType::processServer(U32 deltaT) + { + if(deltaT > mTimeUntilScoreboardUpdate) + { + for(S32 i = 0; i < mClientList.size(); i++) + mClientList[i].ping = (U32) mClientList[i].clientConnection->getRoundTripTime(); + + for(S32 i = 0; i < mClientList.size(); i++) + if(mClientList[i].wantsScoreboardUpdates) + updateClientScoreboard(i); + + mTimeUntilScoreboardUpdate = 0; + } + } + void GameType::onAddedToGame(Game *theGame) { *************** *** 112,115 **** --- 128,140 ---- } + void GameType::countTeamPlayers() + { + for(S32 i = 0; i < mTeams.size(); i ++) + mTeams[i].numPlayers = 0; + + for(S32 i = 0; i < mClientList.size(); i++) + mTeams[mClientList[i].teamId].numPlayers++; + } + void GameType::serverAddClient(GameConnection *theClient) { *************** *** 119,124 **** --- 144,152 ---- cref.clientConnection = theClient; + countTeamPlayers(); + U32 minPlayers = mTeams[0].numPlayers; S32 minTeamIndex = 0; + for(S32 i = 1; i < mTeams.size(); i++) { *************** *** 132,137 **** mClientList.push_back(cref); - mTeams[cref.teamId].numPlayers++; - s2cAddClient(cref.clientId, cref.name, false); s2cClientJoinedTeam(cref.clientId, cref.teamId); --- 160,163 ---- *************** *** 163,166 **** --- 189,194 ---- cref.name = name; cref.teamId = 0; + cref.wantsScoreboardUpdates = false; + cref.ping = 0; mClientList.push_back(cref); *************** *** 173,177 **** { S32 clientIndex = findClientIndexByConnection(theClient); - mTeams[mClientList[clientIndex].teamId].numPlayers--; mClientList.erase(clientIndex); --- 201,204 ---- *************** *** 258,261 **** --- 285,289 ---- { GameConnection *source = (GameConnection *) getRPCSourceConnection(); + S32 clientIndex = findClientIndexByConnection(source); RefPtr<NetEvent> theEvent = TNL_RPC_CONSTRUCT_NETEVENT(this, *************** *** 265,271 **** if(!global) ! for(S32 i = 0; i < mClientList.size(); i++) ! if(mClientList[i].clientId == source->mClientId) ! teamId = mClientList[i].teamId; for(S32 i = 0; i < mClientList.size(); i++) --- 293,297 ---- if(!global) ! teamId = mClientList[clientIndex].teamId; for(S32 i = 0; i < mClientList.size(); i++) *************** *** 287,289 **** --- 313,329 ---- } + TNL_IMPLEMENT_NETOBJECT_RPC(GameType, c2sRequestScoreboardUpdates, (bool updates), + NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhostParent, 0) + { + GameConnection *source = (GameConnection *) getRPCSourceConnection(); + S32 clientIndex = findClientIndexByConnection(source); + mClientList[clientIndex].wantsScoreboardUpdates = updates; + if(updates) + updateClientScoreboard(clientIndex); + } + + void GameType::updateClientScoreboard(S32 clientIndex) + { + } + }; \ No newline at end of file Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CTFGame.cpp 20 Apr 2004 19:25:48 -0000 1.3 --- CTFGame.cpp 21 Apr 2004 22:40:40 -0000 1.4 *************** *** 63,74 **** TNL_IMPLEMENT_NETOBJECT(CTFGameType); ! void CTFGameType::renderInterfaceOverlay() { ! for(S32 i = 0; i < mTeams.size(); i++) { ! Point pos(750, 550 - i * 38); ! renderFlag(pos + Point(-20, 18), mTeams[i].color); ! glColor3f(1,1,1); ! UserInterface::drawStringf(pos.x, pos.y, 32, "%d", mTeams[i].score); } } --- 63,180 ---- TNL_IMPLEMENT_NETOBJECT(CTFGameType); ! void CTFGameType::renderInterfaceOverlay(bool scoreboardVisible) { ! if(scoreboardVisible) { ! U32 totalWidth = 780; ! U32 teamWidth = totalWidth / mTeams.size(); ! U32 maxTeamPlayers = 0; ! countTeamPlayers(); ! ! for(S32 i = 0; i < mTeams.size(); i++) ! if(mTeams[i].numPlayers > maxTeamPlayers) ! maxTeamPlayers = mTeams[i].numPlayers; ! ! U32 totalHeight = 580; ! U32 maxHeight = (totalHeight - 40) / maxTeamPlayers; ! if(maxHeight > 30) ! maxHeight = 30; ! ! totalHeight = 40 + maxHeight * maxTeamPlayers; ! U32 yt = (600 - totalHeight) / 2; ! U32 yb = yt + totalHeight; ! ! for(S32 i = 0; i < mTeams.size(); i++) ! { ! U32 xl = 10 + i * teamWidth; ! U32 xr = xl + teamWidth - 2; ! ! Color c = mTeams[i].color; ! glEnable(GL_BLEND); ! glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ! ! glColor4f(c.r, c.g, c.b, 0.6); ! glBegin(GL_POLYGON); ! glVertex2f(xl, yt); ! glVertex2f(xr, yt); ! glVertex2f(xr, yb); ! glVertex2f(xl, yb); ! glEnd(); ! ! glDisable(GL_BLEND); ! glBlendFunc(GL_ONE, GL_ZERO); ! ! renderFlag(Point(xl + 20, yt + 18), c); ! renderFlag(Point(xr - 20, yt + 18), c); ! ! glColor3f(1,1,1); ! glBegin(GL_LINES); ! glVertex2f(xl, yt + 40); ! glVertex2f(xr, yt + 40); ! glEnd(); ! ! UserInterface::drawString(xl + 40, yt + 2, 30, mTeams[i].name.getString()); ! UserInterface::drawStringf(xr - 140, yt + 2, 30, "%d", mTeams[i].score); ! ! U32 curRowY = yt + 41; ! U32 fontSize = maxHeight * 0.8f; ! for(S32 j = 0; j < mClientList.size(); j++) ! { ! if(mClientList[j].teamId == i) ! { ! UserInterface::drawString(xl + 40, curRowY, fontSize, mClientList[i].name.getString()); ! UserInterface::drawStringf(xr - 140, curRowY, fontSize, "%d", mClientList[i].score); ! UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[i].ping); ! curRowY += maxHeight; ! } ! } ! } ! } ! else ! { ! for(S32 i = 0; i < mTeams.size(); i++) ! { ! Point pos(750, 550 - i * 38); ! renderFlag(pos + Point(-20, 18), mTeams[i].color); ! glColor3f(1,1,1); ! UserInterface::drawStringf(pos.x, pos.y, 32, "%d", mTeams[i].score); ! } ! } ! } ! ! Vector<RangedU32<0, CTFGameType::MaxPing> > CTFGameType::mPingTimes; ///< Static vector used for constructing update RPCs ! Vector<Int<9> > CTFGameType::mScores; ! ! void CTFGameType::updateClientScoreboard(S32 clientIndex) ! { ! mPingTimes.clear(); ! mScores.clear(); ! ! for(S32 i = 0; i < mClientList.size(); i++) ! { ! if(mClientList[i].ping < MaxPing) ! mPingTimes.push_back(mClientList[i].ping); ! else ! mPingTimes.push_back(MaxPing); ! mScores.push_back(mClientList[i].score); ! } ! ! NetObject::setRPCDestConnection(mClientList[clientIndex].clientConnection); ! s2cScoreboardUpdate(mPingTimes, mScores); ! NetObject::setRPCDestConnection(NULL); ! } ! ! TNL_DECLARE_RPC_MEM_ENUM(CTFGameType, MaxPing); ! ! TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cScoreboardUpdate, (const Vector<RangedU32<0, CTFGameType::MaxPing> > &pingTimes, const Vector<Int<9> > &scores), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) ! { ! for(S32 i = 0; i < mClientList.size(); i++) ! { ! if(i >= pingTimes.size()) ! break; ! ! mClientList[i].ping = pingTimes[i]; ! mClientList[i].score = scores[i]; } } Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameType.h 20 Apr 2004 04:27:20 -0000 1.1 --- gameType.h 21 Apr 2004 22:40:43 -0000 1.2 *************** *** 42,46 **** --- 42,48 ---- S32 teamId; U32 score; + bool wantsScoreboardUpdates; SafePtr<GameConnection> clientConnection; + U32 ping; }; *************** *** 58,63 **** --- 60,67 ---- Vector<Team> mTeams; U32 mThisClientId; ///< Set to the client ID of this client (only on the ghost of the GameType) + U32 mTimeUntilScoreboardUpdate; GameType(); + void countTeamPlayers(); S32 findClientIndexById(U32 clientId); *************** *** 68,71 **** --- 72,76 ---- void onAddedToGame(Game *theGame); void onGhostAvailable(GhostConnection *theConnection); + void processServer(U32 deltaT); virtual void serverAddClient(GameConnection *theClient); *************** *** 78,82 **** virtual void processClientGameMenuOption(U32 index); ! virtual void renderInterfaceOverlay() {}; TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntry teamName, F32 r, F32 g, F32 b)); --- 83,88 ---- virtual void processClientGameMenuOption(U32 index); ! virtual void renderInterfaceOverlay(bool scoreboardVisible) {}; ! virtual void updateClientScoreboard(S32 clientIndex); TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntry teamName, F32 r, F32 g, F32 b)); *************** *** 91,94 **** --- 97,102 ---- TNL_DECLARE_RPC(s2cDisplayChatMessage, (bool global, StringTableEntry clientName, const char *message)); + TNL_DECLARE_RPC(c2sRequestScoreboardUpdates, (bool updates)); + TNL_DECLARE_CLASS(GameType); }; Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game.cpp 21 Apr 2004 02:23:08 -0000 1.4 --- game.cpp 21 Apr 2004 22:40:43 -0000 1.5 *************** *** 164,170 **** mNetInterface->setAllowsConnections(true); - - // Load a level - loadLevel("level1.txt"); } --- 164,167 ---- Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIGame.h 20 Apr 2004 04:27:19 -0000 1.1 --- UIGame.h 21 Apr 2004 22:40:43 -0000 1.2 *************** *** 72,75 **** --- 72,76 ---- bool mChatBlink; U32 mChatLastBlinkTime; + bool mInScoreboardMode; public: Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UIGame.cpp 21 Apr 2004 20:19:06 -0000 1.4 --- UIGame.cpp 21 Apr 2004 22:40:42 -0000 1.5 *************** *** 45,48 **** --- 45,49 ---- { mCurrentMode = PlayMode; + mInScoreboardMode = false; mChatLastBlinkTime = 0; *************** *** 173,177 **** if(theGameType) ! theGameType->renderInterfaceOverlay(); if(mCurrentMode == ChatMode) --- 174,178 ---- if(theGameType) ! theGameType->renderInterfaceOverlay(mInScoreboardMode); if(mCurrentMode == ChatMode) *************** *** 247,250 **** --- 248,259 ---- switch(key) { + case '\t': + { + mInScoreboardMode = true; + GameType *g = gClientGame->getGameType(); + if(g) + g->c2sRequestScoreboardUpdates(true); + break; + } case 'w': case 'W': *************** *** 392,395 **** --- 401,412 ---- switch(key) { + case '\t': + { + mInScoreboardMode = false; + GameType *g = gClientGame->getGameType(); + if(g) + g->c2sRequestScoreboardUpdates(false); + break; + } case 'w': case 'W': Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CTFGame.h 20 Apr 2004 04:27:19 -0000 1.1 --- CTFGame.h 21 Apr 2004 22:40:42 -0000 1.2 *************** *** 41,45 **** public: void shipTouchFlag(Ship *theShip, CTFFlagItem *theFlag); ! void renderInterfaceOverlay(); enum { --- 41,53 ---- public: void shipTouchFlag(Ship *theShip, CTFFlagItem *theFlag); ! void renderInterfaceOverlay(bool scoreboardVisible); ! void updateClientScoreboard(S32 clientIndex); ! ! enum { ! MaxPing = 999, ! }; ! ! static Vector<RangedU32<0, MaxPing> > mPingTimes; ///< Static vector used for constructing update RPCs ! static Vector<Int<9> > mScores; enum { *************** *** 50,53 **** --- 58,62 ---- TNL_DECLARE_RPC(s2cCTFMessage, (U32 messageIndex, U32 clientId, U32 teamIndex)); + TNL_DECLARE_RPC(s2cScoreboardUpdate, (const Vector<RangedU32<0, MaxPing> > &pingTimes, const Vector<Int<9> > &scores)); TNL_DECLARE_CLASS(CTFGameType); }; *************** *** 70,73 **** --- 79,83 ---- U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); void unpackUpdate(GhostConnection *connection, BitStream *stream); + TNL_DECLARE_CLASS(CTFFlagItem); }; |
From: Mark F. <mar...@us...> - 2004-04-21 22:41:27
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32291/tnl Modified Files: tnlRPC.h Log Message: Added scoreboard render call for game type Added client to server scoreboard update request Added CTF custom scoreboard rendering Added duplicate name checking on connect with .N appended for dupes Added -level command line argument for level loading Index: tnlRPC.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlRPC.h 20 Apr 2004 04:27:19 -0000 1.1 --- tnlRPC.h 21 Apr 2004 22:40:39 -0000 1.2 *************** *** 143,148 **** { U32 value; ! Int(U32 val) { value = val; } ! operator U32() { return value; } U32 getPrecisionBits() { return bitCount; } }; --- 143,148 ---- { U32 value; ! Int(U32 val=0) { value = val; } ! operator U32() const { return value; } U32 getPrecisionBits() { return bitCount; } }; *************** *** 155,160 **** { S32 value; ! SignedInt(S32 val) { value = val; } ! operator S32() { return value; } U32 getPrecisionBits() { return bitCount; } }; --- 155,160 ---- { S32 value; ! SignedInt(S32 val=0) { value = val; } ! operator S32() const { return value; } U32 getPrecisionBits() { return bitCount; } }; *************** *** 167,172 **** { F32 value; ! Float(F32 val) { value = val; } ! operator F32() { return value; } U32 getPrecisionBits() { return bitCount; } }; --- 167,172 ---- { F32 value; ! Float(F32 val=0) { value = val; } ! operator F32() const { return value; } U32 getPrecisionBits() { return bitCount; } }; *************** *** 179,184 **** { F32 value; ! SignedFloat(F32 val) { value = val; } ! operator F32() { return value; } U32 getPrecisionBits() { return bitCount; } }; --- 179,184 ---- { F32 value; ! SignedFloat(F32 val=0) { value = val; } ! operator F32() const { return value; } U32 getPrecisionBits() { return bitCount; } }; *************** *** 191,196 **** { U32 value; ! RangedU32(U32 val) { TNLAssert(value >= rangeStart && value <= rangeEnd, "Out of range value!"); value = val; } ! operator U32() { return value; } }; --- 191,196 ---- { U32 value; ! RangedU32(U32 val=rangeStart) { TNLAssert(value >= rangeStart && value <= rangeEnd, "Out of range value!"); value = val; } ! operator U32() const { return value; } }; |
From: Ben G. <s_a...@us...> - 2004-04-21 20:20:32
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6427/zap Modified Files: UIGame.cpp UIMenus.cpp UIMenus.h gameType.cpp ship.cpp Log Message: Added option to render player name below ships. Name is rendered in a slightly brighter version of the team color. Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UIGame.cpp 21 Apr 2004 02:23:08 -0000 1.3 --- UIGame.cpp 21 Apr 2004 20:19:06 -0000 1.4 *************** *** 417,419 **** } ! }; \ No newline at end of file --- 417,419 ---- } ! }; Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameType.cpp 20 Apr 2004 19:25:48 -0000 1.3 --- gameType.cpp 21 Apr 2004 20:19:07 -0000 1.4 *************** *** 107,111 **** spawnPoint = mTeams[teamIndex].spawnPoints[spawnIndex]; ! Ship *newShip = new Ship(spawnPoint, mTeams[teamIndex].color); newShip->addToGame(getGame()); theClient->setControlObject(newShip); --- 107,111 ---- spawnPoint = mTeams[teamIndex].spawnPoints[spawnIndex]; ! Ship *newShip = new Ship(mClientList[clientIndex].name, spawnPoint, mTeams[teamIndex].color); newShip->addToGame(getGame()); theClient->setControlObject(newShip); Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIMenus.cpp 20 Apr 2004 04:27:19 -0000 1.1 --- UIMenus.cpp 21 Apr 2004 20:19:07 -0000 1.2 *************** *** 158,161 **** --- 158,162 ---- bool OptionsMenuUserInterface::controlsRelative = false; bool OptionsMenuUserInterface::fullscreen = false; + bool OptionsMenuUserInterface::showNames = false; OptionsMenuUserInterface::OptionsMenuUserInterface() *************** *** 184,187 **** --- 185,193 ---- menuItems.push_back("SET FULLSCREEN MODE"); + if(showNames) + menuItems.push_back("SET NAMES HIDDEN"); + else + menuItems.push_back("SET NAMES VISIBLE"); + if(gClientGame->getConnectionToServer()) menuItems.push_back("RETURN TO GAME"); *************** *** 212,219 **** void OptionsMenuUserInterface::processSelection(U32 index) { ! if(index == 0) ! controlsRelative = !controlsRelative; ! else if(index == 1) { if(fullscreen) { --- 218,227 ---- void OptionsMenuUserInterface::processSelection(U32 index) { ! switch(index) { + case 0: + controlsRelative = !controlsRelative; + break; + case 1: if(fullscreen) { *************** *** 224,237 **** glutFullScreen(); fullscreen = !fullscreen; ! } ! if(index == 2) ! { if(gClientGame->getConnectionToServer()) gGameUserInterface.activate(); else gMainMenuUserInterface.activate(); ! } ! else ! setupMenus(); } --- 232,247 ---- glutFullScreen(); fullscreen = !fullscreen; ! break; ! case 2: ! showNames = !showNames; ! break; ! case 3: if(gClientGame->getConnectionToServer()) gGameUserInterface.activate(); else gMainMenuUserInterface.activate(); ! break; ! }; ! setupMenus(); } Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIMenus.h 20 Apr 2004 04:27:19 -0000 1.1 --- UIMenus.h 21 Apr 2004 20:19:07 -0000 1.2 *************** *** 74,77 **** --- 74,78 ---- static bool controlsRelative; static bool fullscreen; + static bool showNames; OptionsMenuUserInterface(); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ship.cpp 20 Apr 2004 19:25:49 -0000 1.5 --- ship.cpp 21 Apr 2004 20:19:07 -0000 1.6 *************** *** 33,36 **** --- 33,40 ---- #include "gameLoader.h" #include "sfx.h" + #include "UI.h" + #include "UIMenus.h" + + #include <stdio.h> namespace Zap *************** *** 39,43 **** //------------------------------------------------------------------------ TNL_IMPLEMENT_NETOBJECT(Ship); ! Ship::Ship(Point p, Color c, F32 m) : MoveObject(p, CollisionRadius) { mObjectTypeMask = ShipType | MoveableType; --- 43,48 ---- //------------------------------------------------------------------------ TNL_IMPLEMENT_NETOBJECT(Ship); ! ! Ship::Ship(StringTableEntry playerName, Point p, Color c, F32 m) : MoveObject(p, CollisionRadius) { mObjectTypeMask = ShipType | MoveableType; *************** *** 58,61 **** --- 63,68 ---- updateExtent(); lastFireTime = 0; + + mPlayerName = playerName; } *************** *** 283,286 **** --- 290,294 ---- if(stream->writeFlag(updateMask & InitialMask)) { + connection->packStringTableEntry(stream, mPlayerName); stream->write(color.r); stream->write(color.g); *************** *** 342,345 **** --- 350,354 ---- if(stream->readFlag()) { + mPlayerName = connection->unpackStringTableEntry(stream); stream->read(&color.r); stream->read(&color.g); *************** *** 562,565 **** --- 571,585 ---- glTranslatef(mMoveState[RenderState].pos.x, mMoveState[RenderState].pos.y, 0); + // Render name... + if(OptionsMenuUserInterface::showNames) + { + static char buff[255]; + sprintf(buff, "%s", mPlayerName.getString()); + + // Make it a nice pastel + glColor3f(color.r*1.2,color.g*1.2,color.b*1.2); + UserInterface::drawString( UserInterface::getStringWidth(14, buff) * -0.5, 30, 14, buff ); + } + F32 alpha = 1.0; *************** *** 735,738 **** --- 755,759 ---- if(mMountedItems[i].isValid()) mMountedItems[i]->renderItem(mMoveState[RenderState].pos); + } |
From: Ben G. <s_a...@us...> - 2004-04-21 02:23:17
|
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) |
From: Ben G. <s_a...@us...> - 2004-04-21 02:23:16
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19428/tnl Modified Files: clientPuzzle.cpp Log Message: Assorted fixes to enhance smoothness of load. Added master server status display. Index: clientPuzzle.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/clientPuzzle.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** clientPuzzle.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- clientPuzzle.cpp 21 Apr 2004 02:23:08 -0000 1.2 *************** *** 158,163 **** for(;;) { ! // We do 100,000 attempts... ! U32 nextValue = startValue + 100000; for(;startValue < nextValue; startValue++) { --- 158,163 ---- for(;;) { ! // We do 5,000 attempts... (this valus is tweakable ! U32 nextValue = startValue + 5000; for(;startValue < nextValue; startValue++) { *************** *** 168,171 **** --- 168,172 ---- } } + // Then we check to see if we're out of time... if(Platform::getRealMilliseconds() - startTime > MaxSolutionComputeFragment) |
From: Mark F. <mar...@us...> - 2004-04-21 02:17:26
|
Update of /cvsroot/opentnl/tnl/osx/tnl.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18513/osx/tnl.xcode Modified Files: project.pbxproj Log Message: More mac fixes Index: project.pbxproj =================================================================== RCS file: /cvsroot/opentnl/tnl/osx/tnl.xcode/project.pbxproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** project.pbxproj 20 Apr 2004 22:19:55 -0000 1.2 --- project.pbxproj 21 Apr 2004 02:17:14 -0000 1.3 *************** *** 179,182 **** --- 179,183 ---- 29B97323FDCFA39411CA2CEA = { children = ( + DB9525CF0636109800B8795E, 6656DD9B0635C8EF00E30126, 6692C11906247CF900D5ADFE, *************** *** 458,461 **** --- 459,463 ---- 6649E0EE05FD022100B3DD8B = { children = ( + DB9525E3063610C200B8795E, 66BA0CE005FD17F600D882FA, 66BA0CE105FD17F600D882FA, *************** *** 1799,1803 **** INSTALL_PATH = /usr/local/bin; OTHER_CFLAGS = ""; ! OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_NAME = ZAP; --- 1801,1805 ---- INSTALL_PATH = /usr/local/bin; OTHER_CFLAGS = ""; ! OTHER_LDFLAGS = "-lobjc"; OTHER_REZFLAGS = ""; PRODUCT_NAME = ZAP; *************** *** 2283,2286 **** --- 2285,2289 ---- 6692C16106247D2700D5ADFE, 6656DD9C0635C8EF00E30126, + DB9525D00636109800B8795E, ); isa = PBXFrameworksBuildPhase; *************** *** 3435,3438 **** --- 3438,3442 ---- 66BA0CE605FD17F600D882FA, 66BA0CE705FD17F600D882FA, + DB9525E4063610C200B8795E, ); isa = PBXSourcesBuildPhase; *************** *** 3939,3942 **** --- 3943,3947 ---- 66BA0CF605FD182100D882FA, 8D11072F0486CEB800E47090, + DB9525D10636109800B8795E, ); isa = PBXFrameworksBuildPhase; *************** *** 3965,3968 **** --- 3970,4018 ---- sourceTree = BUILT_PRODUCTS_DIR; }; + //8D0 + //8D1 + //8D2 + //8D3 + //8D4 + //DB0 + //DB1 + //DB2 + //DB3 + //DB4 + DB9525CF0636109800B8795E = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = OpenGL.framework; + path = /System/Library/Frameworks/OpenGL.framework; + refType = 0; + sourceTree = "<absolute>"; + }; + DB9525D00636109800B8795E = { + fileRef = DB9525CF0636109800B8795E; + isa = PBXBuildFile; + settings = { + }; + }; + DB9525D10636109800B8795E = { + fileRef = DB9525CF0636109800B8795E; + isa = PBXBuildFile; + settings = { + }; + }; + DB9525E3063610C200B8795E = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = certificate.cpp; + path = ../tnl/certificate.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + DB9525E4063610C200B8795E = { + fileRef = DB9525E3063610C200B8795E; + isa = PBXBuildFile; + settings = { + }; + }; }; rootObject = 29B97313FDCFA39411CA2CEA; |
From: Mark F. <mar...@us...> - 2004-04-21 01:59:34
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15792/zap Modified Files: sfx.cpp Log Message: Fixed OpenAL on Mac (sortof) Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sfx.cpp 20 Apr 2004 22:17:46 -0000 1.7 --- sfx.cpp 21 Apr 2004 01:59:26 -0000 1.8 *************** *** 148,151 **** --- 148,154 ---- alSourcei(source, AL_BUFFER, gBuffers[mSFXIndex]); alSourcei(source, AL_LOOPING, mProfile->isLooping); + alSourcef(source, AL_REFERENCE_DISTANCE,9000); + alSourcef(source, AL_ROLLOFF_FACTOR,1); + alSourcef(source, AL_MAX_DISTANCE, 10000); updateMovementParams(); *************** *** 204,207 **** --- 207,211 ---- void SFXObject::init() { + ALint error; gDevice = alcOpenDevice((ALubyte *) "DirectSound3D"); if(!gDevice) *************** *** 220,232 **** alcMakeContextCurrent(gContext); ! alGetError(); alDistanceModel(AL_NONE); // load up all the sound buffers ! alGenBuffers(NumSFXBuffers, gBuffers); ! ! if(alGetError() != AL_NO_ERROR) ! return; alGenSources(NumSources, gSources); --- 224,238 ---- alcMakeContextCurrent(gContext); ! error = alGetError(); ! ! alGenBuffers(NumSFXBuffers, gBuffers); ! error = alGetError(); alDistanceModel(AL_NONE); + error = alGetError(); // load up all the sound buffers ! //if(error != AL_NO_ERROR) ! // return; alGenSources(NumSources, gSources); |
From: Ben G. <s_a...@us...> - 2004-04-21 01:57:15
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15475/zap Modified Files: barrier.cpp Log Message: Fix to barrier calculations to get rid of "gaps." Index: barrier.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** barrier.cpp 20 Apr 2004 08:51:29 -0000 1.2 --- barrier.cpp 21 Apr 2004 01:57:06 -0000 1.3 *************** *** 163,167 **** Point rp1 = mRenderLineSegments[i]; Point rp2 = mRenderLineSegments[i + 1]; ! Point cp1 = polyPoints[polyPoints.size() - 1]; for(S32 j = 0; j < polyPoints.size(); j++) --- 163,179 ---- Point rp1 = mRenderLineSegments[i]; Point rp2 = mRenderLineSegments[i + 1]; ! ! /* Point cp1 = polyPoints[polyPoints.size() - 1]; ! for(S32 j = 0; j < polyPoints.size(); j++) ! { ! Point cp2 = polyPoints[j]; ! Point ce = cp2 - cp1; ! ! // If we're collinear, just don't clip ! ! cp1 = cp2; ! } */ ! ! Point cp1 = polyPoints[polyPoints.size() - 1]; for(S32 j = 0; j < polyPoints.size(); j++) *************** *** 180,184 **** bool d2in = d2 > distToZero; ! if(!d1in && !d2in) // both points are outside this edge of the poly, so... { // add them to the render poly --- 192,206 ---- bool d2in = d2 > distToZero; ! // collinearity check ! Point a = ce; ! Point b = rp2-rp1; ! a.normalize(); ! b.normalize(); ! F32 v = a.dot(b); ! ! // And locality check ! F32 lc = getMin( getMin( (cp1 - rp1).len(), (cp1 - rp2).len() ), getMin( (cp2 - rp1).len(), (cp2 - rp2).len() )); ! ! if(!d1in && !d2in || (v >= 1.f && lc < 0.1)) // both points are outside this edge of the poly, so... { // add them to the render poly *************** *** 208,212 **** // if both are in, just go to the next edge. - cp1 = cp2; } --- 230,233 ---- |
From: Ben G. <s_a...@us...> - 2004-04-21 01:40:47
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12661/tnl Modified Files: tnlNetConnection.h Log Message: Small bit of sanity enforcement now that we're doing pointer lookups based on the NetConnectionState enum. Index: tnlNetConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlNetConnection.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlNetConnection.h 21 Apr 2004 01:40:35 -0000 1.2 *************** *** 480,484 **** /// Connection state flags for a NetConnection instance. enum NetConnectionState { ! NotConnected, ///< Initial state of a NetConnection instance - not connected. AwaitingChallengeResponse, ///< We've sent a challenge request, awaiting the response. SendingPunchPackets, ///< The state of a pending arranged connection when both sides haven't heard from the other yet --- 480,484 ---- /// Connection state flags for a NetConnection instance. enum NetConnectionState { ! NotConnected=0, ///< Initial state of a NetConnection instance - not connected. AwaitingChallengeResponse, ///< We've sent a challenge request, awaiting the response. SendingPunchPackets, ///< The state of a pending arranged connection when both sides haven't heard from the other yet |
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"); } |
From: Mark F. <mar...@us...> - 2004-04-21 00:22:06
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31179/zap Modified Files: gameConnection.cpp Log Message: Fixed bug where timed out connection from the master would set the main menu on the hosting game Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameConnection.cpp 20 Apr 2004 19:25:48 -0000 1.3 --- gameConnection.cpp 21 Apr 2004 00:21:58 -0000 1.4 *************** *** 237,241 **** void GameConnection::onConnectTimedOut() { ! gMainMenuUserInterface.activate(); } --- 237,242 ---- void GameConnection::onConnectTimedOut() { ! if(this == gClientGame->getConnectionToServer()) ! gMainMenuUserInterface.activate(); } |
From: Ben G. <s_a...@us...> - 2004-04-20 23:44:33
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24625/zap Modified Files: main.cpp Log Message: Fixed mouse code, only left clicks count, no possibility of hosed firing state. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 20 Apr 2004 23:37:26 -0000 1.3 --- main.cpp 20 Apr 2004 23:44:25 -0000 1.4 *************** *** 85,92 **** void mouse(int button, int state, int x, int y) { ! static int mouseState=0; ! logprintf("button=%d state=%d", button, state); ! if(UserInterface::current) if(state==1 && !mouseState) { --- 85,93 ---- void mouse(int button, int state, int x, int y) { ! // This is pretty gross. We need a trigger system. - BJG ! static int mouseState = 0; ! if(UserInterface::current && button == 0) ! { if(state==1 && !mouseState) { *************** *** 99,102 **** --- 100,104 ---- UserInterface::current->onMouseDown(x, y); } + } } |
From: Mark F. <mar...@us...> - 2004-04-20 23:37:37
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23375/zap Modified Files: main.cpp masterConnection.cpp Log Message: Fixed master server Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 20 Apr 2004 22:18:48 -0000 1.2 --- main.cpp 20 Apr 2004 23:37:26 -0000 1.3 *************** *** 50,54 **** const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! const char *gMasterAddressString = "IP:master.garagegames.com:29002"; Address gMasterAddress; --- 50,54 ---- const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! const char *gMasterAddressString = "IP:master.opentnl.org:29002"; Address gMasterAddress; Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** masterConnection.cpp 20 Apr 2004 04:27:20 -0000 1.1 --- masterConnection.cpp 20 Apr 2004 23:37:26 -0000 1.2 *************** *** 117,125 **** c2mAcceptArrangedConnection(requestId, localAddress, b); GameConnection *conn = new GameConnection(); - Vector<Address> fullPossibleAddresses; for(S32 i = 0; i < possibleAddresses.size(); i++) fullPossibleAddresses.push_back(Address(possibleAddresses[i])); logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString()); logprintf(" Generated shared secret data: %s", b.encodeBase64()->getBuffer()); --- 117,126 ---- c2mAcceptArrangedConnection(requestId, localAddress, b); GameConnection *conn = new GameConnection(); Vector<Address> fullPossibleAddresses; for(S32 i = 0; i < possibleAddresses.size(); i++) fullPossibleAddresses.push_back(Address(possibleAddresses[i])); + conn->setNetAddress(fullPossibleAddresses[0]); + logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString()); logprintf(" Generated shared secret data: %s", b.encodeBase64()->getBuffer()); |
From: Ben G. <s_a...@us...> - 2004-04-20 22:20:21
|
Update of /cvsroot/opentnl/tnl/osx/tnl.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7028/osx/tnl.xcode Modified Files: project.pbxproj Log Message: Updated ProjectBuilder project. Index: project.pbxproj =================================================================== RCS file: /cvsroot/opentnl/tnl/osx/tnl.xcode/project.pbxproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** project.pbxproj 20 Apr 2004 04:27:17 -0000 1.1 --- project.pbxproj 20 Apr 2004 22:19:55 -0000 1.2 *************** *** 84,89 **** isa = PBXGroup; name = Products; ! refType = 4; ! sourceTree = "<group>"; }; //190 --- 84,90 ---- isa = PBXGroup; name = Products; ! path = ../exe; [...1134 lines suppressed...] *** 3680,3684 **** INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; ! LIBRARY_SEARCH_PATHS = /Users/markfrohnmayer/tnl/osx/build; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; --- 3873,3877 ---- INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; ! LIBRARY_SEARCH_PATHS = ../osx/build; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; *************** *** 3743,3746 **** --- 3936,3940 ---- buildActionMask = 2147483647; files = ( + 6656DD850635C66F00E30126, 66BA0CF605FD182100D882FA, 8D11072F0486CEB800E47090, |
From: Mark F. <mar...@us...> - 2004-04-20 22:19:05
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/zap Modified Files: main.cpp Log Message: Zap now connects to the master server added an init() in the udp code for address resolution before socket creation Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 20 Apr 2004 04:27:20 -0000 1.1 --- main.cpp 20 Apr 2004 22:18:48 -0000 1.2 *************** *** 50,55 **** const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! ! Address gMasterAddress("127.0.0.1:28999"); void reshape(int nw, int nh) --- 50,55 ---- const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! const char *gMasterAddressString = "IP:master.garagegames.com:29002"; ! Address gMasterAddress; void reshape(int nw, int nh) *************** *** 256,260 **** { if(hasAdditionalArg) ! gMasterAddress.set(argv[i+1]); } else if(!stricmp(argv[i], "-dedicated")) --- 256,260 ---- { if(hasAdditionalArg) ! gMasterAddressString = argv[i+1]; } else if(!stricmp(argv[i], "-dedicated")) *************** *** 284,287 **** --- 284,288 ---- } } + gMasterAddress.set(gMasterAddressString); if(hasClient) |
From: Mark F. <mar...@us...> - 2004-04-20 22:19:05
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/tnl Modified Files: udp.cpp Log Message: Zap now connects to the master server added an init() in the udp code for address resolution before socket creation Index: udp.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/udp.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** udp.cpp 20 Apr 2004 04:27:19 -0000 1.1 --- udp.cpp 20 Apr 2004 22:18:37 -0000 1.2 *************** *** 448,451 **** --- 448,452 ---- bool Address::set(const char *addressString) { + init(); if(strnicmp(addressString, "ipx:", 4)) { |