[Opentnl-cvs] tnl/zap main.cpp,1.6,1.7 ship.h,1.1,1.2
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ben G. <s_a...@us...> - 2004-04-21 23:50:59
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11362/zap Modified Files: main.cpp ship.h Log Message: Added a file logger. Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ship.h 20 Apr 2004 04:27:20 -0000 1.1 --- ship.h 21 Apr 2004 23:47:34 -0000 1.2 *************** *** 69,72 **** --- 69,74 ---- bool hasExploded; + StringTableEntry mPlayerName; + Move lastMove; // last client input move for this ship *************** *** 75,79 **** void render(); ! Ship(Point p = Point(0,0), Color c = Color(), F32 m = 1.0); void kill(); --- 77,81 ---- void render(); ! Ship(StringTableEntry playerName="", Point p = Point(0,0), Color c = Color(), F32 m = 1.0); void kill(); Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.cpp 21 Apr 2004 22:40:43 -0000 1.6 --- main.cpp 21 Apr 2004 23:47:34 -0000 1.7 *************** *** 176,179 **** --- 176,201 ---- } gStdoutLogConsumer; + class FileLogConsumer : public LogConsumer + { + private: + FILE *f; + public: + FileLogConsumer(const char* logFile="zap.log") + { + f = fopen(logFile, "w"); + logString("------ Zap Log File ------"); + } + + ~FileLogConsumer() + { + fclose(f); + } + + void logString(const char *string) + { + fprintf(f, "%s\r\n", string); + } + } gFileLogConsumer; + void hostGame(bool dedicated, Address bindAddress) { *************** *** 186,189 **** --- 208,212 ---- } + void joinGame(Address remoteAddress, bool isFromMaster, bool local) { |