opentnl-cvs Mailing List for Torque Network Library (Page 25)
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: John Q. <jm...@us...> - 2004-04-25 19:10:36
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28776/zap Modified Files: main.cpp Log Message: Enabled platform logging so that osx/linux get assert messages Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.cpp 24 Apr 2004 23:52:33 -0000 1.9 --- main.cpp 25 Apr 2004 19:10:03 -0000 1.10 *************** *** 261,264 **** --- 261,265 ---- { TNLLogEnable(LogNetInterface, true); + TNLLogEnable(LogPlatform, true); bool hasClient = true; bool hasServer = false; |
From: John Q. <jm...@us...> - 2004-04-25 19:09:54
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28618/zap Modified Files: Makefile Log Message: Enable logging so that assert messages are printed. Added new object targets Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 20 Apr 2004 09:28:25 -0000 1.2 --- Makefile 25 Apr 2004 19:09:24 -0000 1.3 *************** *** 5,9 **** # Configuration # ! CC=g++ -g -I../tnl -I../glut -I../openal -DTNL_DEBUG #-O2 OBJECTS_ZAP=\ --- 5,9 ---- # Configuration # ! CC=g++ -g -I../tnl -I../glut -I../openal -DTNL_DEBUG -DTNL_ENABLE_LOGGING #-O2 OBJECTS_ZAP=\ *************** *** 11,14 **** --- 11,15 ---- game.o\ gameConnection.o\ + gameItems.o\ gameLoader.o\ gameNetInterface.o\ *************** *** 26,29 **** --- 27,31 ---- UIQueryServers.o\ projectile.o\ + quickChat.o\ ship.o\ sfx.o\ |
From: John Q. <jm...@us...> - 2004-04-25 19:09:45
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28542/tnl Modified Files: platform.cpp Log Message: Use SIGTRAP debugBreak on linux as well as osx Index: platform.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/platform.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** platform.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- platform.cpp 25 Apr 2004 19:08:24 -0000 1.2 *************** *** 202,209 **** } ! #else ! ! #ifdef TNL_OS_MAC_OSX ! //#include <CarbonCore.h> void Platform::debugBreak() --- 202,206 ---- } ! #else // osx and linux void Platform::debugBreak() *************** *** 211,215 **** kill(getpid(), SIGTRAP); } - #endif void Platform::outputDebugString(const char *string) --- 208,211 ---- *************** *** 220,223 **** --- 216,220 ---- void Platform::forceQuit() { + debugBreak(); exit(1); } |
From: John Q. <jm...@us...> - 2004-04-25 19:09:38
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28390/tnl Modified Files: Makefile Log Message: Use g++ instead of gcc to compile tnl Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 20 Apr 2004 09:25:57 -0000 1.2 --- Makefile 25 Apr 2004 19:07:23 -0000 1.3 *************** *** 8,12 **** # Configuration # ! CC=gcc -g -DTNL_DEBUG -I../libtomcrypt # -O2 OBJECTS=\ --- 8,12 ---- # Configuration # ! CC=g++ -g -DTNL_DEBUG -DTNL_ENABLE_LOGGING -I../libtomcrypt # -O2 OBJECTS=\ |
From: Ben G. <s_a...@us...> - 2004-04-25 06:11:15
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7386/zap Modified Files: gameItems.cpp Log Message: Powerups rotate. Might want to move this into the PickupItem class - maybe not, though. Index: gameItems.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameItems.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameItems.cpp 23 Apr 2004 01:50:48 -0000 1.1 --- gameItems.cpp 25 Apr 2004 06:01:30 -0000 1.2 *************** *** 34,40 **** --- 34,45 ---- class RepairItem : public PickupItem { + private: + typedef PickupItem Parent; + F32 spin; + public: RepairItem(Point p = Point()) : PickupItem(p, 20) { + spin=0.f; mNetFlags.set(Ghostable); } *************** *** 77,80 **** --- 82,91 ---- } + void processClient(U32 deltaT) + { + Parent::processClient(deltaT); + spin += 50.f * (F32)deltaT / 1000.f; + } + void renderItem(Point pos) { *************** *** 82,85 **** --- 93,97 ---- glPushMatrix(); glTranslatef(pos.x, pos.y, 0); + glRotatef(spin, 0, 0, 1.f); glColor3f(1, 1, 0); *************** *** 148,150 **** --- 160,163 ---- TNL_IMPLEMENT_NETOBJECT(TestItem); + }; \ No newline at end of file |
From: Ben G. <s_a...@us...> - 2004-04-25 06:05:23
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6759/zap Modified Files: gameType.cpp Log Message: Fixed null pointer crash. (ALWAYS CHECK SafePtrs!) Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gameType.cpp 23 Apr 2004 07:02:26 -0000 1.11 --- gameType.cpp 25 Apr 2004 05:57:55 -0000 1.12 *************** *** 310,314 **** { if(global || mClientList[i].teamId == teamId) ! mClientList[i].clientConnection->postNetEvent(theEvent); } } --- 310,315 ---- { if(global || mClientList[i].teamId == teamId) ! if(mClientList[i].clientConnection) ! mClientList[i].clientConnection->postNetEvent(theEvent); } } |
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447/zap Modified Files: UIMenus.cpp UIMenus.h ZAP.vcproj game.cpp game.h gameNetInterface.cpp main.cpp masterConnection.cpp ship.cpp ship.h Added Files: winJoystick.cpp Log Message: Added controller support dinput rudimentary win32 Fixed bug in netInterface for debug message requests Messed around with some ship movement parameters Other misc stuff. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.cpp 23 Apr 2004 01:49:46 -0000 1.8 --- main.cpp 24 Apr 2004 23:52:33 -0000 1.9 *************** *** 252,255 **** --- 252,257 ---- } + extern void InitController(); + }; *************** *** 357,360 **** --- 359,366 ---- glutIdleFunc(idle); + #ifdef TNL_OS_WIN32 + InitController(); + #endif + glutSetCursor(GLUT_CURSOR_NONE); glMatrixMode(GL_PROJECTION); Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UIMenus.h 23 Apr 2004 08:10:03 -0000 1.3 --- UIMenus.h 24 Apr 2004 23:52:33 -0000 1.4 *************** *** 74,77 **** --- 74,78 ---- static bool controlsRelative; static bool fullscreen; + static bool joystickEnabled; OptionsMenuUserInterface(); Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ZAP.vcproj 23 Apr 2004 08:10:03 -0000 1.4 --- ZAP.vcproj 24 Apr 2004 23:52:33 -0000 1.5 *************** *** 34,38 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="../openal/OpenAL32.lib ../openal/alut.lib wsock32.lib ../glut/glut32.lib" OutputFile="../exe/ZAPd.exe" LinkIncremental="2" --- 34,38 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="../glut/dxguid.lib ../glut/dinput8.lib ../glut/dinput.lib ../openal/OpenAL32.lib ../openal/alut.lib wsock32.lib ../glut/glut32.lib" OutputFile="../exe/ZAPd.exe" LinkIncremental="2" *************** *** 84,88 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="../openal/OpenAL32.lib ../openal/alut.lib wsock32.lib ../glut/glut32.lib" OutputFile="../exe/ZAP.exe" LinkIncremental="1" --- 84,88 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="../glut/dxguid.lib ../glut/dinput8.lib ../glut/dinput.lib ../openal/OpenAL32.lib ../openal/alut.lib wsock32.lib ../glut/glut32.lib" OutputFile="../exe/ZAP.exe" LinkIncremental="1" *************** *** 283,286 **** --- 283,289 ---- </File> <File + RelativePath=".\winJoystick.cpp"> + </File> + <File RelativePath=".\winmain.cpp"> </File> Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game.h 22 Apr 2004 00:35:44 -0000 1.4 --- game.h 24 Apr 2004 23:52:33 -0000 1.5 *************** *** 184,187 **** --- 184,188 ---- extern void endGame(); + #define ZAP_GAME_STRING "ZAP 1.1.1" }; Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** masterConnection.cpp 23 Apr 2004 08:10:03 -0000 1.5 --- masterConnection.cpp 24 Apr 2004 23:52:33 -0000 1.6 *************** *** 182,186 **** Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.3"); // Game Name if(bstream->writeFlag(mIsGameServer)) { --- 182,186 ---- Parent::writeConnectRequest(bstream); ! bstream->writeString(ZAP_GAME_STRING); // Game Name if(bstream->writeFlag(mIsGameServer)) { --- NEW FILE: winJoystick.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 // //------------------------------------------------------------------------------------ #define STRICT #define DIRECTINPUT_VERSION 0x0800 #include <windows.h> #include <dinput.h> #include "gameConnection.h" #include "point.h" namespace Zap { BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, VOID* pContext ); LPDIRECTINPUT8 gDirectInput = NULL; LPDIRECTINPUTDEVICE8 gJoystick = NULL; void InitController() { if(FAILED(DirectInput8Create ( GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&gDirectInput, NULL ) ) ) return; if(FAILED(gDirectInput->EnumDevices( DI8DEVCLASS_GAMECTRL, EnumJoysticksCallback, NULL, DIEDFL_ATTACHEDONLY ) ) ) return; if(!gJoystick) return; // since we passed in a NULL window, we don't bother setting the cooperative level. } BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, VOID* pContext ) { // Obtain an interface to the enumerated joystick. if(FAILED(gDirectInput->CreateDevice( pdidInstance->guidInstance, &gJoystick, NULL ))) return DIENUM_CONTINUE; return DIENUM_STOP; } void JoystickUpdateMove( Move *theMove ) { DIJOYSTATE2 js; // DInput joystick state if(!gJoystick) return; if(FAILED(gJoystick->Poll() ) ) { HRESULT hr; hr = gJoystick->Acquire(); while( hr == DIERR_INPUTLOST ) hr = gJoystick->Acquire(); return; } // Get the input's device state if(FAILED(gJoystick->GetDeviceState( sizeof(DIJOYSTATE2), &js ) ) ) return; // The device should have been acquired during the Poll() S32 x = js.lX; F32 deadZone = 8192.0f; F32 controls[4]; controls[0] = F32( js.lX ) - 32768.0f; controls[1] = F32( js.lY ) - 32768.0f; controls[2] = F32( js.lRz ) - 32768.0f; controls[3] = F32( js.rglSlider[0] ) - 32768.0f; for(U32 i = 0; i < 4; i++) { if(controls[i] < -deadZone) controls[i] = -(-controls[i] - deadZone) / F32(32768.0f - deadZone); else if(controls[i] > deadZone) controls[i] = (controls[i] - deadZone) / F32(32768.0f - deadZone); else controls[i] = 0; } if(controls[0] < 0) { theMove->left = -controls[0]; theMove->right = 0; } else { theMove->left = 0; theMove->right = controls[0]; } if(controls[1] < 0) { theMove->up = -controls[1]; theMove->down = 0; } else { theMove->down = controls[1]; theMove->up = 0; } Point p(controls[2], controls[3]); if(p.len() > 0.1) { theMove->angle = atan2(p.x, p.y); theMove->fire = true; } else theMove->fire = false; } void FreeDirectInput() { // Unacquire the device one last time just in case // the app tried to exit while the device is still acquired. if( gJoystick ) gJoystick->Unacquire(); // Release any DirectInput objects. if(gJoystick) gJoystick->Release(); if(gDirectInput) gDirectInput->Release(); } }; Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ship.h 23 Apr 2004 01:49:46 -0000 1.4 --- ship.h 24 Apr 2004 23:52:33 -0000 1.5 *************** *** 39,44 **** public: enum { ! MaxVelocity = 500, // points per second ! Acceleration = 800, // points per second per second InterpMaxVelocity = 900, // velocity to use to interpolate to proper position InterpAcceleration = 1800, --- 39,44 ---- public: enum { ! MaxVelocity = 400, // points per second ! Acceleration = 3000, // points per second per second InterpMaxVelocity = 900, // velocity to use to interpolate to proper position InterpAcceleration = 1800, Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UIMenus.cpp 23 Apr 2004 08:10:03 -0000 1.5 --- UIMenus.cpp 24 Apr 2004 23:52:33 -0000 1.6 *************** *** 168,171 **** --- 168,172 ---- bool OptionsMenuUserInterface::controlsRelative = false; bool OptionsMenuUserInterface::fullscreen = false; + bool OptionsMenuUserInterface::joystickEnabled = false; OptionsMenuUserInterface::OptionsMenuUserInterface() *************** *** 194,197 **** --- 195,203 ---- menuItems.push_back("SET FULLSCREEN MODE"); + if(joystickEnabled) + menuItems.push_back("DISABLE JOYSTICK/CONTROLLER"); + else + menuItems.push_back("ENABLE JOYSTICK/CONTROLLER"); + if(gClientGame->getConnectionToServer()) menuItems.push_back("RETURN TO GAME"); *************** *** 238,241 **** --- 244,250 ---- break; case 2: + joystickEnabled = !joystickEnabled; + break; + case 3: if(gClientGame->getConnectionToServer()) gGameUserInterface.activate(); Index: gameNetInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameNetInterface.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameNetInterface.cpp 20 Apr 2004 04:27:20 -0000 1.1 --- gameNetInterface.cpp 24 Apr 2004 23:52:33 -0000 1.2 *************** *** 48,51 **** --- 48,56 ---- Nonce clientNonce; clientNonce.read(stream); + char string[256]; + stream->readString(string); + if(strcmp(string, ZAP_GAME_STRING)) + break; + U32 token = computeClientIdentityToken(remoteAddress, clientNonce); PacketStream pingResponse; *************** *** 108,111 **** --- 113,117 ---- packet.write(U8(Ping)); clientNonce.write(&packet); + packet.writeString(ZAP_GAME_STRING); packet.sendto(mSocket, theAddress); } Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** game.cpp 22 Apr 2004 00:35:43 -0000 1.6 --- game.cpp 24 Apr 2004 23:52:33 -0000 1.7 *************** *** 38,41 **** --- 38,42 ---- #include "ship.h" #include "UIGame.h" + #include "UIMenus.h" #include "SweptEllipsoid.h" #include "sparkManager.h" *************** *** 95,98 **** --- 96,101 ---- if(!mConnectionToMaster.isValid()) { + if(gMasterAddress == Address()) + return; if(mNextMasterTryTime < timeDelta) { *************** *** 246,249 **** --- 249,254 ---- } + extern void JoystickUpdateMove( Move *theMove ); + void ClientGame::idle(U32 timeDelta) { *************** *** 257,260 **** --- 262,270 ---- Move *theMove = gGameUserInterface.getCurrentMove(); + + #ifdef TNL_OS_WIN32 + if(OptionsMenuUserInterface::joystickEnabled) + JoystickUpdateMove(theMove); + #endif theMove->prepare(); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ship.cpp 23 Apr 2004 08:10:03 -0000 1.10 --- ship.cpp 24 Apr 2004 23:52:33 -0000 1.11 *************** *** 139,143 **** lastFireTime = currentTime; Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); ! Point projVel = mMoveState[ActualState].vel + dir * 500; Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * (CollisionRadius-1), projVel, 1000, this); proj->addToGame(getGame()); --- 139,143 ---- lastFireTime = currentTime; Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); ! Point projVel = dir * 600 + dir * mMoveState[ActualState].vel.dot(dir); //mMoveState[ActualState].vel + dir * 500; Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * (CollisionRadius-1), projVel, 1000, this); proj->addToGame(getGame()); *************** *** 181,256 **** lastMove.time = deltaT; processMove(&lastMove, ActualState); if(interpTime) { ! mMoveState[RenderState].angle = mMoveState[ActualState].angle; ! float time = deltaT * 0.001; ! Point deltap = mMoveState[ActualState].pos - ! mMoveState[RenderState].pos; ! Point requestVel = deltap; ! requestVel *= 1 / time; ! float requestVelLen = deltap.len(); ! bool hit = false; ! if(requestVelLen > InterpMaxVelocity) ! { ! hit = false; ! requestVel.normalize(InterpMaxVelocity); ! } ! ! Point velDelta = requestVel - mMoveState[RenderState].vel; ! F32 accRequested = velDelta.len(); ! F32 maxAccel = InterpAcceleration * time; ! if(accRequested > maxAccel) { hit = false; ! velDelta *= maxAccel / accRequested; ! mMoveState[RenderState].vel += velDelta; ! } ! else ! mMoveState[RenderState].vel = requestVel; ! if(hit) ! { ! interpTime = 0; ! mMoveState[RenderState] = mMoveState[ActualState]; } ! else ! mMoveState[RenderState].pos += mMoveState[RenderState].vel * time; ! } ! else ! mMoveState[RenderState] = mMoveState[ActualState]; ! /* ! ! U32 timeUsed = deltaT; ! if(interpTime) ! { ! if(interpTime < timeUsed) { ! timeUsed -= interpTime; ! interpTime = 0; ! mMoveState[RenderState] = mMoveState[ActualState]; } - else - { - Point totalDelta = mMoveState[ActualState].pos - - mMoveState[RenderState].pos; ! mMoveState[RenderState].pos += ! totalDelta * (timeUsed / F32(interpTime)); ! interpTime -= timeUsed; ! timeUsed = 0; ! } } ! ! if(timeUsed) { ! lastMove.time = timeUsed; ! processMove(&lastMove, ActualState); mMoveState[RenderState] = mMoveState[ActualState]; ! }*/ updateExtent(); --- 181,240 ---- lastMove.time = deltaT; processMove(&lastMove, ActualState); + mMoveState[RenderState].angle = mMoveState[ActualState].angle; if(interpTime) { ! // first step is to constrain the render velocity to ! // the vector of difference between the current position and ! // the actual position. ! // we can also clamp to zero, the actual velocity, or the ! // render velocity, depending on which one is best. ! Point deltaP = mMoveState[ActualState].pos - mMoveState[RenderState].pos; ! F32 distance = deltaP.len(); ! if(!distance) ! goto interpDone; ! deltaP.normalize(); ! F32 vel = deltaP.dot(mMoveState[RenderState].vel); ! F32 avel = deltaP.dot(mMoveState[ActualState].vel); ! if(avel > vel) ! vel = avel; ! if(vel < 0) ! vel = 0; ! ! bool hit = true; ! float time = deltaT * 0.001; ! if(vel * time > distance) ! goto interpDone; ! ! float requestVel = distance / time; ! if(requestVel > InterpMaxVelocity) { hit = false; ! requestVel = InterpMaxVelocity; } ! F32 a = (requestVel - vel) / time; ! if(a > InterpAcceleration) { ! a = InterpAcceleration; ! hit = false; } ! if(hit) ! goto interpDone; ! vel += a * time; ! mMoveState[RenderState].vel = deltaP * vel; ! mMoveState[RenderState].pos += mMoveState[RenderState].vel * time; } ! else { ! interpDone: ! interpTime = 0; mMoveState[RenderState] = mMoveState[ActualState]; ! } updateExtent(); *************** *** 396,400 **** { interpTime = InterpMS; ! mMoveState[RenderState].vel = mMoveState[ActualState].vel; } else --- 380,385 ---- { interpTime = InterpMS; ! // if the actual velocity is in the direction of the actual position ! // then we'll set it into the render velocity } else |
From: Mark F. <mar...@us...> - 2004-04-24 23:52:42
|
Update of /cvsroot/opentnl/tnl/glut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447/glut Added Files: dinput.lib dinput8.lib dxguid.lib Log Message: Added controller support dinput rudimentary win32 Fixed bug in netInterface for debug message requests Messed around with some ship movement parameters Other misc stuff. --- NEW FILE: dinput8.lib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dinput.lib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: dxguid.lib --- (This appears to be a binary file; contents omitted.) |
From: Mark F. <mar...@us...> - 2004-04-24 23:52:42
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447/tnl Modified Files: netConnection.cpp netInterface.cpp tnlNetConnection.h tnlNetInterface.h Log Message: Added controller support dinput rudimentary win32 Fixed bug in netInterface for debug message requests Messed around with some ship movement parameters Other misc stuff. Index: netInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netInterface.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** netInterface.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- netInterface.cpp 24 Apr 2004 23:52:33 -0000 1.2 *************** *** 844,848 **** if(!conn->readConnectAccept(stream, &errorString)) { - conn->handleStartupError(errorString); removePendingConnection(conn); return; --- 844,847 ---- *************** *** 1075,1078 **** --- 1074,1078 ---- out.write(SymmetricCipher::KeySize, theParams.mSymmetricKey); } + out.writeFlag(theParams.mDebugObjectSizes); out.write(conn->getInitialSendSequence()); conn->writeConnectRequest(&out); *************** *** 1168,1171 **** --- 1168,1172 ---- U32 connectSequence; + theParams.mDebugObjectSizes = stream->readFlag(); stream->read(&connectSequence); TNLLogMessageV(LogNetInterface, ("Received Arranged Connect Request")); *************** *** 1204,1207 **** --- 1205,1209 ---- else if(conn->getConnectionState() == NetConnection::Connected) { + conn->setConnectionState(NetConnection::Disconnected); if(conn->isNetworkConnection()) { *************** *** 1260,1262 **** --- 1262,1270 ---- } + void NetInterface::handleConnectionError(NetConnection *theConnection, const char *errorString) + { + theConnection->onConnectionError(errorString); + disconnect(theConnection, errorString); + } + }; Index: tnlNetConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tnlNetConnection.h 21 Apr 2004 01:40:35 -0000 1.2 --- tnlNetConnection.h 24 Apr 2004 23:52:33 -0000 1.3 *************** *** 204,209 **** virtual void onConnectionRejected(const char *reason); ///< Called when the remote host rejects this connection. virtual void onConnectionEstablished(bool isInitiator); ///< Called when the connection is successfully established with the remote host. ! virtual void handleStartupError(const char *errorString); ///< Called when the connection was "accepted" with a bogus connect accept packet. ! /// validates that the given certificate is a valid certificate for this /// connection. --- 204,208 ---- virtual void onConnectionRejected(const char *reason); ///< Called when the remote host rejects this connection. virtual void onConnectionEstablished(bool isInitiator); ///< Called when the connection is successfully established with the remote host. ! virtual void onConnectionError(const char *errorString); ///< Called when a connection receives a bogus packet or invalid data from the remote host /// validates that the given certificate is a valid certificate for this /// connection. *************** *** 257,264 **** public: - /// Called to indicate that this connection has received invalid data - /// and should be terminated with the given reason. - virtual void connectionError(const char *errorString); - /// Returns the next send sequence that will be sent by this side. U32 getNextSendSequence() { return mLastSendSeq + 1; } --- 256,259 ---- Index: netConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netConnection.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** netConnection.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- netConnection.cpp 24 Apr 2004 23:52:32 -0000 1.2 *************** *** 233,238 **** readPacket(bstream); if(mErrorBuffer[0]) ! connectionError(mErrorBuffer); } } --- 233,241 ---- readPacket(bstream); + if(!bstream->isValid() && !mErrorBuffer[0]) + NetConnection::setLastError("Invalid Packet."); if(mErrorBuffer[0]) ! getInterface()->handleConnectionError(this, mErrorBuffer); ! mErrorBuffer[0] = 0; } } *************** *** 593,601 **** } - void NetConnection::connectionError(const char *errorString) - { - errorString; - } - //-------------------------------------------------------------------- --- 596,599 ---- *************** *** 799,803 **** } ! void NetConnection::handleStartupError(const char *errorString) { --- 797,801 ---- } ! void NetConnection::onConnectionError(const char *errorString) { Index: tnlNetInterface.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetInterface.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlNetInterface.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlNetInterface.h 24 Apr 2004 23:52:33 -0000 1.2 *************** *** 304,307 **** --- 304,309 ---- void handleDisconnect(const Address &address, BitStream *stream); + /// Handles an error reported while reading a packet from this remote connection. + void handleConnectionError(NetConnection *theConnection, const char *errorString); /// @} public: |
From: Mark F. <mar...@us...> - 2004-04-24 23:52:41
|
Update of /cvsroot/opentnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447 Modified Files: tnl.sln Log Message: Added controller support dinput rudimentary win32 Fixed bug in netInterface for debug message requests Messed around with some ship movement parameters Other misc stuff. Index: tnl.sln =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tnl.sln 20 Apr 2004 19:45:03 -0000 1.2 --- tnl.sln 24 Apr 2004 23:52:32 -0000 1.3 *************** *** 61,65 **** {5FAF4911-1DA7-44FE-9DA1-49AE25B11250}.Release Xbox.Build.0 = Release|Win32 {2BF337F1-B812-4324-A9BA-E4D580C8CFF1}.Debug.ActiveCfg = Debug|Win32 - {2BF337F1-B812-4324-A9BA-E4D580C8CFF1}.Debug.Build.0 = Debug|Win32 {2BF337F1-B812-4324-A9BA-E4D580C8CFF1}.Debug Win32.ActiveCfg = Debug|Win32 {2BF337F1-B812-4324-A9BA-E4D580C8CFF1}.Debug Xbox.ActiveCfg = Debug|Win32 --- 61,64 ---- *************** *** 72,76 **** {2BF337F1-B812-4324-A9BA-E4D580C8CFF1}.Release Xbox.Build.0 = Release|Win32 {2BC8A06B-B9E6-4C92-9E10-6B5E37CBFF96}.Debug.ActiveCfg = Debug|Win32 - {2BC8A06B-B9E6-4C92-9E10-6B5E37CBFF96}.Debug.Build.0 = Debug|Win32 {2BC8A06B-B9E6-4C92-9E10-6B5E37CBFF96}.Debug Win32.ActiveCfg = Debug|Win32 {2BC8A06B-B9E6-4C92-9E10-6B5E37CBFF96}.Debug Xbox.ActiveCfg = Debug|Win32 --- 71,74 ---- *************** *** 83,87 **** {2BC8A06B-B9E6-4C92-9E10-6B5E37CBFF96}.Release Xbox.Build.0 = Release|Win32 {3F7F7B79-4473-4CAB-A54E-4274A9F1A01A}.Debug.ActiveCfg = Debug|Win32 - {3F7F7B79-4473-4CAB-A54E-4274A9F1A01A}.Debug.Build.0 = Debug|Win32 {3F7F7B79-4473-4CAB-A54E-4274A9F1A01A}.Debug Win32.ActiveCfg = Debug|Win32 {3F7F7B79-4473-4CAB-A54E-4274A9F1A01A}.Debug Win32.Build.0 = Debug|Win32 --- 81,84 ---- *************** *** 95,99 **** {3F7F7B79-4473-4CAB-A54E-4274A9F1A01A}.Release Xbox.Build.0 = Release|Win32 {CE4F0113-8119-491D-BCBE-20F5C3A555FC}.Debug.ActiveCfg = Debug|Win32 - {CE4F0113-8119-491D-BCBE-20F5C3A555FC}.Debug.Build.0 = Debug|Win32 {CE4F0113-8119-491D-BCBE-20F5C3A555FC}.Debug Win32.ActiveCfg = Debug|Win32 {CE4F0113-8119-491D-BCBE-20F5C3A555FC}.Debug Xbox.ActiveCfg = Debug|Win32 --- 92,95 ---- *************** *** 106,110 **** {CE4F0113-8119-491D-BCBE-20F5C3A555FC}.Release Xbox.Build.0 = Release|Win32 {F931A5FA-FF37-4977-8493-786AFD5D71EC}.Debug.ActiveCfg = Debug|Win32 - {F931A5FA-FF37-4977-8493-786AFD5D71EC}.Debug.Build.0 = Debug|Win32 {F931A5FA-FF37-4977-8493-786AFD5D71EC}.Debug Win32.ActiveCfg = Debug|Win32 {F931A5FA-FF37-4977-8493-786AFD5D71EC}.Debug Xbox.ActiveCfg = Debug|Win32 --- 102,105 ---- |
From: Ben G. <s_a...@us...> - 2004-04-23 22:02:59
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19912/tnl Modified Files: clientPuzzle.cpp tnlClientPuzzle.h Log Message: Documented and cleaned up client puzzle header. Changed iterations per client puzzle fragment back to 50k after inadvertant checkin of test value. Index: tnlClientPuzzle.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlClientPuzzle.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlClientPuzzle.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlClientPuzzle.h 23 Apr 2004 22:02:47 -0000 1.2 *************** *** 10,15 **** // (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. // --- 10,15 ---- // (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. // *************** *** 46,52 **** /// NonceTable manages the list of client nonces for which clients /// have constructed valid puzzle solutions for the current server ! /// nonce. There are 2 nonce tables in the ClientPuzzleManager - /// one for the current nonce and one for the previous nonce. ! class NonceTable { private: --- 46,52 ---- /// NonceTable manages the list of client nonces for which clients /// have constructed valid puzzle solutions for the current server ! /// nonce. There are 2 nonce tables in the ClientPuzzleManager - /// one for the current nonce and one for the previous nonce. ! class NonceTable { private: *************** *** 77,84 **** }; - enum { - PuzzleRefreshTime = 30000, ///< Refresh the server puzzle every 30 seconds - }; - U32 mCurrentDifficulty; U32 mLastUpdateTime; --- 77,80 ---- *************** *** 111,117 **** /// Difficulty levels of puzzles enum { ! InitialPuzzleDifficulty = 17, ///< Initial puzzle difficulty is set so clients do approx 2-3x the shared secret generation of the server ! MaxPuzzleDifficulty = 26, ///< Maximum puzzle diffuclty is approx 1 minute to solve on ~2004 hardware. ! MaxSolutionComputeFragment = 30, ///< Number of milliseconds spent computing a solution per call to solvePuzzle. }; --- 107,116 ---- /// Difficulty levels of puzzles enum { ! PuzzleRefreshTime = 30000, ///< Refresh the server puzzle every 30 seconds ! InitialPuzzleDifficulty = 17, ///< Initial puzzle difficulty is set so clients do approx 2-3x the shared secret ! /// generation of the server ! MaxPuzzleDifficulty = 26, ///< Maximum puzzle difficulty is approx 1 minute to solve on ~2004 hardware. ! MaxSolutionComputeFragment = 30, ///< Number of milliseconds spent computing solution per call to solvePuzzle. ! SolutionFragmentIterations = 50000, ///< Number of attempts to spend on the client puzzle per call to solvePuzzle. }; *************** *** 120,124 **** /// Computes a puzzle solution value for the given puzzle difficulty and server nonce. If the execution time of this function ! /// exceeds 30 milliseconds, it will return the current trail solution in the solution variable and a return value of false. static bool solvePuzzle(U32 *solution, Nonce &clientNonce, Nonce &serverNonce, U32 puzzleDifficulty, U32 clientIdentity); --- 119,134 ---- /// Computes a puzzle solution value for the given puzzle difficulty and server nonce. If the execution time of this function ! /// exceeds MaxSolutionComputeFragment milliseconds, it will return the current trail solution in the solution variable and a ! /// return value of false. ! /// ! /// @note Although the behavior of this function can be tweaked using MaxSolutionComputeFragment and ! /// SolutionFragmentIterations, it's important to bias these settings in favor of rapid puzzle ! /// completion. A client puzzle is only valid for two times PuzzleRefreshTime, so for about a ! /// minute, maximum. Most of the time the puzzle can be solved in only a few hundred ! /// milliseconds. It's better to solve the puzzle fast than to let it drag out, (ie, it's better to ! /// let your application hitch for a moment whilst calculating than to make the user endure many ! /// seconds of lag) so reducing the timeout or iterations should be done only if you know what ! /// you're doing. ! /// static bool solvePuzzle(U32 *solution, Nonce &clientNonce, Nonce &serverNonce, U32 puzzleDifficulty, U32 clientIdentity); Index: clientPuzzle.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/clientPuzzle.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** clientPuzzle.cpp 23 Apr 2004 08:10:02 -0000 1.3 --- clientPuzzle.cpp 23 Apr 2004 22:02:38 -0000 1.4 *************** *** 10,15 **** // (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. // --- 10,15 ---- // (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. // *************** *** 158,163 **** for(;;) { ! // We do 50,000 attempts... (this valus is tweakable) ! U32 nextValue = startValue + 50000; for(;startValue < nextValue; startValue++) { --- 158,162 ---- for(;;) { ! U32 nextValue = startValue + SolutionFragmentIterations; for(;startValue < nextValue; startValue++) { |
From: Ben G. <s_a...@us...> - 2004-04-23 08:10:19
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14372/zap Modified Files: CTFGame.cpp UIMenus.cpp UIMenus.h ZAP.vcproj masterConnection.cpp quickChat.cpp ship.cpp Log Message: Variety of small fixes and formats, but crash bug remains. Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** quickChat.cpp 23 Apr 2004 02:14:29 -0000 1.4 --- quickChat.cpp 23 Apr 2004 08:10:03 -0000 1.5 *************** *** 53,60 **** {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!"}, --- 53,60 ---- {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!"}, *************** *** 75,89 **** {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."}, --- 75,89 ---- {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, 'N', 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 you're shooting!"}, {2, 'D', true, "Dont know", "I don't know."}, {2, 'Y', true, "Yes", "Yes."}, *************** *** 104,116 **** {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."}, --- 104,115 ---- {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 ***"}, {1, 'G', true, "Global", ""}, {2, 'Z', false, "Doh", "Doh!"}, {2, 'O', false, "Oops", "Oops!"}, {2, 'F', false, "Shazbot", "Shazbot!"}, ! {2, 'Q', false, "Damnit", "Dammit!"}, {2, 'C', false, "Crap", "Ah Crap!"}, {2, 'E', false, "Duh", "Duh."}, Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UIMenus.h 21 Apr 2004 20:19:07 -0000 1.2 --- UIMenus.h 23 Apr 2004 08:10:03 -0000 1.3 *************** *** 74,78 **** static bool controlsRelative; static bool fullscreen; - static bool showNames; OptionsMenuUserInterface(); --- 74,77 ---- Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ZAP.vcproj 23 Apr 2004 01:49:46 -0000 1.3 --- ZAP.vcproj 23 Apr 2004 08:10:03 -0000 1.4 *************** *** 71,74 **** --- 71,75 ---- <Tool Name="VCCLCompilerTool" + OptimizeForWindowsApplication="TRUE" AdditionalIncludeDirectories="../tnl;../glut;../openal" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UIMenus.cpp 23 Apr 2004 01:49:46 -0000 1.4 --- UIMenus.cpp 23 Apr 2004 08:10:03 -0000 1.5 *************** *** 168,172 **** bool OptionsMenuUserInterface::controlsRelative = false; bool OptionsMenuUserInterface::fullscreen = false; - bool OptionsMenuUserInterface::showNames = false; OptionsMenuUserInterface::OptionsMenuUserInterface() --- 168,171 ---- *************** *** 195,203 **** 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"); --- 194,197 ---- *************** *** 244,250 **** break; case 2: - showNames = !showNames; - break; - case 3: if(gClientGame->getConnectionToServer()) gGameUserInterface.activate(); --- 238,241 ---- Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** masterConnection.cpp 23 Apr 2004 01:49:46 -0000 1.4 --- masterConnection.cpp 23 Apr 2004 08:10:03 -0000 1.5 *************** *** 182,186 **** Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.2"); // Game Name if(bstream->writeFlag(mIsGameServer)) { --- 182,186 ---- Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.3"); // Game Name if(bstream->writeFlag(mIsGameServer)) { Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CTFGame.cpp 23 Apr 2004 07:02:25 -0000 1.11 --- CTFGame.cpp 23 Apr 2004 08:10:02 -0000 1.12 *************** *** 238,241 **** --- 238,245 ---- GameConnection *controlConnection = theShip->getControllingClient(); + + if(!controlConnection) + return 0; + S32 clientIndex = findClientIndexByConnection(controlConnection); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ship.cpp 23 Apr 2004 01:49:46 -0000 1.9 --- ship.cpp 23 Apr 2004 08:10:03 -0000 1.10 *************** *** 578,582 **** // Render name... ! if(gClientGame->getConnectionToServer()->getControlObject() != this) //OptionsMenuUserInterface::showNames) { static char buff[255]; --- 578,582 ---- // Render name... ! if(gClientGame->getConnectionToServer()->getControlObject() != this) { static char buff[255]; |
From: Ben G. <s_a...@us...> - 2004-04-23 08:10:16
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14372/tnl Modified Files: clientPuzzle.cpp Log Message: Variety of small fixes and formats, but crash bug remains. Index: clientPuzzle.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/clientPuzzle.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clientPuzzle.cpp 21 Apr 2004 02:23:08 -0000 1.2 --- clientPuzzle.cpp 23 Apr 2004 08:10:02 -0000 1.3 *************** *** 158,163 **** for(;;) { ! // We do 5,000 attempts... (this valus is tweakable ! U32 nextValue = startValue + 5000; for(;startValue < nextValue; startValue++) { --- 158,163 ---- for(;;) { ! // We do 50,000 attempts... (this valus is tweakable) ! U32 nextValue = startValue + 50000; for(;startValue < nextValue; startValue++) { |
From: Ben G. <s_a...@us...> - 2004-04-23 07:02:35
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2846/zap Modified Files: CTFGame.cpp gameType.cpp Log Message: Fixed various crash situations. Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gameType.cpp 23 Apr 2004 02:14:29 -0000 1.10 --- gameType.cpp 23 Apr 2004 07:02:26 -0000 1.11 *************** *** 51,55 **** { for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i].ping = (U32) mClientList[i].clientConnection->getRoundTripTime(); for(S32 i = 0; i < mClientList.size(); i++) --- 51,56 ---- { for(S32 i = 0; i < mClientList.size(); i++) ! if(mClientList[i].clientConnection) ! mClientList[i].ping = (U32) mClientList[i].clientConnection->getRoundTripTime(); for(S32 i = 0; i < mClientList.size(); i++) Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CTFGame.cpp 23 Apr 2004 02:14:29 -0000 1.10 --- CTFGame.cpp 23 Apr 2004 07:02:25 -0000 1.11 *************** *** 265,270 **** bool CTFGameType::objectCanDamageObject(GameObject *damager, GameObject *victim) { ! GameConnection *c1 = damager->getControllingClient(); ! GameConnection *c2 = victim->getControllingClient(); if(!c1 || !c2) --- 265,270 ---- bool CTFGameType::objectCanDamageObject(GameObject *damager, GameObject *victim) { ! GameConnection *c1 = (damager ? damager->getControllingClient() : NULL); ! GameConnection *c2 = (victim ? victim->getControllingClient() : NULL); if(!c1 || !c2) |
From: Mark F. <mar...@us...> - 2004-04-23 02:14:39
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26796/zap Modified Files: CTFGame.cpp gameType.cpp quickChat.cpp Log Message: added files to mac project file Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** quickChat.cpp 23 Apr 2004 02:10:41 -0000 1.3 --- quickChat.cpp 23 Apr 2004 02:14:29 -0000 1.4 *************** *** 28,32 **** #include "glutInclude.h" #include "gameType.h" ! namespace Zap { --- 28,32 ---- #include "glutInclude.h" #include "gameType.h" ! #include <ctype.h> namespace Zap { Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gameType.cpp 23 Apr 2004 01:49:46 -0000 1.9 --- gameType.cpp 23 Apr 2004 02:14:29 -0000 1.10 *************** *** 244,247 **** --- 244,248 ---- { S32 clientIndex = findClientIndexByName(name); + gGameUserInterface.displayMessage(Color(0.6f, 0.6f, 0.8f), "%s left the game.", name.getString()); mClientList.erase(clientIndex); } Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CTFGame.cpp 23 Apr 2004 01:49:46 -0000 1.9 --- CTFGame.cpp 23 Apr 2004 02:14:29 -0000 1.10 *************** *** 202,206 **** s2cCTFMessage(CTFMsgReturnFlag, cl.name, theFlag->getTeamIndex()); theFlag->sendHome(); ! cl.score += Scores::ReturnScore; } else --- 202,206 ---- s2cCTFMessage(CTFMsgReturnFlag, cl.name, theFlag->getTeamIndex()); theFlag->sendHome(); ! cl.score += ReturnScore; } else *************** *** 219,223 **** mountedFlag->dismount(); mountedFlag->sendHome(); ! cl.score += Scores::CapScore; } } --- 219,223 ---- mountedFlag->dismount(); mountedFlag->sendHome(); ! cl.score += CapScore; } } *************** *** 285,291 **** // 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); --- 285,291 ---- // Punish team killers slightly if(mClientList[killerIndex].teamId == mClientList[clientIndex].teamId) ! mClientList[killerIndex].score -= KillScore/4; else ! mClientList[killerIndex].score += KillScore; s2cKillMessage(mClientList[clientIndex].name, mClientList[killerIndex].name); |
From: Mark F. <mar...@us...> - 2004-04-23 02:14:39
|
Update of /cvsroot/opentnl/tnl/osx/tnl.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26796/osx/tnl.xcode Modified Files: project.pbxproj Log Message: added files to mac project file Index: project.pbxproj =================================================================== RCS file: /cvsroot/opentnl/tnl/osx/tnl.xcode/project.pbxproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** project.pbxproj 21 Apr 2004 02:17:14 -0000 1.3 --- project.pbxproj 23 Apr 2004 02:14:29 -0000 1.4 *************** *** 1751,1754 **** --- 1751,1755 ---- 6656DDDB0635C95C00E30126, 6656DDDD0635C95C00E30126, + DB997D2C0638AFC1002745B0, ); isa = PBXHeadersBuildPhase; *************** *** 1783,1786 **** --- 1784,1789 ---- 6656DDDA0635C95C00E30126, 6656DDDC0635C95C00E30126, + DB997D2A0638AFC1002745B0, + DB997D2B0638AFC1002745B0, ); isa = PBXSourcesBuildPhase; *************** *** 1800,1803 **** --- 1803,1807 ---- HEADER_SEARCH_PATHS = "../glut ../openal"; INSTALL_PATH = /usr/local/bin; + MACOSX_DEPLOYMENT_TARGET = 10.2; OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-lobjc"; *************** *** 2215,2218 **** --- 2219,2225 ---- 6692C0E606247C3B00D5ADFE = { children = ( + DB997D270638AFC1002745B0, + DB997D280638AFC1002745B0, + DB997D290638AFC1002745B0, 6656DDCA0635C95C00E30126, 6656DDCB0635C95C00E30126, *************** *** 4015,4018 **** --- 4022,4070 ---- }; }; + DB997D270638AFC1002745B0 = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = gameItems.cpp; + path = ../zap/gameItems.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + DB997D280638AFC1002745B0 = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = quickChat.cpp; + path = ../zap/quickChat.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + DB997D290638AFC1002745B0 = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = quickChat.h; + path = ../zap/quickChat.h; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + DB997D2A0638AFC1002745B0 = { + fileRef = DB997D270638AFC1002745B0; + isa = PBXBuildFile; + settings = { + }; + }; + DB997D2B0638AFC1002745B0 = { + fileRef = DB997D280638AFC1002745B0; + isa = PBXBuildFile; + settings = { + }; + }; + DB997D2C0638AFC1002745B0 = { + fileRef = DB997D290638AFC1002745B0; + isa = PBXBuildFile; + settings = { + }; + }; }; rootObject = 29B97313FDCFA39411CA2CEA; |
From: Ben G. <s_a...@us...> - 2004-04-23 02:10:49
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26170/zap Modified Files: quickChat.cpp Log Message: Fixed commands - dup use of key. Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** quickChat.cpp 22 Apr 2004 07:46:20 -0000 1.2 --- quickChat.cpp 23 Apr 2004 02:10:41 -0000 1.3 *************** *** 41,45 **** {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."}, --- 41,45 ---- {2, 'C', true, "Cease fire", "Cease fire!"}, {2, 'M', true, "Move out", "Move out."}, ! {2, 'N', true, "Retreat", "Retreat!"}, {2, 'H', true, "Hit deck", "Hit the deck!"}, {2, 'E', true, "Regroup", "Regroup."}, |
From: Mark F. <mar...@us...> - 2004-04-23 01:50:56
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21919/zap Added Files: gameItems.cpp Log Message: Added game items file --- NEW FILE: gameItems.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 "item.h" #include "ship.h" #include "glutInclude.h" namespace Zap { class RepairItem : public PickupItem { public: RepairItem(Point p = Point()) : PickupItem(p, 20) { mNetFlags.set(Ghostable); } bool pickup(Ship *theShip) { if(theShip->getHealth() >= 1) return false; DamageInfo di; di.damageAmount = -0.21; di.damageType = 0; di.damagingObject = this; theShip->damageObject(&di); return true; } U32 getRepopDelay() { return 20000; } static void emitVerts(F32 x, F32 y) { static int verts[6][2] = { { 1, 0 }, { 2, 1 }, { 3, 1 }, { 4, 2 }, { 4, 3 }, { 3, 2 } }; glBegin(GL_LINE_STRIP); for(S32 i = 0; i < 6; i++) glVertex2f(x * verts[i][0], y * verts[i][1]); for(S32 i = 5; i >= 0; i--) glVertex2f(x * verts[i][1], y * verts[i][0]); glEnd(); } void renderItem(Point pos) { glPushMatrix(); glTranslatef(pos.x, pos.y, 0); glColor3f(1, 1, 0); emitVerts(-5, 5); emitVerts(5, 5); emitVerts(5, -5); emitVerts(-5, -5); glBegin(GL_LINES); glVertex2f(-5, 0); glVertex2f(0, -5); glVertex2f(5, 0); glVertex2f(0, 5); glEnd(); glPopMatrix(); } TNL_DECLARE_CLASS(RepairItem); }; TNL_IMPLEMENT_NETOBJECT(RepairItem); class TestItem : public Item { U32 teamIndex; public: TestItem() : Item(Point(0,0), true, 60, 4) { mNetFlags.set(Ghostable); } void renderItem(Point pos) { glPushMatrix(); glTranslatef(pos.x, pos.y, 0); glColor3f(1, 1, 0); glBegin(GL_LINE_LOOP); glVertex2f(-60, 0); glVertex2f(-40, 40); glVertex2f(0, 60); glVertex2f(40, 40); glVertex2f(60, 0); glVertex2f(40, -40); glVertex2f(0, -60); glVertex2f(-40, -40); glEnd(); glPopMatrix(); } void damageObject(DamageInfo *theInfo) { // compute impulse direction Point dv = theInfo->impulseVector - mMoveState[ActualState].vel; Point iv = mMoveState[ActualState].pos - theInfo->collisionPoint; iv.normalize(); mMoveState[ActualState].vel += iv * dv.dot(iv) * 0.3; } TNL_DECLARE_CLASS(TestItem); }; TNL_IMPLEMENT_NETOBJECT(TestItem); }; |
From: Mark F. <mar...@us...> - 2004-04-23 01:49:56
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21514/zap Modified Files: CTFGame.cpp CTFGame.h UIMenus.cpp ZAP.vcproj barrier.cpp gameConnection.cpp gameConnection.h gameObject.cpp gameObject.h gameType.cpp gameType.h item.cpp item.h main.cpp masterConnection.cpp projectile.cpp projectile.h ship.cpp ship.h Log Message: Added health packs Removed some unecessary state transmissions Added better priority function Made barriers scope always Increased the default size of the connection string table to 1k strings Added pickup items Added repair item CTFGame no longer allows team damge Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** main.cpp 21 Apr 2004 23:47:34 -0000 1.7 --- main.cpp 23 Apr 2004 01:49:46 -0000 1.8 *************** *** 50,54 **** const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! const char *gMasterAddressString = "IP:master.opentnl.org:29002"; Address gMasterAddress; const char *gLoadLevel = "level1.txt"; --- 50,54 ---- const char *gHostName = "ZAP Game"; U32 gMaxPlayers = 128; ! const char *gMasterAddressString = "IP:master.opentnl.org:29005"; Address gMasterAddress; const char *gLoadLevel = "level1.txt"; Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gameType.cpp 22 Apr 2004 02:50:53 -0000 1.8 --- gameType.cpp 23 Apr 2004 01:49:46 -0000 1.9 *************** *** 108,115 **** } ! S32 GameType::findClientIndexById(U32 clientId) { for(S32 clientIndex = 0; clientIndex < mClientList.size(); clientIndex++) ! if(mClientList[clientIndex].clientId == clientId) return clientIndex; return -1; --- 108,115 ---- } ! S32 GameType::findClientIndexByName(const StringTableEntry &name) { for(S32 clientIndex = 0; clientIndex < mClientList.size(); clientIndex++) ! if(mClientList[clientIndex].name == name) return clientIndex; return -1; *************** *** 125,129 **** spawnPoint = mTeams[teamIndex].spawnPoints[spawnIndex]; ! Ship *newShip = new Ship(mClientList[clientIndex].name, spawnPoint, mTeams[teamIndex].color); newShip->addToGame(getGame()); theClient->setControlObject(newShip); --- 125,129 ---- spawnPoint = mTeams[teamIndex].spawnPoints[spawnIndex]; ! Ship *newShip = new Ship(mClientList[clientIndex].name, spawnPoint); newShip->addToGame(getGame()); theClient->setControlObject(newShip); *************** *** 142,146 **** { ClientRef cref; - cref.clientId = theClient->mClientId; cref.name = theClient->playerName; --- 142,145 ---- *************** *** 165,170 **** mClientList.push_back(cref); ! s2cAddClient(cref.clientId, cref.name, false); ! s2cClientJoinedTeam(cref.clientId, cref.teamId); spawnShip(theClient); } --- 164,169 ---- mClientList.push_back(cref); ! s2cAddClient(cref.name, false); ! s2cClientJoinedTeam(cref.name, cref.teamId); spawnShip(theClient); } *************** *** 209,221 **** 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) { ClientRef cref; - cref.clientId = id; cref.name = name; cref.teamId = 0; --- 208,219 ---- U32 newTeamId = (mClientList[clientIndex].teamId + 1) % mTeams.size(); mClientList[clientIndex].teamId = newTeamId; ! s2cClientJoinedTeam(mClientList[clientIndex].name, newTeamId); spawnShip(source); } ! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cAddClient, (StringTableEntry name, bool isMyClient), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ClientRef cref; cref.name = name; cref.teamId = 0; *************** *** 225,229 **** if(isMyClient) ! mThisClientId = id; gGameUserInterface.displayMessage(Color(0.6f, 0.6f, 0.8f), "%s joined the game.", name.getString()); } --- 223,227 ---- if(isMyClient) ! mThisClientName = name; gGameUserInterface.displayMessage(Color(0.6f, 0.6f, 0.8f), "%s joined the game.", name.getString()); } *************** *** 239,249 **** getGame()->deleteObject(theControlObject, 0); ! s2cRemoveClient(theClient->mClientId); } ! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cRemoveClient, (U32 id), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexById(id); mClientList.erase(clientIndex); } --- 237,247 ---- getGame()->deleteObject(theControlObject, 0); ! s2cRemoveClient(theClient->playerName); } ! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cRemoveClient, (StringTableEntry name), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexByName(name); mClientList.erase(clientIndex); } *************** *** 266,273 **** } ! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cClientJoinedTeam, (U32 clientId, U32 teamIndex), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexById(clientId); mClientList[clientIndex].teamId = teamIndex; gGameUserInterface.displayMessage(Color(0.6f, 0.6f, 0.8f), "%s joined team %s.", mClientList[clientIndex].name.getString(), mTeams[teamIndex].name.getString()); --- 264,271 ---- } ! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, s2cClientJoinedTeam, (StringTableEntry name, U32 teamIndex), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexByName(name); mClientList[clientIndex].teamId = teamIndex; gGameUserInterface.displayMessage(Color(0.6f, 0.6f, 0.8f), "%s joined team %s.", mClientList[clientIndex].name.getString(), mTeams[teamIndex].name.getString()); *************** *** 287,292 **** for(S32 i = 0; i < mClientList.size(); i++) { ! s2cAddClient(mClientList[i].clientId, mClientList[i].name, mClientList[i].clientConnection == theConnection); ! s2cClientJoinedTeam(mClientList[i].clientId, mClientList[i].teamId); } NetObject::setRPCDestConnection(NULL); --- 285,290 ---- for(S32 i = 0; i < mClientList.size(); i++) { ! s2cAddClient(mClientList[i].name, mClientList[i].clientConnection == theConnection); ! s2cClientJoinedTeam(mClientList[i].name, mClientList[i].teamId); } NetObject::setRPCDestConnection(NULL); Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** projectile.cpp 22 Apr 2004 00:35:44 -0000 1.6 --- projectile.cpp 23 Apr 2004 01:49:46 -0000 1.7 *************** *** 99,103 **** DamageInfo theInfo; theInfo.collisionPoint = collisionPoint; ! theInfo.damageAmount = 1; theInfo.damageType = 0; theInfo.damagingObject = mShooter; --- 99,103 ---- DamageInfo theInfo; theInfo.collisionPoint = collisionPoint; ! theInfo.damageAmount = 0.21; theInfo.damageType = 0; theInfo.damagingObject = mShooter; Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gameConnection.cpp 22 Apr 2004 20:42:25 -0000 1.6 --- gameConnection.cpp 23 Apr 2004 01:49:46 -0000 1.7 *************** *** 230,235 **** } - U32 GameConnection::currentClientId = 0; - void GameConnection::onConnectionEstablished(bool isInitiator) { --- 230,233 ---- *************** *** 245,250 **** else { - mClientId = ++currentClientId; - linkToClientList(); gServerGame->addClient(this); --- 243,246 ---- Index: gameObject.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameObject.cpp 20 Apr 2004 04:27:20 -0000 1.1 --- gameObject.cpp 23 Apr 2004 01:49:46 -0000 1.2 *************** *** 81,87 **** nearest.y = center.y; F32 distance = (nearest - center).len(); ! return (200 / distance) + updateSkips; } --- 81,103 ---- nearest.y = center.y; + Point deltap = nearest - center; + F32 distance = (nearest - center).len(); ! Point deltav = getActualVel() - so->getActualVel(); ! ! F32 add = 0; ! ! // initial scoping factor is distance based. ! F32 distFactor = (500 - distance) / 500; ! ! // give some extra love to things that are moving towards the scope object ! if(deltav.dot(deltap) < 0) ! add = 0.7; ! ! // and a little more love if this object has not yet been scoped. ! if(updateMask == 0xFFFFFFFF) ! add += 0.5; ! return distFactor + add + updateSkips * 0.5f; } *************** *** 122,125 **** --- 138,151 ---- } + void GameObject::addToDatabase() + { + mGame->getGridDatabase()->addToExtents(this, extent); + } + + void GameObject::removeFromDatabase() + { + mGame->getGridDatabase()->removeFromExtents(this, extent); + } + void GameObject::addToGame(Game *theGame) { *************** *** 127,131 **** theGame->addToGameObjectList(this); mGame = theGame; ! mGame->getGridDatabase()->addToExtents(this, extent); onAddedToGame(theGame); } --- 153,157 ---- theGame->addToGameObjectList(this); mGame = theGame; ! addToDatabase(); onAddedToGame(theGame); } *************** *** 139,143 **** if(mGame) { ! mGame->getGridDatabase()->removeFromExtents(this, extent); mGame->removeFromGameObjectList(this); mGame = NULL; --- 165,169 ---- if(mGame) { ! removeFromDatabase(); mGame->removeFromGameObjectList(this); mGame = NULL; Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ZAP.vcproj 22 Apr 2004 07:27:43 -0000 1.2 --- ZAP.vcproj 23 Apr 2004 01:49:46 -0000 1.3 *************** *** 141,144 **** --- 141,147 ---- </File> <File + RelativePath=".\gameItems.cpp"> + </File> + <File RelativePath=".\gameLoader.cpp"> </File> Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** masterConnection.cpp 22 Apr 2004 02:57:51 -0000 1.3 --- masterConnection.cpp 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 182,186 **** Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.1"); // Game Name if(bstream->writeFlag(mIsGameServer)) { --- 182,186 ---- Parent::writeConnectRequest(bstream); ! bstream->writeString("ZAP1.2"); // Game Name if(bstream->writeFlag(mIsGameServer)) { Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CTFGame.h 22 Apr 2004 02:57:51 -0000 1.4 --- CTFGame.h 23 Apr 2004 01:49:46 -0000 1.5 *************** *** 53,56 **** --- 53,58 ---- void controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject); void controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject); + bool objectCanDamageObject(GameObject *damager, GameObject *victim); + U32 checkFlagDrop(GameObject *theObject); *************** *** 69,73 **** }; ! 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)); --- 71,75 ---- }; ! TNL_DECLARE_RPC(s2cCTFMessage, (U32 messageIndex, StringTableEntry clientName, 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)); Index: projectile.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** projectile.h 20 Apr 2004 21:53:37 -0000 1.2 --- projectile.h 23 Apr 2004 01:49:46 -0000 1.3 *************** *** 55,58 **** --- 55,61 ---- void processClient(U32 deltaT); + virtual Point getRenderVel() { return velocity; } + virtual Point getActualVel() { return velocity; } + void render(); Index: gameConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameConnection.h 22 Apr 2004 20:42:25 -0000 1.3 --- gameConnection.h 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 159,164 **** StringTableEntry playerName; - static U32 currentClientId; - U32 mClientId; U32 mLastClientControlCRC; --- 159,162 ---- Index: gameObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameObject.h 20 Apr 2004 04:27:20 -0000 1.1 --- gameObject.h 23 Apr 2004 01:49:46 -0000 1.2 *************** *** 111,114 **** --- 111,117 ---- virtual Point getRenderPos(); virtual Point getActualPos(); + virtual Point getRenderVel() { return Point(); } + virtual Point getActualVel() { return Point(); } + virtual void setActualPos(Point p); *************** *** 120,123 **** --- 123,128 ---- void disableCollision() { mDisableCollisionCount++; } void enableCollision() { mDisableCollisionCount--; } + void addToDatabase(); + void removeFromDatabase(); bool isCollisionEnabled() { return mDisableCollisionCount == 0; } Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ship.h 22 Apr 2004 00:35:49 -0000 1.3 --- ship.h 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 76,80 **** void render(); ! Ship(StringTableEntry playerName="", Point p = Point(0,0), Color c = Color(), F32 m = 1.0); void emitMovementSparks(); --- 76,82 ---- void render(); ! Ship(StringTableEntry playerName="", Point p = Point(0,0), F32 m = 1.0); ! ! F32 getHealth() { return mHealth; } void emitMovementSparks(); Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UIMenus.cpp 22 Apr 2004 07:46:20 -0000 1.3 --- UIMenus.cpp 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 46,49 **** --- 46,53 ---- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glColor3f(1,1,1); drawCenteredString( 10, 30, menuTitle); Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CTFGame.cpp 22 Apr 2004 20:42:25 -0000 1.8 --- CTFGame.cpp 23 Apr 2004 01:49:46 -0000 1.9 *************** *** 200,204 **** if(!theFlag->isAtHome()) { ! s2cCTFMessage(CTFMsgReturnFlag, cl.clientId, theFlag->getTeamIndex()); theFlag->sendHome(); cl.score += Scores::ReturnScore; --- 200,204 ---- if(!theFlag->isAtHome()) { ! s2cCTFMessage(CTFMsgReturnFlag, cl.name, theFlag->getTeamIndex()); theFlag->sendHome(); cl.score += Scores::ReturnScore; *************** *** 215,219 **** mTeams[cl.teamId].score++; s2cSetTeamScore(cl.teamId, mTeams[cl.teamId].score); ! s2cCTFMessage(CTFMsgCaptureFlag, cl.clientId, mountedFlag->getTeamIndex()); // score the flag for the client's team... mountedFlag->dismount(); --- 215,219 ---- mTeams[cl.teamId].score++; s2cSetTeamScore(cl.teamId, mTeams[cl.teamId].score); ! s2cCTFMessage(CTFMsgCaptureFlag, cl.name, mountedFlag->getTeamIndex()); // score the flag for the client's team... mountedFlag->dismount(); *************** *** 226,230 **** else { ! s2cCTFMessage(CTFMsgTakeFlag, cl.clientId, theFlag->getTeamIndex()); theFlag->mountToShip(theShip); } --- 226,230 ---- else { ! s2cCTFMessage(CTFMsgTakeFlag, cl.name, theFlag->getTeamIndex()); theFlag->mountToShip(theShip); } *************** *** 253,257 **** if(mountedFlag) { ! s2cCTFMessage(CTFMsgDropFlag, cl.clientId, mountedFlag->getTeamIndex()); mountedFlag->dismount(); flagCount++; --- 253,257 ---- if(mountedFlag) { ! s2cCTFMessage(CTFMsgDropFlag, cl.name, mountedFlag->getTeamIndex()); mountedFlag->dismount(); flagCount++; *************** *** 263,266 **** --- 263,278 ---- } + bool CTFGameType::objectCanDamageObject(GameObject *damager, GameObject *victim) + { + GameConnection *c1 = damager->getControllingClient(); + GameConnection *c2 = victim->getControllingClient(); + + if(!c1 || !c2) + return true; + + return mClientList[findClientIndexByConnection(c1)].teamId != + mClientList[findClientIndexByConnection(c2)].teamId; + } + void CTFGameType::controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject) { *************** *** 304,311 **** }; ! TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cCTFMessage, (U32 messageIndex, U32 clientId, U32 teamIndex), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexById(clientId); gGameUserInterface.displayMessage(Color(0.6f, 1.0f, 0.8f), --- 316,323 ---- }; ! TNL_IMPLEMENT_NETOBJECT_RPC(CTFGameType, s2cCTFMessage, (U32 messageIndex, StringTableEntry clientName, U32 teamIndex), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! S32 clientIndex = findClientIndexByName(clientName); gGameUserInterface.displayMessage(Color(0.6f, 1.0f, 0.8f), Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameType.h 22 Apr 2004 00:35:44 -0000 1.3 --- gameType.h 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 38,43 **** struct ClientRef { ! U32 clientId; ! StringTableEntry name; S32 teamId; U32 score; --- 38,42 ---- struct ClientRef { ! StringTableEntry name; /// Name of client - guaranteed to be unique of current clients S32 teamId; U32 score; *************** *** 59,63 **** }; Vector<Team> mTeams; ! U32 mThisClientId; ///< Set to the client ID of this client (only on the ghost of the GameType) U32 mTimeUntilScoreboardUpdate; --- 58,62 ---- }; Vector<Team> mTeams; ! U32 mThisClientName; ///< Set to the client name of this client (only on the ghost of the GameType) U32 mTimeUntilScoreboardUpdate; *************** *** 65,69 **** void countTeamPlayers(); ! S32 findClientIndexById(U32 clientId); S32 findClientIndexByConnection(GameConnection *theConnection); --- 64,76 ---- void countTeamPlayers(); ! Color getClientColor(const StringTableEntry &clientName) ! { ! S32 index = findClientIndexByName(clientName); ! if(index != -1) ! return mTeams[mClientList[index].teamId].color; ! return Color(); ! } ! ! S32 findClientIndexByName(const StringTableEntry &name); S32 findClientIndexByConnection(GameConnection *theConnection); *************** *** 77,80 **** --- 84,88 ---- virtual void serverRemoveClient(GameConnection *theClient); + virtual bool objectCanDamageObject(GameObject *damager, GameObject *victim) { return true; } virtual void controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject); virtual void controlObjectForClientRemoved(GameConnection *theClient, GameObject *clientObject); *************** *** 90,98 **** TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntry teamName, F32 r, F32 g, F32 b)); TNL_DECLARE_RPC(s2cSetTeamScore, (U32 teamIndex, U32 score)); ! TNL_DECLARE_RPC(s2cAddClient, (U32 clientId, StringTableEntry clientName, bool isMyClient)); ! TNL_DECLARE_RPC(s2cRemoveClient, (U32 clientId)); TNL_DECLARE_RPC(c2sChangeTeams, ()); ! TNL_DECLARE_RPC(s2cClientJoinedTeam, (U32 clientId, U32 teamIndex)); TNL_DECLARE_RPC(c2sSendChat, (bool global, const char *message)); --- 98,106 ---- TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntry teamName, F32 r, F32 g, F32 b)); TNL_DECLARE_RPC(s2cSetTeamScore, (U32 teamIndex, U32 score)); ! TNL_DECLARE_RPC(s2cAddClient, (StringTableEntry clientName, bool isMyClient)); ! TNL_DECLARE_RPC(s2cRemoveClient, (StringTableEntry clientName)); TNL_DECLARE_RPC(c2sChangeTeams, ()); ! TNL_DECLARE_RPC(s2cClientJoinedTeam, (StringTableEntry clientName, U32 teamIndex)); TNL_DECLARE_RPC(c2sSendChat, (bool global, const char *message)); Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** item.cpp 20 Apr 2004 19:45:04 -0000 1.4 --- item.cpp 23 Apr 2004 01:49:46 -0000 1.5 *************** *** 50,53 **** --- 50,54 ---- for(U32 i = 0; i < MoveStateCount; i++) mMoveState[i].pos = pos; + updateExtent(); } *************** *** 169,173 **** stream->write(mMoveState[RenderState].pos.x); stream->write(mMoveState[RenderState].pos.y); - stream->write(mMoveState[RenderState].angle); stream->write(mMoveState[RenderState].vel.x); stream->write(mMoveState[RenderState].vel.y); --- 170,173 ---- *************** *** 198,202 **** stream->read(&mMoveState[ActualState].pos.x); stream->read(&mMoveState[ActualState].pos.y); - stream->read(&mMoveState[ActualState].angle); stream->read(&mMoveState[ActualState].vel.x); stream->read(&mMoveState[ActualState].vel.y); --- 198,201 ---- *************** *** 240,278 **** } ! TNL_IMPLEMENT_NETOBJECT(TestItem); ! ! TestItem::TestItem() : Item(Point(0,0), true, 60, 4) { ! mNetFlags.set(Ghostable); } ! void TestItem::renderItem(Point pos) { ! glPushMatrix(); ! glTranslatef(pos.x, pos.y, 0); ! ! glColor3f(1, 1, 0); ! glBegin(GL_LINE_LOOP); ! ! glVertex2f(-60, 0); ! glVertex2f(-40, 40); ! glVertex2f(0, 60); ! glVertex2f(40, 40); ! glVertex2f(60, 0); ! glVertex2f(40, -40); ! glVertex2f(0, -60); ! glVertex2f(-40, -40); ! ! glEnd(); ! glPopMatrix(); } ! void TestItem::damageObject(DamageInfo *theInfo) { ! // compute impulse direction ! Point dv = theInfo->impulseVector - mMoveState[ActualState].vel; ! Point iv = mMoveState[ActualState].pos - theInfo->collisionPoint; ! iv.normalize(); ! mMoveState[ActualState].vel += iv * dv.dot(iv) * 0.3; } --- 239,275 ---- } ! PickupItem::PickupItem(Point p, float radius) ! : Item(p, false, radius, 1) { ! mIsVisible = true; ! mRepopDelay = 0; } ! void PickupItem::processServer(U32 deltaT) { ! if(!mIsVisible) ! { ! if(deltaT > mRepopDelay) ! { ! mIsVisible = true; ! addToDatabase(); ! } ! else ! mRepopDelay -= deltaT; ! } } ! bool PickupItem::collide(GameObject *otherObject) { ! if(!isGhost() && otherObject->getObjectTypeMask() & ShipType) ! { ! if(pickup((Ship *) otherObject)) ! { ! mRepopDelay = getRepopDelay(); ! mIsVisible = false; ! removeFromDatabase(); ! } ! } ! return false; } Index: barrier.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** barrier.cpp 21 Apr 2004 01:57:06 -0000 1.3 --- barrier.cpp 23 Apr 2004 01:49:46 -0000 1.4 *************** *** 111,115 **** { mObjectTypeMask = BarrierType; ! mNetFlags.set(Ghostable); start = st; end = e; --- 111,115 ---- { mObjectTypeMask = BarrierType; ! mNetFlags.set(Ghostable | ScopeAlways); start = st; end = e; Index: item.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** item.h 20 Apr 2004 04:27:20 -0000 1.1 --- item.h 23 Apr 2004 01:49:46 -0000 1.2 *************** *** 69,84 **** class PickupItem : public Item { ! ! }; ! ! class TestItem : public Item ! { ! U32 teamIndex; public: ! TestItem(); ! void renderItem(Point pos); ! void damageObject(DamageInfo *theInfo); ! ! TNL_DECLARE_CLASS(TestItem); }; --- 69,81 ---- class PickupItem : public Item { ! typedef Item Parent; ! bool mIsVisible; ! U32 mRepopDelay; public: ! PickupItem(Point p = Point(), float radius = 1); ! void processServer(U32 deltaT); ! bool collide(GameObject *otherObject); ! virtual bool pickup(Ship *theShip) = 0; ! virtual U32 getRepopDelay() = 0; }; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ship.cpp 22 Apr 2004 20:42:25 -0000 1.8 --- ship.cpp 23 Apr 2004 01:49:46 -0000 1.9 *************** *** 45,49 **** TNL_IMPLEMENT_NETOBJECT(Ship); ! Ship::Ship(StringTableEntry playerName, Point p, Color c, F32 m) : MoveObject(p, CollisionRadius) { mObjectTypeMask = ShipType | MoveableType; --- 45,49 ---- TNL_IMPLEMENT_NETOBJECT(Ship); ! Ship::Ship(StringTableEntry playerName, Point p, F32 m) : MoveObject(p, CollisionRadius) { mObjectTypeMask = ShipType | MoveableType; *************** *** 57,61 **** } mHealth = 1.0; - color = c; interpTime = 0; mass = m; --- 57,60 ---- *************** *** 150,154 **** void Ship::damageObject(DamageInfo *theInfo) { ! mHealth -= 0.21; setMaskBits(HealthMask); if(mHealth <= 0) --- 149,156 ---- void Ship::damageObject(DamageInfo *theInfo) { ! if(!getGame()->getGameType()->objectCanDamageObject(theInfo->damagingObject, this)) ! return; ! ! mHealth -= theInfo->damageAmount; setMaskBits(HealthMask); if(mHealth <= 0) *************** *** 157,160 **** --- 159,164 ---- kill(theInfo); } + else if(mHealth > 1) + mHealth = 1; } *************** *** 292,298 **** { connection->packStringTableEntry(stream, mPlayerName); - stream->writeFloat(color.r, 8); - stream->writeFloat(color.g, 8); - stream->writeFloat(color.b, 8); stream->write(mass); --- 296,299 ---- *************** *** 352,358 **** { mPlayerName = connection->unpackStringTableEntry(stream); ! color.r = stream->readFloat(8); ! color.g = stream->readFloat(8); ! color.b = stream->readFloat(8); stream->read(&mass); --- 353,360 ---- { mPlayerName = connection->unpackStringTableEntry(stream); ! GameType *g = gClientGame->getGameType(); ! if(g) ! color = g->getClientColor(mPlayerName); ! stream->read(&mass); |
From: Mark F. <mar...@us...> - 2004-04-23 01:49:54
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21514/exe Modified Files: level1.txt Log Message: Added health packs Removed some unecessary state transmissions Added better priority function Made barriers scope always Increased the default size of the connection string table to 1k strings Added pickup items Added repair item CTFGame no longer allows team damge Index: level1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/level1.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** level1.txt 20 Apr 2004 04:27:12 -0000 1.1 --- level1.txt 23 Apr 2004 01:49:46 -0000 1.2 *************** *** 31,34 **** --- 31,38 ---- Spawn 1 1.5 14.5 + RepairItem 4.5 0.88 + RepairItem 4.5 2.12 + RepairItem 11.5 15.12 + RepairItem 11.5 13.88 BarrierMaker 1 0 2 0 3 1 4 1 4.2 0.5 4.8 0.5 5 1 6 1 7 0 9 0 10 1 10 2 11 2 11.2 1.5 11.8 1.5 12 2 13 2 14 1 14 0 16 0 16 2 15 3 16 4 16 11 15 12 15 13 16 14 16 15 15 16 14 16 13 15 12 15 11.8 15.5 11.2 15.5 11 15 10 15 9 16 7 16 6 15 6 14 5 14 4.8 14.5 4.2 14.5 4 14 3 14 2 15 2 16 0 16 0 14 1 13 0 12 0 5 1 4 1 3 0 2 0 1 1 0 |
From: Mark F. <mar...@us...> - 2004-04-23 01:49:54
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21514/tnl Modified Files: tnlConnectionStringTable.h Log Message: Added health packs Removed some unecessary state transmissions Added better priority function Made barriers scope always Increased the default size of the connection string table to 1k strings Added pickup items Added repair item CTFGame no longer allows team damge Index: tnlConnectionStringTable.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlConnectionStringTable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlConnectionStringTable.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlConnectionStringTable.h 23 Apr 2004 01:49:46 -0000 1.2 *************** *** 42,48 **** public: enum StringTableConstants{ ! EntryCount = 32, ! EntryBitSize = 5, ! InvalidEntryId = 32, }; --- 42,47 ---- public: enum StringTableConstants{ ! EntryCount = 1024, ! EntryBitSize = 10, }; |
From: Mark F. <mar...@us...> - 2004-04-22 20:42:34
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23137/zap Modified Files: CTFGame.cpp gameConnection.cpp gameConnection.h ship.cpp Log Message: Reduced bandwidth usage of ship updates Does not send server state of control object if it is unchanged on client Added CRC capability to ByteBuffer class Index: gameConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameConnection.h 21 Apr 2004 02:23:08 -0000 1.2 --- gameConnection.h 22 Apr 2004 20:42:25 -0000 1.3 *************** *** 161,164 **** --- 161,165 ---- static U32 currentClientId; U32 mClientId; + U32 mLastClientControlCRC; U32 firstMoveIndex; *************** *** 180,183 **** --- 181,185 ---- GameObject *getControlObject() { return controlObject; } + U32 getControlCRC(); void linkToClientList(); Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gameConnection.cpp 21 Apr 2004 22:40:43 -0000 1.5 --- gameConnection.cpp 22 Apr 2004 20:42:25 -0000 1.6 *************** *** 46,49 **** --- 46,50 ---- highSendIndex[1] = 0; highSendIndex[2] = 0; + mLastClientControlCRC = 0; firstMoveIndex = 1; theGame = game; *************** *** 89,92 **** --- 90,107 ---- } + U32 GameConnection::getControlCRC() + { + PacketStream stream; + GameObject *co = getControlObject(); + + if(!co) + return 0; + + stream.writeInt(getGhostIndex(co), GhostConnection::GhostIdBitSize); + co->writeControlState(&stream); + stream.zeroToByteBoundary(); + return stream.calculateCRC(0, stream.getBytePosition()); + } + void GameConnection::writePacket(BitStream *bstream, PacketNotify *notify) { *************** *** 97,100 **** --- 112,117 ---- firstSendIndex = firstMoveIndex; + bstream->write(getControlCRC()); + bstream->write(firstSendIndex); U32 skipCount = firstSendIndex - firstMoveIndex; *************** *** 116,126 **** else { ! S32 ghostIndex = -1; ! if(controlObject.isValid()) ! ghostIndex = getGhostIndex(controlObject); ! if(bstream->writeFlag(ghostIndex != -1)) { ! bstream->writeInt(ghostIndex, GhostConnection::GhostIdBitSize); ! controlObject->writeControlState(bstream); } } --- 133,146 ---- else { ! if(bstream->writeFlag(getControlCRC() != mLastClientControlCRC)) { ! S32 ghostIndex = -1; ! if(controlObject.isValid()) ! ghostIndex = getGhostIndex(controlObject); ! if(bstream->writeFlag(ghostIndex != -1)) ! { ! bstream->writeInt(ghostIndex, GhostConnection::GhostIdBitSize); ! controlObject->writeControlState(bstream); ! } } } *************** *** 132,135 **** --- 152,157 ---- if(isConnectionToClient()) { + bstream->read(&mLastClientControlCRC); + U32 firstMove; bstream->read(&firstMove); *************** *** 156,166 **** if(bstream->readFlag()) { ! U32 ghostIndex = bstream->readInt(GhostConnection::GhostIdBitSize); ! controlObject = (GameObject *) resolveGhost(ghostIndex); ! controlObject->readControlState(bstream); ! for(S32 i = 0; i < pendingMoves.size(); i++) { ! controlObject->processClientMove(&pendingMoves[i], true); } } } --- 178,193 ---- if(bstream->readFlag()) { ! if(bstream->readFlag()) { ! U32 ghostIndex = bstream->readInt(GhostConnection::GhostIdBitSize); ! controlObject = (GameObject *) resolveGhost(ghostIndex); ! controlObject->readControlState(bstream); ! for(S32 i = 0; i < pendingMoves.size(); i++) ! { ! controlObject->processClientMove(&pendingMoves[i], true); ! } } + else + controlObject = NULL; } } Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CTFGame.cpp 22 Apr 2004 02:57:51 -0000 1.7 --- CTFGame.cpp 22 Apr 2004 20:42:25 -0000 1.8 *************** *** 133,137 **** UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[j].ping); curRowY += maxHeight; ! } } } --- 133,137 ---- UserInterface::drawStringf(xr - 70, curRowY, fontSize, "%d", mClientList[j].ping); curRowY += maxHeight; ! } } } Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ship.cpp 22 Apr 2004 00:35:45 -0000 1.7 --- ship.cpp 22 Apr 2004 20:42:25 -0000 1.8 *************** *** 141,145 **** Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); Point projVel = mMoveState[ActualState].vel + dir * 500; ! Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * 25, projVel, 1000, this); proj->addToGame(getGame()); } --- 141,145 ---- Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); Point projVel = mMoveState[ActualState].vel + dir * 500; ! Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * (CollisionRadius-1), projVel, 1000, this); proj->addToGame(getGame()); } *************** *** 292,298 **** { connection->packStringTableEntry(stream, mPlayerName); ! stream->write(color.r); ! stream->write(color.g); ! stream->write(color.b); stream->write(mass); --- 292,298 ---- { connection->packStringTableEntry(stream, mPlayerName); ! stream->writeFloat(color.r, 8); ! stream->writeFloat(color.g, 8); ! stream->writeFloat(color.b, 8); stream->write(mass); *************** *** 331,337 **** stream->write(mMoveState[RenderState].pos.x); stream->write(mMoveState[RenderState].pos.y); - stream->write(mMoveState[RenderState].angle); stream->write(mMoveState[RenderState].vel.x); stream->write(mMoveState[RenderState].vel.y); stream->writeFlag(updateMask & WarpPositionMask); } --- 331,337 ---- stream->write(mMoveState[RenderState].pos.x); stream->write(mMoveState[RenderState].pos.y); stream->write(mMoveState[RenderState].vel.x); stream->write(mMoveState[RenderState].vel.y); + stream->writeFlag(updateMask & WarpPositionMask); } *************** *** 352,358 **** { mPlayerName = connection->unpackStringTableEntry(stream); ! stream->read(&color.r); ! stream->read(&color.g); ! stream->read(&color.b); stream->read(&mass); --- 352,358 ---- { mPlayerName = connection->unpackStringTableEntry(stream); ! color.r = stream->readFloat(8); ! color.g = stream->readFloat(8); ! color.b = stream->readFloat(8); stream->read(&mass); *************** *** 373,377 **** stream->read(&mMoveState[ActualState].pos.x); stream->read(&mMoveState[ActualState].pos.y); - stream->read(&mMoveState[ActualState].angle); stream->read(&mMoveState[ActualState].vel.x); stream->read(&mMoveState[ActualState].vel.y); --- 373,376 ---- *************** *** 385,388 **** --- 384,389 ---- lastMove.unpack(stream); } + mMoveState[ActualState].angle = lastMove.angle; + if(positionChanged) { *************** *** 575,579 **** // Render name... ! if(OptionsMenuUserInterface::showNames) { static char buff[255]; --- 576,580 ---- // Render name... ! if(gClientGame->getConnectionToServer()->getControlObject() != this) //OptionsMenuUserInterface::showNames) { static char buff[255]; *************** *** 583,587 **** 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 ); --- 584,588 ---- glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ! glColor4f(1,1,1,0.5); //glColor3f(color.r*1.2,color.g*1.2,color.b*1.2); UserInterface::drawString( UserInterface::getStringWidth(14, buff) * -0.5, 30, 14, buff ); |
From: Mark F. <mar...@us...> - 2004-04-22 20:42:33
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23137/tnl Modified Files: byteBuffer.cpp tnlBitStream.h tnlByteBuffer.h Log Message: Reduced bandwidth usage of ship updates Does not send server state of control object if it is unchanged on client Added CRC capability to ByteBuffer class Index: byteBuffer.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/byteBuffer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** byteBuffer.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- byteBuffer.cpp 22 Apr 2004 20:42:25 -0000 1.2 *************** *** 49,52 **** --- 49,87 ---- } + U32 ByteBuffer::calculateCRC(U32 start, U32 end, U32 crcVal) const + { + static U32 crcTable[256]; + static bool crcTableValid = false; + + if(!crcTableValid) + { + U32 val; + + for(S32 i = 0; i < 256; i++) + { + val = i; + for(S32 j = 0; j < 8; j++) + { + if(val & 0x01) + val = 0xedb88320 ^ (val >> 1); + else + val = val >> 1; + } + crcTable[i] = val; + } + crcTableValid = true; + } + + if(start >= mBufSize) + return 0; + if(end > mBufSize) + end = mBufSize; + + // now calculate the crc + const U8 * buf = getBuffer(); + for(U32 i = start; i < end; i++) + crcVal = crcTable[(crcVal ^ buf[i]) & 0xff] ^ (crcVal >> 8); + return(crcVal); + } }; Index: tnlBitStream.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlBitStream.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlBitStream.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlBitStream.h 22 Apr 2004 20:42:25 -0000 1.2 *************** *** 114,117 **** --- 114,120 ---- void advanceBitPosition(const S32 numBits); + /// Pads the bits up to the next byte boundary with 0's. + void zeroToByteBoundary(); + /// Writes an unsigned integer value between 0 and 2^(bitCount - 1) into the stream. void writeInt(U32 value, U8 bitCount); *************** *** 291,294 **** --- 294,303 ---- } + inline void BitStream::zeroToByteBoundary() + { + if(bitNum & 0x7) + writeInt(0, 8 - (bitNum & 0x7)); + } + inline bool BitStream::write(const U32 in_numBytes, const void* in_pBuffer) { Index: tnlByteBuffer.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlByteBuffer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlByteBuffer.h 20 Apr 2004 04:27:18 -0000 1.1 --- tnlByteBuffer.h 22 Apr 2004 20:42:25 -0000 1.2 *************** *** 170,173 **** --- 170,176 ---- /// Decode the buffer from base 64, in place. Resizes the buffer. RefPtr<ByteBuffer> decodeBase64() const; + + /// Returns a 32 bit CRC for the buffer. + U32 calculateCRC(U32 start = 0, U32 end = 0xFFFFFFFF, U32 crcVal = 0xFFFFFFFF) const; }; |
From: Ben G. <s_a...@us...> - 2004-04-22 08:05:39
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12861/zap Modified Files: UI.cpp UI.h UIGame.cpp UIMenus.cpp quickChat.cpp sfx.cpp sfx.h Log Message: Added menu boop. Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UIGame.cpp 22 Apr 2004 07:27:27 -0000 1.6 --- UIGame.cpp 22 Apr 2004 07:46:20 -0000 1.7 *************** *** 307,310 **** --- 307,311 ---- case 'v': case 'V': + UserInterface::playBoop(); mVChat->show(); mCurrentMode = VChatMode; Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UIMenus.cpp 21 Apr 2004 20:19:07 -0000 1.2 --- UIMenus.cpp 22 Apr 2004 07:46:20 -0000 1.3 *************** *** 85,88 **** --- 85,90 ---- if(selectionIndex < 0) selectionIndex = menuItems.size() - 1; + + UserInterface::playBoop(); } else if(key == GLUT_KEY_DOWN || key == GLUT_KEY_RIGHT) *************** *** 91,94 **** --- 93,98 ---- if(selectionIndex >= menuItems.size()) selectionIndex = 0; + + UserInterface::playBoop(); } } *************** *** 98,101 **** --- 102,106 ---- if(key == '\r') { + UserInterface::playBoop(); processSelection(selectionIndex); selectionIndex = 0; *************** *** 103,106 **** --- 108,112 ---- else if(key == 27) { + UserInterface::playBoop(); selectionIndex = 0; onEscape(); Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sfx.cpp 21 Apr 2004 01:59:26 -0000 1.8 --- sfx.cpp 22 Apr 2004 07:46:20 -0000 1.9 *************** *** 39,53 **** static SFXProfile gSFXProfiles[] = { ! { "phaser.wav", false, 0.45f, false, 150, 600 }, ! { "phaser_impact.wav", false, 0.7f, false, 150, 600 }, ! { "ship_explode.wav", false, 1.0, false, 300, 1000 }, ! { "flag_capture.wav", true, 0.45f, false, 0, 0 }, ! { "flag_drop.wav", true, 0.45f, false, 0, 0 }, ! { "flag_return.wav", true, 0.45f, false, 0, 0 }, ! { "flag_snatch.wav", true, 0.45f, false, 0, 0 }, ! { "teleport_in.wav", false, 1.0, false, 200, 500 }, ! { "teleport_out.wav", false, 1.0, false, 200, 500 }, ! { "bounce_wall.wav", false, 0.7f, false, 150, 600 }, ! { "bounce_obj.wav", false, 0.7f, false, 150, 600 }, { NULL, false, 0, false, 0, 0 }, }; --- 39,54 ---- static SFXProfile gSFXProfiles[] = { ! { "phaser.wav", false, 0.45f, false, 150, 600 }, ! { "phaser_impact.wav", false, 0.7f, false, 150, 600 }, ! { "ship_explode.wav", false, 1.0, false, 300, 1000 }, ! { "flag_capture.wav", true, 0.45f, false, 0, 0 }, ! { "flag_drop.wav", true, 0.45f, false, 0, 0 }, ! { "flag_return.wav", true, 0.45f, false, 0, 0 }, ! { "flag_snatch.wav", true, 0.45f, false, 0, 0 }, ! { "teleport_in.wav", false, 1.0, false, 200, 500 }, ! { "teleport_out.wav", false, 1.0, false, 200, 500 }, ! { "bounce_wall.wav", false, 0.7f, false, 150, 600 }, ! { "bounce_obj.wav", false, 0.7f, false, 150, 600 }, ! { "boop.wav", true, 0.4f, false, 150, 600 }, { NULL, false, 0, false, 0, 0 }, }; Index: UI.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UI.h 20 Apr 2004 04:27:19 -0000 1.1 --- UI.h 22 Apr 2004 07:46:20 -0000 1.2 *************** *** 61,64 **** --- 61,65 ---- static void drawStringf(S32 x, S32 y, S32 size, const char *fmt, ...); static U32 getStringWidth(S32 size, const char *string, U32 len = 0); + static void playBoop(); }; Index: UI.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UI.cpp 20 Apr 2004 04:27:19 -0000 1.1 --- UI.cpp 22 Apr 2004 07:46:20 -0000 1.2 *************** *** 29,32 **** --- 29,33 ---- #include "UI.h" + #include "sfx.h" #include <stdarg.h> *************** *** 95,98 **** --- 96,103 ---- } + void UserInterface::playBoop() + { + SFXObject::play(SFXUIBoop, 1); + } void UserInterface::render() Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** quickChat.cpp 22 Apr 2004 07:27:43 -0000 1.1 --- quickChat.cpp 22 Apr 2004 07:46:20 -0000 1.2 *************** *** 135,139 **** {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!"}, --- 135,139 ---- {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!"}, *************** *** 199,202 **** --- 199,203 ---- if(key == 27) { + UserInterface::playBoop(); mVisible = false; return; *************** *** 223,226 **** --- 224,229 ---- mCurNode = walk; + UserInterface::playBoop(); + // 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++; Index: sfx.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sfx.h 20 Apr 2004 19:25:49 -0000 1.4 --- sfx.h 22 Apr 2004 07:46:20 -0000 1.5 *************** *** 49,52 **** --- 49,53 ---- SFXBounceWall, SFXBounceObject, + SFXUIBoop, NumSFXBuffers }; |
From: Ben G. <s_a...@us...> - 2004-04-22 07:55:39
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12861/exe Added Files: boop.wav Log Message: Added menu boop. --- NEW FILE: boop.wav --- (This appears to be a binary file; contents omitted.) |