opentnl-cvs Mailing List for Torque Network Library (Page 18)
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: Mark F. <mar...@us...> - 2004-05-18 00:03:24
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6361/zap Modified Files: item.cpp Log Message: Pickup items that have been picked up should no longer make sounds when entering scope. Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** item.cpp 16 May 2004 21:48:57 -0000 1.9 --- item.cpp 18 May 2004 00:02:57 -0000 1.10 *************** *** 212,215 **** --- 212,216 ---- { U32 retMask = Parent::packUpdate(connection, updateMask, stream); + stream->writeFlag(updateMask & InitialMask); stream->writeFlag(mIsVisible); *************** *** 220,226 **** { Parent::unpackUpdate(connection, stream); bool visible = stream->readFlag(); ! if(!visible && mIsVisible) onClientPickup(); mIsVisible = visible; --- 221,228 ---- { Parent::unpackUpdate(connection, stream); + bool isInitial = stream->readFlag(); bool visible = stream->readFlag(); ! if(!isInitial && !visible && mIsVisible) onClientPickup(); mIsVisible = visible; |
From: Mark F. <mar...@us...> - 2004-05-17 23:50:30
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3726/zap Modified Files: CTFGame.cpp game.h gameType.cpp soccerGame.cpp Log Message: Incremented game version to rc2 Fixed nasty read overrun bug in BitStream code Fixed div by zero crashes in game types Updated readme Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** game.h 16 May 2004 18:06:51 -0000 1.24 --- game.h 17 May 2004 23:50:19 -0000 1.25 *************** *** 212,216 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.2 rc 1" }; --- 212,216 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.2 rc 2" }; Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** gameType.cpp 17 May 2004 06:09:36 -0000 1.25 --- gameType.cpp 17 May 2004 23:50:19 -0000 1.26 *************** *** 105,108 **** --- 105,111 ---- maxTeamPlayers = mTeams[i].numPlayers; + if(!maxTeamPlayers) + return; + U32 teamAreaHeight = 40; if(mTeams.size() < 2) Index: soccerGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** soccerGame.cpp 17 May 2004 05:32:13 -0000 1.7 --- soccerGame.cpp 17 May 2004 23:50:19 -0000 1.8 *************** *** 55,58 **** --- 55,61 ---- maxTeamPlayers = mTeams[i].numPlayers; + if(!maxTeamPlayers) + return; + U32 totalHeight = 580; U32 maxHeight = (totalHeight - 40) / maxTeamPlayers; Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CTFGame.cpp 8 May 2004 00:03:50 -0000 1.22 --- CTFGame.cpp 17 May 2004 23:50:19 -0000 1.23 *************** *** 77,80 **** --- 77,83 ---- maxTeamPlayers = mTeams[i].numPlayers; + if(!maxTeamPlayers) + return; + U32 totalHeight = 580; U32 maxHeight = (totalHeight - 40) / maxTeamPlayers; |
From: Mark F. <mar...@us...> - 2004-05-17 23:50:28
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3726/tnl Modified Files: bitStream.cpp Log Message: Incremented game version to rc2 Fixed nasty read overrun bug in BitStream code Fixed div by zero crashes in game types Updated readme Index: bitStream.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/bitStream.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bitStream.cpp 11 May 2004 02:45:26 -0000 1.2 --- bitStream.cpp 17 May 2004 23:50:18 -0000 1.3 *************** *** 99,125 **** if(!resizeBits(bitCount + bitNum - maxWriteBitNum)) return false; - const U8 *ptr = (U8 *) bitPtr; - U8 *stPtr = getBuffer() + (bitNum >> 3); - U8 *endPtr = getBuffer() + ((bitCount + bitNum - 1) >> 3); - U8 lastByte = *endPtr; U32 upShift = bitNum & 0x7; U32 downShift= 8 - upShift; U8 lastMask = 0xFF >> (7 - ((bitNum + bitCount - 1) & 0x7)); - U8 startMask = 0xFF >> downShift; ! U8 curB = *ptr++; ! *stPtr = (curB << upShift) | (*stPtr & startMask); ! stPtr++; ! while(stPtr <= endPtr) { ! U8 nextB = *ptr++; ! *stPtr++ = (curB >> downShift) | (nextB << upShift); ! curB = nextB; } ! *endPtr = (*endPtr & lastMask) | (lastByte & ~lastMask); ! bitNum += bitCount; return true; } --- 99,208 ---- if(!resizeBits(bitCount + bitNum - maxWriteBitNum)) return false; U32 upShift = bitNum & 0x7; U32 downShift= 8 - upShift; + + const U8 *sourcePtr = (U8 *) bitPtr; + U8 *destPtr = getBuffer() + (bitNum >> 3); + + // if this write is for <= 1 byte, and it will all fit in the + // first dest byte, then do some special masking. + if(downShift >= bitCount) + { + U8 mask = ((1 << bitCount) - 1) << upShift; + *destPtr = (*destPtr & ~mask) | ((*sourcePtr << upShift) & mask); + bitNum += bitCount; + return true; + } + + // check for byte aligned writes -- this will be + // much faster than the shifting writes. + if(!upShift) + { + bitNum += bitCount; + for(; bitCount >= 8; bitCount -= 8) + *destPtr++ = *sourcePtr++; + if(bitCount) + { + U8 mask = (1 << bitCount) - 1; + *destPtr = (*sourcePtr & mask) | (*destPtr & ~mask); + } + return true; + } + + // the write destination is not byte aligned. + U8 sourceByte; + U8 destByte = *destPtr & (0xFF >> downShift); U8 lastMask = 0xFF >> (7 - ((bitNum + bitCount - 1) & 0x7)); ! bitNum += bitCount; ! for(;bitCount >= 8; bitCount -= 8) { ! sourceByte = *sourcePtr++; ! *destPtr++ = destByte | (sourceByte << upShift); ! destByte = sourceByte >> downShift; } ! if(bitCount == 0) ! { ! *destPtr = (*destPtr & ~lastMask) | (destByte & lastMask); ! return true; ! } ! if(bitCount <= downShift) ! { ! *destPtr = (*destPtr & ~lastMask) | ((destByte | (*sourcePtr << upShift)) & lastMask); ! return true; ! } ! sourceByte = *sourcePtr; ! ! *destPtr++ = destByte | (sourceByte << upShift); ! *destPtr = (*destPtr & ~lastMask) | ((sourceByte >> downShift) & lastMask); ! return true; ! } ! ! bool BitStream::readBits(U32 bitCount, void *bitPtr) ! { ! if(!bitCount) ! return true; ! if(bitCount + bitNum > maxReadBitNum) ! { ! error = true; ! return false; ! } ! ! U8 *sourcePtr = getBuffer() + (bitNum >> 3); ! U32 byteCount = (bitCount + 7) >> 3; ! ! U8 *destPtr = (U8 *) bitPtr; ! ! U32 downShift = bitNum & 0x7; ! U32 upShift = 8 - downShift; ! ! if(!downShift) ! { ! while(byteCount--) ! *destPtr++ = *sourcePtr++; ! bitNum += bitCount; ! return true; ! } ! ! U8 sourceByte = *sourcePtr >> downShift; bitNum += bitCount; + + for(; bitCount >= 8; bitCount -= 8) + { + U8 nextByte = *++sourcePtr; + *destPtr++ = sourceByte | (nextByte << upShift); + sourceByte = nextByte >> downShift; + } + if(bitCount) + { + if(bitCount <= upShift) + { + *destPtr = sourceByte; + return true; + } + *destPtr = sourceByte | ( (*++sourcePtr) << upShift); + } return true; } *************** *** 155,187 **** } - bool BitStream::readBits(U32 bitCount, void *bitPtr) - { - if(!bitCount) - return true; - if(bitCount + bitNum > maxReadBitNum) - { - error = true; - return false; - } - U8 *stPtr = getBuffer() + (bitNum >> 3); - U32 byteCount = (bitCount + 7) >> 3; - - U8 *ptr = (U8 *) bitPtr; - - U32 downShift = bitNum & 0x7; - U32 upShift = 8 - downShift; - - U8 curB = *stPtr; - while(byteCount--) - { - U8 nextB = *++stPtr; - *ptr++ = (curB >> downShift) | (nextB << upShift); - curB = nextB; - } - - bitNum += bitCount; - return true; - } - bool BitStream::write(const ByteBuffer *theBuffer) { --- 238,241 ---- |
From: Mark F. <mar...@us...> - 2004-05-17 23:50:27
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3726/exe Modified Files: README.txt Log Message: Incremented game version to rc2 Fixed nasty read overrun bug in BitStream code Fixed div by zero crashes in game types Updated readme Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** README.txt 16 May 2004 18:06:50 -0000 1.12 --- README.txt 17 May 2004 23:50:18 -0000 1.13 *************** *** 1,10 **** ! ZAP 1.2.1 Welcome to ZAP, the retro multiplayer team action game! Changes since version 1.2.1: ! - Fixed more crashes - Improved smoothness of play on higher ping connections - Improved packet space utilization Controls: --- 1,12 ---- ! ZAP 1.2.2 Welcome to ZAP, the retro multiplayer team action game! Changes since version 1.2.1: ! - Fixed the big one! (crash) - Improved smoothness of play on higher ping connections - Improved packet space utilization + - Fixed multiple other crashes + - Added a crazy bot option to slam test the game. Controls: |
From: Ben G. <s_a...@us...> - 2004-05-17 07:01:58
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7354/zap Modified Files: main.cpp sfx.cpp Log Message: Crazybot's vocalizations are now more euphonious. (Distinctive noise makes it easier to diagnose broken audio codecs.) Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** main.cpp 17 May 2004 06:09:36 -0000 1.36 --- main.cpp 17 May 2004 07:01:38 -0000 1.37 *************** *** 279,282 **** --- 279,291 ---- w++; } + + // Occasionally add gibberish text + if(Random::readI(0, 16) < 3) + { + U8 gibChar = Random::readI(0, 256); + gZapJournal.key(gibChar); + gZapJournal.keyup(gibChar); + + } // Occasionally drop the enter *************** *** 309,316 **** gZapJournal.keyup('d'); ! if(Random::readB()) gZapJournal.key('r'); ! else gZapJournal.keyup('r'); if(Random::readB() && false) --- 318,334 ---- gZapJournal.keyup('d'); ! static S32 voiceCount = 1; ! ! voiceCount--; ! if(voiceCount <= 0 && Random::readB() && Random::readB() && Random::readB()) ! { gZapJournal.key('r'); ! voiceCount = Random::readI(0, 15); ! } ! ! if(voiceCount == 0) ! { gZapJournal.keyup('r'); + } if(Random::readB() && false) Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** sfx.cpp 17 May 2004 04:41:47 -0000 1.23 --- sfx.cpp 17 May 2004 07:01:38 -0000 1.24 *************** *** 135,140 **** if(gIsCrazyBot) { ! U32 blah = Random::readI() + 0x00FF00FF; ! memset(buffer->getBuffer() + start, blah, (sizeAdd)/2); } --- 135,158 ---- if(gIsCrazyBot) { ! S16 *buff = (S16*)buffer->getBuffer() + start/2; ! static U32 synthCount = 0; ! static U16 synthGoal = 100; ! static U16 curSynth = 0; ! for(U32 i=0; i<sizeAdd/2; i++) ! { ! if(synthCount == 0) ! { ! if(Random::readI(0, 16) < 4) ! curSynth = Random::readI(0, 65535); ! ! synthGoal = Random::readI(0, 32000); ! synthCount = 25; ! } ! synthCount--; ! ! curSynth = (U32)((U32)curSynth+(U32)curSynth+(U32)synthGoal)/3; ! ! buff[i] = curSynth; ! } } |
From: Mark F. <mar...@us...> - 2004-05-17 06:20:37
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv540/zap Modified Files: lpc10.h lpc10dec.c voiceCodec.cpp voiceCodec.h Log Message: Fixed connection termination bug in netInterface for timed out connections fixed voice coded to not overrun the read on the VBR LPC10 codec. Index: lpc10.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/lpc10.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lpc10.h 7 May 2004 02:21:46 -0000 1.1 --- lpc10.h 17 May 2004 06:20:14 -0000 1.2 *************** *** 62,67 **** lpc10_decoder_state * create_lpc10_decoder_state (void); void init_lpc10_decoder_state (lpc10_decoder_state *st); ! int lpc10_decode(unsigned char *in, short *out, lpc10_decoder_state *st); ! int vbr_lpc10_decode(unsigned char *in, short *out, lpc10_decoder_state *st, int *p); void destroy_lpc10_decoder_state (lpc10_decoder_state *st); --- 62,67 ---- lpc10_decoder_state * create_lpc10_decoder_state (void); void init_lpc10_decoder_state (lpc10_decoder_state *st); ! int lpc10_decode(unsigned char *in, int inSz, short *out, lpc10_decoder_state *st); ! int vbr_lpc10_decode(unsigned char *in, int inSz, short *out, lpc10_decoder_state *st, int *p); void destroy_lpc10_decoder_state (lpc10_decoder_state *st); Index: voiceCodec.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/voiceCodec.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** voiceCodec.h 9 May 2004 20:35:17 -0000 1.2 --- voiceCodec.h 17 May 2004 06:20:14 -0000 1.3 *************** *** 62,66 **** virtual U32 getAvgCompressedFrameSize() = 0; ! virtual U32 decompressFrame(S16 *framePtr, U8 *inputPtr) = 0; public: ByteBufferPtr decompressBuffer(ByteBufferRef compressedBuffer); --- 62,66 ---- virtual U32 getAvgCompressedFrameSize() = 0; ! virtual U32 decompressFrame(S16 *framePtr, U8 *inputPtr, U32 inSize) = 0; public: ByteBufferPtr decompressBuffer(ByteBufferRef compressedBuffer); *************** *** 88,92 **** U32 getAvgCompressedFrameSize(); ! U32 decompressFrame(S16 *framePtr, U8 *inputPtr); public: LPC10VoiceDecoder(); --- 88,92 ---- U32 getAvgCompressedFrameSize(); ! U32 decompressFrame(S16 *framePtr, U8 *inputPtr, U32 inSize); public: LPC10VoiceDecoder(); *************** *** 115,119 **** U32 getAvgCompressedFrameSize(); ! U32 decompressFrame(S16 *framePtr, U8 *inputPtr); public: GSMVoiceDecoder(); --- 115,119 ---- U32 getAvgCompressedFrameSize(); ! U32 decompressFrame(S16 *framePtr, U8 *inputPtr, U32 inSize); public: GSMVoiceDecoder(); Index: voiceCodec.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/voiceCodec.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** voiceCodec.cpp 9 May 2004 20:35:17 -0000 1.2 --- voiceCodec.cpp 17 May 2004 06:20:14 -0000 1.3 *************** *** 88,92 **** samplePtr = (S16 *) ret->getBuffer(); } ! p = decompressFrame(samplePtr + frameCount * spf, inputPtr + i); frameCount++; } --- 88,92 ---- samplePtr = (S16 *) ret->getBuffer(); } ! p = decompressFrame(samplePtr + frameCount * spf, inputPtr + i, compressedSize - i); frameCount++; } *************** *** 143,150 **** } ! U32 LPC10VoiceDecoder::decompressFrame(S16 *framePtr, U8 *inputPtr) { int p; ! vbr_lpc10_decode(inputPtr, framePtr, (lpc10_decoder_state *) decoderState, &p); return (U32) p; } --- 143,150 ---- } ! U32 LPC10VoiceDecoder::decompressFrame(S16 *framePtr, U8 *inputPtr, U32 inSize) { int p; ! vbr_lpc10_decode(inputPtr, inSize, framePtr, (lpc10_decoder_state *) decoderState, &p); return (U32) p; } *************** *** 195,199 **** } ! U32 GSMVoiceDecoder::decompressFrame(S16 *framePtr, U8 *inputPtr) { gsm_decode((struct gsm_state *) decoderState, inputPtr, framePtr); --- 195,199 ---- } ! U32 GSMVoiceDecoder::decompressFrame(S16 *framePtr, U8 *inputPtr, U32 inSize) { gsm_decode((struct gsm_state *) decoderState, inputPtr, framePtr); Index: lpc10dec.c =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/lpc10dec.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lpc10dec.c 8 May 2004 00:19:08 -0000 1.2 --- lpc10dec.c 17 May 2004 06:20:14 -0000 1.3 *************** *** 664,668 **** } ! static int lpc10_decode_int(unsigned char *in, short *speech, lpc10_decoder_state *st, int *p, int vbr) { --- 664,668 ---- } ! static int lpc10_decode_int(unsigned char *in, int inLenMax, short *speech, lpc10_decoder_state *st, int *p, int vbr) { *************** *** 675,682 **** /* unpack bits into array */ ! for (i = 0; i < LPC10_BITS_IN_COMPRESSED_FRAME; i++) { bits[i] = (in[i >> 3] & (1 << (i & 7))) != 0 ? 1 : 0; } /* decode speech */ --- 675,688 ---- /* unpack bits into array */ ! int maxBits = inLenMax << 3; ! if(maxBits > LPC10_BITS_IN_COMPRESSED_FRAME) ! maxBits = LPC10_BITS_IN_COMPRESSED_FRAME; ! ! for (i = 0; i < maxBits; i++) { bits[i] = (in[i >> 3] & (1 << (i & 7))) != 0 ? 1 : 0; } + for (; i < LPC10_BITS_IN_COMPRESSED_FRAME; i++) + bits[i] = 0; /* decode speech */ *************** *** 689,702 **** } ! int lpc10_decode(unsigned char *in, short *speech, lpc10_decoder_state *st) { int p = 0; ! return lpc10_decode_int(in, speech, st, &p, FALSE); } ! int vbr_lpc10_decode(unsigned char *in, short *speech, lpc10_decoder_state *st, int *p) { ! return lpc10_decode_int(in, speech, st, p, TRUE); } --- 695,708 ---- } ! int lpc10_decode(unsigned char *in, int inLenMax, short *speech, lpc10_decoder_state *st) { int p = 0; ! return lpc10_decode_int(in, inLenMax, speech, st, &p, FALSE); } ! int vbr_lpc10_decode(unsigned char *in, int inLenMax, short *speech, lpc10_decoder_state *st, int *p) { ! return lpc10_decode_int(in, inLenMax, speech, st, p, TRUE); } |
From: Mark F. <mar...@us...> - 2004-05-17 06:20:23
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv540/tnl Modified Files: netInterface.cpp Log Message: Fixed connection termination bug in netInterface for timed out connections fixed voice coded to not overrun the read on the VBR LPC10 codec. Index: netInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netInterface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** netInterface.cpp 16 May 2004 02:29:41 -0000 1.4 --- netInterface.cpp 17 May 2004 06:20:14 -0000 1.5 *************** *** 386,390 **** { mConnectionList[i]->setConnectionState(NetConnection::TimedOut); ! mConnectionList[i]->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removeConnection(mConnectionList[i]); } --- 386,390 ---- { mConnectionList[i]->setConnectionState(NetConnection::TimedOut); ! mConnectionList[i]->onConnectionTerminated(NetConnection::ReasonTimedOut, "Timeout"); removeConnection(mConnectionList[i]); } |
From: Ben G. <s_a...@us...> - 2004-05-17 06:09:45
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30719/zap Modified Files: gameType.cpp main.cpp Log Message: Crazybots now stresstest chatting. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** main.cpp 17 May 2004 05:32:13 -0000 1.35 --- main.cpp 17 May 2004 06:09:36 -0000 1.36 *************** *** 236,288 **** if(delta > 200.0) { ! // Do movement craziness if(Random::readB()) ! gZapJournal.key('w'); else ! gZapJournal.keyup('w'); ! if(Random::readB()) ! gZapJournal.key('a'); ! else ! gZapJournal.keyup('a'); ! if(Random::readB()) ! gZapJournal.key('s'); ! else ! gZapJournal.keyup('s'); ! if(Random::readB()) ! gZapJournal.key('d'); ! else ! gZapJournal.keyup('d'); ! if(Random::readB()) ! gZapJournal.key('r'); ! else ! gZapJournal.keyup('r'); ! if(Random::readB()) ! gZapJournal.key('c'); ! else ! gZapJournal.keyup('c'); ! if(Random::readB()) ! gZapJournal.key('\t'); ! else ! gZapJournal.keyup('\t'); ! if(Random::readB()) ! gZapJournal.key(' '); ! else ! gZapJournal.keyup(' '); ! // Do mouse craziness ! S32 x = Random::readI(0, 800); ! S32 y = Random::readI(0, 600); ! gZapJournal.passivemotion(x,y); ! gZapJournal.mouse(0, Random::readF() > 0.2, x,y); ! gZapJournal.mouse(1, Random::readF() > 0.2, x,y); ! gZapJournal.mouse(2, Random::readF() > 0.8, x,y); ! lastMove = currentTimer; } gIsCrazyBot = true; // Reenable input events --- 236,340 ---- if(delta > 200.0) { ! // See if we feel like chatting ! if(Random::readB() && Random::readB()) ! { if(Random::readB()) ! { ! // Global chat ! gZapJournal.key('g'); ! gZapJournal.keyup('g'); ! } else ! { ! // Team chat ! gZapJournal.key('t'); ! gZapJournal.keyup('t'); ! } ! char *msg[13] = ! { ! "GIMME THE YUM YUM!", ! "Weasels! Oh yeah!", ! "Here, pony-pony-pony!", ! "ERMINES!", ! "fr0hnzed!", ! "m1lked!", ! "Ben IS love", ! "Blame Joe.", ! "Just ask the ponies.", ! "the ponies know.", ! "EVIL!@#$%^&*()", ! "EVIL\\1\\2\\3\\4\\5\\6\\7\\8\\9\\0", ! "EVIL\\n\\r\\t\\b\\", ! }; ! U32 msgId = Random::readI(0, 12); ! char *w = msg[msgId]; ! while(*w) ! { ! gZapJournal.key(*w); ! gZapJournal.keyup(*w); ! w++; ! } ! // Occasionally drop the enter ! if(Random::readI(0, 16) != 4) ! { ! gZapJournal.key('\r'); ! gZapJournal.keyup('\r'); ! } ! } ! ! // Do movement craziness ! if(Random::readB()) ! gZapJournal.key('w'); ! else ! gZapJournal.keyup('w'); ! if(Random::readB()) ! gZapJournal.key('a'); ! else ! gZapJournal.keyup('a'); ! if(Random::readB()) ! gZapJournal.key('s'); ! else ! gZapJournal.keyup('s'); ! if(Random::readB()) ! gZapJournal.key('d'); ! else ! gZapJournal.keyup('d'); ! ! if(Random::readB()) ! gZapJournal.key('r'); ! else ! gZapJournal.keyup('r'); ! ! if(Random::readB() && false) ! gZapJournal.key('c'); ! else ! gZapJournal.keyup('c'); ! ! if(Random::readB()) ! gZapJournal.key('\t'); ! else ! gZapJournal.keyup('\t'); ! ! if(Random::readB()) ! gZapJournal.key(' '); ! else ! gZapJournal.keyup(' '); ! ! // Do mouse craziness ! S32 x = Random::readI(0, 800); ! S32 y = Random::readI(0, 600); ! gZapJournal.passivemotion(x,y); ! gZapJournal.mouse(0, Random::readB(), x, y); ! gZapJournal.mouse(1, Random::readB(), x, y); ! gZapJournal.mouse(2, Random::readB(), x, y); ! lastMove = currentTimer; } gIsCrazyBot = true; // Reenable input events Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gameType.cpp 16 May 2004 17:33:51 -0000 1.24 --- gameType.cpp 17 May 2004 06:09:36 -0000 1.25 *************** *** 292,295 **** --- 292,298 ---- if(mClientList[i].teamId == teamId) { + if(!mClientList[i].clientConnection) + continue; + GameObject *co = mClientList[i].clientConnection->getControlObject(); if(!co) |
From: Ben G. <s_a...@us...> - 2004-05-17 05:32:22
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24569/zap Modified Files: main.cpp soccerGame.cpp Log Message: Added scoreboard to crazybot reportoire. Fixed divide-by-zero in soccer scoreboard. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** main.cpp 17 May 2004 05:01:33 -0000 1.34 --- main.cpp 17 May 2004 05:32:13 -0000 1.35 *************** *** 267,271 **** gZapJournal.keyup('c'); ! if(Random::readF() > 0.8) gZapJournal.key(' '); else --- 267,276 ---- gZapJournal.keyup('c'); ! if(Random::readB()) ! gZapJournal.key('\t'); ! else ! gZapJournal.keyup('\t'); ! ! if(Random::readB()) gZapJournal.key(' '); else Index: soccerGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** soccerGame.cpp 16 May 2004 17:33:51 -0000 1.6 --- soccerGame.cpp 17 May 2004 05:32:13 -0000 1.7 *************** *** 44,48 **** void SoccerGameType::renderInterfaceOverlay(bool scoreboardVisible) { ! if(scoreboardVisible || mGameOver ) { U32 totalWidth = 780; --- 44,48 ---- void SoccerGameType::renderInterfaceOverlay(bool scoreboardVisible) { ! if((mGameOver || scoreboardVisible) && mTeams.size() > 0) { U32 totalWidth = 780; |
From: Ben G. <s_a...@us...> - 2004-05-17 05:01:43
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19355/zap Modified Files: main.cpp Log Message: Bot generates name/journal filename properly. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** main.cpp 17 May 2004 04:41:46 -0000 1.33 --- main.cpp 17 May 2004 05:01:33 -0000 1.34 *************** *** 33,36 **** --- 33,37 ---- #include "glutInclude.h" #include <stdarg.h> + #include <direct.h> using namespace TNL; *************** *** 480,483 **** --- 481,496 ---- gIsCrazyBot = true; + // Generate a name... + char journalPath[512]; + getcwd(journalPath, 512); + + char *name = tmpnam(NULL); + nameSet = true; + gNameEntryUserInterface.setText(name); + + strcat(journalPath, name); + strcat(journalPath, "journal"); + gZapJournal.record(journalPath); + // Connect to specified server connectRemote = true; *************** *** 485,494 **** gConnectAddress.set(argv[i+1]); - // Generate a name... - char *name = tmpnam(NULL); - - nameSet = true; - gNameEntryUserInterface.setText(name); - gZapJournal.record(name); } else if(!stricmp(argv[i], "-server")) --- 498,501 ---- |
From: Ben G. <s_a...@us...> - 2004-05-17 04:41:56
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15275/tnl Modified Files: random.cpp tnlRandom.h Log Message: Added crazybot mode for stress testing. Added bot.sh to automatically spawn N bots connecting to a given address. Index: random.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/random.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** random.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- random.cpp 17 May 2004 04:41:46 -0000 1.2 *************** *** 95,98 **** --- 95,105 ---- } + bool readB() + { + U8 randomBuffer; + read(&randomBuffer, 1); + + return(randomBuffer & 1); + } }; Index: tnlRandom.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRandom.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlRandom.h 20 Apr 2004 04:27:19 -0000 1.1 --- tnlRandom.h 17 May 2004 04:41:46 -0000 1.2 *************** *** 55,58 **** --- 55,61 ---- F32 readF(); + /// Returns a single random bit. + bool readB(); + /// Returns an opaque pointer to the random number generator's internal state /// for use in certain encryption functions. |
From: Ben G. <s_a...@us...> - 2004-05-17 04:41:56
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15275/zap Modified Files: main.cpp sfx.cpp Log Message: Added crazybot mode for stress testing. Added bot.sh to automatically spawn N bots connecting to a given address. Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** main.cpp 14 May 2004 18:49:55 -0000 1.32 --- main.cpp 17 May 2004 04:41:46 -0000 1.33 *************** *** 48,51 **** --- 48,52 ---- { + bool gIsCrazyBot = false; bool gQuit = false; bool gIsServer = false; *************** *** 100,103 **** --- 101,107 ---- TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, motion, (S32 x, S32 y)) { + if(gIsCrazyBot) + return; + if(UserInterface::current) UserInterface::current->onMouseDragged(x, y); *************** *** 111,114 **** --- 115,121 ---- TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, passivemotion, (S32 x, S32 y)) { + if(gIsCrazyBot) + return; + if(UserInterface::current) UserInterface::current->onMouseMoved(x, y); *************** *** 148,151 **** --- 155,161 ---- return; + if(gIsCrazyBot) + return; + if(button == GLUT_LEFT_BUTTON) { *************** *** 216,222 **** } // Sleep a bit so we don't saturate the system. For a non-dedicated server, // sleep(0) helps reduce the impact of OpenGL on windows. ! Platform::sleep((gClientGame ? 0 : 1)); gZapJournal.processNextJournalEntry(); } --- 226,296 ---- } + // Make us move all crazy like... + if(gIsCrazyBot) + { + gIsCrazyBot = false; // Reenable input events + static S64 lastMove = Platform::getHighPrecisionTimerValue(); + + F64 delta = Platform::getHighPrecisionMilliseconds(currentTimer - lastMove); + if(delta > 200.0) + { + // Do movement craziness + if(Random::readB()) + gZapJournal.key('w'); + else + gZapJournal.keyup('w'); + + if(Random::readB()) + gZapJournal.key('a'); + else + gZapJournal.keyup('a'); + + if(Random::readB()) + gZapJournal.key('s'); + else + gZapJournal.keyup('s'); + + if(Random::readB()) + gZapJournal.key('d'); + else + gZapJournal.keyup('d'); + + if(Random::readB()) + gZapJournal.key('r'); + else + gZapJournal.keyup('r'); + + if(Random::readB()) + gZapJournal.key('c'); + else + gZapJournal.keyup('c'); + + if(Random::readF() > 0.8) + gZapJournal.key(' '); + else + gZapJournal.keyup(' '); + + // Do mouse craziness + S32 x = Random::readI(0, 800); + S32 y = Random::readI(0, 600); + gZapJournal.passivemotion(x,y); + gZapJournal.mouse(0, Random::readF() > 0.2, x,y); + gZapJournal.mouse(1, Random::readF() > 0.2, x,y); + gZapJournal.mouse(2, Random::readF() > 0.8, x,y); + lastMove = currentTimer; + } + gIsCrazyBot = true; // Reenable input events + } + + + // Sleep a bit so we don't saturate the system. For a non-dedicated server, // sleep(0) helps reduce the impact of OpenGL on windows. ! U32 sleepTime = 1; ! ! if(gClientGame) sleepTime = 0; ! if(gIsCrazyBot) sleepTime = 10; ! ! Platform::sleep(sleepTime); gZapJournal.processNextJournalEntry(); } *************** *** 402,406 **** bool hasAdditionalArg = (i != argc - 1); ! if(!stricmp(argv[i], "-server")) { hasServer = true; --- 476,496 ---- bool hasAdditionalArg = (i != argc - 1); ! if(!stricmp(argv[i], "-crazybot")) ! { ! gIsCrazyBot = true; ! ! // Connect to specified server ! connectRemote = true; ! if(hasAdditionalArg) ! gConnectAddress.set(argv[i+1]); ! ! // Generate a name... ! char *name = tmpnam(NULL); ! ! nameSet = true; ! gNameEntryUserInterface.setText(name); ! gZapJournal.record(name); ! } ! else if(!stricmp(argv[i], "-server")) { hasServer = true; Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** sfx.cpp 16 May 2004 02:29:41 -0000 1.22 --- sfx.cpp 17 May 2004 04:41:47 -0000 1.23 *************** *** 28,31 **** --- 28,32 ---- #include "tnl.h" #include "tnlLog.h" + #include "tnlRandom.h" #ifdef TNL_OS_WIN32 *************** *** 37,40 **** --- 38,43 ---- { + extern bool gIsCrazyBot; + static LPDIRECTSOUNDCAPTURE8 capture = NULL; static LPDIRECTSOUNDCAPTUREBUFFER captureBuffer = NULL; *************** *** 129,133 **** captureBuffer->Unlock(buf1, count1, buf2, count2); ! lastReadOffset += count1 + count2; lastReadOffset %= BufferBytes; } --- 132,143 ---- captureBuffer->Unlock(buf1, count1, buf2, count2); ! // Write our own random noise in... ! if(gIsCrazyBot) ! { ! U32 blah = Random::readI() + 0x00FF00FF; ! memset(buffer->getBuffer() + start, blah, (sizeAdd)/2); ! } ! ! lastReadOffset += sizeAdd; lastReadOffset %= BufferBytes; } |
From: Ben G. <s_a...@us...> - 2004-05-17 04:41:56
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15275/exe Added Files: bot.sh Log Message: Added crazybot mode for stress testing. Added bot.sh to automatically spawn N bots connecting to a given address. --- NEW FILE: bot.sh --- #!/bin/bash LIMIT=$1 for ((a=1; a <= LIMIT ; a++)) # Double parentheses, and "LIMIT" with no "$". do echo Bot $a connecting to $1 ./zapd -crazybot $2 & echo Waiting 10 seconds for bot to connect... sleep 10 done # A construct borrowed from 'ksh93'. |
From: Mark F. <mar...@us...> - 2004-05-16 21:49:07
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3030/zap Modified Files: gameItems.cpp item.cpp item.h Log Message: Fixed pickup item immediate respawn Changed repair item to look like a health kit Fixed pickup sounds on clients Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** item.cpp 16 May 2004 17:33:51 -0000 1.8 --- item.cpp 16 May 2004 21:48:57 -0000 1.9 *************** *** 201,218 **** void PickupItem::idle(GameObject::IdleCallPath path) { ! Parent::idle(path); ! if(mRepopTimer.update(mCurrentMove.time)) { ! mIsVisible = true; ! addToDatabase(); } } bool PickupItem::collide(GameObject *otherObject) { ! if(!isGhost() && otherObject->getObjectTypeMask() & ShipType) { if(pickup((Ship *) otherObject)) { mRepopTimer.reset(getRepopDelay()); mIsVisible = false; --- 201,238 ---- void PickupItem::idle(GameObject::IdleCallPath path) { ! if(!mIsVisible && path == GameObject::ServerIdleMainLoop) { ! if(mRepopTimer.update(mCurrentMove.time)) ! mIsVisible = true; } + updateExtent(); + } + + U32 PickupItem::packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream) + { + U32 retMask = Parent::packUpdate(connection, updateMask, stream); + stream->writeFlag(mIsVisible); + + return retMask; } + void PickupItem::unpackUpdate(GhostConnection *connection, BitStream *stream) + { + Parent::unpackUpdate(connection, stream); + bool visible = stream->readFlag(); + + if(!visible && mIsVisible) + onClientPickup(); + mIsVisible = visible; + } + + bool PickupItem::collide(GameObject *otherObject) { ! if(mIsVisible && !isGhost() && otherObject->getObjectTypeMask() & ShipType) { if(pickup((Ship *) otherObject)) { + setMaskBits(PickupMask); mRepopTimer.reset(getRepopDelay()); mIsVisible = false; *************** *** 223,225 **** --- 243,246 ---- } + }; \ No newline at end of file Index: item.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** item.h 16 May 2004 17:33:51 -0000 1.3 --- item.h 16 May 2004 21:48:57 -0000 1.4 *************** *** 44,47 **** --- 44,48 ---- WarpPositionMask = BIT(2), MountMask = BIT(3), + FirstFreeMask = BIT(4), }; *************** *** 72,82 **** --- 73,93 ---- bool mIsVisible; Timer mRepopTimer; + protected: + enum MaskBits { + PickupMask = Parent::FirstFreeMask << 0, + FirstFreeMask = Parent::FirstFreeMask << 1, + }; public: PickupItem(Point p = Point(), float radius = 1); void idle(GameObject::IdleCallPath path); + bool isVisible() { return mIsVisible; } + + U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); + void unpackUpdate(GhostConnection *connection, BitStream *stream); bool collide(GameObject *otherObject); virtual bool pickup(Ship *theShip) = 0; virtual U32 getRepopDelay() = 0; + virtual void onClientPickup() = 0; }; Index: gameItems.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameItems.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gameItems.cpp 16 May 2004 17:33:51 -0000 1.4 --- gameItems.cpp 16 May 2004 21:48:57 -0000 1.5 *************** *** 36,45 **** private: typedef PickupItem Parent; - F32 spin; public: RepairItem(Point p = Point()) : PickupItem(p, 20) { - spin=0.f; mNetFlags.set(Ghostable); } --- 36,43 ---- *************** *** 51,110 **** DamageInfo di; ! di.damageAmount = -0.21; di.damageType = 0; di.damagingObject = this; theShip->damageObject(&di); - SFXObject::play(SFXShipHeal, getRenderPos(), getRenderVel()); 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 idle(GameObject::IdleCallPath path) { ! Parent::idle(path); ! if(path == GameObject::ClientIdleMainRemote) ! spin += 50.f * (F32)mCurrentMove.time * 0.001f; } void renderItem(Point pos) { glPushMatrix(); glTranslatef(pos.x, pos.y, 0); - glRotatef(spin, 0, 0, 1.f); ! 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(); --- 49,104 ---- DamageInfo di; ! di.damageAmount = -0.5f; di.damageType = 0; di.damagingObject = this; theShip->damageObject(&di); return true; } ! void onClientPickup() { ! SFXObject::play(SFXShipHeal, getRenderPos(), getRenderVel()); } ! U32 getRepopDelay() { ! return 20000; } void renderItem(Point pos) { + if(!isVisible()) + return; glPushMatrix(); glTranslatef(pos.x, pos.y, 0); ! glColor3f(1,1,1); ! glBegin(GL_LINE_LOOP); ! glVertex2f(-18, -18); ! glVertex2f(18, -18); ! glVertex2f(18, 18); ! glVertex2f(-18, 18); ! glEnd(); ! ! glColor3f(1,0,0); ! glBegin(GL_LINE_LOOP); ! ! float crossWidth = 4; ! float crossLen = 14; ! ! glVertex2f(crossWidth, crossWidth); ! glVertex2f(crossLen, crossWidth); ! glVertex2f(crossLen, -crossWidth); ! glVertex2f(crossWidth, -crossWidth); ! glVertex2f(crossWidth, -crossLen); ! glVertex2f(-crossWidth, -crossLen); ! glVertex2f(-crossWidth, -crossWidth); ! glVertex2f(-crossLen, -crossWidth); ! glVertex2f(-crossLen, crossWidth); ! glVertex2f(-crossWidth, crossWidth); ! glVertex2f(-crossWidth, crossLen); ! glVertex2f(crossWidth, crossLen); glEnd(); |
From: Mark F. <mar...@us...> - 2004-05-16 20:21:48
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16954/zap Modified Files: UIGame.cpp UIGame.h controlObjectConnection.cpp point.h projectile.cpp projectile.h ship.cpp Log Message: Normalized out unnecessary bits in ship position and velocity so that control object updates match on slightly different numeric precision archtectures Commented some of ship's update process Index: controlObjectConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/controlObjectConnection.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** controlObjectConnection.cpp 16 May 2004 17:33:51 -0000 1.3 --- controlObjectConnection.cpp 16 May 2004 20:21:36 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- #include "gameObject.h" #include "controlObjectConnection.h" + #include "UIGame.h" namespace Zap *************** *** 164,167 **** --- 165,169 ---- mCompressPointsRelative = controlObjectValid; + gGameUserInterface.receivedControlUpdate(false); // CRC mismatch... if(bstream->readFlag()) *************** *** 182,185 **** --- 184,188 ---- } controlObject->controlMoveReplayComplete(); + gGameUserInterface.receivedControlUpdate(true); } else Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** UIGame.cpp 14 May 2004 18:49:55 -0000 1.26 --- UIGame.cpp 16 May 2004 20:21:36 -0000 1.27 *************** *** 64,67 **** --- 64,68 ---- mVChat = new VChatHelper(); + mGotControlUpdate = false; } *************** *** 264,267 **** --- 265,272 ---- drawStringf(710, 10, 30, "%4.2f fps", (1000 * FPSAvgCount) / F32(sum)); } + else if(mGotControlUpdate) + { + drawString(710, 10, 30, "CU"); + } if(mVChat->isActive()) mVChat->render(); Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** projectile.cpp 16 May 2004 17:33:51 -0000 1.11 --- projectile.cpp 16 May 2004 20:21:36 -0000 1.12 *************** *** 59,62 **** --- 59,63 ---- if(stream->writeFlag(index != -1)) stream->writeInt(index, GhostConnection::GhostIdBitSize); + stream->writeFlag(collided); return 0; *************** *** 71,77 **** mShooter = (Ship *) connection->resolveGhost(stream->readInt(GhostConnection::GhostIdBitSize)); Rect newExtent(pos,pos); setExtent(newExtent); ! mCurrentMove.time = connection->getOneWayTime(); idle(GameObject::ClientIdleMainRemote); --- 72,84 ---- mShooter = (Ship *) connection->resolveGhost(stream->readInt(GhostConnection::GhostIdBitSize)); + collided = stream->readFlag(); + if(collided) + explode(NULL, pos); + else + pos += velocity * -0.020f; + Rect newExtent(pos,pos); setExtent(newExtent); ! mCurrentMove.time = connection->getOneWayTime() + 20; idle(GameObject::ClientIdleMainRemote); *************** *** 107,121 **** liveTime = 0; // Do some particle spew... if(isGhost()) { ! SparkManager::emitExplosion(collisionPoint, 0.4, SparkColors, NumSparkColors); Ship *s = dynamic_cast<Ship*>(hitObject); if(s && s->mShield) ! SFXObject::play(SFXBounceShield, pos, velocity); else ! SFXObject::play(SFXPhaserImpact, pos, velocity); } } --- 114,132 ---- liveTime = 0; + explode(hitObject, collisionPoint); + } + void Projectile::explode(GameObject *hitObject, Point thePos) + { // Do some particle spew... if(isGhost()) { ! SparkManager::emitExplosion(thePos, 0.4, SparkColors, NumSparkColors); Ship *s = dynamic_cast<Ship*>(hitObject); if(s && s->mShield) ! SFXObject::play(SFXBounceShield, thePos, velocity); else ! SFXObject::play(SFXPhaserImpact, thePos, velocity); } } *************** *** 124,167 **** { U32 deltaT = mCurrentMove.time; ! if(collided) ! return; ! Point endPos = pos + velocity * deltaT * 0.001; ! static Vector<GameObject *> disableVector; ! Rect queryRect(pos, endPos); ! float collisionTime; ! disableVector.clear(); ! if(mShooter.isValid()) ! { ! disableVector.push_back(mShooter); ! mShooter->disableCollision(); ! } ! GameObject *hitObject; ! for(;;) ! { ! hitObject = findObjectLOS(MoveableType | BarrierType, MoveObject::RenderState, pos, endPos, collisionTime); ! if(!hitObject || hitObject->collide(this)) ! break; ! disableVector.push_back(hitObject); ! hitObject->disableCollision(); ! } ! for(S32 i = 0; i < disableVector.size(); i++) ! disableVector[i]->enableCollision(); ! if(hitObject) ! { ! Point collisionPoint = pos + (endPos - pos) * collisionTime; ! handleCollision(hitObject, collisionPoint); } - else - pos = endPos; - - Rect newExtent(pos,pos); - setExtent(newExtent); if(path == GameObject::ClientIdleMainRemote) --- 135,178 ---- { U32 deltaT = mCurrentMove.time; ! if(!collided) ! { ! Point endPos = pos + velocity * deltaT * 0.001; ! static Vector<GameObject *> disableVector; ! Rect queryRect(pos, endPos); ! float collisionTime; ! disableVector.clear(); ! if(mShooter.isValid()) ! { ! disableVector.push_back(mShooter); ! mShooter->disableCollision(); ! } ! GameObject *hitObject; ! for(;;) ! { ! hitObject = findObjectLOS(MoveableType | BarrierType, MoveObject::RenderState, pos, endPos, collisionTime); ! if(!hitObject || hitObject->collide(this)) ! break; ! disableVector.push_back(hitObject); ! hitObject->disableCollision(); ! } ! for(S32 i = 0; i < disableVector.size(); i++) ! disableVector[i]->enableCollision(); ! if(hitObject) ! { ! Point collisionPoint = pos + (endPos - pos) * collisionTime; ! handleCollision(hitObject, collisionPoint); ! } ! else ! pos = endPos; ! Rect newExtent(pos,pos); ! setExtent(newExtent); } if(path == GameObject::ClientIdleMainRemote) Index: point.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/point.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** point.h 30 Apr 2004 20:27:41 -0000 1.6 --- point.h 16 May 2004 20:21:36 -0000 1.7 *************** *** 62,65 **** --- 62,70 ---- void normalize(float newLen) { member_type l = len(); if(l == 0) { x = newLen; y = 0; } else { l = newLen / l; x *= l; y *= l; } } + void scaleFloorDiv(float scaleFactor, float divFactor) + { + x = (member_type) floor(x * scaleFactor + 0.5) * divFactor; + y = (member_type) floor(y * scaleFactor + 0.5) * divFactor; + } member_type dot(const Point &p) const { return x * p.x + y * p.y; } void read(const char **argv) { x = (member_type) atof(argv[0]); y = (member_type) atof(argv[1]); } Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UIGame.h 14 May 2004 18:49:55 -0000 1.9 --- UIGame.h 16 May 2004 20:21:36 -0000 1.10 *************** *** 79,82 **** --- 79,83 ---- U32 mChatLastBlinkTime; bool mInScoreboardMode; + bool mGotControlUpdate; bool mFPSVisible; *************** *** 134,137 **** --- 135,140 ---- void onControllerButtonUp(U32 buttonIndex); + void receivedControlUpdate(bool recvd) { mGotControlUpdate = recvd; } + Move *getCurrentMove(); }; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ship.cpp 16 May 2004 17:33:51 -0000 1.31 --- ship.cpp 16 May 2004 20:21:36 -0000 1.32 *************** *** 159,169 **** void Ship::controlMoveReplayComplete() { Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; F32 deltaLen = delta.len(); ! if(deltaLen > MaxControlObjectInterpDistance) { ! for(S32 i=0; i<TrailCount; i++) ! mTrail[i].reset(); mMoveState[RenderState].pos = mMoveState[ActualState].pos; --- 159,176 ---- void Ship::controlMoveReplayComplete() { + // compute the delta between our current render position + // and the server position after client-side prediction has + // been run. Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; F32 deltaLen = delta.len(); ! // if the delta is either very small, or greater than the ! // max interpolation threshold, just warp to the new position ! if(deltaLen <= 0.5 || deltaLen > MaxControlObjectInterpDistance) { ! // if it's a large delta, get rid of the movement trails. ! if(deltaLen > MaxControlObjectInterpDistance) ! for(S32 i=0; i<TrailCount; i++) ! mTrail[i].reset(); mMoveState[RenderState].pos = mMoveState[ActualState].pos; *************** *** 171,180 **** mInterpolating = false; } - else if(deltaLen <= 0.5) - { - mMoveState[RenderState].pos = mMoveState[ActualState].pos; - mMoveState[RenderState].vel = mMoveState[ActualState].vel; - mInterpolating = false; - } else mInterpolating = true; --- 178,181 ---- *************** *** 183,186 **** --- 184,188 ---- void Ship::idle(GameObject::IdleCallPath path) { + // don't process exploded ships if(hasExploded) return; *************** *** 188,191 **** --- 190,198 ---- if(path == GameObject::ServerIdleMainLoop && isControlled()) { + // if this is a controlled object in the server's main + // idle loop, process the render state forward -- this + // is what projectiles will collide against. This allows + // clients to properly lead other clients, instead of + // piecewise stepping only when packets arrive from the client. processMove(RenderState); setMaskBits(PositionMask); *************** *** 193,210 **** else { processMove(ActualState); if(path == GameObject::ServerIdleMainLoop || path == GameObject::ServerIdleControlFromClient) { mMoveState[RenderState] = mMoveState[ActualState]; setMaskBits(PositionMask); - } else if(path == GameObject::ClientIdleControlMain || path == GameObject::ClientIdleMainRemote) { updateInterpolation(); } } updateExtent(); --- 200,244 ---- else { + // for all other cases, advance the actual state of the + // object with the current move. processMove(ActualState); + + if(path == GameObject::ServerIdleControlFromClient || + path == GameObject::ClientIdleControlMain || + path == GameObject::ClientIdleControlReplay) + { + // for different optimizer settings and different platforms + // the floating point calculations may come out slightly + // differently in the lowest mantissa bits. So normalize + // after each update the position and velocity, so that + // the control state update will not differ from client to server. + const F32 ShipVarNormalizeMultiplier = 128; + const F32 ShipVarNormalizeFraction = 1 / ShipVarNormalizeMultiplier; + + mMoveState[ActualState].pos.scaleFloorDiv(ShipVarNormalizeMultiplier, ShipVarNormalizeFraction); + mMoveState[ActualState].vel.scaleFloorDiv(ShipVarNormalizeMultiplier, ShipVarNormalizeFraction); + } + if(path == GameObject::ServerIdleMainLoop || path == GameObject::ServerIdleControlFromClient) { + // update the render state on the server to match + // the actual updated state, and mark the object + // as having changed Position state. An optimization + // here would check the before and after positions + // so as to not update unmoving ships. mMoveState[RenderState] = mMoveState[ActualState]; setMaskBits(PositionMask); } else if(path == GameObject::ClientIdleControlMain || path == GameObject::ClientIdleMainRemote) { + // on the client, update the interpolation of this object + // only if we are not replaying control moves. updateInterpolation(); } } + + // update the object in the game's extents database. updateExtent(); *************** *** 219,222 **** --- 253,257 ---- path == GameObject::ClientIdleControlReplay) { + // process weapons and energy on controlled object objects processWeaponFire(); processEnergy(); *************** *** 226,230 **** path == GameObject::ClientIdleMainRemote) { ! // Emit some particles emitMovementSparks(); for(U32 i=0; i<TrailCount; i++) --- 261,265 ---- path == GameObject::ClientIdleMainRemote) { ! // Emit some particles, trail sections and update the turbo noise emitMovementSparks(); for(U32 i=0; i<TrailCount; i++) *************** *** 333,337 **** stream->write(mMoveState[ActualState].pos.x); stream->write(mMoveState[ActualState].pos.y); - stream->write(mMoveState[ActualState].angle); stream->write(mMoveState[ActualState].vel.x); stream->write(mMoveState[ActualState].vel.y); --- 368,371 ---- *************** *** 345,349 **** 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); --- 379,382 ---- *************** *** 352,357 **** U32 fireTimer = stream->readRangedU32(0, FireDelay); mFireTimer.reset(fireTimer); - - logprintf("got a CU %g %g.", mMoveState[ActualState].pos.x, mMoveState[ActualState].pos.y); } --- 385,388 ---- Index: projectile.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** projectile.h 16 May 2004 17:33:51 -0000 1.5 --- projectile.h 16 May 2004 20:21:36 -0000 1.6 *************** *** 57,60 **** --- 57,61 ---- void idle(GameObject::IdleCallPath path); + void explode(GameObject *hitObject, Point p); virtual Point getRenderVel() { return velocity; } |
From: Mark F. <mar...@us...> - 2004-05-16 18:07:00
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21985/exe Modified Files: README.txt Log Message: Updated game version string Removed unused variable warning Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** README.txt 14 May 2004 01:34:17 -0000 1.11 --- README.txt 16 May 2004 18:06:50 -0000 1.12 *************** *** 3,8 **** Welcome to ZAP, the retro multiplayer team action game! ! Changes since version 1.2.0: ! - Fixed bad crashiness. Controls: --- 3,10 ---- Welcome to ZAP, the retro multiplayer team action game! ! Changes since version 1.2.1: ! - Fixed more crashes ! - Improved smoothness of play on higher ping connections ! - Improved packet space utilization Controls: |
From: Mark F. <mar...@us...> - 2004-05-16 18:07:00
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21985/zap Modified Files: game.h masterConnection.cpp Log Message: Updated game version string Removed unused variable warning Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** game.h 14 May 2004 22:16:11 -0000 1.23 --- game.h 16 May 2004 18:06:51 -0000 1.24 *************** *** 212,216 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.1 rc 2" }; --- 212,216 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.2 rc 1" }; Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** masterConnection.cpp 16 May 2004 02:29:41 -0000 1.9 --- masterConnection.cpp 16 May 2004 18:06:51 -0000 1.10 *************** *** 94,99 **** mCurrentQueryId++; - IPAddress theAddress = remoteAddress.toIPAddress(); - c2mRequestArrangedConnection(mCurrentQueryId, remoteAddress.toIPAddress(), getInterface()->getFirstBoundInterfaceAddress().toIPAddress(), --- 94,97 ---- |
From: Mark F. <mar...@us...> - 2004-05-16 17:34:06
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14316/zap Modified Files: controlObjectConnection.cpp game.cpp gameItems.cpp gameObject.cpp gameObject.h gameType.cpp gameType.h item.cpp item.h moveObject.cpp moveObject.h projectile.cpp projectile.h ship.cpp ship.h soccerGame.cpp soccerGame.h teleporter.cpp teleporter.h Log Message: Finished cleaning up energy system on ship Removed all process, processSever, processClient calls Added idle() to GameObject Moved interpolation code from ship into MoveObject Removed interpolation code from item housecleaning, etc. Index: controlObjectConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/controlObjectConnection.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** controlObjectConnection.cpp 16 May 2004 02:29:41 -0000 1.2 --- controlObjectConnection.cpp 16 May 2004 17:33:51 -0000 1.3 *************** *** 151,155 **** // and all that joy. if(controlObject.isValid()) ! controlObject->processServerMove(&theMove); firstMoveIndex++; } --- 151,158 ---- // and all that joy. if(controlObject.isValid()) ! { ! controlObject->setCurrentMove(theMove); ! controlObject->idle(GameObject::ServerIdleControlFromClient); ! } firstMoveIndex++; } *************** *** 175,180 **** Move theMove = pendingMoves[i]; theMove.prepare(); ! controlObject->processClientMove(&theMove, true); } } else --- 178,185 ---- Move theMove = pendingMoves[i]; theMove.prepare(); ! controlObject->setCurrentMove(theMove); ! controlObject->idle(GameObject::ClientIdleControlReplay); } + controlObject->controlMoveReplayComplete(); } else Index: moveObject.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/moveObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** moveObject.cpp 30 Apr 2004 20:27:41 -0000 1.6 --- moveObject.cpp 16 May 2004 17:33:51 -0000 1.7 *************** *** 42,45 **** --- 42,46 ---- mRadius = radius; mMass = mass; + mInterpolating = false; } *************** *** 354,358 **** --- 355,420 ---- } + void MoveObject::updateInterpolation() + { + U32 deltaT = mCurrentMove.time; + { + mMoveState[RenderState].angle = mMoveState[ActualState].angle; + + if(mInterpolating) + { + // 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: + mInterpolating = false; + mMoveState[RenderState] = mMoveState[ActualState]; + } + } + } }; \ No newline at end of file Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gameType.cpp 14 May 2004 00:33:38 -0000 1.23 --- gameType.cpp 16 May 2004 17:33:51 -0000 1.24 *************** *** 54,64 **** } ! void GameType::processClient(U32 deltaT) ! { ! mGameTimer.update(deltaT); ! } ! ! void GameType::processServer(U32 deltaT) { if(mScoreboardUpdateTimer.update(deltaT)) { --- 54,65 ---- } ! void GameType::idle(GameObject::IdleCallPath path) { + U32 deltaT = mCurrentMove.time; + if(isGhost()) + { + mGameTimer.update(deltaT); + return; + } if(mScoreboardUpdateTimer.update(deltaT)) { Index: soccerGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** soccerGame.cpp 8 May 2004 00:03:51 -0000 1.5 --- soccerGame.cpp 16 May 2004 17:33:51 -0000 1.6 *************** *** 254,258 **** mNetFlags.set(Ghostable); initialPos = pos; - sendHomeTime = 0; } --- 254,257 ---- *************** *** 278,299 **** } ! void SoccerBallItem::processServer(U32 deltaT) { ! if(sendHomeTime) { ! F32 accelFraction = 1 - (0.98 * deltaT / 1000.0f); mMoveState[ActualState].vel *= accelFraction; mMoveState[RenderState].vel *= accelFraction; - - if(sendHomeTime > deltaT) - sendHomeTime -= deltaT; - else - { - sendHomeTime = 0; - sendHome(); - } } ! Parent::processServer(deltaT); } --- 277,292 ---- } ! void SoccerBallItem::idle(GameObject::IdleCallPath path) { ! if(mSendHomeTimer.update(mCurrentMove.time)) ! sendHome(); ! else if(mSendHomeTimer.getCurrent()) { ! F32 accelFraction = 1 - (0.98 * mCurrentMove.time * 0.001f); mMoveState[ActualState].vel *= accelFraction; mMoveState[RenderState].vel *= accelFraction; } ! Parent::idle(path); } *************** *** 332,340 **** SoccerGoalObject *goal = dynamic_cast<SoccerGoalObject *>(hitObject); ! if(goal && sendHomeTime == 0) { SoccerGameType *g = (SoccerGameType *) getGame()->getGameType(); g->scoreGoal(lastPlayerTouch, goal->getTeamIndex()); ! sendHomeTime = 1500; } } --- 325,333 ---- SoccerGoalObject *goal = dynamic_cast<SoccerGoalObject *>(hitObject); ! if(goal && !mSendHomeTimer.getCurrent()) { SoccerGameType *g = (SoccerGameType *) getGame()->getGameType(); g->scoreGoal(lastPlayerTouch, goal->getTeamIndex()); ! mSendHomeTimer.reset(1500); } } Index: teleporter.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/teleporter.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** teleporter.h 20 Apr 2004 04:27:20 -0000 1.1 --- teleporter.h 16 May 2004 17:33:51 -0000 1.2 *************** *** 54,59 **** void unpackUpdate(GhostConnection *connection, BitStream *stream); ! void processServer(U32 deltaT); ! void processClient(U32 deltaT); void render(); --- 54,58 ---- void unpackUpdate(GhostConnection *connection, BitStream *stream); ! void idle(GameObject::IdleCallPath path); void render(); Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** projectile.cpp 12 May 2004 19:35:12 -0000 1.10 --- projectile.cpp 16 May 2004 17:33:51 -0000 1.11 *************** *** 73,77 **** Rect newExtent(pos,pos); setExtent(newExtent); ! process(connection->getOneWayTime()); SFXObject::play(0, pos, velocity); --- 73,78 ---- Rect newExtent(pos,pos); setExtent(newExtent); ! mCurrentMove.time = connection->getOneWayTime(); ! idle(GameObject::ClientIdleMainRemote); SFXObject::play(0, pos, velocity); *************** *** 120,125 **** } ! void Projectile::process(U32 deltaT) { if(collided) return; --- 121,127 ---- } ! void Projectile::idle(GameObject::IdleCallPath path) { + U32 deltaT = mCurrentMove.time; if(collided) return; *************** *** 162,171 **** Rect newExtent(pos,pos); setExtent(newExtent); - } ! void Projectile::processServer(U32 deltaT) ! { ! process(deltaT); ! if(alive) { if(liveTime <= deltaT) --- 164,171 ---- Rect newExtent(pos,pos); setExtent(newExtent); ! if(path == GameObject::ClientIdleMainRemote) ! liveTime += deltaT; ! else if(alive) { if(liveTime <= deltaT) *************** *** 180,189 **** } - void Projectile::processClient(U32 deltaT) - { - process(deltaT); - liveTime += deltaT; - } - void Projectile::render() { --- 180,183 ---- Index: teleporter.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/teleporter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** teleporter.cpp 30 Apr 2004 20:27:42 -0000 1.4 --- teleporter.cpp 16 May 2004 17:33:51 -0000 1.5 *************** *** 114,133 **** static Vector<GameObject *> fillVector2; ! void Teleporter::processClient(U32 deltaT) { if(timeout > deltaT) timeout -= deltaT; else timeout = 0; - } ! void Teleporter::processServer(U32 deltaT) ! { ! // Deal with our timeout... ! if(timeout > deltaT) ! { ! timeout -= deltaT; return; - } // Check for players within range --- 114,131 ---- static Vector<GameObject *> fillVector2; ! void Teleporter::idle(GameObject::IdleCallPath path) { + U32 deltaT = mCurrentMove.time; + // Deal with our timeout... if(timeout > deltaT) + { timeout -= deltaT; + return; + } else timeout = 0; ! if(path != GameObject::ServerIdleMainLoop) return; // Check for players within range Index: gameObject.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameObject.cpp 12 May 2004 19:35:12 -0000 1.3 --- gameObject.cpp 16 May 2004 17:33:51 -0000 1.4 *************** *** 185,209 **** } ! void GameObject::processServerMove(Move *) ! { ! } ! ! void GameObject::processClientMove(Move *, bool replay) ! { ! } ! ! void GameObject::processClient(U32 deltaT) { } ! void GameObject::processServer(U32 deltaT) { } ! void GameObject::writeControlState(BitStream *) { } ! void GameObject::readControlState(BitStream *) { } --- 185,201 ---- } ! void GameObject::idle(IdleCallPath path) { } ! void GameObject::writeControlState(BitStream *) { } ! void GameObject::readControlState(BitStream *) { } ! void GameObject::controlMoveReplayComplete() { } Index: item.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** item.h 23 Apr 2004 01:49:46 -0000 1.2 --- item.h 16 May 2004 17:33:51 -0000 1.3 *************** *** 29,32 **** --- 29,33 ---- #include "moveObject.h" + #include "timer.h" namespace Zap *************** *** 48,55 **** bool mIsMounted; bool mIsCollideable; - U32 mInterpTime; public: ! void processServer(U32 deltaT); ! void processClient(U32 deltaT); void processArguments(S32 argc, const char **argv); --- 49,55 ---- bool mIsMounted; bool mIsCollideable; public: ! void idle(GameObject::IdleCallPath path); ! void processArguments(S32 argc, const char **argv); *************** *** 71,78 **** 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; --- 71,79 ---- typedef Item Parent; bool mIsVisible; ! Timer mRepopTimer; public: PickupItem(Point p = Point(), float radius = 1); ! void idle(GameObject::IdleCallPath path); ! bool collide(GameObject *otherObject); virtual bool pickup(Ship *theShip) = 0; Index: projectile.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** projectile.h 12 May 2004 19:35:12 -0000 1.4 --- projectile.h 16 May 2004 17:33:51 -0000 1.5 *************** *** 55,61 **** void handleCollision(GameObject *theObject, Point collisionPoint); ! void process(U32 deltaT); ! void processServer(U32 deltaT); ! void processClient(U32 deltaT); virtual Point getRenderVel() { return velocity; } --- 55,60 ---- void handleCollision(GameObject *theObject, Point collisionPoint); ! ! void idle(GameObject::IdleCallPath path); virtual Point getRenderVel() { return velocity; } Index: moveObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/moveObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** moveObject.h 3 May 2004 22:55:51 -0000 1.2 --- moveObject.h 16 May 2004 17:33:51 -0000 1.3 *************** *** 54,62 **** --- 54,68 ---- Point vel; // actual velocity of the ship }; + enum { + InterpMaxVelocity = 900, // velocity to use to interpolate to proper position + InterpAcceleration = 1800, + }; MoveState mMoveState[MoveStateCount]; + bool mInterpolating; public: MoveObject(Point pos = Point(0,0), float radius = 1, float mass = 1); + void updateInterpolation(); void updateExtent(); Point getRenderPos() { return mMoveState[RenderState].pos; } Index: gameObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gameObject.h 12 May 2004 19:35:12 -0000 1.6 --- gameObject.h 16 May 2004 17:33:51 -0000 1.7 *************** *** 30,34 **** #include "point.h" #include "gameConnection.h" ! #include "../tnl/tnlNetObject.h" #include "game.h" --- 30,34 ---- #include "point.h" #include "gameConnection.h" ! #include "tnlNetObject.h" #include "game.h" *************** *** 74,77 **** --- 74,79 ---- protected: U32 mObjectTypeMask; + Move mLastMove; ///< the move for the previous update + Move mCurrentMove; ///< The move for the current update public: *************** *** 104,115 **** virtual bool getCollisionCircle(U32 stateIndex, Point &point, float &radius); ! virtual void processServerMove(Move *theMove); ! virtual void processClientMove(Move *theMove, bool replay); ! virtual void processServer(U32 deltaT); ! virtual void processClient(U32 deltaT); virtual void writeControlState(BitStream *stream); virtual void readControlState(BitStream *stream); void writeCompressedVelocity(Point &vel, U32 max, BitStream *stream); void readCompressedVelocity(Point &vel, U32 max, BitStream *stream); --- 106,129 ---- virtual bool getCollisionCircle(U32 stateIndex, Point &point, float &radius); ! const Move &getCurrentMove() { return mCurrentMove; } ! const Move &getLastMove() { return mLastMove; } ! void setCurrentMove(const Move &theMove) { mCurrentMove = theMove; } ! void setLastMove(const Move &theMove) { mLastMove = theMove; } ! ! enum IdleCallPath { ! ServerIdleMainLoop, ! ServerIdleControlFromClient, ! ClientIdleMainRemote, ! ClientIdleControlMain, ! ClientIdleControlReplay, ! }; ! ! virtual void idle(IdleCallPath path); virtual void writeControlState(BitStream *stream); virtual void readControlState(BitStream *stream); + virtual void controlMoveReplayComplete(); + void writeCompressedVelocity(Point &vel, U32 max, BitStream *stream); void readCompressedVelocity(Point &vel, U32 max, BitStream *stream); Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ship.h 16 May 2004 02:29:41 -0000 1.18 --- ship.h 16 May 2004 17:33:51 -0000 1.19 *************** *** 48,54 **** TurboMaxVelocity = 700, // points per second TurboAcceleration = 5000, // points per second per second ! InterpMaxVelocity = 900, // velocity to use to interpolate to proper position ! InterpAcceleration = 1800, ! InterpMS = 15, // default interpolation time to new position CollisionRadius = 24, VisibilityRadius = 30, --- 48,52 ---- TurboMaxVelocity = 700, // points per second TurboAcceleration = 5000, // points per second per second ! CollisionRadius = 24, VisibilityRadius = 30, *************** *** 62,65 **** --- 60,65 ---- EnergyTurboDrain = 15000, EnergyShieldDrain = 15000, + EnergyShieldHitDrain = 20000, + EnergyShootDrain = 500, EnergyCooldownThreshold = 15000, }; *************** *** 75,79 **** }; - U32 interpTime; Timer mFireTimer; F32 mHealth; --- 75,78 ---- *************** *** 91,96 **** bool hasExploded; - Move lastMove; // last client input move for this ship - Vector<Point> posSegments; Vector<SafePtr<Item> > mMountedItems; --- 90,93 ---- *************** *** 102,116 **** void onGhostRemove(); void updateTurboNoise(); ! void burnEnergy(U32 dT); ! void emitMovementSparks(U32 deltaT); ! void emitShipExplosion(Point pos); ! void processServerMove(Move *theMove); ! void processClientMove(Move *theMove, bool replay); ! void processServer(U32 deltaT); ! void processClient(U32 deltaT); ! void updateInterpolation(U32 deltaT); void setActualPos(Point p); --- 99,115 ---- void onGhostRemove(); + + + void idle(IdleCallPath path); + + void processMove(U32 stateIndex); + void processWeaponFire(); + void processEnergy(); void updateTurboNoise(); ! void emitMovementSparks(); ! void controlMoveReplayComplete(); + void emitShipExplosion(Point pos); void setActualPos(Point p); *************** *** 118,123 **** void kill(DamageInfo *theInfo); - void processMove(Move *theMove, U32 stateIndex); - void writeControlState(BitStream *stream); void readControlState(BitStream *stream); --- 117,120 ---- Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gameType.h 8 May 2004 22:01:13 -0000 1.12 --- gameType.h 16 May 2004 17:33:51 -0000 1.13 *************** *** 106,111 **** void onAddedToGame(Game *theGame); void onGhostAvailable(GhostConnection *theConnection); ! void processClient(U32 deltaT); ! void processServer(U32 deltaT); void setTeamScore(S32 teamIndex, S32 newScore); --- 106,111 ---- void onAddedToGame(Game *theGame); void onGhostAvailable(GhostConnection *theConnection); ! ! void idle(GameObject::IdleCallPath path); void setTeamScore(S32 teamIndex, S32 newScore); Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** game.cpp 16 May 2004 02:29:41 -0000 1.22 --- game.cpp 16 May 2004 17:33:51 -0000 1.23 *************** *** 282,287 **** for(S32 i = 0; i < mGameObjects.size(); i++) { ! mGameObjects[i]->processServer(timeDelta); } processDeleteList(timeDelta); mNetInterface->processConnections(); --- 282,291 ---- for(S32 i = 0; i < mGameObjects.size(); i++) { ! Move thisMove = mGameObjects[i]->getCurrentMove(); ! thisMove.time = timeDelta; ! mGameObjects[i]->setCurrentMove(thisMove); ! mGameObjects[i]->idle(GameObject::ServerIdleMainLoop); } + processDeleteList(timeDelta); mNetInterface->processConnections(); *************** *** 370,373 **** --- 374,378 ---- { mConnectionToServer->addPendingMove(theMove); + GameObject *controlObject = mConnectionToServer->getControlObject(); theMove->prepare(); *************** *** 375,386 **** for(S32 i = 0; i < mGameObjects.size(); i++) { ! if(mGameObjects[i] == mConnectionToServer->getControlObject()) ! mGameObjects[i]->processClientMove(theMove, false); else ! mGameObjects[i]->processClient(timeDelta); } } processDeleteList(timeDelta); ! SparkManager::tick((F32)timeDelta / 1000.f); SFXObject::process(); --- 380,402 ---- for(S32 i = 0; i < mGameObjects.size(); i++) { ! if(mGameObjects[i] == controlObject) ! { ! mGameObjects[i]->setCurrentMove(*theMove); ! mGameObjects[i]->idle(GameObject::ClientIdleControlMain); ! } else ! { ! Move m = mGameObjects[i]->getCurrentMove(); ! m.time = timeDelta; ! mGameObjects[i]->setCurrentMove(m); ! mGameObjects[i]->idle(GameObject::ClientIdleMainRemote); ! } } + + if(controlObject) + SFXObject::setListenerParams(controlObject->getRenderPos(),controlObject->getRenderVel()); } processDeleteList(timeDelta); ! SparkManager::tick((F32)timeDelta * 0.001f); SFXObject::process(); Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** item.cpp 12 May 2004 19:35:12 -0000 1.7 --- item.cpp 16 May 2004 17:33:51 -0000 1.8 *************** *** 37,41 **** mIsMounted = false; mIsCollideable = collideable; - mInterpTime = 0; mObjectTypeMask = MoveableType | ItemType | CommandMapVisType; } --- 37,40 ---- *************** *** 92,96 **** } ! void Item::processServer(U32 deltaT) { if(mIsMounted) --- 91,95 ---- } ! void Item::idle(GameObject::IdleCallPath path) { if(mIsMounted) *************** *** 102,161 **** mMoveState[RenderState].pos = mMount->getRenderPos(); mMoveState[ActualState].pos = mMount->getActualPos(); - - updateExtent(); } } else { ! float time = deltaT * 0.001f; move(time, ActualState, false); ! mMoveState[RenderState] = mMoveState[ActualState]; ! setMaskBits(PositionMask); ! updateExtent(); ! } ! } ! ! void Item::processClient(U32 deltaT) ! { ! if(mIsMounted) ! { ! if(mMount.isValid()) ! { ! mMoveState[RenderState].pos = mMount->getRenderPos(); ! mMoveState[ActualState].pos = mMount->getActualPos(); ! ! updateExtent(); ! } ! } ! else ! { ! U32 timeUsed = deltaT; ! if(mInterpTime) ! { ! if(mInterpTime < timeUsed) ! { ! timeUsed -= mInterpTime; ! mInterpTime = 0; ! mMoveState[RenderState] = mMoveState[ActualState]; ! } ! else ! { ! Point totalDelta = mMoveState[ActualState].pos - ! mMoveState[RenderState].pos; ! ! mMoveState[RenderState].pos += ! totalDelta * (timeUsed / F32(mInterpTime)); ! ! mInterpTime -= timeUsed; ! timeUsed = 0; ! } ! } ! if(timeUsed) { - move(timeUsed * 0.001f, ActualState, false); mMoveState[RenderState] = mMoveState[ActualState]; } ! updateExtent(); } } --- 101,119 ---- mMoveState[RenderState].pos = mMount->getRenderPos(); mMoveState[ActualState].pos = mMount->getActualPos(); } } else { ! float time = mCurrentMove.time * 0.001f; move(time, ActualState, false); ! if(path == GameObject::ServerIdleMainLoop) { mMoveState[RenderState] = mMoveState[ActualState]; + setMaskBits(PositionMask); } ! else ! updateInterpolation(); } + updateExtent(); } *************** *** 218,227 **** if(interpolate) { ! mInterpTime = InterpMS; ! move((mInterpTime + connection->getOneWayTime()) * 0.001f, ActualState, false); } else { ! mInterpTime = 0; mMoveState[RenderState] = mMoveState[ActualState]; } --- 176,185 ---- if(interpolate) { ! mInterpolating = true; ! move(connection->getOneWayTime() * 0.001f, ActualState, false); } else { ! mInterpolating = false; mMoveState[RenderState] = mMoveState[ActualState]; } *************** *** 239,256 **** { mIsVisible = true; - mRepopDelay = 0; } ! void PickupItem::processServer(U32 deltaT) { ! if(!mIsVisible) { ! if(deltaT > mRepopDelay) ! { ! mIsVisible = true; ! addToDatabase(); ! } ! else ! mRepopDelay -= deltaT; } } --- 197,209 ---- { mIsVisible = true; } ! void PickupItem::idle(GameObject::IdleCallPath path) { ! Parent::idle(path); ! if(mRepopTimer.update(mCurrentMove.time)) { ! mIsVisible = true; ! addToDatabase(); } } *************** *** 262,266 **** if(pickup((Ship *) otherObject)) { ! mRepopDelay = getRepopDelay(); mIsVisible = false; removeFromDatabase(); --- 215,219 ---- if(pickup((Ship *) otherObject)) { ! mRepopTimer.reset(getRepopDelay()); mIsVisible = false; removeFromDatabase(); Index: gameItems.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameItems.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameItems.cpp 5 May 2004 09:50:35 -0000 1.3 --- gameItems.cpp 16 May 2004 17:33:51 -0000 1.4 *************** *** 82,89 **** } ! void processClient(U32 deltaT) { ! Parent::processClient(deltaT); ! spin += 50.f * (F32)deltaT / 1000.f; } --- 82,90 ---- } ! void idle(GameObject::IdleCallPath path) { ! Parent::idle(path); ! if(path == GameObject::ClientIdleMainRemote) ! spin += 50.f * (F32)mCurrentMove.time * 0.001f; } Index: soccerGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** soccerGame.h 6 May 2004 00:33:39 -0000 1.4 --- soccerGame.h 16 May 2004 17:33:51 -0000 1.5 *************** *** 67,71 **** typedef Item Parent; Point initialPos; ! U32 sendHomeTime; StringTableEntry lastPlayerTouch; public: --- 67,71 ---- typedef Item Parent; Point initialPos; ! Timer mSendHomeTimer; StringTableEntry lastPlayerTouch; public: *************** *** 74,78 **** void sendHome(); void damageObject(DamageInfo *theInfo); ! void processServer(U32 deltaT); void processArguments(S32 argc, const char **argv); --- 74,78 ---- void sendHome(); void damageObject(DamageInfo *theInfo); ! void idle(GameObject::IdleCallPath path); void processArguments(S32 argc, const char **argv); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ship.cpp 16 May 2004 02:29:41 -0000 1.30 --- ship.cpp 16 May 2004 17:33:51 -0000 1.31 *************** *** 58,62 **** } mHealth = 1.0; - interpTime = 0; mass = m; hasExploded = false; --- 58,61 ---- *************** *** 107,118 **** // process a move. This will advance the position of the ship, as well as adjust the velocity and angle. ! void Ship::processMove(Move *theMove, U32 stateIndex) { ! U32 msTime = theMove->time; mMoveState[LastProcessState] = mMoveState[stateIndex]; ! F32 time = theMove->time * 0.001; ! Point requestVel(theMove->right - theMove->left, theMove->down - theMove->up); requestVel *= (mTurbo ? TurboMaxVelocity : MaxVelocity); F32 len = requestVel.len(); --- 106,117 ---- // process a move. This will advance the position of the ship, as well as adjust the velocity and angle. ! void Ship::processMove(U32 stateIndex) { ! U32 msTime = mCurrentMove.time; mMoveState[LastProcessState] = mMoveState[stateIndex]; ! F32 time = mCurrentMove.time * 0.001; ! Point requestVel(mCurrentMove.right - mCurrentMove.left, mCurrentMove.down - mCurrentMove.up); requestVel *= (mTurbo ? TurboMaxVelocity : MaxVelocity); F32 len = requestVel.len(); *************** *** 133,239 **** mMoveState[stateIndex].vel = requestVel; ! mMoveState[stateIndex].angle = theMove->angle; move(time, stateIndex, false); } ! void Ship::processServerMove(Move *theMove) { ! if(!hasExploded) ! processMove(theMove, ActualState); ! else ! return; ! ! mMoveState[RenderState] = mMoveState[ActualState]; ! setMaskBits(PositionMask); ! ! if(!theMove->isEqualMove(&lastMove)) ! { ! lastMove = *theMove; ! setMaskBits(MoveMask); ! } ! ! mFireTimer.update(theMove->time); ! if(theMove->fire) { ! if(mFireTimer.getCurrent() == 0) { ! mEnergy -= 0.5f; mFireTimer.reset(FireDelay); ! Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); ! Point projVel = dir * 600 + dir * mMoveState[ActualState].vel.dot(dir); ! Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * (CollisionRadius-1), projVel, 500, this); ! proj->addToGame(getGame()); } } - bool shield = mShield, turbo = mTurbo; - mShield = theMove->shield; - mTurbo = theMove->boost; - burnEnergy(theMove->time); - - if(mTurbo != turbo || mShield != shield) - setMaskBits(PowersMask); - - updateExtent(); } ! void Ship::processClientMove(Move *theMove, bool replay) { ! if(!hasExploded) ! processMove(theMove, ActualState); ! else ! return; ! ! updateInterpolation(theMove->time); ! lastMove = *theMove; ! mShield = theMove->shield; ! mTurbo = theMove->boost; ! burnEnergy(theMove->time); ! SFXObject::setListenerParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); ! if(!replay) { ! // Emit some particles ! emitMovementSparks(theMove->time); ! for(U32 i=0; i<TrailCount; i++) ! mTrail[i].tick(theMove->time); ! updateTurboNoise(); } } ! void Ship::processServer(U32 deltaT) { ! lastMove.time = deltaT; ! if(isControlled()) ! processMove(&lastMove, RenderState); ! else { ! processMove(&lastMove, ActualState); ! mMoveState[RenderState] = mMoveState[ActualState]; setMaskBits(PositionMask); } updateExtent(); - } ! void Ship::processClient(U32 deltaT) ! { ! lastMove.time = deltaT; ! processMove(&lastMove, ActualState); ! updateInterpolation(deltaT); ! // Emit some particles ! emitMovementSparks(deltaT); ! for(U32 i=0; i<TrailCount; i++) ! mTrail[i].tick(deltaT); ! // Update the turbo noise ! updateTurboNoise(); } ! void Ship::burnEnergy( U32 dT ) { ! // if(isGhost()) return; ! F32 scaleFactor = dT * 0.001; // Update things based on available energy... --- 132,245 ---- mMoveState[stateIndex].vel = requestVel; ! mMoveState[stateIndex].angle = mCurrentMove.angle; move(time, stateIndex, false); } ! void Ship::processWeaponFire() { ! mFireTimer.update(mCurrentMove.time); ! if(mCurrentMove.fire) { ! if(mFireTimer.getCurrent() == 0 && mEnergy >= EnergyShootDrain) { ! mEnergy -= EnergyShootDrain; mFireTimer.reset(FireDelay); ! ! if(!isGhost()) ! { ! Point dir(sin(mMoveState[ActualState].angle), cos(mMoveState[ActualState].angle) ); ! Point projVel = dir * 600 + dir * mMoveState[ActualState].vel.dot(dir); ! Projectile *proj = new Projectile(mMoveState[ActualState].pos + dir * (CollisionRadius-1), projVel, 500, this); ! proj->addToGame(getGame()); ! } } } } ! void Ship::controlMoveReplayComplete() { ! Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; ! F32 deltaLen = delta.len(); ! if(deltaLen > MaxControlObjectInterpDistance) ! { ! for(S32 i=0; i<TrailCount; i++) ! mTrail[i].reset(); ! mMoveState[RenderState].pos = mMoveState[ActualState].pos; ! mMoveState[RenderState].vel = mMoveState[ActualState].vel; ! mInterpolating = false; ! } ! else if(deltaLen <= 0.5) { ! mMoveState[RenderState].pos = mMoveState[ActualState].pos; ! mMoveState[RenderState].vel = mMoveState[ActualState].vel; ! mInterpolating = false; } + else + mInterpolating = true; } ! void Ship::idle(GameObject::IdleCallPath path) { ! if(hasExploded) ! return; ! ! if(path == GameObject::ServerIdleMainLoop && isControlled()) { ! processMove(RenderState); setMaskBits(PositionMask); } + else + { + processMove(ActualState); + if(path == GameObject::ServerIdleMainLoop || + path == GameObject::ServerIdleControlFromClient) + { + mMoveState[RenderState] = mMoveState[ActualState]; + setMaskBits(PositionMask); + + } + else if(path == GameObject::ClientIdleControlMain || + path == GameObject::ClientIdleMainRemote) + { + updateInterpolation(); + } + } updateExtent(); ! if(path == GameObject::ServerIdleControlFromClient && ! !mCurrentMove.isEqualMove(&mLastMove)) ! setMaskBits(MoveMask); ! mLastMove = mCurrentMove; ! if(path == GameObject::ServerIdleControlFromClient || ! path == GameObject::ClientIdleControlMain || ! path == GameObject::ClientIdleControlReplay) ! { ! processWeaponFire(); ! processEnergy(); ! } ! ! if(path == GameObject::ClientIdleControlMain || ! path == GameObject::ClientIdleMainRemote) ! { ! // Emit some particles ! emitMovementSparks(); ! for(U32 i=0; i<TrailCount; i++) ! mTrail[i].tick(mCurrentMove.time); ! updateTurboNoise(); ! } } ! void Ship::processEnergy() { ! bool shield = mShield, turbo = mTurbo; ! mShield = mCurrentMove.shield; ! mTurbo = mCurrentMove.boost; ! ! F32 scaleFactor = mCurrentMove.time * 0.001; // Update things based on available energy... *************** *** 274,277 **** --- 280,286 ---- if(mEnergy >= EnergyMax) mEnergy = EnergyMax; + + if(mTurbo != turbo || mShield != shield) + setMaskBits(PowersMask); } *************** *** 282,288 **** // Factor in shields ! if(mShield && mEnergy >= 20.f) { ! mEnergy -= 20.f; return; } --- 291,297 ---- // Factor in shields ! if(mShield && mEnergy >= EnergyShieldHitDrain) { ! mEnergy -= EnergyShieldHitDrain; return; } *************** *** 320,384 **** - void Ship::updateInterpolation(U32 deltaT) - { - 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(); - } - void Ship::writeControlState(BitStream *stream) { --- 329,332 ---- *************** *** 390,393 **** --- 338,342 ---- stream->writeRangedU32(mEnergy, 0, EnergyMax); stream->writeFlag(mCooldown); + stream->writeRangedU32(mFireTimer.getCurrent(), 0, FireDelay); } *************** *** 401,415 **** mEnergy = stream->readRangedU32(0, EnergyMax); mCooldown = stream->readFlag(); - Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; - if(delta.len() > MaxControlObjectInterpDistance) - { - for(S32 i=0; i<TrailCount; i++) - mTrail[i].reset(); - - interpTime = 0; - } - else - interpTime = 1; logprintf("got a CU %g %g.", mMoveState[ActualState].pos.x, mMoveState[ActualState].pos.y); } --- 350,356 ---- mEnergy = stream->readRangedU32(0, EnergyMax); mCooldown = stream->readFlag(); + U32 fireTimer = stream->readRangedU32(0, FireDelay); + mFireTimer.reset(fireTimer); logprintf("got a CU %g %g.", mMoveState[ActualState].pos.x, mMoveState[ActualState].pos.y); } *************** *** 463,467 **** if(stream->writeFlag(updateMask & MoveMask)) { ! lastMove.pack(stream, NULL); } if(stream->writeFlag(updateMask & PowersMask)) --- 404,408 ---- if(stream->writeFlag(updateMask & MoveMask)) { ! mCurrentMove.pack(stream, NULL); } if(stream->writeFlag(updateMask & PowersMask)) *************** *** 514,519 **** if(stream->readFlag()) { ! lastMove = Move(); ! lastMove.unpack(stream); } if(stream->readFlag()) --- 455,460 ---- if(stream->readFlag()) { ! mCurrentMove = Move(); ! mCurrentMove.unpack(stream); } if(stream->readFlag()) *************** *** 523,536 **** } ! mMoveState[ActualState].angle = lastMove.angle; if(positionChanged) { ! lastMove.time = connection->getOneWayTime(); ! processMove(&lastMove, ActualState); if(interpolate) { ! interpTime = InterpMS; // if the actual velocity is in the direction of the actual position // then we'll set it into the render velocity --- 464,477 ---- } ! mMoveState[ActualState].angle = mCurrentMove.angle; if(positionChanged) { ! mCurrentMove.time = connection->getOneWayTime(); ! processMove(ActualState); if(interpolate) { ! mInterpolating = true; // if the actual velocity is in the direction of the actual position // then we'll set it into the render velocity *************** *** 538,542 **** else { ! interpTime = 0; mMoveState[RenderState] = mMoveState[ActualState]; --- 479,483 ---- else { ! mInterpolating = false; mMoveState[RenderState] = mMoveState[ActualState]; *************** *** 639,644 **** } ! void Ship::emitMovementSparks(U32 deltaT) { // Do nothing if we're under 0.1 vel if(hasExploded || mMoveState[ActualState].vel.len() < 0.1) --- 580,587 ---- } ! void Ship::emitMovementSparks() { + U32 deltaT = mCurrentMove.time; + // Do nothing if we're under 0.1 vel if(hasExploded || mMoveState[ActualState].vel.len() < 0.1) *************** *** 732,736 **** // Finally, do some particles ! Point velDir(lastMove.right - lastMove.left, lastMove.down - lastMove.up); F32 len = velDir.len(); --- 675,679 ---- // Finally, do some particles ! Point velDir(mCurrentMove.right - mCurrentMove.left, mCurrentMove.down - mCurrentMove.up); F32 len = velDir.len(); *************** *** 826,830 **** // draw thrusters ! Point velDir(lastMove.right - lastMove.left, lastMove.down - lastMove.up); F32 len = velDir.len(); F32 thrusts[4]; --- 769,773 ---- // draw thrusters ! Point velDir(mCurrentMove.right - mCurrentMove.left, mCurrentMove.down - mCurrentMove.up); F32 len = velDir.len(); F32 thrusts[4]; |
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7085/zap Modified Files: controlObjectConnection.cpp game.cpp gameConnection.cpp gameConnection.h masterConnection.cpp masterConnection.h sfx.cpp ship.cpp ship.h Log Message: Cleaned up disconnection processes on NetConnection to all go through a single call point - onConnectionTerminated Cleaned up failed connect processes on NetConnection to all go through a single call point - onConnectTerminated Fixed energy system on Zap ships to use integer energy Fixed energy system on Zap ships to use client-side prediction appropriately Fixed bug in move pack/repacking Index: gameConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gameConnection.h 14 May 2004 00:33:38 -0000 1.12 --- gameConnection.h 16 May 2004 02:29:41 -0000 1.13 *************** *** 77,88 **** bool readConnectRequest(BitStream *stream, const char **errorString); ! void onConnectionEstablished(bool isInitiator); ! void onConnectionRejected(const char *reason); ! void onDisconnect(const char *reason); ! void onTimedOut(); ! void onConnectTimedOut(); ! void onConnectionTerminated(const char *reason); TNL_DECLARE_NETCONNECTION(GameConnection); --- 77,85 ---- bool readConnectRequest(BitStream *stream, const char **errorString); ! void onConnectionEstablished(); ! void onConnectTerminated(TerminationReason r, const char *); ! void onConnectionTerminated(TerminationReason r, const char *string); TNL_DECLARE_NETCONNECTION(GameConnection); Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gameConnection.cpp 14 May 2004 00:33:38 -0000 1.14 --- gameConnection.cpp 16 May 2004 02:29:41 -0000 1.15 *************** *** 130,138 **** } ! void GameConnection::onConnectionEstablished(bool isInitiator) { ! Parent::onConnectionEstablished(isInitiator); ! if(isInitiator) { setGhostFrom(false); --- 130,138 ---- } ! void GameConnection::onConnectionEstablished() { ! Parent::onConnectionEstablished(); ! if(isInitiator()) { setGhostFrom(false); *************** *** 153,159 **** } ! void GameConnection::onConnectionTerminated(const char *reason) { ! if(isConnectionToServer()) { gMainMenuUserInterface.activate(); --- 153,159 ---- } ! void GameConnection::onConnectionTerminated(NetConnection::TerminationReason r, const char *reason) { ! if(isInitiator()) { gMainMenuUserInterface.activate(); *************** *** 165,186 **** } ! void GameConnection::onConnectionRejected(const char *reason) ! { ! gMainMenuUserInterface.activate(); ! } ! ! void GameConnection::onDisconnect(const char *reason) ! { ! onConnectionTerminated(avar("Server disconnect - %s", reason)); ! } ! ! void GameConnection::onTimedOut() ! { ! onConnectionTerminated("Connection timed out."); ! } ! ! void GameConnection::onConnectTimedOut() { ! if(gClientGame && this == gClientGame->getConnectionToServer()) gMainMenuUserInterface.activate(); } --- 165,171 ---- } ! void GameConnection::onConnectTerminated(TerminationReason r, const char *string) { ! if(isInitiator()) gMainMenuUserInterface.activate(); } Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ship.h 12 May 2004 21:08:25 -0000 1.17 --- ship.h 16 May 2004 02:29:41 -0000 1.18 *************** *** 39,42 **** --- 39,43 ---- class Ship : public MoveObject { + typedef MoveObject Parent; public: enum { *************** *** 57,61 **** MaxControlObjectInterpDistance = 200, TrailCount = 2, ! RechargeRate = 6, // How many percent/second }; --- 58,66 ---- MaxControlObjectInterpDistance = 200, TrailCount = 2, ! EnergyMax = 100000, ! EnergyRechargeRate = 6000, // How many percent/second ! EnergyTurboDrain = 15000, ! EnergyShieldDrain = 15000, ! EnergyCooldownThreshold = 15000, }; *************** *** 73,77 **** Timer mFireTimer; F32 mHealth; ! F32 mEnergy; StringTableEntry mPlayerName; bool mShield, mTurbo, mCooldown; --- 78,82 ---- Timer mFireTimer; F32 mHealth; ! S32 mEnergy; StringTableEntry mPlayerName; bool mShield, mTurbo, mCooldown; *************** *** 93,100 **** void render(); Ship(StringTableEntry playerName="", Point p = Point(0,0), F32 m = 1.0); - ~Ship(); F32 getHealth() { return mHealth; } void burnEnergy(U32 dT); void emitMovementSparks(U32 deltaT); --- 98,106 ---- void render(); Ship(StringTableEntry playerName="", Point p = Point(0,0), F32 m = 1.0); F32 getHealth() { return mHealth; } + void onGhostRemove(); + void updateTurboNoise(); void burnEnergy(U32 dT); void emitMovementSparks(U32 deltaT); Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** game.cpp 14 May 2004 00:33:38 -0000 1.21 --- game.cpp 16 May 2004 02:29:41 -0000 1.22 *************** *** 365,370 **** JoystickUpdateMove(theMove); #endif - theMove->prepare(); - theMove->time = timeDelta; --- 365,368 ---- *************** *** 373,376 **** --- 371,376 ---- mConnectionToServer->addPendingMove(theMove); + theMove->prepare(); + for(S32 i = 0; i < mGameObjects.size(); i++) { *************** *** 580,586 **** if(s) { ! static F32 curEnergy = 0.f; ! curEnergy = (curEnergy + s->mEnergy) * 0.5f; const F32 offset = 50; --- 580,588 ---- if(s) { ! //static F32 curEnergy = 0.f; ! //curEnergy = (curEnergy + s->mEnergy) * 0.5f; ! ! F32 energy = s->mEnergy * 100.0f / F32(Ship::EnergyMax); const F32 offset = 50; *************** *** 589,603 **** glBegin(GL_POLYGON); glVertex2f(15, 515 + offset); ! glVertex2f(15 + curEnergy, 515 + offset); ! glVertex2f(15 + curEnergy, 535 + offset); glVertex2f(15, 535 + offset); glEnd(); // Show danger line. ! glColor3f(1, 0, 0); ! glBegin(GL_LINES); ! glVertex2f(15 + 5, 512 + offset); ! glVertex2f(15 + 5, 539 + offset); ! glEnd(); // Show safety line. --- 591,605 ---- glBegin(GL_POLYGON); glVertex2f(15, 515 + offset); ! glVertex2f(15 + energy, 515 + offset); ! glVertex2f(15 + energy, 535 + offset); glVertex2f(15, 535 + offset); glEnd(); // Show danger line. ! //glColor3f(1, 0, 0); ! //glBegin(GL_LINES); ! //glVertex2f(15 + 5, 512 + offset); ! //glVertex2f(15 + 5, 539 + offset); ! //glEnd(); // Show safety line. Index: controlObjectConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/controlObjectConnection.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** controlObjectConnection.cpp 14 May 2004 00:33:38 -0000 1.1 --- controlObjectConnection.cpp 16 May 2004 02:29:41 -0000 1.2 *************** *** 172,176 **** for(S32 i = 0; i < pendingMoves.size(); i++) ! controlObject->processClientMove(&pendingMoves[i], true); } else --- 172,180 ---- for(S32 i = 0; i < pendingMoves.size(); i++) ! { ! Move theMove = pendingMoves[i]; ! theMove.prepare(); ! controlObject->processClientMove(&theMove, true); ! } } else Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** sfx.cpp 14 May 2004 18:49:55 -0000 1.21 --- sfx.cpp 16 May 2004 02:29:41 -0000 1.22 *************** *** 341,344 **** --- 341,347 ---- return; + if(!p->getBufferSize()) + return; + mInitialBuffer = p; if(mSourceIndex != -1) Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** masterConnection.cpp 14 May 2004 00:33:38 -0000 1.8 --- masterConnection.cpp 16 May 2004 02:29:41 -0000 1.9 *************** *** 200,204 **** } ! void MasterServerConnection::onConnectionEstablished(bool isInitiator) { } --- 200,204 ---- } ! void MasterServerConnection::onConnectionEstablished() { } Index: masterConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** masterConnection.h 12 May 2004 01:38:00 -0000 1.2 --- masterConnection.h 16 May 2004 02:29:41 -0000 1.3 *************** *** 63,67 **** void writeConnectRequest(BitStream *bstream); ! void onConnectionEstablished(bool isInitiator); TNL_DECLARE_NETCONNECTION(MasterServerConnection); --- 63,67 ---- void writeConnectRequest(BitStream *bstream); ! void onConnectionEstablished(); TNL_DECLARE_NETCONNECTION(MasterServerConnection); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ship.cpp 14 May 2004 00:33:38 -0000 1.29 --- ship.cpp 16 May 2004 02:29:41 -0000 1.30 *************** *** 68,85 **** mTrail[i].reset(); ! mEnergy = 100.f; mShield = false; mTurbo = false; mCooldown = false; - mTurboNoise = NULL; } ! Ship::~Ship() { ! if(mTurboNoise.isValid()) ! { ! mTurboNoise->setGain(0.f); ! mTurboNoise->stop(); ! } } --- 68,82 ---- mTrail[i].reset(); ! mEnergy = EnergyMax; mShield = false; mTurbo = false; mCooldown = false; } ! void Ship::onGhostRemove() { ! Parent::onGhostRemove(); ! mTurbo = false; ! updateTurboNoise(); } *************** *** 169,225 **** } } ! if(mTurbo != theMove->boost || mShield != theMove->shield) setMaskBits(PowersMask); ! mShield = theMove->shield; ! mTurbo = theMove->boost; burnEnergy(theMove->time); updateExtent(); } void Ship::burnEnergy( U32 dT ) { // if(isGhost()) return; ! F32 scaleFactor = ((F32)dT) / 1000.f; // Update things based on available energy... ! if(mEnergy <= 5.f || mCooldown) { mShield = false; mTurbo = false; - mCooldown = true; - } - - if(mCooldown && mEnergy >= 15.f) - { - mCooldown = false; } if(mShield) ! { ! mEnergy -= 15.0f * scaleFactor; ! } if(mTurbo) ! { ! mEnergy -= 15.0f * scaleFactor; ! } ! if(mEnergy < 100.f) { // If we're not doing anything, recharge. if(!(mShield || mTurbo)) ! mEnergy += (F32)(dT * RechargeRate) / 1000.f; ! if(mEnergy < 0.f) ! mEnergy = 0.f; } ! if(mEnergy >= 100.f) ! mEnergy = 100.f; } --- 166,277 ---- } } + bool shield = mShield, turbo = mTurbo; + mShield = theMove->shield; + mTurbo = theMove->boost; + burnEnergy(theMove->time); ! if(mTurbo != turbo || mShield != shield) setMaskBits(PowersMask); ! updateExtent(); ! } ! ! void Ship::processClientMove(Move *theMove, bool replay) ! { ! if(!hasExploded) ! processMove(theMove, ActualState); ! else ! return; + updateInterpolation(theMove->time); + lastMove = *theMove; + + mShield = theMove->shield; + mTurbo = theMove->boost; burnEnergy(theMove->time); + + SFXObject::setListenerParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); + if(!replay) + { + // Emit some particles + emitMovementSparks(theMove->time); + for(U32 i=0; i<TrailCount; i++) + mTrail[i].tick(theMove->time); + updateTurboNoise(); + } + } + + void Ship::processServer(U32 deltaT) + { + lastMove.time = deltaT; + if(isControlled()) + processMove(&lastMove, RenderState); + else + { + processMove(&lastMove, ActualState); + mMoveState[RenderState] = mMoveState[ActualState]; + setMaskBits(PositionMask); + } updateExtent(); } + void Ship::processClient(U32 deltaT) + { + lastMove.time = deltaT; + processMove(&lastMove, ActualState); + updateInterpolation(deltaT); + // Emit some particles + emitMovementSparks(deltaT); + + for(U32 i=0; i<TrailCount; i++) + mTrail[i].tick(deltaT); + + // Update the turbo noise + updateTurboNoise(); + } + void Ship::burnEnergy( U32 dT ) { // if(isGhost()) return; ! F32 scaleFactor = dT * 0.001; // Update things based on available energy... ! ! if(mEnergy > EnergyCooldownThreshold) ! mCooldown = false; ! ! if(mCooldown) { mShield = false; mTurbo = false; } if(mShield) ! mEnergy -= EnergyShieldDrain * scaleFactor; if(mTurbo) ! mEnergy -= EnergyTurboDrain * scaleFactor; + if(!mShield && !mTurbo && mEnergy <= EnergyCooldownThreshold) + mCooldown = true; ! if(mEnergy < EnergyMax) { // If we're not doing anything, recharge. if(!(mShield || mTurbo)) ! mEnergy += EnergyRechargeRate * scaleFactor; ! if(mEnergy <= 0) ! { ! mEnergy = 0; ! mShield = false; ! mTurbo = false; ! mCooldown = true; ! } } ! if(mEnergy >= EnergyMax) ! mEnergy = EnergyMax; } *************** *** 247,286 **** } ! void Ship::processClientMove(Move *theMove, bool replay) { ! if(!hasExploded) ! processMove(theMove, ActualState); else ! return; ! ! updateInterpolation(theMove->time); ! lastMove = *theMove; ! ! // Emit some particles ! emitMovementSparks(theMove->time); ! ! for(U32 i=0; i<TrailCount; i++) ! mTrail[i].tick(theMove->time); ! ! SFXObject::setListenerParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); ! ! if(mTurboNoise) ! mTurboNoise->setMovementParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); } - void Ship::processClient(U32 deltaT) - { - lastMove.time = deltaT; - processMove(&lastMove, ActualState); - updateInterpolation(deltaT); - // Emit some particles - emitMovementSparks(deltaT); - - for(U32 i=0; i<TrailCount; i++) - mTrail[i].tick(deltaT); - - if(mTurboNoise) - mTurboNoise->setMovementParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); - } void Ship::updateInterpolation(U32 deltaT) --- 299,322 ---- } ! ! void Ship::updateTurboNoise() { ! if(mTurbo) ! { ! if(mTurboNoise.isValid()) ! mTurboNoise->setMovementParams(mMoveState[RenderState].pos, mMoveState[RenderState].vel); ! else ! mTurboNoise = SFXObject::play(SFXShipTurbo, mMoveState[RenderState].pos, mMoveState[RenderState].vel); ! } else ! { ! if(mTurboNoise.isValid()) ! { ! mTurboNoise->stop(); ! mTurboNoise = 0; ! } ! } } void Ship::updateInterpolation(U32 deltaT) *************** *** 345,363 **** } - void Ship::processServer(U32 deltaT) - { - lastMove.time = deltaT; - if(isControlled()) - processMove(&lastMove, RenderState); - else - { - processMove(&lastMove, ActualState); - mMoveState[RenderState] = mMoveState[ActualState]; - setMaskBits(PositionMask); - } - burnEnergy(deltaT); - updateExtent(); - } - void Ship::writeControlState(BitStream *stream) { --- 381,384 ---- *************** *** 367,373 **** stream->write(mMoveState[ActualState].vel.x); stream->write(mMoveState[ActualState].vel.y); ! stream->write(mEnergy); ! stream->writeFlag(mTurbo); ! stream->writeFlag(mShield); } --- 388,393 ---- stream->write(mMoveState[ActualState].vel.x); stream->write(mMoveState[ActualState].vel.y); ! stream->writeRangedU32(mEnergy, 0, EnergyMax); ! stream->writeFlag(mCooldown); } *************** *** 379,385 **** stream->read(&mMoveState[ActualState].vel.x); stream->read(&mMoveState[ActualState].vel.y); ! stream->read(&mEnergy); ! mTurbo = stream->readFlag(); ! mShield = stream->readFlag(); Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; --- 399,404 ---- stream->read(&mMoveState[ActualState].vel.x); stream->read(&mMoveState[ActualState].vel.y); ! mEnergy = stream->readRangedU32(0, EnergyMax); ! mCooldown = stream->readFlag(); Point delta = mMoveState[ActualState].pos - mMoveState[RenderState].pos; *************** *** 393,407 **** else interpTime = 1; ! ! // Update the turbo noise ! if(mTurbo && mTurboNoise.isNull()) ! mTurboNoise = SFXObject::play(SFXShipTurbo, mMoveState[RenderState].pos, mMoveState[RenderState].vel); ! ! if(!mTurbo && mTurboNoise.isValid()) ! { ! mTurboNoise->setGain(0); ! mTurboNoise->stop(); ! mTurboNoise = NULL; ! } } --- 412,416 ---- else interpTime = 1; ! logprintf("got a CU %g %g.", mMoveState[ActualState].pos.x, mMoveState[ActualState].pos.y); } *************** *** 433,442 **** stream->writeFloat(mHealth, 6); - if(stream->writeFlag(updateMask & PowersMask)) - { - stream->writeFlag(mTurbo); - stream->writeFlag(mShield); - } - stream->writeFlag(hasExploded); --- 442,445 ---- *************** *** 448,451 **** --- 451,455 ---- stream->writeFlag(false); stream->writeFlag(false); + stream->writeFlag(false); } else *************** *** 461,464 **** --- 465,473 ---- lastMove.pack(stream, NULL); } + if(stream->writeFlag(updateMask & PowersMask)) + { + stream->writeFlag(mTurbo); + stream->writeFlag(mShield); + } } return 0; *************** *** 494,503 **** mHealth = stream->readFloat(6); - if(stream->readFlag()) - { - mTurbo = stream->readFlag(); - mShield = stream->readFlag(); - } - bool explode = stream->readFlag(); --- 503,506 ---- *************** *** 514,517 **** --- 517,526 ---- lastMove.unpack(stream); } + if(stream->readFlag()) + { + mTurbo = stream->readFlag(); + mShield = stream->readFlag(); + } + mMoveState[ActualState].angle = lastMove.angle; *************** *** 544,558 **** emitShipExplosion(mMoveState[ActualState].pos); } - - // Update the turbo noise - if(mTurbo && mTurboNoise.isNull()) - mTurboNoise = SFXObject::play(SFXShipTurbo, mMoveState[RenderState].pos, mMoveState[RenderState].vel); - - if(!mTurbo && mTurboNoise.isValid()) - { - mTurboNoise->setGain(0); - mTurboNoise->stop(); - mTurboNoise = NULL; - } } --- 553,556 ---- |
From: Mark F. <mar...@us...> - 2004-05-16 02:29:50
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7085/tnl Modified Files: netConnection.cpp netInterface.cpp tnlNetConnection.h tnlNetInterface.h Log Message: Cleaned up disconnection processes on NetConnection to all go through a single call point - onConnectionTerminated Cleaned up failed connect processes on NetConnection to all go through a single call point - onConnectTerminated Fixed energy system on Zap ships to use integer energy Fixed energy system on Zap ships to use client-side prediction appropriately Fixed bug in move pack/repacking Index: netInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** netInterface.cpp 11 May 2004 18:26:24 -0000 1.3 --- netInterface.cpp 16 May 2004 02:29:41 -0000 1.4 *************** *** 64,68 **** { NetConnection *c = mConnectionList[0]; ! disconnect(c, "Shutdown"); } } --- 64,68 ---- { NetConnection *c = mConnectionList[0]; ! disconnect(c, NetConnection::ReasonSelfDisconnect, "Shutdown"); } } *************** *** 148,152 **** NetConnection *temp = findConnection(connection->getNetAddress()); if(temp) ! disconnect(temp, "Reconnecting"); // hang on to the connection and add it to the pending connection list --- 148,152 ---- NetConnection *temp = findConnection(connection->getNetAddress()); if(temp) ! disconnect(temp, NetConnection::ReasonSelfDisconnect, "Reconnecting"); // hang on to the connection and add it to the pending connection list *************** *** 332,336 **** { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTimedOut(); removePendingConnection(pending); continue; --- 332,336 ---- { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removePendingConnection(pending); continue; *************** *** 345,349 **** { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTimedOut(); removePendingConnection(pending); continue; --- 345,349 ---- { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removePendingConnection(pending); continue; *************** *** 363,367 **** { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTimedOut(); removePendingConnection(pending); continue; --- 363,367 ---- { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removePendingConnection(pending); continue; *************** *** 374,378 **** { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTimedOut(); removePendingConnection(pending); } --- 374,378 ---- { pending->setConnectionState(NetConnection::ConnectTimedOut); ! pending->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removePendingConnection(pending); } *************** *** 386,390 **** { mConnectionList[i]->setConnectionState(NetConnection::TimedOut); ! mConnectionList[i]->onTimedOut(); removeConnection(mConnectionList[i]); } --- 386,390 ---- { mConnectionList[i]->setConnectionState(NetConnection::TimedOut); ! mConnectionList[i]->onConnectTerminated(NetConnection::ReasonTimedOut, "Timeout"); removeConnection(mConnectionList[i]); } *************** *** 752,756 **** if(connect) ! disconnect(connect, "NewConnection"); char connectionClass[256]; --- 752,756 ---- if(connect) ! disconnect(connect, NetConnection::ReasonSelfDisconnect, "NewConnection"); char connectionClass[256]; *************** *** 780,784 **** addConnection(conn); conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(false); sendConnectAccept(conn); } --- 780,784 ---- addConnection(conn); conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(); sendConnectAccept(conn); } *************** *** 857,861 **** conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(true); // notify the connection that it has been established TNLLogMessageV(LogNetInterface, ("Received Connect Accept - connection established.")); } --- 857,861 ---- conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(); // notify the connection that it has been established TNLLogMessageV(LogNetInterface, ("Received Connect Accept - connection established.")); } *************** *** 910,914 **** conn->setConnectionState(NetConnection::ConnectRejected); ! conn->onConnectionRejected(reason); removePendingConnection(conn); } --- 910,914 ---- conn->setConnectionState(NetConnection::ConnectRejected); ! conn->onConnectTerminated(NetConnection::ReasonRemoteHostRejectedConnection, reason); removePendingConnection(conn); } *************** *** 1173,1177 **** if(oldConnection) ! disconnect(oldConnection, ""); conn->setNetAddress(theAddress); --- 1173,1177 ---- if(oldConnection) ! disconnect(oldConnection, NetConnection::ReasonSelfDisconnect, ""); conn->setNetAddress(theAddress); *************** *** 1190,1194 **** removePendingConnection(conn); conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(false); sendConnectAccept(conn); } --- 1190,1194 ---- removePendingConnection(conn); conn->setConnectionState(NetConnection::Connected); ! conn->onConnectionEstablished(); sendConnectAccept(conn); } *************** *** 1198,1209 **** //----------------------------------------------------------------------------- ! void NetInterface::disconnect(NetConnection *conn, const char *reason) { if(conn->getConnectionState() == NetConnection::AwaitingChallengeResponse || conn->getConnectionState() == NetConnection::AwaitingConnectResponse) removePendingConnection(conn); else if(conn->getConnectionState() == NetConnection::Connected) { conn->setConnectionState(NetConnection::Disconnected); if(conn->isNetworkConnection()) { --- 1198,1213 ---- //----------------------------------------------------------------------------- ! void NetInterface::disconnect(NetConnection *conn, NetConnection::TerminationReason reason, const char *reasonString) { if(conn->getConnectionState() == NetConnection::AwaitingChallengeResponse || conn->getConnectionState() == NetConnection::AwaitingConnectResponse) + { + conn->onConnectTerminated(reason, reasonString); removePendingConnection(conn); + } else if(conn->getConnectionState() == NetConnection::Connected) { conn->setConnectionState(NetConnection::Disconnected); + conn->onConnectionTerminated(reason, reasonString); if(conn->isNetworkConnection()) { *************** *** 1216,1220 **** U32 encryptPos = out.getBytePosition(); out.setBytePosition(encryptPos); ! out.writeString(reason); if(theParams.mUsingCrypto) --- 1220,1224 ---- U32 encryptPos = out.getBytePosition(); out.setBytePosition(encryptPos); ! out.writeString(reasonString); if(theParams.mUsingCrypto) *************** *** 1258,1262 **** conn->setConnectionState(NetConnection::Disconnected); ! conn->onDisconnect(reason); removeConnection(conn); } --- 1262,1266 ---- conn->setConnectionState(NetConnection::Disconnected); ! conn->onConnectionTerminated(NetConnection::ReasonRemoteDisconnectPacket, reason); removeConnection(conn); } *************** *** 1264,1269 **** void NetInterface::handleConnectionError(NetConnection *theConnection, const char *errorString) { ! theConnection->onConnectionError(errorString); ! disconnect(theConnection, errorString); } --- 1268,1272 ---- void NetInterface::handleConnectionError(NetConnection *theConnection, const char *errorString) { ! disconnect(theConnection, NetConnection::ReasonError, errorString); } Index: tnlNetConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tnlNetConnection.h 24 Apr 2004 23:52:33 -0000 1.3 --- tnlNetConnection.h 16 May 2004 02:29:41 -0000 1.4 *************** *** 109,112 **** --- 109,113 ---- ConnectionParameters() { + mIsInitiator = false; mPuzzleRetried = false; mUsingCrypto = false; *************** *** 199,208 **** protected: ! virtual void onTimedOut(); ///< Called when this instance is unable to elicit a response from the remote host for the timeout period. ! virtual void onConnectTimedOut(); ///< Called when the attempt to connect to a remote host fails due to lack of response. ! virtual void onDisconnect(const char *reason); ///< Called when the remote host issues a disconnect packet to this instance. ! 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. --- 200,217 ---- protected: ! enum TerminationReason { ! ReasonTimedOut, ! ReasonFailedConnectHandshake, ! ReasonRemoteHostRejectedConnection, ! ReasonRemoteDisconnectPacket, ! ReasonDuplicateConnectionAttempt, ! ReasonSelfDisconnect, ! ReasonError, ! }; ! ! virtual void onConnectTerminated(TerminationReason reason, const char *rejectionString); ///< Called when a pending connection is terminated ! virtual void onConnectionTerminated(TerminationReason, const char *errorDisconnectString); ///< Called when this established connection is terminated for any reason ! virtual void onConnectionEstablished(); ///< Called when the connection is successfully established with the remote host. ! /// validates that the given certificate is a valid certificate for this /// connection. *************** *** 397,400 **** --- 406,411 ---- ConnectionParameters &getConnectionParameters() { return mConnectionParameters; } + /// returns true if this object initiated the connection with the remote host + bool isInitiator() { return mConnectionParameters.mIsInitiator; } void setRemoteConnectionObject(NetConnection *connection) { mRemoteConnection = connection; }; Index: netConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netConnection.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** netConnection.cpp 13 May 2004 01:45:50 -0000 1.4 --- netConnection.cpp 16 May 2004 02:29:41 -0000 1.5 *************** *** 746,754 **** //---------------------------------------------------------------------------- - void NetConnection::onTimedOut() - { - - } - void NetConnection::setInterface(NetInterface *myInterface) { --- 746,749 ---- *************** *** 770,773 **** --- 765,769 ---- mConnectionParameters.mRequestKeyExchange = requestKeyExchange; mConnectionParameters.mRequestCertificate = requestCertificate; + mConnectionParameters.mIsInitiator = true; setNetAddress(address); *************** *** 792,817 **** } - void NetConnection::onConnectTimedOut() - { - - } - void NetConnection::disconnect(const char *reason) { ! mInterface->disconnect(this, reason); ! } ! ! void NetConnection::onDisconnect(const char *reason) ! { ! reason; ! } ! ! void NetConnection::onConnectionRejected(const char *reason) ! { } ! void NetConnection::onConnectionEstablished(bool isInitiator) { ! if(isInitiator) setIsConnectionToServer(); else --- 788,799 ---- } void NetConnection::disconnect(const char *reason) { ! mInterface->disconnect(this, ReasonSelfDisconnect, reason); } ! void NetConnection::onConnectionEstablished() { ! if(isInitiator()) setIsConnectionToServer(); else *************** *** 819,825 **** } ! void NetConnection::onConnectionError(const char *errorString) { } --- 801,810 ---- } ! void NetConnection::onConnectionTerminated(TerminationReason, const char *) { + } + void NetConnection::onConnectTerminated(TerminationReason, const char *) + { } *************** *** 867,870 **** --- 852,857 ---- client->setInterface(connectionInterface); + client->getConnectionParameters().mIsInitiator = true; + server->setInterface(serverInterface); *************** *** 890,895 **** server->setConnectionState(NetConnection::Connected); ! client->onConnectionEstablished(true); ! server->onConnectionEstablished(false); connectionInterface->addConnection(client); serverInterface->addConnection(server); --- 877,882 ---- server->setConnectionState(NetConnection::Connected); ! client->onConnectionEstablished(); ! server->onConnectionEstablished(); connectionInterface->addConnection(client); serverInterface->addConnection(server); Index: tnlNetInterface.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetInterface.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tnlNetInterface.h 24 Apr 2004 23:52:33 -0000 1.2 --- tnlNetInterface.h 16 May 2004 02:29:41 -0000 1.3 *************** *** 28,33 **** --- 28,39 ---- #define _TNL_NETINTERFACE_H_ + #ifndef _TNL_VECTOR_H_ #include "tnlVector.h" + #endif + + #ifndef _TNL_NETBASE_H_ #include "tnlNetBase.h" + #endif + #include "tnlClientPuzzle.h" *************** *** 36,39 **** --- 42,49 ---- #endif + #ifndef _TNL_NETCONNECTION_H_ + #include "tnlNetConnection.h" + #endif + namespace TNL { *************** *** 306,309 **** --- 316,322 ---- /// Handles an error reported while reading a packet from this remote connection. void handleConnectionError(NetConnection *theConnection, const char *errorString); + + /// Disconnects the given connection and removes it from the NetInterface + void disconnect(NetConnection *conn, NetConnection::TerminationReason reason, const char *reasonString); /// @} public: *************** *** 359,365 **** void processConnections(); - /// Disconnects the given connection and removes it from the NetInterface - void disconnect(NetConnection *conn, const char *reason); - /// Returns the list of connections on this NetInterface. Vector<NetConnection *> &getConnectionList() { return mConnectionList; } --- 372,375 ---- |
From: Mark F. <mar...@us...> - 2004-05-16 02:29:49
|
Update of /cvsroot/opentnl/tnl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7085/test Modified Files: testGame.cpp testGame.h Log Message: Cleaned up disconnection processes on NetConnection to all go through a single call point - onConnectionTerminated Cleaned up failed connect processes on NetConnection to all go through a single call point - onConnectTerminated Fixed energy system on Zap ships to use integer energy Fixed energy system on Zap ships to use client-side prediction appropriately Fixed bug in move pack/repacking Index: testGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testGame.h 6 May 2004 00:33:38 -0000 1.2 --- testGame.h 16 May 2004 02:29:40 -0000 1.3 *************** *** 231,255 **** SafePtr<Player> myPlayer; ! /// onTimedOut is called when the connection to the server or client has been ! /// terminated due to a lack of network traffic from the remote host. ! /// When a TestConnection to a server times out, the client's network interface ! /// is notified so it can begin searching for another server to connect to. ! void onTimedOut(); ! ! /// onConnectTimedOut is called when the connection request to the server ! /// is unable to complete due to connection timeout. ! /// When a TestConnection connect request to a server times out, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectTimedOut(); ! /// onDisconnect is called when the remote host has terminated the connection. /// When a TestConnection to a server is disconnected, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onDisconnect(const char *reason); /// onConnectionEstablished is called on both ends of a connection when the connection is established. /// On the server this will create a player for this client, and set it as the client's /// scope object. On both sides this will set the proper ghosting behavior for the connection (ie server to client). ! void onConnectionEstablished(bool isInitiator); /// Remote function that client calls to set the position of the player on the server. --- 231,250 ---- SafePtr<Player> myPlayer; ! /// onConnectTerminated is called when the connection request to the server ! /// is unable to complete due to server rejection, timeout or other error. ! /// When a TestConnection connect request to a server is terminated, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectTerminated(NetConnection::TerminationReason reason, const char *rejectionString); ! /// onConnectionTerminated is called when an established connection is terminated, whether ! /// from the local or remote hosts explicitly disconnecting, timing out or network error. /// When a TestConnection to a server is disconnected, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectionTerminated(NetConnection::TerminationReason reason, const char *string); /// onConnectionEstablished is called on both ends of a connection when the connection is established. /// On the server this will create a player for this client, and set it as the client's /// scope object. On both sides this will set the proper ghosting behavior for the connection (ie server to client). ! void onConnectionEstablished(); /// Remote function that client calls to set the position of the player on the server. Index: testGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testGame.cpp 6 May 2004 00:33:38 -0000 1.2 --- testGame.cpp 16 May 2004 02:29:40 -0000 1.3 *************** *** 390,412 **** } ! void TestConnection::onTimedOut() ! { ! logprintf("%s - connection to %s timed out.", getNetAddressString(), isConnectionToServer() ? "server" : "client" ); ! ! // if this is a client to server connection, set us back to pinging servers. ! if(isConnectionToServer()) ! ((TestNetInterface *) getInterface())->pingingServers = true; ! else ! delete (Player*)myPlayer; // delete the client's player object. ! } ! ! void TestConnection::onConnectTimedOut() { ((TestNetInterface *) getInterface())->pingingServers = true; } ! void TestConnection::onDisconnect(const char *reason) { ! logprintf("%s - %s disconnected.", getNetAddressString(), isConnectionToServer() ? "server" : "client" ); if(isConnectionToServer()) --- 390,401 ---- } ! void TestConnection::onConnectTerminated(NetConnection::TerminationReason reason, const char *string) { ((TestNetInterface *) getInterface())->pingingServers = true; } ! void TestConnection::onConnectionTerminated(NetConnection::TerminationReason reason, const char *edString) { ! logprintf("%s - %s connection terminated - reason %d.", getNetAddressString(), isConnectionToServer() ? "server" : "client", reason); if(isConnectionToServer()) *************** *** 416,425 **** } ! void TestConnection::onConnectionEstablished(bool isInitiator) { // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection // to "server" and the non-initiator to be a connnection to "client" ! Parent::onConnectionEstablished(isInitiator); // To see how this program performs with 50% packet loss, --- 405,414 ---- } ! void TestConnection::onConnectionEstablished() { // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection // to "server" and the non-initiator to be a connnection to "client" ! Parent::onConnectionEstablished(); // To see how this program performs with 50% packet loss, |
From: Mark F. <mar...@us...> - 2004-05-16 02:29:49
|
Update of /cvsroot/opentnl/tnl/masterclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7085/masterclient Modified Files: main.cpp Log Message: Cleaned up disconnection processes on NetConnection to all go through a single call point - onConnectionTerminated Cleaned up failed connect processes on NetConnection to all go through a single call point - onConnectTerminated Fixed energy system on Zap ships to use integer energy Fixed energy system on Zap ships to use client-side prediction appropriately Fixed bug in move pack/repacking Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/masterclient/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 20 Apr 2004 04:27:15 -0000 1.1 --- main.cpp 16 May 2004 02:29:40 -0000 1.2 *************** *** 117,121 **** } ! void onConnectionEstablished(bool isInitiator) { logprintf("connection to %s - %s established.", isInitiator ? "server" : "client", getNetAddress().toString()); --- 117,121 ---- } ! void onConnectionEstablished() { logprintf("connection to %s - %s established.", isInitiator ? "server" : "client", getNetAddress().toString()); *************** *** 123,127 **** // If we're a server (ie, being connected to by the client) add this new connection to // our list of clients. ! if(!isInitiator) linkToClientList(); } --- 123,127 ---- // If we're a server (ie, being connected to by the client) add this new connection to // our list of clients. ! if(!isInitiator()) linkToClientList(); } *************** *** 145,161 **** // Various things that should trigger us to try another server... ! void onConnectTimedOut() ! { ! GameConnectionDone(); ! } ! ! void onDisconnect(const char *reason) { - logprintf("Remote host disconnected - %s", reason); GameConnectionDone(); } ! void onTimedOut() { GameConnectionDone(); } --- 145,156 ---- // Various things that should trigger us to try another server... ! void onConnectTerminated(NetConnection::TerminationReason, const char *) { GameConnectionDone(); } ! void onConnectionTerminated(NetConnection::TerminationReason, const char *reason) { + logprintf("Connection to remote host terminated - %s", reason); GameConnectionDone(); } *************** *** 357,361 **** } ! void onConnectionEstablished(bool isInitiator) { if(!gIsServer) --- 352,356 ---- } ! void onConnectionEstablished() { if(!gIsServer) |
From: Mark F. <mar...@us...> - 2004-05-14 22:16:23
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17584/zap Modified Files: game.h Log Message: Added vc6 projects as binary Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** game.h 14 May 2004 01:34:17 -0000 1.22 --- game.h 14 May 2004 22:16:11 -0000 1.23 *************** *** 212,216 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.1 rc 1" }; --- 212,216 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.1 rc 2" }; |
From: Ben G. <s_a...@us...> - 2004-05-14 22:02:28
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15222/exe Modified Files: credits.txt Log Message: Added Joe, Alex, Clark, Brian to credits as testers. Index: credits.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/credits.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** credits.txt 30 Apr 2004 21:36:05 -0000 1.2 --- credits.txt 14 May 2004 22:02:19 -0000 1.3 *************** *** 8,10 **** Ben Garney Programmer ! Robert Blanchet \ No newline at end of file --- 8,14 ---- Ben Garney Programmer ! Robert Blanchet ! Internal Testers ! Alex Swanson, Brian Ramage ! External Testers ! Clark Fagot, Joe Maruschak \ No newline at end of file |
From: Mark F. <mar...@us...> - 2004-05-14 19:57:02
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20900/zap Added Files: zap.dsp Log Message: Added vc6 projects as binary --- NEW FILE: zap.dsp --- # Microsoft Developer Studio Project File - Name="zap" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=zap - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "zap.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "zap.mak" CFG="zap - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "zap - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "zap - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "zap - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "zap___Win32_Release" # PROP BASE Intermediate_Dir "zap___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "zap___Win32_Release" # PROP Intermediate_Dir "zap___Win32_Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GR /GX /Zi /O2 /I "../tnl" /I "../glut" /I "../openal" /I "c:/dxsdk/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TNL_ENABLE_LOGGING" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 dsound.lib dinput.lib dinput8.lib dxguid.lib ../openal/alut.lib ../openal/openal32.lib wsock32.lib opengl32.lib glu32.lib ../glut/glut32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../exe/zap.exe" /libpath:"c:/dxsdk/lib" !ELSEIF "$(CFG)" == "zap - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "zap___Win32_Debug" # PROP BASE Intermediate_Dir "zap___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "zap___Win32_Debug" # PROP Intermediate_Dir "zap___Win32_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "../tnl" /I "../glut" /I "../openal" /I "c:/dxsdk/include" /D "TNL_DEBUG" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 dsound.lib dinput.lib dinput8.lib dxguid.lib ../openal/alut.lib ../openal/openal32.lib wsock32.lib opengl32.lib glu32.lib ../glut/glut32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../exe/zapd.exe" /pdbtype:sept /libpath:"c:/dxsdk/lib" !ENDIF # Begin Target # Name "zap - Win32 Release" # Name "zap - Win32 Debug" # Begin Source File SOURCE=.\barrier.cpp # End Source File # Begin Source File SOURCE=.\barrier.h # End Source File # Begin Source File SOURCE=.\collision.h # End Source File # Begin Source File SOURCE=.\controlObjectConnection.cpp # End Source File # Begin Source File SOURCE=.\controlObjectConnection.h # End Source File # Begin Source File SOURCE=.\CTFGame.cpp # End Source File # Begin Source File SOURCE=.\CTFGame.h # End Source File # Begin Source File SOURCE=.\game.cpp # End Source File # Begin Source File SOURCE=.\game.h # End Source File # Begin Source File SOURCE=.\gameConnection.cpp # End Source File # Begin Source File SOURCE=.\gameConnection.h # End Source File # Begin Source File SOURCE=.\gameItems.cpp # End Source File # Begin Source File SOURCE=.\gameLoader.cpp # End Source File # Begin Source File SOURCE=.\gameLoader.h # End Source File # Begin Source File SOURCE=.\gameNetInterface.cpp # End Source File # Begin Source File SOURCE=.\gameNetInterface.h # End Source File # Begin Source File SOURCE=.\gameObject.cpp # End Source File # Begin Source File SOURCE=.\gameObject.h # End Source File # Begin Source File SOURCE=.\gameType.cpp # End Source File # Begin Source File SOURCE=.\gameType.h # End Source File # Begin Source File SOURCE=.\gridDB.cpp # End Source File # Begin Source File SOURCE=.\gridDB.h # End Source File # Begin Source File SOURCE=.\gsm.h # End Source File # Begin Source File SOURCE=.\gsm_decode.c # End Source File # Begin Source File SOURCE=.\gsm_encode.c # End Source File # Begin Source File SOURCE=.\gsm_state.c # End Source File # Begin Source File SOURCE=.\item.cpp # End Source File # Begin Source File SOURCE=.\item.h # End Source File # Begin Source File SOURCE=.\lpc10.h # End Source File # Begin Source File SOURCE=.\lpc10dec.c # End Source File # Begin Source File SOURCE=.\lpc10enc.c # End Source File # Begin Source File SOURCE=.\main.cpp # End Source File # Begin Source File SOURCE=.\masterConnection.cpp # End Source File # Begin Source File SOURCE=.\masterConnection.h # End Source File # Begin Source File SOURCE=..\master\masterInterface.cpp # End Source File # Begin Source File SOURCE=.\moveObject.cpp # End Source File # Begin Source File SOURCE=.\moveObject.h # End Source File # Begin Source File SOURCE=.\point.h # End Source File # Begin Source File SOURCE=.\projectile.cpp # End Source File # Begin Source File SOURCE=.\projectile.h # End Source File # Begin Source File SOURCE=.\quickChat.cpp # End Source File # Begin Source File SOURCE=.\quickChat.h # End Source File # Begin Source File SOURCE=.\sfx.cpp # End Source File # Begin Source File SOURCE=.\sfx.h # End Source File # Begin Source File SOURCE=.\ship.cpp # End Source File # Begin Source File SOURCE=.\ship.h # End Source File # Begin Source File SOURCE=.\soccerGame.cpp # End Source File # Begin Source File SOURCE=.\sparkManager.cpp # End Source File # Begin Source File SOURCE=.\sparkManager.h # End Source File # Begin Source File SOURCE=.\SweptEllipsoid.cpp # End Source File # Begin Source File SOURCE=.\SweptEllipsoid.h # End Source File # Begin Source File SOURCE=.\teleporter.cpp # End Source File # Begin Source File SOURCE=.\teleporter.h # End Source File # Begin Source File SOURCE=.\UI.cpp # End Source File # Begin Source File SOURCE=.\UI.h # End Source File # Begin Source File SOURCE=.\UICredits.cpp # End Source File # Begin Source File SOURCE=.\UiCredits.h # End Source File # Begin Source File SOURCE=.\UIGame.cpp # End Source File # Begin Source File SOURCE=.\UIGame.h # End Source File # Begin Source File SOURCE=.\UIMenus.cpp # End Source File # Begin Source File SOURCE=.\UIMenus.h # End Source File # Begin Source File SOURCE=.\UINameEntry.cpp # End Source File # Begin Source File SOURCE=.\UINameEntry.h # End Source File # Begin Source File SOURCE=.\UIQueryServers.cpp # End Source File # Begin Source File SOURCE=.\UIQueryServers.h # End Source File # Begin Source File SOURCE=.\voiceCodec.cpp # End Source File # Begin Source File SOURCE=.\voiceCodec.h # End Source File # Begin Source File SOURCE=.\winJoystick.cpp # End Source File # End Target # End Project |