You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rene S. <sa...@us...> - 2004-09-04 09:01:11
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1854/src/jake2/game Modified Files: SuperAdapter.java PlayerClient.java Log Message: debug messages clean up, shotgun switched back to blaster. Index: PlayerClient.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerClient.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlayerClient.java 20 Aug 2004 21:29:58 -0000 1.4 --- PlayerClient.java 4 Sep 2004 09:01:01 -0000 1.5 *************** *** 305,309 **** gitem_t item; - //memset(& client.pers, 0, sizeof(client.pers)); client.pers = new client_persistant_t(); --- 305,308 ---- *************** *** 312,319 **** client.pers.inventory[client.pers.selected_item] = 1; item = FindItem("Shotgun"); client.pers.selected_item = ITEM_INDEX(item); client.pers.inventory[client.pers.selected_item] = 1; ! client.pers.weapon = item; --- 311,320 ---- client.pers.inventory[client.pers.selected_item] = 1; + /* Give shotgun. item = FindItem("Shotgun"); client.pers.selected_item = ITEM_INDEX(item); client.pers.inventory[client.pers.selected_item] = 1; ! */ ! client.pers.weapon = item; Index: SuperAdapter.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/SuperAdapter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SuperAdapter.java 20 Aug 2004 21:29:58 -0000 1.2 --- SuperAdapter.java 4 Sep 2004 09:01:01 -0000 1.3 *************** *** 44,48 **** public static SuperAdapter getFromID(String key) { - System.out.println("SuperAdapter.getFromID(\"" + key + "\")"); SuperAdapter sa = (SuperAdapter) adapters.get(key); --- 44,47 ---- *************** *** 50,54 **** if (sa == null) { ! System.out.println("adapter not found:" + key); int pos = key.indexOf('$'); String classname = key; --- 49,53 ---- if (sa == null) { ! Com.DPrintf("SuperAdapter.getFromID():adapter not found->" + key + "\n"); int pos = key.indexOf('$'); String classname = key; *************** *** 59,68 **** try { ! System.err.println("loading class " + classname); Class.forName(classname).newInstance(); } catch(Exception e) { ! System.err.println("jake2: class not found:" + classname); } --- 58,67 ---- try { ! //Com.DPrintf("SuperAdapter.getFromID():loading class->" + classname + "\n"); Class.forName(classname).newInstance(); } catch(Exception e) { ! Com.DPrintf("SuperAdapter.getFromID():class not found->" + classname + "\n"); } *************** *** 71,75 **** if (sa == null) ! System.err.println("jake2: could not load adapter:" + key); } --- 70,74 ---- if (sa == null) ! Com.DPrintf("jake2: could not load adapter:" + key + "\n"); } *************** *** 84,88 **** if (adapterid == "") new Throwable("error in creating an adapter id!").printStackTrace(); ! else register(this, adapterid); } --- 83,87 ---- if (adapterid == "") new Throwable("error in creating an adapter id!").printStackTrace(); ! else register(this, adapterid); } |
From: Rene S. <sa...@us...> - 2004-09-04 09:01:11
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1854/src/jake2/server Modified Files: SV_CCMDS.java Log Message: debug messages clean up, shotgun switched back to blaster. Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SV_CCMDS.java 29 Aug 2004 21:39:25 -0000 1.8 --- SV_CCMDS.java 4 Sep 2004 09:01:01 -0000 1.9 *************** *** 212,217 **** byte buffer[]= new byte[65536]; ! Com.DPrintf("CopyFile (" + src + ", " + dst + ")\n"); ! System.out.println("CopyFile (" + src + ", " + dst + ")\n"); try { f1= new RandomAccessFile(src, "r"); --- 212,216 ---- byte buffer[]= new byte[65536]; ! //Com.DPrintf("CopyFile (" + src + ", " + dst + ")\n"); try { f1= new RandomAccessFile(src, "r"); |
From: Holger Z. <hz...@us...> - 2004-08-30 06:25:42
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28192 Modified Files: ChangeLog Log Message: new features Index: ChangeLog =================================================================== RCS file: /cvsroot/jake2/jake2/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChangeLog 9 Jul 2004 06:50:48 -0000 1.2 --- ChangeLog 30 Aug 2004 06:25:33 -0000 1.3 *************** *** 1,2 **** --- 1,10 ---- + 0.9.3 + + - savegames + - command line completion in console + - better fullscreen vidmode selection + - memory footprint reduced + - bugfixes + 0.9.2 2004-06-28 |
From: Holger Z. <hz...@us...> - 2004-08-29 21:39:36
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11173/src/jake2/server Modified Files: SV_GAME.java SV.java SV_USER.java SV_WORLD.java SV_INIT.java SV_CCMDS.java SV_MAIN.java SV_ENTS.java Log Message: remove game_export_t and other dll related stuff Index: SV_WORLD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_WORLD.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_WORLD.java 20 Aug 2004 21:29:57 -0000 1.5 --- SV_WORLD.java 29 Aug 2004 21:39:25 -0000 1.6 *************** *** 24,36 **** package jake2.server; - import jake2.game.edict_t; - import jake2.game.trace_t; - - import jake2.*; - import jake2.client.*; import jake2.game.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.util.Vargs; public class SV_WORLD extends SV_CCMDS --- 24,30 ---- package jake2.server; import jake2.game.*; ! import jake2.qcommon.CM; ! import jake2.qcommon.Com; public class SV_WORLD extends SV_CCMDS *************** *** 203,207 **** SV_UnlinkEdict(ent); // unlink from old position ! if (ent == ge.edicts[0]) return; // don't add the world --- 197,201 ---- SV_UnlinkEdict(ent); // unlink from old position ! if (ent == GameBase.g_edicts[0]) return; // don't add the world *************** *** 664,668 **** // clip to world clip.trace= CM.BoxTrace(start, end, mins, maxs, 0, contentmask); ! clip.trace.ent= ge.edicts[0]; if (clip.trace.fraction == 0) return clip.trace; // blocked by the world --- 658,662 ---- // clip to world clip.trace= CM.BoxTrace(start, end, mins, maxs, 0, contentmask); ! clip.trace.ent= GameBase.g_edicts[0]; if (clip.trace.fraction == 0) return clip.trace; // blocked by the world Index: SV_ENTS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_ENTS.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SV_ENTS.java 12 Jul 2004 20:47:02 -0000 1.3 --- SV_ENTS.java 29 Aug 2004 21:39:25 -0000 1.4 *************** *** 457,462 **** c_fullsend = 0; ! for (e = 1; e < SV_GAME.ge.num_edicts; e++) { ! ent = SV_GAME.ge.edicts[e]; // ignore ents without visible models --- 457,462 ---- c_fullsend = 0; ! for (e = 1; e < GameBase.num_edicts; e++) { ! ent = GameBase.g_edicts[e]; // ignore ents without visible models *************** *** 568,574 **** e = 1; ! ent = SV_GAME.ge.edicts[e]; ! while (e < SV_GAME.ge.num_edicts) { // ignore ents without visible models unless they have an effect if (ent.inuse --- 568,574 ---- e = 1; ! ent = GameBase.g_edicts[e]; ! while (e < GameBase.num_edicts) { // ignore ents without visible models unless they have an effect if (ent.inuse *************** *** 579,583 **** e++; ! ent = SV_GAME.ge.edicts[e]; } --- 579,583 ---- e++; ! ent = GameBase.g_edicts[e]; } Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SV_INIT.java 22 Aug 2004 14:25:13 -0000 1.7 --- SV_INIT.java 29 Aug 2004 21:39:25 -0000 1.8 *************** *** 100,106 **** int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); ! svent= SV_GAME.ge.edicts[entnum]; if (!svent.inuse) --- 100,106 ---- int entnum; ! for (entnum= 1; entnum < GameBase.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); ! svent= GameBase.g_edicts[entnum]; if (!svent.inuse) *************** *** 169,173 **** sv.state= ss_loading; // PGM for (i= 0; i < 100; i++) ! SV_GAME.ge.RunFrame(); sv.state= previousState; // PGM --- 169,173 ---- sv.state= ss_loading; // PGM for (i= 0; i < 100; i++) ! Game.G_RunFrame(); sv.state= previousState; // PGM *************** *** 279,287 **** // load and spawn all other entities ! SV_GAME.ge.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); // run two frames to allow everything to settle ! SV_GAME.ge.RunFrame(); ! SV_GAME.ge.RunFrame(); // all precaches are complete --- 279,287 ---- // load and spawn all other entities ! Game.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); // run two frames to allow everything to settle ! Game.G_RunFrame(); ! Game.G_RunFrame(); // all precaches are complete *************** *** 383,387 **** for (i= 0; i < SV_MAIN.maxclients.value; i++) { ! ent= SV_GAME.ge.edicts[i + 1]; //ent.s.number = i + 1; //dont need this, ent.s.number already set. --- 383,387 ---- for (i= 0; i < SV_MAIN.maxclients.value; i++) { ! ent= GameBase.g_edicts[i + 1]; //ent.s.number = i + 1; //dont need this, ent.s.number already set. Index: SV_MAIN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_MAIN.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_MAIN.java 30 Jul 2004 06:07:23 -0000 1.5 --- SV_MAIN.java 29 Aug 2004 21:39:25 -0000 1.6 *************** *** 90,94 **** // call the prog function for removing a client // this will remove the body, among other things ! SV_GAME.ge.ClientDisconnect(drop.edict); } --- 90,94 ---- // call the prog function for removing a client // this will remove the body, among other things ! PlayerClient.ClientDisconnect(drop.edict); } *************** *** 364,373 **** //edictnum = (newcl-svs.clients)+1; int edictnum = i + 1; ! edict_t ent = ge.edicts[edictnum]; svs.clients[i].edict = ent; svs.clients[i].challenge = challenge; // save challenge for checksumming // get the game a chance to reject this connection or modify the userinfo ! if (!(ge.ClientConnect(ent, userinfo))) { if (Info.Info_ValueForKey(userinfo, "rejmsg") != null) Netchan.OutOfBandPrint( --- 364,373 ---- //edictnum = (newcl-svs.clients)+1; int edictnum = i + 1; ! edict_t ent = GameBase.g_edicts[edictnum]; svs.clients[i].edict = ent; svs.clients[i].challenge = challenge; // save challenge for checksumming // get the game a chance to reject this connection or modify the userinfo ! if (!(PlayerClient.ClientConnect(ent, userinfo))) { if (Info.Info_ValueForKey(userinfo, "rejmsg") != null) Netchan.OutOfBandPrint( *************** *** 671,676 **** int i; ! for (i = 0; i < ge.num_edicts; i++) { ! ent = SV_GAME.ge.edicts[i]; // events only last for a single message ent.s.event = 0; --- 671,676 ---- int i; ! for (i = 0; i < GameBase.num_edicts; i++) { ! ent = GameBase.g_edicts[i]; // events only last for a single message ent.s.event = 0; *************** *** 697,701 **** // don't run if paused if (0 == sv_paused.value || maxclients.value > 1) { ! ge.RunFrame(); // never get more than one tic behind --- 697,701 ---- // don't run if paused if (0 == sv_paused.value || maxclients.value > 1) { ! Game.G_RunFrame(); // never get more than one tic behind *************** *** 863,867 **** // call prog code to allow overrides ! SV_GAME.ge.ClientUserinfoChanged(cl.edict, cl.userinfo); // name for C code --- 863,867 ---- // call prog code to allow overrides ! PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo); // name for C code Index: SV_GAME.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_GAME.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_GAME.java 22 Aug 2004 14:25:12 -0000 1.6 --- SV_GAME.java 29 Aug 2004 21:39:25 -0000 1.7 *************** *** 24,37 **** package jake2.server; - import jake2.*; - import jake2.client.*; import jake2.game.*; import jake2.qcommon.*; - import jake2.render.*; - import jake2.sys.Sys; public class SV_GAME extends SV_INIT { - public static game_export_t ge; /* --- 24,32 ---- *************** *** 298,306 **** */ public static void SV_ShutdownGameProgs() { ! if (ge == null) ! return; ! ge.Shutdown(); ! Sys.UnloadGame(); ! ge = null; } --- 293,297 ---- */ public static void SV_ShutdownGameProgs() { ! Game.ShutdownGame(); } *************** *** 316,333 **** // unload anything we have now ! if (ge != null) ! SV_ShutdownGameProgs(); game_import_t gimport = new game_import_t(); // all functions set in game_export_t (rst) ! ge = GameBase.GetGameApi(gimport); ! ! if (ge == null) ! Com.Error(ERR_DROP, "failed to load game DLL"); ! if (ge.apiversion != GAME_API_VERSION) ! Com.Error(ERR_DROP, "game is version " + ge.apiversion + " not " + GAME_API_VERSION); ! ge.Init(); } } --- 307,318 ---- // unload anything we have now ! SV_ShutdownGameProgs(); game_import_t gimport = new game_import_t(); // all functions set in game_export_t (rst) ! GameBase.GetGameApi(gimport); ! Game.InitGame(); } } Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SV_CCMDS.java 22 Aug 2004 14:25:12 -0000 1.7 --- SV_CCMDS.java 29 Aug 2004 21:39:25 -0000 1.8 *************** *** 29,33 **** import jake2.sys.NET; import jake2.sys.Sys; - import jake2.util.Lib; import jake2.util.QuakeFile; import jake2.util.Vargs; --- 29,32 ---- *************** *** 354,358 **** name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! ge.WriteLevel(name); } --- 353,357 ---- name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! GameSave.WriteLevel(name); } *************** *** 387,391 **** name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! ge.ReadLevel(name); System.out.println("all done!"); } --- 386,390 ---- name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! GameSave.ReadLevel(name); System.out.println("all done!"); } *************** *** 458,462 **** // write game state filename= FS.Gamedir() + "/save/current/game.ssv"; ! ge.WriteGame(filename, autosave); } --- 457,461 ---- // write game state filename= FS.Gamedir() + "/save/current/game.ssv"; ! GameSave.WriteGame(filename, autosave); } *************** *** 509,513 **** // read game state filename= FS.Gamedir() + "/save/current/game.ssv"; ! ge.ReadGame(filename); } catch (Exception e) { --- 508,512 ---- // read game state filename= FS.Gamedir() + "/save/current/game.ssv"; ! GameSave.ReadGame(filename); } catch (Exception e) { *************** *** 1056,1065 **** */ public static void SV_ServerCommand_f() { - if (SV_GAME.ge == null) { - Com.Printf("No game loaded.\n"); - return; - } ! SV_GAME.ge.ServerCommand(); } --- 1055,1060 ---- */ public static void SV_ServerCommand_f() { ! Game.ServerCommand(); } Index: SV_USER.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_USER.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV_USER.java 9 Jul 2004 06:50:49 -0000 1.4 --- SV_USER.java 29 Aug 2004 21:39:25 -0000 1.5 *************** *** 125,129 **** { // set up the entity for the client ! ent= SV_GAME.ge.edicts[playernum + 1]; ent.s.number= playernum + 1; sv_client.edict= ent; --- 125,129 ---- { // set up the entity for the client ! ent= GameBase.g_edicts[playernum + 1]; ent.s.number= playernum + 1; sv_client.edict= ent; *************** *** 270,274 **** // call the game begin function ! SV_GAME.ge.ClientBegin(sv_player); Cbuf.InsertFromDefer(); --- 270,274 ---- // call the game begin function ! PlayerClient.ClientBegin(sv_player); Cbuf.InsertFromDefer(); *************** *** 553,557 **** if (i == ucmds.length && sv.state == ss_game) ! SV_GAME.ge.ClientCommand(sv_player); // SV_EndRedirect (); --- 553,557 ---- if (i == ucmds.length && sv.state == ss_game) ! PlayerClient.ClientCommand(sv_player); // SV_EndRedirect (); *************** *** 576,580 **** } ! SV_GAME.ge.ClientThink(cl.edict, cmd); } --- 576,580 ---- } ! PlayerClient.ClientThink(cl.edict, cmd); } Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SV.java 22 Aug 2004 20:39:03 -0000 1.8 --- SV.java 29 Aug 2004 21:39:25 -0000 1.9 *************** *** 379,383 **** //check= g_edicts + 1; ! for (e= 1; e < GameBase.globals.num_edicts; e++) { check= GameBase.g_edicts[e]; --- 379,383 ---- //check= g_edicts + 1; ! for (e= 1; e < GameBase.num_edicts; e++) { check= GameBase.g_edicts[e]; |
From: Holger Z. <hz...@us...> - 2004-08-29 21:39:35
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11173/src/jake2/game Modified Files: GameTargetAdapters.java GameUtil.java GameSave.java GameBase.java GameSpawn.java Removed Files: game_export_t.java Log Message: remove game_export_t and other dll related stuff Index: GameTargetAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTargetAdapters.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameTargetAdapters.java 27 Aug 2004 21:57:48 -0000 1.2 --- GameTargetAdapters.java 29 Aug 2004 21:39:24 -0000 1.3 *************** *** 24,32 **** package jake2.game; ! import jake2.*; ! import jake2.client.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.server.*; import jake2.util.Lib; import jake2.util.Math3D; --- 24,29 ---- package jake2.game; ! import jake2.Defines; ! import jake2.Globals; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 554,558 **** } ! for (i = 1; i < GameBase.globals.num_edicts; i++) { e = GameBase.g_edicts[i]; --- 551,555 ---- } ! for (i = 1; i < GameBase.num_edicts; i++) { e = GameBase.g_edicts[i]; Index: GameSave.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSave.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GameSave.java 22 Aug 2004 14:25:12 -0000 1.3 --- GameSave.java 29 Aug 2004 21:39:24 -0000 1.4 *************** *** 24,38 **** package jake2.game; ! import java.io.FileNotFoundException; ! import java.io.IOException; ! import java.io.RandomAccessFile; ! import java.nio.*; ! ! import jake2.*; ! import jake2.client.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.server.*; ! import jake2.util.*; public class GameSave extends GameFunc { --- 24,29 ---- package jake2.game; ! import jake2.qcommon.Com; ! import jake2.util.QuakeFile; public class GameSave extends GameFunc { *************** *** 58,62 **** for (int i= 0; i < game.maxentities; i++) g_edicts[i]= new edict_t(i); ! SV_GAME.ge.edicts= g_edicts; } --- 49,53 ---- for (int i= 0; i < game.maxentities; i++) g_edicts[i]= new edict_t(i); ! GameBase.g_edicts= g_edicts; } *************** *** 140,145 **** CreateEdicts(); ! globals.edicts= g_edicts; ! globals.max_edicts= game.maxentities; // initialize all clients for this game --- 131,136 ---- CreateEdicts(); ! // globals.edicts= g_edicts; ! // globals.max_edicts= game.maxentities; // initialize all clients for this game *************** *** 148,152 **** CreateClients(); ! globals.num_edicts= game.maxclients + 1; } --- 139,143 ---- CreateClients(); ! num_edicts= game.maxclients + 1; } *************** *** 222,226 **** ================= */ ! static void WriteLevel(String filename) { try { int i; --- 213,217 ---- ================= */ ! public static void WriteLevel(String filename) { try { int i; *************** *** 236,240 **** // write out all the entities ! for (i= 0; i < globals.num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) --- 227,231 ---- // write out all the entities ! for (i= 0; i < num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) *************** *** 271,275 **** ================= */ ! static void ReadLevel(String filename) { try { edict_t ent; --- 262,266 ---- ================= */ ! public static void ReadLevel(String filename) { try { edict_t ent; *************** *** 283,287 **** Game.CreateEdicts(); ! globals.num_edicts= (int) maxclients.value + 1; // load the level locals --- 274,278 ---- Game.CreateEdicts(); ! num_edicts= (int) maxclients.value + 1; // load the level locals *************** *** 294,299 **** break; ! if (entnum >= globals.num_edicts) ! globals.num_edicts= entnum + 1; ent= g_edicts[entnum]; --- 285,290 ---- break; ! if (entnum >= num_edicts) ! num_edicts= entnum + 1; ent= g_edicts[entnum]; *************** *** 314,318 **** // do any load time things at this point ! for (int i= 0; i < globals.num_edicts; i++) { ent= g_edicts[i]; --- 305,309 ---- // do any load time things at this point ! for (int i= 0; i < num_edicts; i++) { ent= g_edicts[i]; Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameUtil.java 20 Aug 2004 21:29:57 -0000 1.4 --- GameUtil.java 29 Aug 2004 21:39:24 -0000 1.5 *************** *** 24,33 **** package jake2.game; - import java.sql.Savepoint; - - import jake2.Defines; import jake2.client.M; import jake2.qcommon.Com; ! import jake2.util.*; public class GameUtil extends GameBase --- 24,31 ---- package jake2.game; import jake2.client.M; import jake2.qcommon.Com; ! import jake2.util.Lib; ! import jake2.util.Math3D; public class GameUtil extends GameBase *************** *** 166,170 **** edict_t e = null; ! for (i = (int) maxclients.value + 1; i < globals.num_edicts; i++) { e = g_edicts[i]; --- 164,168 ---- edict_t e = null; ! for (i = (int) maxclients.value + 1; i < num_edicts; i++) { e = g_edicts[i]; *************** *** 183,187 **** e = g_edicts[i] = new edict_t(i); ! globals.num_edicts++; G_InitEdict(e, i); return e; --- 181,185 ---- e = g_edicts[i] = new edict_t(i); ! num_edicts++; G_InitEdict(e, i); return e; Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GameSpawn.java 29 Aug 2004 19:27:37 -0000 1.5 --- GameSpawn.java 29 Aug 2004 21:39:24 -0000 1.6 *************** *** 285,289 **** c = 0; c2 = 0; ! for (i = 1; i < globals.num_edicts; i++) { e = g_edicts[i]; --- 285,289 ---- c = 0; c2 = 0; ! for (i = 1; i < num_edicts; i++) { e = g_edicts[i]; *************** *** 299,303 **** c2++; //Com.Printf("Team:" + e.team+" entity: " + e.index + "\n"); ! for (j = i + 1; j < globals.num_edicts; j++) { e2 = g_edicts[j]; if (!e2.inuse) --- 299,303 ---- c2++; //Com.Printf("Team:" + e.team+" entity: " + e.index + "\n"); ! for (j = i + 1; j < num_edicts; j++) { e2 = g_edicts[j]; if (!e2.inuse) *************** *** 329,333 **** */ ! static void SpawnEntities(String mapname, String entities, String spawnpoint) { edict_t ent; int inhibit; --- 329,333 ---- */ ! public static void SpawnEntities(String mapname, String entities, String spawnpoint) { edict_t ent; int inhibit; Index: GameBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameBase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GameBase.java 22 Aug 2004 14:25:11 -0000 1.5 --- GameBase.java 29 Aug 2004 21:39:24 -0000 1.6 *************** *** 39,43 **** public static level_locals_t level= new level_locals_t(); public static game_import_t gi= new game_import_t(); - public static game_export_t globals= new game_export_t(); public static spawn_temp_t st= new spawn_temp_t(); --- 39,42 ---- *************** *** 45,48 **** --- 44,48 ---- public static int snd_fry; public static int meansOfDeath; + public static int num_edicts; public static edict_t g_edicts[]= new edict_t[MAX_EDICTS]; *************** *** 157,161 **** from.i++; ! for (; from.i < globals.num_edicts; from.i++) { from.o= g_edicts[from.i]; if (from.o.classname == null) { --- 157,161 ---- from.i++; ! for (; from.i < num_edicts; from.i++) { from.o= g_edicts[from.i]; if (from.o.classname == null) { *************** *** 194,198 **** from.i++; ! for (; from.i < globals.num_edicts; from.i++) { from.o= g_edicts[from.i]; if (!from.o.inuse) --- 194,198 ---- from.i++; ! for (; from.i < num_edicts; from.i++) { from.o= g_edicts[from.i]; if (!from.o.inuse) *************** *** 376,394 **** */ public static int DI_NODIR= -1; - public static void assert1(boolean cond) { - if (!cond) { - - try { - - int a[]= null; - int b= a[0]; - } - catch (Exception e) { - System.err.println("assertion failed!"); - e.printStackTrace(); - } - - } - } public static void ClearBounds(float[] mins, float[] maxs) { --- 376,379 ---- *************** *** 428,434 **** public static void ShutdownGame() { gi.dprintf("==== ShutdownGame ====\n"); - - //gi.FreeTags (TAG_LEVEL); - //gi.FreeTags (TAG_GAME); } --- 413,416 ---- *************** *** 655,659 **** // ! for (i= 0; i < globals.num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) --- 637,641 ---- // ! for (i= 0; i < num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) *************** *** 699,703 **** */ ! public static game_export_t GetGameApi(game_import_t imp) { gi= imp; --- 681,685 ---- */ ! public static void GetGameApi(game_import_t imp) { gi= imp; *************** *** 708,712 **** }; ! globals.apiversion= GAME_API_VERSION; /* globals.Init = InitGame; --- 690,694 ---- }; ! //globals.apiversion= GAME_API_VERSION; /* globals.Init = InitGame; *************** *** 729,733 **** */ ! return globals; } } \ No newline at end of file --- 711,715 ---- */ ! //return globals; } } \ No newline at end of file --- game_export_t.java DELETED --- |
From: Holger Z. <hz...@us...> - 2004-08-29 21:39:35
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11173/src/jake2/sys Modified Files: Sys.java Log Message: remove game_export_t and other dll related stuff Index: Sys.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/Sys.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sys.java 28 Jul 2004 11:59:32 -0000 1.6 --- Sys.java 29 Aug 2004 21:39:26 -0000 1.7 *************** *** 30,34 **** import jake2.client.CL; import jake2.qcommon.Com; - import jake2.util.Lib; import java.io.File; --- 30,33 ---- *************** *** 227,238 **** } - - - public static void UnloadGame() - { - //TODO:implement UnloadGame - //Com.Error(Defines.ERR_FATAL, "UnloadGame not implemented!"); - - } public static void SendKeyEvents() { --- 226,229 ---- |
From: Holger Z. <hz...@us...> - 2004-08-29 19:27:46
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20311/src/jake2/game Modified Files: GameSpawn.java Log Message: fix linebreak handling in entity strings Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameSpawn.java 23 Jul 2004 10:07:14 -0000 1.4 --- GameSpawn.java 29 Aug 2004 19:27:37 -0000 1.5 *************** *** 128,145 **** static String ED_NewString(String string) { ! //String newb, new_p; ! int i, l; ! ! l = string.length() + 1; ! //newb = gi.TagMalloc(l, TAG_LEVEL); ! StringBuffer newb = new StringBuffer(l); ! for (i = 0; i < l - 1; i++) { ! char c; ! ! c = string.charAt(i); if (c == '\\' && i < l - 1) { ! c = string.charAt(i++); if (c == 'n') newb.append('\n'); --- 128,138 ---- static String ED_NewString(String string) { ! int l = string.length(); StringBuffer newb = new StringBuffer(l); ! for (int i = 0; i < l; i++) { ! char c = string.charAt(i); if (c == '\\' && i < l - 1) { ! c = string.charAt(++i); if (c == 'n') newb.append('\n'); |
From: Carsten W. <ca...@us...> - 2004-08-28 16:40:24
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2821/src/jake2/game Modified Files: GameAI.java Log Message: layout string for the helpcomputer is now correct Index: GameAI.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameAI.java 8 Jul 2004 15:58:44 -0000 1.2 --- GameAI.java 28 Aug 2004 16:40:12 -0000 1.3 *************** *** 26,31 **** --- 26,33 ---- import jake2.Defines; import jake2.client.M; + import jake2.qcommon.Com; import jake2.util.Lib; import jake2.util.Math3D; + import jake2.util.Vargs; import java.util.StringTokenizer; *************** *** 1519,1523 **** public static void HelpComputer(edict_t ent) { ! String string; String sk; --- 1521,1525 ---- public static void HelpComputer(edict_t ent) { ! StringBuffer sb = new StringBuffer(256); String sk; *************** *** 1532,1557 **** // send the layout ! string = "xv 32 yv 8 picn help " + // background ! "xv 202 yv 12 string2 \"" + sk + "\" " + // skill ! "xv 0 yv 24 cstring2 \"" + level.level_name + "\" " + // level name ! "xv 0 yv 54 cstring2 \"" + game.helpmessage1 + "\" " + // help 1 ! "xv 0 yv 110 cstring2 \"" + game.helpmessage2 + "\" " + // help 2 ! "xv 50 yv 164 string2 \" kills goals secrets\" " ! + "xv 50 yv 172 string2 \"" ! + level.killed_monsters ! + "/" ! + level.total_monsters ! + " " ! + level.found_goals ! + "/" ! + level.total_goals ! + " " ! + level.found_secrets ! + "/" ! + level.total_secrets ! + "\" "; gi.WriteByte(svc_layout); ! gi.WriteString(string); gi.unicast(ent, true); } --- 1534,1556 ---- // send the layout ! sb.append("xv 32 yv 8 picn help "); // background ! sb.append("xv 202 yv 12 string2 \"").append(sk).append("\" "); // skill ! sb.append("xv 0 yv 24 cstring2 \"").append(level.level_name).append("\" "); // level name ! sb.append("xv 0 yv 54 cstring2 \"").append(game.helpmessage1).append("\" "); // help 1 ! sb.append("xv 0 yv 110 cstring2 \"").append(game.helpmessage2).append("\" "); // help 2 ! sb.append("xv 50 yv 164 string2 \" kills goals secrets\" "); ! sb.append("xv 50 yv 172 string2 \""); ! sb.append(Com.sprintf("%3i/%3i %i/%i %i/%i\" ", ! new Vargs(6).add(level.killed_monsters) ! .add(level.total_monsters) ! .add(level.found_goals) ! .add(level.total_goals) ! .add(level.found_secrets) ! .add(level.total_secrets) ! ) ! ); gi.WriteByte(svc_layout); ! gi.WriteString(sb.toString()); gi.unicast(ent, true); } |
From: Holger Z. <hz...@us...> - 2004-08-27 21:59:32
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/src/jake2/game Modified Files: PlayerHud.java Log Message: duplicate functions removed Index: PlayerHud.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerHud.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlayerHud.java 20 Jul 2004 16:14:37 -0000 1.4 --- PlayerHud.java 27 Aug 2004 21:59:23 -0000 1.5 *************** *** 310,387 **** } - /* - ================== - HelpComputer - - Draw help computer. - ================== - */ - public static void HelpComputer(edict_t ent) { - //char string[1024]; - String string; - - String sk; - - if (skill.value == 0) - sk = "easy"; - else if (skill.value == 1) - sk = "medium"; - else if (skill.value == 2) - sk = "hard"; - else - sk = "hard+"; - - // send the layout - - string = Com.sprintf("xv 32 yv 8 picn help " + // background - "xv 202 yv 12 string2 \"%s\" " + // skill - "xv 0 yv 24 cstring2 \"%s\" " + // level name - "xv 0 yv 54 cstring2 \"%s\" " + // help 1 - "xv 0 yv 110 cstring2 \"%s\" " + // help 2 - "xv 50 yv 164 string2 \" kills goals secrets\" " + "xv 50 yv 172 string2 \"%3i/%3i %i/%i %i/%i\" ", - new Vargs() - .add(sk) - .add(level.level_name) - .add(game.helpmessage1) - .add(game.helpmessage2) - .add(level.killed_monsters) - .add(level.total_monsters) - .add(level.found_goals) - .add(level.total_goals) - .add(level.found_secrets) - .add(level.total_secrets)); - - gi.WriteByte(svc_layout); - gi.WriteString(string); - gi.unicast(ent, true); - } - - /* - ================== - Cmd_Help_f - - Display the current help message - ================== - */ - public static void Cmd_Help_f(edict_t ent) { - // this is for backwards compatability - if (deathmatch.value != 0) { - Cmd_Score_f(ent); - return; - } - - ent.client.showinventory = false; - ent.client.showscores = false; - - if (ent.client.showhelp && (ent.client.pers.game_helpchanged == game.helpchanged)) { - ent.client.showhelp = false; - return; - } - - ent.client.showhelp = true; - ent.client.pers.helpchanged = 0; - HelpComputer(ent); - } - //======================================================================= --- 310,313 ---- |
From: Holger Z. <hz...@us...> - 2004-08-27 21:57:58
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6596/src/jake2/game Modified Files: GameTargetAdapters.java Log Message: strncpy(dest, src, size) !!! Index: GameTargetAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTargetAdapters.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GameTargetAdapters.java 8 Jul 2004 15:58:43 -0000 1.1 --- GameTargetAdapters.java 27 Aug 2004 21:57:48 -0000 1.2 *************** *** 92,99 **** if ((ent.spawnflags & 1) != 0) //strncpy(game.helpmessage1, ent.message, sizeof(game.helpmessage2) - 1); ! ent.message = GameBase.game.helpmessage1; else //strncpy(game.helpmessage2, ent.message, sizeof(game.helpmessage1) - 1); ! ent.message = GameBase.game.helpmessage2; GameBase.game.helpchanged++; --- 92,99 ---- if ((ent.spawnflags & 1) != 0) //strncpy(game.helpmessage1, ent.message, sizeof(game.helpmessage2) - 1); ! GameBase.game.helpmessage1 = ent.message; else //strncpy(game.helpmessage2, ent.message, sizeof(game.helpmessage1) - 1); ! GameBase.game.helpmessage2 = ent.message; GameBase.game.helpchanged++; |
From: Holger Z. <hz...@us...> - 2004-08-27 21:07:10
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30871/src/jake2/client Modified Files: SCR.java Log Message: draw help screen Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SCR.java 22 Aug 2004 14:25:15 -0000 1.6 --- SCR.java 27 Aug 2004 21:07:01 -0000 1.7 *************** *** 786,792 **** // scan out one line of text from the string line= new StringBuffer(1024); ! while (string.charAt(l) != '\n') line.append(string.charAt(l)); ! l++; if (centerwidth != 0) --- 786,793 ---- // scan out one line of text from the string line= new StringBuffer(1024); ! while (l < string.length() && string.charAt(l) != '\n') { line.append(string.charAt(l)); ! l++; ! } if (centerwidth != 0) *************** *** 1170,1175 **** static void DrawLayout() { if (cl.frame.playerstate.stats[STAT_LAYOUTS] != 0) ! return; ! SCR.ExecuteLayoutString(cl.layout); } --- 1171,1175 ---- static void DrawLayout() { if (cl.frame.playerstate.stats[STAT_LAYOUTS] != 0) ! SCR.ExecuteLayoutString(cl.layout); } |
From: Holger Z. <hz...@us...> - 2004-08-27 21:05:13
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30537/src/jake2/client Modified Files: CL.java Log Message: don't eat the whole cpu when not in game mode Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CL.java 18 Aug 2004 20:27:35 -0000 1.7 --- CL.java 27 Aug 2004 21:05:04 -0000 1.8 *************** *** 1550,1553 **** --- 1550,1558 ---- cls.framecount++; + if (cls.state != ca_active || cls.key_dest != key_game) { + try { + Thread.sleep(20); + } catch (InterruptedException e) {} + } } |
From: Holger Z. <hz...@us...> - 2004-08-23 20:49:24
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32547/src/jake2/client Modified Files: VID.java Log Message: - better vid mode selection when switching between window and fullscreen - new configurable window mode 11 vid_wdth x vid_height (CAVE!) Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VID.java 16 Jul 2004 10:11:36 -0000 1.8 --- VID.java 23 Aug 2004 20:49:12 -0000 1.9 *************** *** 64,67 **** --- 64,69 ---- static cvar_t vid_xpos; // X coordinate of window position static cvar_t vid_ypos; // Y coordinate of window position + static cvar_t vid_width; + static cvar_t vid_height; static cvar_t vid_fullscreen; *************** *** 102,107 **** ============ */ ! static void Restart_f() ! { vid_ref.modified = true; } --- 104,111 ---- ============ */ ! static void Restart_f() { ! vid_modes[11].width = (int) vid_width.value; ! vid_modes[11].height = (int) vid_height.value; ! vid_ref.modified = true; } *************** *** 110,114 **** ** VID_GetModeInfo */ ! static final vidmode_t vid_modes[] = { new vidmode_t("Mode 0: 320x240", 320, 240, 0), --- 114,118 ---- ** VID_GetModeInfo */ ! static vidmode_t vid_modes[] = { new vidmode_t("Mode 0: 320x240", 320, 240, 0), *************** *** 122,126 **** new vidmode_t("Mode 8: 1280x1024", 1280, 1024, 8), new vidmode_t("Mode 9: 1600x1200", 1600, 1200, 9), ! new vidmode_t("Mode 10: 2048x1536", 2048, 1536, 10)}; static vidmode_t fs_modes[]; --- 126,131 ---- new vidmode_t("Mode 8: 1280x1024", 1280, 1024, 8), new vidmode_t("Mode 9: 1600x1200", 1600, 1200, 9), ! new vidmode_t("Mode 10: 2048x1536", 2048, 1536, 10), ! new vidmode_t("Mode 11: user", 640, 480, 11)}; static vidmode_t fs_modes[]; *************** *** 131,139 **** if (vid_fullscreen.value != 0.0f) modes = fs_modes; ! if (mode < 0 || mode >= modes.length) return false; ! dim.width = modes[mode].width; dim.height = modes[mode].height; return true; } --- 136,145 ---- if (vid_fullscreen.value != 0.0f) modes = fs_modes; ! if (mode < 0 || mode >= modes.length) return false; ! dim.width = modes[mode].width; dim.height = modes[mode].height; + return true; } *************** *** 293,299 **** --- 299,310 ---- vid_xpos = Cvar.Get("vid_xpos", "3", CVAR_ARCHIVE); vid_ypos = Cvar.Get("vid_ypos", "22", CVAR_ARCHIVE); + vid_width = Cvar.Get("vid_width", "640", CVAR_ARCHIVE); + vid_height = Cvar.Get("vid_height", "480", CVAR_ARCHIVE); vid_fullscreen = Cvar.Get("vid_fullscreen", "0", CVAR_ARCHIVE); vid_gamma = Cvar.Get( "vid_gamma", "1", CVAR_ARCHIVE ); + vid_modes[11].width = (int)vid_width.value; + vid_modes[11].height = (int)vid_height.value; + /* Add some console commands that we want to handle */ Cmd.AddCommand ("vid_restart", new xcommand_t() { *************** *** 539,547 **** "[1600 1200]", "[2048 1536]", null }; static String[] fs_resolutions; ! static int last_fs; ! static int last_win; static final String[] refs = --- 550,558 ---- "[1600 1200]", "[2048 1536]", + "user mode", null }; static String[] fs_resolutions; ! static int mode_x; static final String[] refs = *************** *** 618,622 **** s_mode_list[OPENGL_MENU].curvalue = 0; } ! last_fs = s_mode_list[OPENGL_MENU].curvalue; } else { s_mode_list[OPENGL_MENU].itemnames = resolutions; --- 629,633 ---- s_mode_list[OPENGL_MENU].curvalue = 0; } ! mode_x = fs_modes[s_mode_list[OPENGL_MENU].curvalue].width; } else { s_mode_list[OPENGL_MENU].itemnames = resolutions; *************** *** 624,628 **** s_mode_list[OPENGL_MENU].curvalue = 0; } ! last_win = s_mode_list[OPENGL_MENU].curvalue; } --- 635,639 ---- s_mode_list[OPENGL_MENU].curvalue = 0; } ! mode_x = vid_modes[s_mode_list[OPENGL_MENU].curvalue].width; } *************** *** 728,735 **** if (fs == 0) { s_mode_list[1].itemnames = resolutions; ! s_mode_list[1].curvalue = last_win; } else { s_mode_list[1].itemnames = fs_resolutions; ! s_mode_list[1].curvalue = last_fs; } } --- 739,750 ---- if (fs == 0) { s_mode_list[1].itemnames = resolutions; ! int i = vid_modes.length - 2; ! while (i > 0 && vid_modes[i].width > mode_x) i--; ! s_mode_list[1].curvalue = i; } else { s_mode_list[1].itemnames = fs_resolutions; ! int i = fs_modes.length - 1; ! while (i > 0 && fs_modes[i].width > mode_x) i--; ! s_mode_list[1].curvalue = i; } } |
From: Holger Z. <hz...@us...> - 2004-08-23 20:49:23
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32547/src/jake2/render Modified Files: JoglBase.java Log Message: - better vid mode selection when switching between window and fullscreen - new configurable window mode 11 vid_wdth x vid_height (CAVE!) Index: JoglBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglBase.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JoglBase.java 19 Aug 2004 20:49:56 -0000 1.6 --- JoglBase.java 23 Aug 2004 20:49:12 -0000 1.7 *************** *** 105,108 **** --- 105,109 ---- if (m.getBitDepth() != oldDisplayMode.getBitDepth()) continue; if (m.getRefreshRate() > oldDisplayMode.getRefreshRate()) continue; + if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; |
From: Rene S. <sa...@us...> - 2004-08-22 20:39:15
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23939/src/jake2/server Modified Files: SV.java Log Message: bugfix in a touch call. the bug was in the original code as well !!! Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SV.java 22 Aug 2004 14:25:12 -0000 1.7 --- SV.java 22 Aug 2004 20:39:03 -0000 1.8 *************** *** 108,112 **** { edict_t e2; - // cplane_t backplane; e2= trace.ent; --- 108,111 ---- *************** *** 116,120 **** if (e2.touch != null && e2.solid != Defines.SOLID_NOT) ! e2.touch.touch(e2, e1, null, null); } --- 115,119 ---- if (e2.touch != null && e2.solid != Defines.SOLID_NOT) ! e2.touch.touch(e2, e1, GameBase.dummyplane, null); } |
From: Holger Z. <hz...@us...> - 2004-08-22 18:30:33
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16670/src/jake2/qcommon Modified Files: Com.java Log Message: fix comment handling in Parse() remove obsolete ServerState() Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Com.java 28 Jul 2004 11:54:43 -0000 1.5 --- Com.java 22 Aug 2004 18:30:15 -0000 1.6 *************** *** 206,210 **** if (hlp.getchar() == '/') { if (hlp.nextchar() == '/') { ! hlp.skipwhitestoeol(); return ""; } else { --- 206,210 ---- if (hlp.getchar() == '/') { if (hlp.nextchar() == '/') { ! hlp.skiptoeol(); return ""; } else { *************** *** 432,440 **** } - public static int ServerState() - { - return Globals.server_state; - } - public static int Argc() { --- 432,435 ---- |
From: Rene S. <sa...@us...> - 2004-08-22 15:46:33
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31480/src/jake2/game Modified Files: GameTriggerAdapters.java GameAIAdapters.java Log Message: trigger debug messages removed Index: GameTriggerAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTriggerAdapters.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GameTriggerAdapters.java 8 Jul 2004 15:58:44 -0000 1.1 --- GameTriggerAdapters.java 22 Aug 2004 15:46:19 -0000 1.2 *************** *** 115,119 **** int index; - Com.p("trigger_key_use!"); if (self.item == null) return; --- 115,118 ---- *************** *** 225,229 **** static EntTouchAdapter trigger_push_touch = new EntTouchAdapter() { public void touch(edict_t self, edict_t other, cplane_t plane, csurface_t surf) { - Com.p("TRIGGER TOUCH!"); if (Lib.strcmp(other.classname, "grenade") == 0) { Math3D.VectorScale(self.movedir, self.speed * 10, other.velocity); --- 224,227 ---- Index: GameAIAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAIAdapters.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameAIAdapters.java 8 Jul 2004 20:24:29 -0000 1.2 --- GameAIAdapters.java 22 Aug 2004 15:46:19 -0000 1.3 *************** *** 32,52 **** import java.util.*; ! public class GameAIAdapters ! { /** Common Boss explode animation.*/ ! public static EntThinkAdapter BossExplode = new EntThinkAdapter() ! { ! public boolean think(edict_t self) ! { [...1800 lines suppressed...] }; ! public static ItemDropAdapter Drop_PowerArmor= new ItemDropAdapter() { ! public void drop(edict_t ent, gitem_t item) { if (0 != (ent.flags & Defines.FL_POWER_ARMOR) && (ent.client.pers.inventory[GameUtil.ITEM_INDEX(item)] == 1)) Use_PowerArmor.use(ent, item); *************** *** 1173,1178 **** } }; ! public static gitem_armor_t jacketarmor_info = new gitem_armor_t(25, 50, .30f, .00f, Defines.ARMOR_JACKET); ! public static gitem_armor_t combatarmor_info = new gitem_armor_t(50, 100, .60f, .30f, Defines.ARMOR_COMBAT); ! public static gitem_armor_t bodyarmor_info = new gitem_armor_t(100, 200, .80f, .60f, Defines.ARMOR_BODY); } --- 1044,1049 ---- } }; ! public static gitem_armor_t jacketarmor_info= new gitem_armor_t(25, 50, .30f, .00f, Defines.ARMOR_JACKET); ! public static gitem_armor_t combatarmor_info= new gitem_armor_t(50, 100, .60f, .30f, Defines.ARMOR_COMBAT); ! public static gitem_armor_t bodyarmor_info= new gitem_armor_t(100, 200, .80f, .60f, Defines.ARMOR_BODY); } |
From: Rene S. <sa...@us...> - 2004-08-22 14:25:56
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/game Modified Files: game_import_t.java game_export_t.java GameBase.java GameFuncAdapters.java GameSave.java edict_t.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: game_export_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/game_export_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game_export_t.java 20 Aug 2004 21:29:58 -0000 1.4 --- game_export_t.java 22 Aug 2004 14:25:11 -0000 1.5 *************** *** 35,40 **** // ! public class game_export_t ! { public int apiversion; --- 35,39 ---- // ! public class game_export_t { public int apiversion; *************** *** 43,58 **** // not each time a level is loaded. Persistant data for clients // and the server can be allocated in init ! public void Init() ! { Game.InitGame(); } ! public void Shutdown() ! { Game.ShutdownGame(); } // each new level entered will cause a call to SpawnEntities ! public void SpawnEntities(String mapname, String entstring, String spawnpoint) ! { Game.SpawnEntities(mapname, entstring, spawnpoint); } --- 42,54 ---- // not each time a level is loaded. Persistant data for clients // and the server can be allocated in init ! public void Init() { Game.InitGame(); } ! public void Shutdown() { Game.ShutdownGame(); } // each new level entered will cause a call to SpawnEntities ! public void SpawnEntities(String mapname, String entstring, String spawnpoint) { Game.SpawnEntities(mapname, entstring, spawnpoint); } *************** *** 62,72 **** // WriteGame is called every time a level is exited. // ReadGame is called on a loadgame. ! public void WriteGame(String filename, boolean autosave) ! { GameSave.WriteGame(filename, autosave); } ! public void ReadGame(String filename) ! { Game.ReadGame(filename); } --- 58,66 ---- // WriteGame is called every time a level is exited. // ReadGame is called on a loadgame. ! public void WriteGame(String filename, boolean autosave) { GameSave.WriteGame(filename, autosave); } ! public void ReadGame(String filename) { Game.ReadGame(filename); } *************** *** 74,132 **** // ReadLevel is called after the default map information has been // loaded with SpawnEntities ! public void WriteLevel(String filename) ! { ! try ! { ! GameSave.WriteLevel(filename); ! } ! catch (IOException e) ! { ! e.printStackTrace(); ! } } ! public void ReadLevel(String filename) ! { ! try ! { ! GameSave.ReadLevel(filename); ! } ! catch (IOException e) ! { ! e.printStackTrace(); ! } } ! public boolean ClientConnect(edict_t ent, String userinfo) ! { return PlayerClient.ClientConnect(ent, userinfo); } ! ! public void ClientBegin(edict_t ent) ! { PlayerClient.ClientBegin(ent); } ! ! public void ClientUserinfoChanged(edict_t ent, String userinfo) ! { PlayerClient.ClientUserinfoChanged(ent, userinfo); } ! ! public void ClientDisconnect(edict_t ent) ! { PlayerClient.ClientDisconnect(ent); } ! public void ClientCommand(edict_t ent) ! { PlayerClient.ClientCommand(ent); } ! public void ClientThink(edict_t ent, usercmd_t cmd) ! { PlayerClient.ClientThink(ent, cmd); } ! public void RunFrame() ! { Game.G_RunFrame(); } --- 68,103 ---- // ReadLevel is called after the default map information has been // loaded with SpawnEntities ! public void WriteLevel(String filename) { ! GameSave.WriteLevel(filename); } ! public void ReadLevel(String filename) { ! GameSave.ReadLevel(filename); } ! public boolean ClientConnect(edict_t ent, String userinfo) { return PlayerClient.ClientConnect(ent, userinfo); } ! ! public void ClientBegin(edict_t ent) { PlayerClient.ClientBegin(ent); } ! ! public void ClientUserinfoChanged(edict_t ent, String userinfo) { PlayerClient.ClientUserinfoChanged(ent, userinfo); } ! ! public void ClientDisconnect(edict_t ent) { PlayerClient.ClientDisconnect(ent); } ! public void ClientCommand(edict_t ent) { PlayerClient.ClientCommand(ent); } ! public void ClientThink(edict_t ent, usercmd_t cmd) { PlayerClient.ClientThink(ent, cmd); } ! public void RunFrame() { Game.G_RunFrame(); } *************** *** 136,141 **** // the game can issue gi.argc() / gi.argv() commands to get the rest // of the parameters ! public void ServerCommand() ! { Game.ServerCommand(); } --- 107,111 ---- // the game can issue gi.argc() / gi.argv() commands to get the rest // of the parameters ! public void ServerCommand() { Game.ServerCommand(); } *************** *** 149,154 **** // the size will be fixed when ge.Init() is called ! public edict_t edicts[] = Game.g_edicts; public int num_edicts; // current number, <= max_edicts public int max_edicts; ! } \ No newline at end of file --- 119,124 ---- // the size will be fixed when ge.Init() is called ! public edict_t edicts[]= Game.g_edicts; public int num_edicts; // current number, <= max_edicts public int max_edicts; ! } Index: GameFuncAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameFuncAdapters.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GameFuncAdapters.java 8 Jul 2004 15:58:44 -0000 1.1 --- GameFuncAdapters.java 22 Aug 2004 14:25:11 -0000 1.2 *************** *** 31,36 **** import jake2.util.*; ! public class GameFuncAdapters ! { /* --- 31,35 ---- import jake2.util.*; ! public class GameFuncAdapters { [...2696 lines suppressed...] GameBase.gi.setmodel(ent, ent.model); ! ent.use = use_killbox; ! ent.svflags = Defines.SVF_NOCLIENT; return true; } --- 1623,1636 ---- Kills everything inside when fired, irrespective of protection. */ ! static EntUseAdapter use_killbox= new EntUseAdapter() { ! public void use(edict_t self, edict_t other, edict_t activator) { GameUtil.KillBox(self); } }; ! static EntThinkAdapter SP_func_killbox= new EntThinkAdapter() { ! public boolean think(edict_t ent) { GameBase.gi.setmodel(ent, ent.model); ! ent.use= use_killbox; ! ent.svflags= Defines.SVF_NOCLIENT; return true; } Index: GameSave.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSave.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameSave.java 20 Aug 2004 21:29:57 -0000 1.2 --- GameSave.java 22 Aug 2004 14:25:12 -0000 1.3 *************** *** 38,42 **** public class GameSave extends GameFunc { ! public static field_t levelfields[] = { new field_t("changemap", F_LSTRING), --- 38,42 ---- public class GameSave extends GameFunc { ! public static field_t levelfields[]= { new field_t("changemap", F_LSTRING), *************** *** 47,51 **** new field_t(null, F_INT)}; ! public static field_t clientfields[] = { new field_t("pers.weapon", F_ITEM), --- 47,51 ---- new field_t(null, F_INT)}; ! public static field_t clientfields[]= { new field_t("pers.weapon", F_ITEM), *************** *** 55,68 **** public static void CreateEdicts() { ! g_edicts = new edict_t[game.maxentities]; ! for (int i = 0; i < game.maxentities; i++) ! g_edicts[i] = new edict_t(i); ! SV_GAME.ge.edicts = g_edicts; } public static void CreateClients() { ! game.clients = new gclient_t[game.maxclients]; ! for (int i = 0; i < game.maxclients; i++) ! game.clients[i] = new gclient_t(i); } --- 55,68 ---- public static void CreateEdicts() { ! g_edicts= new edict_t[game.maxentities]; ! for (int i= 0; i < game.maxentities; i++) ! g_edicts[i]= new edict_t(i); ! SV_GAME.ge.edicts= g_edicts; } public static void CreateClients() { ! game.clients= new gclient_t[game.maxclients]; ! for (int i= 0; i < game.maxclients; i++) ! game.clients[i]= new gclient_t(i); } *************** *** 80,152 **** gi.dprintf("==== InitGame ====\n"); ! gun_x = gi.cvar("gun_x", "0", 0); ! gun_y = gi.cvar("gun_y", "0", 0); ! gun_z = gi.cvar("gun_z", "0", 0); //FIXME: sv_ prefix is wrong for these ! sv_rollspeed = gi.cvar("sv_rollspeed", "200", 0); ! sv_rollangle = gi.cvar("sv_rollangle", "2", 0); ! sv_maxvelocity = gi.cvar("sv_maxvelocity", "2000", 0); ! sv_gravity = gi.cvar("sv_gravity", "800", 0); // noset vars ! dedicated = gi.cvar("dedicated", "0", CVAR_NOSET); // latched vars ! sv_cheats = gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamename", GAMEVERSION, CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamedate", __DATE__, CVAR_SERVERINFO | CVAR_LATCH); ! maxclients = gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); ! maxspectators = gi.cvar("maxspectators", "4", CVAR_SERVERINFO); ! deathmatch = gi.cvar("deathmatch", "0", CVAR_LATCH); ! coop = gi.cvar("coop", "0", CVAR_LATCH); ! skill = gi.cvar("skill", "0", CVAR_LATCH); ! maxentities = gi.cvar("maxentities", "1024", CVAR_LATCH); // change anytime vars ! dmflags = gi.cvar("dmflags", "0", CVAR_SERVERINFO); ! fraglimit = gi.cvar("fraglimit", "0", CVAR_SERVERINFO); ! timelimit = gi.cvar("timelimit", "0", CVAR_SERVERINFO); ! password = gi.cvar("password", "", CVAR_USERINFO); ! spectator_password = gi.cvar("spectator_password", "", CVAR_USERINFO); ! needpass = gi.cvar("needpass", "0", CVAR_SERVERINFO); ! filterban = gi.cvar("filterban", "1", 0); ! g_select_empty = gi.cvar("g_select_empty", "0", CVAR_ARCHIVE); ! run_pitch = gi.cvar("run_pitch", "0.002", 0); ! run_roll = gi.cvar("run_roll", "0.005", 0); ! bob_up = gi.cvar("bob_up", "0.005", 0); ! bob_pitch = gi.cvar("bob_pitch", "0.002", 0); ! bob_roll = gi.cvar("bob_roll", "0.002", 0); // flood control ! flood_msgs = gi.cvar("flood_msgs", "4", 0); ! flood_persecond = gi.cvar("flood_persecond", "4", 0); ! flood_waitdelay = gi.cvar("flood_waitdelay", "10", 0); // dm map list ! sv_maplist = gi.cvar("sv_maplist", "", 0); // items InitItems(); ! game.helpmessage1 = ""; ! game.helpmessage2 = ""; // initialize all entities for this game ! game.maxentities = (int) maxentities.value; CreateEdicts(); ! globals.edicts = g_edicts; ! globals.max_edicts = game.maxentities; // initialize all clients for this game ! game.maxclients = (int) maxclients.value; CreateClients(); ! ! globals.num_edicts = game.maxclients + 1; } --- 80,152 ---- gi.dprintf("==== InitGame ====\n"); ! gun_x= gi.cvar("gun_x", "0", 0); ! gun_y= gi.cvar("gun_y", "0", 0); ! gun_z= gi.cvar("gun_z", "0", 0); //FIXME: sv_ prefix is wrong for these ! sv_rollspeed= gi.cvar("sv_rollspeed", "200", 0); ! sv_rollangle= gi.cvar("sv_rollangle", "2", 0); ! sv_maxvelocity= gi.cvar("sv_maxvelocity", "2000", 0); ! sv_gravity= gi.cvar("sv_gravity", "800", 0); // noset vars ! dedicated= gi.cvar("dedicated", "0", CVAR_NOSET); // latched vars ! sv_cheats= gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamename", GAMEVERSION, CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamedate", __DATE__, CVAR_SERVERINFO | CVAR_LATCH); ! maxclients= gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); ! maxspectators= gi.cvar("maxspectators", "4", CVAR_SERVERINFO); ! deathmatch= gi.cvar("deathmatch", "0", CVAR_LATCH); ! coop= gi.cvar("coop", "0", CVAR_LATCH); ! skill= gi.cvar("skill", "0", CVAR_LATCH); ! maxentities= gi.cvar("maxentities", "1024", CVAR_LATCH); // change anytime vars ! dmflags= gi.cvar("dmflags", "0", CVAR_SERVERINFO); ! fraglimit= gi.cvar("fraglimit", "0", CVAR_SERVERINFO); ! timelimit= gi.cvar("timelimit", "0", CVAR_SERVERINFO); ! password= gi.cvar("password", "", CVAR_USERINFO); ! spectator_password= gi.cvar("spectator_password", "", CVAR_USERINFO); ! needpass= gi.cvar("needpass", "0", CVAR_SERVERINFO); ! filterban= gi.cvar("filterban", "1", 0); ! g_select_empty= gi.cvar("g_select_empty", "0", CVAR_ARCHIVE); ! run_pitch= gi.cvar("run_pitch", "0.002", 0); ! run_roll= gi.cvar("run_roll", "0.005", 0); ! bob_up= gi.cvar("bob_up", "0.005", 0); ! bob_pitch= gi.cvar("bob_pitch", "0.002", 0); ! bob_roll= gi.cvar("bob_roll", "0.002", 0); // flood control ! flood_msgs= gi.cvar("flood_msgs", "4", 0); ! flood_persecond= gi.cvar("flood_persecond", "4", 0); ! flood_waitdelay= gi.cvar("flood_waitdelay", "10", 0); // dm map list ! sv_maplist= gi.cvar("sv_maplist", "", 0); // items InitItems(); ! game.helpmessage1= ""; ! game.helpmessage2= ""; // initialize all entities for this game ! game.maxentities= (int) maxentities.value; CreateEdicts(); ! globals.edicts= g_edicts; ! globals.max_edicts= game.maxentities; // initialize all clients for this game ! game.maxclients= (int) maxclients.value; CreateClients(); ! ! globals.num_edicts= game.maxclients + 1; } *************** *** 165,205 **** ============ */ ! public static void WriteGame (String filename, boolean autosave) ! { ! try ! { ! QuakeFile f; ! if (!autosave) SaveClientData(); ! ! f = new QuakeFile(filename, "rw"); ! if (f == null) ! gi.error ("Couldn't write to " + filename); ! ! game.autosaved = autosave; game.write(f); ! game.autosaved = false; ! ! for (int i=0 ; i<game.maxclients ; i++) ! game.clients[i]. write(f); ! ! fclose (f); } ! catch (Exception e) ! { e.printStackTrace(); } } - public static void ReadGame(String filename) { ! QuakeFile f = null; try { ! f = new QuakeFile(filename, "r"); Com.Printf("loading game:" + filename); CreateEdicts(); --- 165,201 ---- ============ */ ! public static void WriteGame(String filename, boolean autosave) { ! try { ! QuakeFile f; ! if (!autosave) SaveClientData(); ! ! f= new QuakeFile(filename, "rw"); ! if (f == null) ! gi.error("Couldn't write to " + filename); ! ! game.autosaved= autosave; game.write(f); ! game.autosaved= false; ! ! for (int i= 0; i < game.maxclients; i++) ! game.clients[i].write(f); ! ! fclose(f); } ! catch (Exception e) { e.printStackTrace(); } } public static void ReadGame(String filename) { ! QuakeFile f= null; try { ! f= new QuakeFile(filename, "r"); Com.Printf("loading game:" + filename); CreateEdicts(); *************** *** 207,215 **** game.load(f); ! for (int i = 0; i < game.maxclients; i++) { ! game.clients[i] = new gclient_t(i); game.clients[i].read(f); } ! f.close(); } --- 203,211 ---- game.load(f); ! for (int i= 0; i < game.maxclients; i++) { ! game.clients[i]= new gclient_t(i); game.clients[i].read(f); } ! f.close(); } *************** *** 219,223 **** } } ! /* ================= --- 215,219 ---- } } ! /* ================= *************** *** 226,267 **** ================= */ ! static void WriteLevel (String filename) ! { ! try ! { int i; edict_t ent; QuakeFile f; ! f= new QuakeFile(filename, "rw"); ! if (f==null) gi.error("Couldn't open for writing: " + filename); ! // write out level_locals_t level.write(f); ! // write out all the entities ! for (i= 0; i < globals.num_edicts; i++) ! { ent= g_edicts[i]; if (!ent.inuse) ! continue; ! f.writeInt(i); ent.write(f); ! } ! i= -1; f.writeInt(-1); ! f.close(); } ! catch (Exception e) ! { e.printStackTrace(); } } ! ! /* ================= --- 222,258 ---- ================= */ ! static void WriteLevel(String filename) { ! try { int i; edict_t ent; QuakeFile f; ! f= new QuakeFile(filename, "rw"); ! if (f == null) gi.error("Couldn't open for writing: " + filename); ! // write out level_locals_t level.write(f); ! // write out all the entities ! for (i= 0; i < globals.num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) ! continue; ! f.writeInt(i); ent.write(f); ! } ! i= -1; f.writeInt(-1); ! f.close(); } ! catch (Exception e) { e.printStackTrace(); } } ! /* ================= *************** *** 280,339 **** ================= */ ! static void ReadLevel (String filename) throws IOException ! { ! edict_t ent; ! ! QuakeFile f = new QuakeFile(filename, "r"); ! ! if (f==null) ! gi.error ("Couldn't read level file " + filename); ! ! // wipe all the entities ! Game.CreateEdicts(); ! ! globals.num_edicts = (int) maxclients.value + 1; ! // load the level locals ! level.read(f); ! ! // load all the entities ! while (true) ! { ! int entnum = f.readInt(); ! if (entnum == -1) ! break; ! ! if (entnum >= globals.num_edicts) ! globals.num_edicts = entnum + 1; ! ! ent = g_edicts[entnum]; ! System.out.println("readint ent" + entnum); ! ent.read(f); ! ent.cleararealinks(); ! gi.linkentity(ent); ! } ! ! fclose (f); ! ! // mark all clients as unconnected ! for (int i=0 ; i<maxclients.value ; i++) ! { ! ent = g_edicts[i+1]; ! ent.client = game.clients[i]; ! ent.client.pers.connected = false; } ! ! // do any load time things at this point ! for (int i=0 ; i<globals.num_edicts ; i++) ! { ! ent = g_edicts[i]; ! ! if (!ent.inuse) ! continue; ! ! // fire any cross-level triggers ! if (ent.classname != null) ! if (strcmp(ent.classname, "target_crosslevel_target") == 0) ! ent.nextthink = level.time + ent.delay; } } --- 271,331 ---- ================= */ ! static void ReadLevel(String filename) { ! try { ! edict_t ent; ! QuakeFile f= new QuakeFile(filename, "r"); ! ! if (f == null) ! gi.error("Couldn't read level file " + filename); ! ! // wipe all the entities ! Game.CreateEdicts(); ! ! globals.num_edicts= (int) maxclients.value + 1; ! ! // load the level locals ! level.read(f); ! ! // load all the entities ! while (true) { ! int entnum= f.readInt(); ! if (entnum == -1) ! break; ! ! if (entnum >= globals.num_edicts) ! globals.num_edicts= entnum + 1; ! ! ent= g_edicts[entnum]; ! System.out.println("readint ent" + entnum); ! ent.read(f); ! ent.cleararealinks(); ! gi.linkentity(ent); ! } ! ! fclose(f); ! ! // mark all clients as unconnected ! for (int i= 0; i < maxclients.value; i++) { ! ent= g_edicts[i + 1]; ! ent.client= game.clients[i]; ! ent.client.pers.connected= false; ! } ! ! // do any load time things at this point ! for (int i= 0; i < globals.num_edicts; i++) { ! ent= g_edicts[i]; ! ! if (!ent.inuse) ! continue; ! ! // fire any cross-level triggers ! if (ent.classname != null) ! if (strcmp(ent.classname, "target_crosslevel_target") == 0) ! ent.nextthink= level.time + ent.delay; ! } } ! catch (Exception e) { ! e.printStackTrace(); } } Index: edict_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/edict_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edict_t.java 20 Aug 2004 21:29:57 -0000 1.3 --- edict_t.java 22 Aug 2004 14:25:12 -0000 1.4 *************** *** 30,39 **** import jake2.util.*; ! public class edict_t ! { /** Constructor. */ ! public edict_t(int i) ! { s.number= i; index= i; --- 30,37 ---- import jake2.util.*; ! public class edict_t { /** Constructor. */ ! public edict_t(int i) { s.number= i; index= i; *************** *** 41,46 **** /** Used during level loading. */ ! public void cleararealinks() ! { area= new link_t(this); } --- 39,43 ---- /** Used during level loading. */ ! public void cleararealinks() { area= new link_t(this); } *************** *** 220,418 **** ///////////////////////////////////////////////// ! public boolean set(String key, String value) ! { ! if (key.equals("classname")) ! { classname= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("model")) ! { model= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("spawnflags")) ! { spawnflags= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("speed")) ! { speed= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("accel")) ! { accel= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("decel")) ! { decel= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("target")) ! { target= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("targetname")) ! { targetname= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("pathtarget")) ! { pathtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("deathtarget")) ! { deathtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("killtarget")) ! { killtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("combattarget")) ! { combattarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("message")) ! { message= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("team")) ! { team= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("wait")) ! { wait= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("delay")) ! { delay= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("random")) ! { random= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("move_origin")) ! { move_origin= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("move_angles")) ! { move_angles= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("style")) ! { style= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("count")) ! { count= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("health")) ! { health= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("sounds")) ! { sounds= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("light")) ! { return true; } // F_IGNORE), ! if (key.equals("dmg")) ! { dmg= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("mass")) ! { mass= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("volume")) ! { volume= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("attenuation")) ! { attenuation= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("map")) ! { map= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("origin")) ! { s.origin= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("angles")) ! { s.angles= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("angle")) ! { s.angles= new float[] { 0, Lib.atof(value), 0 }; return true; } // F_ANGLEHACK), ! if (key.equals("item")) ! { Game.gi.error("ent.set(\"item\") called."); return true; --- 217,381 ---- ///////////////////////////////////////////////// ! public boolean set(String key, String value) { ! if (key.equals("classname")) { classname= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("model")) { model= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("spawnflags")) { spawnflags= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("speed")) { speed= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("accel")) { accel= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("decel")) { decel= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("target")) { target= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("targetname")) { targetname= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("pathtarget")) { pathtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("deathtarget")) { deathtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("killtarget")) { killtarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("combattarget")) { combattarget= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("message")) { message= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("team")) { team= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("wait")) { wait= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("delay")) { delay= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("random")) { random= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("move_origin")) { move_origin= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("move_angles")) { move_angles= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("style")) { style= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("count")) { count= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("health")) { health= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("sounds")) { sounds= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("light")) { return true; } // F_IGNORE), ! if (key.equals("dmg")) { dmg= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("mass")) { mass= Lib.atoi(value); return true; } // F_INT), ! if (key.equals("volume")) { volume= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("attenuation")) { attenuation= Lib.atof(value); return true; } // F_FLOAT), ! if (key.equals("map")) { map= GameSpawn.ED_NewString(value); return true; } // F_LSTRING), ! if (key.equals("origin")) { s.origin= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("angles")) { s.angles= Lib.atov(value); return true; } // F_VECTOR), ! if (key.equals("angle")) { s.angles= new float[] { 0, Lib.atof(value), 0 }; return true; } // F_ANGLEHACK), ! if (key.equals("item")) { Game.gi.error("ent.set(\"item\") called."); return true; *************** *** 423,428 **** /** Writes the entity to the file. */ ! public void write(QuakeFile f) throws IOException ! { s.write(f); --- 386,390 ---- /** Writes the entity to the file. */ ! public void write(QuakeFile f) throws IOException { s.write(f); *************** *** 435,440 **** if (clusternums == null) f.writeInt(-1); ! else ! { f.writeInt(Defines.MAX_ENT_CLUSTERS); for (int n= 0; n < Defines.MAX_ENT_CLUSTERS; n++) --- 397,401 ---- if (clusternums == null) f.writeInt(-1); ! else { f.writeInt(Defines.MAX_ENT_CLUSTERS); for (int n= 0; n < Defines.MAX_ENT_CLUSTERS; n++) *************** *** 468,471 **** --- 429,433 ---- f.writeString(target); f.writeString(targetname); + f.writeString(killtarget); f.writeString(team); f.writeString(pathtarget); *************** *** 583,588 **** /** Reads the entity from the file.*/ ! public void read(QuakeFile f) throws IOException ! { s.read(f); inuse= f.readBoolean(); --- 545,549 ---- /** Reads the entity from the file.*/ ! public void read(QuakeFile f) throws IOException { s.read(f); inuse= f.readBoolean(); *************** *** 597,602 **** if (len == -1) clusternums= null; ! else ! { clusternums= new int[Defines.MAX_ENT_CLUSTERS]; for (int n= 0; n < Defines.MAX_ENT_CLUSTERS; n++) --- 558,562 ---- if (len == -1) clusternums= null; ! else { clusternums= new int[Defines.MAX_ENT_CLUSTERS]; for (int n= 0; n < Defines.MAX_ENT_CLUSTERS; n++) *************** *** 630,633 **** --- 590,594 ---- target= f.readString(); targetname= f.readString(); + killtarget= f.readString(); team= f.readString(); pathtarget= f.readString(); Index: game_import_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/game_import_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** game_import_t.java 8 Jul 2004 15:58:44 -0000 1.2 --- game_import_t.java 22 Aug 2004 14:25:11 -0000 1.3 *************** *** 41,46 **** public class game_import_t { - // R S T: SEE SV_InitGameProgs() ! - // special messages public void bprintf(int printlevel, String s) --- 41,44 ---- Index: GameBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameBase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameBase.java 20 Aug 2004 21:29:58 -0000 1.4 --- GameBase.java 22 Aug 2004 14:25:11 -0000 1.5 *************** *** 34,45 **** import jake2.util.*; ! public class GameBase extends Globals ! { ! public static cplane_t dummyplane = new cplane_t(); ! public static game_locals_t game = new game_locals_t(); ! public static level_locals_t level = new level_locals_t(); ! public static game_import_t gi = new game_import_t(); ! public static game_export_t globals = new game_export_t(); ! public static spawn_temp_t st = new spawn_temp_t(); [...1146 lines suppressed...] }; ! globals.apiversion = GAME_API_VERSION; /* globals.Init = InitGame; --- 699,712 ---- */ ! public static game_export_t GetGameApi(game_import_t imp) { ! gi= imp; ! gi.pointcontents= new pmove_t.PointContentsAdapter() { ! public int pointcontents(float[] o) { return SV_WORLD.SV_PointContents(o); } }; ! globals.apiversion= GAME_API_VERSION; /* globals.Init = InitGame; |
From: Rene S. <sa...@us...> - 2004-08-22 14:25:29
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/server Modified Files: SV.java SV_GAME.java SV_CCMDS.java client_t.java SV_INIT.java SV_SEND.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_CCMDS.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV_CCMDS.java 22 Aug 2004 14:25:12 -0000 1.7 *************** *** 36,41 **** import java.util.Calendar; ! public class SV_CCMDS extends SV_ENTS ! { /* --- 36,40 ---- import java.util.Calendar; ! public class SV_CCMDS extends SV_ENTS { [...1476 lines suppressed...] ! public void execute() { SV_Savegame_f(); } }); ! Cmd.AddCommand("load", new xcommand_t() { ! public void execute() { SV_Loadgame_f(); } }); ! Cmd.AddCommand("killserver", new xcommand_t() { ! public void execute() { SV_KillServer_f(); } }); ! Cmd.AddCommand("sv", new xcommand_t() { ! public void execute() { SV_ServerCommand_f(); } Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SV_SEND.java 8 Jul 2004 20:56:54 -0000 1.3 --- SV_SEND.java 22 Aug 2004 14:25:13 -0000 1.4 *************** *** 41,49 **** */ ! public static byte sv_outputbuf[] = new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s = ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } --- 41,49 ---- */ ! public static byte sv_outputbuf[]= new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s= ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } *************** *** 104,124 **** // echo to console ! if (dedicated.value!=0) ! { ! ! //char copy[1024]; ! //int i; ! ! // mask off high bits ! //for (i=0 ; i<1023 && string[i] ; i++) ! //copy[i] = string[i]&127; ! //copy[i] = 0; ! //Com_Printf ("%s", copy); ! ! Com.Printf(s); ! } ! for (int i = 0; i < SV_MAIN.maxclients.value; i++) { ! cl = SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; --- 104,123 ---- // echo to console ! if (dedicated.value != 0) { ! //char copy[1024]; ! //int i; ! ! // mask off high bits ! //for (i=0 ; i<1023 && string[i] ; i++) ! //copy[i] = string[i]&127; ! //copy[i] = 0; ! //Com_Printf ("%s", copy); ! ! Com.Printf(s); ! } ! ! for (int i= 0; i < SV_MAIN.maxclients.value; i++) { ! cl= SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; *************** *** 174,186 **** int area1, area2; ! reliable = false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum = CM.CM_PointLeafnum(origin); ! area1 = CM.CM_LeafArea(leafnum); } else { ! leafnum = 0; // just to avoid compiler warnings ! area1 = 0; } --- 173,185 ---- int area1, area2; ! reliable= false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum= CM.CM_PointLeafnum(origin); ! area1= CM.CM_LeafArea(leafnum); } else { ! leafnum= 0; // just to avoid compiler warnings ! area1= 0; } *************** *** 191,224 **** switch (to) { case MULTICAST_ALL_R : ! reliable = true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum = 0; ! mask = null; break; case MULTICAST_PHS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PHS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PVS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPVS(cluster); break; default : ! mask = null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j = 0; j < maxclients.value; j++) { ! client = svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) --- 190,223 ---- switch (to) { case MULTICAST_ALL_R : ! reliable= true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum= 0; ! mask= null; break; case MULTICAST_PHS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PHS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PVS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPVS(cluster); break; default : ! mask= null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j= 0; j < maxclients.value; j++) { ! client= svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) *************** *** 228,237 **** if (mask != null) { ! leafnum = CM.CM_PointLeafnum(client.edict.s.origin); ! cluster = CM.CM_LeafCluster(leafnum); ! area2 = CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) --- 227,236 ---- if (mask != null) { ! leafnum= CM.CM_PointLeafnum(client.edict.s.origin); ! cluster= CM.CM_LeafCluster(leafnum); ! area2= CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) *************** *** 288,292 **** int i; int ent; ! float[] origin_v = {0,0,0}; boolean use_phs; --- 287,291 ---- int i; int ent; ! float[] origin_v= { 0, 0, 0 }; boolean use_phs; *************** *** 303,321 **** Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! //ent = NUM_FOR_EDICT(entity); ! //TODO: somehow risky (dont know if constant correct index) ! ent = entity.index; ! if ((channel & 8) != 0) // no PHS flag ! { ! use_phs = false; channel &= 7; } else ! use_phs = true; ! sendchan = (ent << 3) | (channel & 7); ! flags = 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; --- 302,318 ---- Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! ent= entity.index; ! // no PHS flag ! if ((channel & 8) != 0) { ! use_phs= false; channel &= 7; } else ! use_phs= true; ! sendchan= (ent << 3) | (channel & 7); ! flags= 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; *************** *** 336,343 **** // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin = origin_v; if (entity.solid == SOLID_BSP) { ! for (i = 0; i < 3; i++) ! origin_v[i] = entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { --- 333,340 ---- // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin= origin_v; if (entity.solid == SOLID_BSP) { ! for (i= 0; i < 3; i++) ! origin_v[i]= entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { *************** *** 366,370 **** // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs = false; if ((channel & CHAN_RELIABLE) != 0) { --- 363,367 ---- // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs= false; if ((channel & CHAN_RELIABLE) != 0) { *************** *** 396,410 **** */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[] = new byte[MAX_MSGLEN]; ! sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow = true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient (client, msg); // copy the accumulated multicast datagram --- 393,407 ---- */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[]= new byte[MAX_MSGLEN]; ! sizebuf_t msg= new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow= true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient(client, msg); // copy the accumulated multicast datagram *************** *** 427,431 **** // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES] = msg.cursize; return true; --- 424,428 ---- // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES]= msg.cursize; return true; *************** *** 445,449 **** Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile = null; } SV_ENTS.SV_Nextserver(); --- 442,446 ---- Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile= null; } SV_ENTS.SV_Nextserver(); *************** *** 466,472 **** return false; ! total = 0; ! for (i = 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } --- 463,469 ---- return false; ! total= 0; ! for (i= 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } *************** *** 474,478 **** if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES] = 0; return true; } --- 471,475 ---- if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES]= 0; return true; } *************** *** 490,507 **** client_t c; int msglen; ! byte msgbuf[] = new byte[MAX_MSGLEN]; int r; ! msglen = 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen = 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen = EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { --- 487,504 ---- client_t c; int msglen; ! byte msgbuf[]= new byte[MAX_MSGLEN]; int r; ! msglen= 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen= 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen= EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { *************** *** 519,525 **** //r = fread (msgbuf, msglen, 1, sv.demofile); ! r = 0; try { ! r = sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { --- 516,522 ---- //r = fread (msgbuf, msglen, 1, sv.demofile); ! r= 0; try { ! r= sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { *************** *** 534,539 **** // send a message to each connected client ! for (i = 0; i < maxclients.value; i++) { ! c = svs.clients[i]; if (c.state == 0) --- 531,536 ---- // send a message to each connected client ! for (i= 0; i < maxclients.value; i++) { ! c= svs.clients[i]; if (c.state == 0) Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_INIT.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV_INIT.java 22 Aug 2004 14:25:13 -0000 1.7 *************** *** 34,39 **** import java.io.RandomAccessFile; ! public class SV_INIT extends Globals ! { public static server_static_t svs= new server_static_t(); // persistant server info --- 34,38 ---- import java.io.RandomAccessFile; ! public class SV_INIT extends Globals { public static server_static_t svs= new server_static_t(); // persistant server info *************** *** 46,51 **** ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) ! { int i; --- 45,49 ---- ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) { int i; *************** *** 66,71 **** sv.configstrings[start + i]= name; ! if (sv.state != ss_loading) ! { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); --- 64,68 ---- sv.configstrings[start + i]= name; ! if (sv.state != ss_loading) { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); *************** *** 78,93 **** } ! public static int SV_ModelIndex(String name) ! { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) ! { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) ! { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } --- 75,87 ---- } ! public static int SV_ModelIndex(String name) { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } *************** *** 102,112 **** ================ */ ! public static void SV_CreateBaseline() ! { edict_t svent; int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) ! { //svent = EDICT_NUM(entnum); svent= SV_GAME.ge.edicts[entnum]; --- 96,104 ---- ================ */ ! public static void SV_CreateBaseline() { edict_t svent; int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); svent= SV_GAME.ge.edicts[entnum]; *************** *** 132,140 **** ================= */ ! public static void SV_CheckForSavegame() ! { ! //char name[MAX_OSPATH]; String name; - //FILE *f; RandomAccessFile f; --- 124,130 ---- ================= */ ! public static void SV_CheckForSavegame() { ! String name; RandomAccessFile f; *************** *** 148,167 **** name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try ! { f= new RandomAccessFile(name, "r"); } ! catch (Exception e) ! { ! return; // no savegame } ! try ! { f.close(); } ! catch (IOException e1) ! { e1.printStackTrace(); } --- 138,153 ---- name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try { f= new RandomAccessFile(name, "r"); } ! catch (Exception e) { ! return; } ! try { f.close(); } ! catch (IOException e1) { e1.printStackTrace(); } *************** *** 172,177 **** SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) ! { // coming back to a level after being in a different // level, so run it for ten seconds --- 158,162 ---- SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) { // coming back to a level after being in a different // level, so run it for ten seconds *************** *** 199,204 **** ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) ! { int i; int checksum= 0; --- 184,188 ---- ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) { int i; int checksum= 0; *************** *** 211,220 **** Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try ! { sv.demofile.close(); } ! catch (Exception e) ! { } --- 195,202 ---- Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try { sv.demofile.close(); } ! catch (Exception e) { } *************** *** 222,229 **** // restarted ! sv.state = ss_dead; ! ! Globals.server_state= sv.state; // wipe the entire per-level structure --- 204,210 ---- // restarted ! sv.state= ss_dead; + Globals.server_state= sv.state; // wipe the entire per-level structure *************** *** 238,248 **** sv.configstrings[CS_NAME]= server; ! if (Cvar.VariableValue("deathmatch") != 0) ! { sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } ! else ! { sv.configstrings[CS_AIRACCEL]= "0"; PMove.pm_airaccelerate= 0; --- 219,227 ---- sv.configstrings[CS_NAME]= server; ! if (Cvar.VariableValue("deathmatch") != 0) { sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } ! else { sv.configstrings[CS_AIRACCEL]= "0"; PMove.pm_airaccelerate= 0; *************** *** 254,259 **** // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { // needs to reconnect if (svs.clients[i].state > cs_connected) --- 233,237 ---- // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { // needs to reconnect if (svs.clients[i].state > cs_connected) *************** *** 269,278 **** int iw[]= { checksum }; ! if (serverstate != ss_game) ! { sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } ! else ! { sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); --- 247,254 ---- int iw[]= { checksum }; ! if (serverstate != ss_game) { sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } ! else { sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); *************** *** 286,291 **** SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) ! { sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references --- 262,266 ---- SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) { sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references *************** *** 300,304 **** // map initialization ! sv.state = ss_loading; Globals.server_state= sv.state; --- 275,279 ---- // map initialization ! sv.state= ss_loading; Globals.server_state= sv.state; *************** *** 311,315 **** // all precaches are complete ! sv.state = serverstate; Globals.server_state= sv.state; --- 286,290 ---- // all precaches are complete ! sv.state= serverstate; Globals.server_state= sv.state; *************** *** 333,338 **** ============== */ ! public static void SV_InitGame() ! { int i; edict_t ent; --- 308,312 ---- ============== */ ! public static void SV_InitGame() { int i; edict_t ent; *************** *** 340,350 **** String idmaster; ! if (svs.initialized) ! { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else ! { // make sure the client is down CL.Drop(); --- 314,322 ---- String idmaster; ! if (svs.initialized) { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else { // make sure the client is down CL.Drop(); *************** *** 357,362 **** svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) ! { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); --- 329,333 ---- svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 365,370 **** // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) ! { if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); --- 336,340 ---- // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) { if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 372,377 **** // init clients ! if (Cvar.VariableValue("deathmatch") != 0) ! { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); --- 342,346 ---- // init clients ! if (Cvar.VariableValue("deathmatch") != 0) { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 379,384 **** Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) ! { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); --- 348,352 ---- Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 414,419 **** SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { ent= SV_GAME.ge.edicts[i + 1]; --- 382,386 ---- SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { ent= SV_GAME.ge.edicts[i + 1]; *************** *** 441,446 **** ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) ! { //char level[MAX_QPATH]; //char *ch; --- 408,412 ---- ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) { //char level[MAX_QPATH]; //char *ch; *************** *** 471,481 **** int c= level.indexOf('+'); ! if (c != -1) ! { Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level= level.substring(0, c); } ! else ! { Cvar.Set("nextserver", ""); } --- 437,445 ---- int c= level.indexOf('+'); ! if (c != -1) { Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level= level.substring(0, c); } ! else { Cvar.Set("nextserver", ""); } *************** *** 487,492 **** // if there is a $, use the remainder as a spawnpoint int pos= level.indexOf('$'); ! if (pos != -1) ! { //* ch = 0; spawnpoint= level.substring(pos + 1); --- 451,455 ---- // if there is a $, use the remainder as a spawnpoint int pos= level.indexOf('$'); ! if (pos != -1) { //* ch = 0; spawnpoint= level.substring(pos + 1); *************** *** 503,526 **** l= level.length(); ! if (l > 4 && level.endsWith(".cin")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); --- 466,485 ---- l= level.length(); ! if (l > 4 && level.endsWith(".cin")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); Index: SV_GAME.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_GAME.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_GAME.java 9 Jul 2004 06:50:49 -0000 1.5 --- SV_GAME.java 22 Aug 2004 14:25:12 -0000 1.6 *************** *** 33,38 **** public class SV_GAME extends SV_INIT { - // sv_game.c -- interface to the game dll - public static game_export_t ge; --- 33,36 ---- *************** *** 51,55 **** return; - //p = NUM_FOR_EDICT(ent); p = ent.index; if (p < 1 || p > SV_MAIN.maxclients.value) --- 49,52 ---- *************** *** 74,87 **** */ public static void PF_dprintf(String fmt) { - /* - char msg[1024]; - va_list argptr; - - va_start (argptr,fmt); - vsprintf (msg, fmt, argptr); - va_end (argptr); - - */ - Com.Printf(fmt); } --- 71,74 ---- *************** *** 95,105 **** */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! //char msg[1024]; ! //va_list argptr; int n = 0; if (ent != null) { - - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) --- 82,89 ---- */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! int n = 0; if (ent != null) { n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) *************** *** 107,114 **** } - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - if (ent != null) SV_SEND.SV_ClientPrintf(svs.clients[n - 1], level, fmt); --- 91,94 ---- *************** *** 125,142 **** */ public static void PF_centerprintf(edict_t ent, String fmt) { - //char msg[1024]; - //va_list argptr; int n; - //TODO: NUM_FOR_EDICT - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) return; // Com_Error (ERR_DROP, "centerprintf to a non-client"); - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - MSG.WriteByte(sv.multicast, svc_centerprint); MSG.WriteString(sv.multicast, fmt); --- 105,114 ---- *************** *** 175,179 **** i = SV_ModelIndex(name); - //ent.model = name; ent.s.modelindex = i; --- 147,150 ---- Index: client_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/client_t.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** client_t.java 7 Jul 2004 19:59:50 -0000 1.1 --- client_t.java 22 Aug 2004 14:25:13 -0000 1.2 *************** *** 44,48 **** int state; - //char userinfo[MAX_INFO_STRING]; // name, etc String userinfo = ""; --- 44,47 ---- *************** *** 86,90 **** netchan_t netchan = new netchan_t(); ! //TODO: this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } --- 85,89 ---- netchan_t netchan = new netchan_t(); ! //this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV.java 22 Aug 2004 14:25:12 -0000 1.7 *************** *** 850,854 **** } ! // regular thinking SV_RunThink(ent); } --- 850,854 ---- } ! // regular thinking SV_RunThink(ent); } |
From: Rene S. <sa...@us...> - 2004-08-22 14:25:28
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/client Modified Files: SCR.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SCR.java 9 Jul 2004 06:50:50 -0000 1.5 --- SCR.java 22 Aug 2004 14:25:15 -0000 1.6 *************** *** 40,49 **** * SCR */ ! public final class SCR extends Globals ! { // cl_scrn.c -- master for refresh, status bar, console, chat, notify, etc ! static String[][] sb_nums = { { "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_minus" }, { "anum_0", "anum_1", "anum_2", "anum_3", "anum_4", "anum_5", "anum_6", "anum_7", "anum_8", "anum_9", "anum_minus" } [...3372 lines suppressed...] ! // cin.s_channels = LittleLong(cin.s_channels); ! // ! // Huff1TableInit (); ! // ! // // switch up to 22 khz sound if necessary ! // old_khz = Cvar_VariableValue ("s_khz"); ! // if (old_khz != cin.s_rate/1000) ! // { ! // cin.restart_sound = true; ! // Cvar_SetValue ("s_khz", cin.s_rate/1000); ! // CL_Snd_Restart_f (); ! // Cvar_SetValue ("s_khz", old_khz); ! // } ! // ! // cl.cinematicframe = 0; ! // cin.pic = SCR_ReadNextFrame (); ! // cl.cinematictime = Sys_Milliseconds (); } } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2004-08-22 14:25:26
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/render/fastjogl Modified Files: Draw.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Draw.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Draw.java 16 Jul 2004 10:11:35 -0000 1.3 --- Draw.java 22 Aug 2004 14:25:14 -0000 1.4 *************** *** 276,280 **** } ! // ============================================================================= /* --- 276,280 ---- } ! //============================================================================= /* |
From: Rene S. <sa...@us...> - 2004-08-22 14:25:24
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/qcommon Modified Files: PMove.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: PMove.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/PMove.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PMove.java 8 Jul 2004 15:58:46 -0000 1.2 --- PMove.java 22 Aug 2004 14:25:14 -0000 1.3 *************** *** 161,164 **** --- 161,165 ---- if (pm.numtouch < MAXTOUCH && trace.ent != null) { + //rst: just for debugging touches. //if (trace.ent.index != -1 && trace.ent.index != 0) //Com.p("touch: " + trace.ent.classname + " (" + trace.ent.index + ")" ); *************** *** 1257,1260 **** PM_SnapPosition(); } - } --- 1258,1260 ---- |
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2/game Modified Files: GameUtil.java gitem_t.java client_respawn_t.java level_locals_t.java GameSave.java mmove_t.java edict_t.java moveinfo_t.java mframe_t.java game_export_t.java SuperAdapter.java PlayerClient.java game_locals_t.java GameBase.java entity_state_t.java PlayerClientAdapters.java player_state_t.java pmove_state_t.java monsterinfo_t.java client_persistant_t.java gclient_t.java Log Message: savegames now seem to work. Index: PlayerClientAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerClientAdapters.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlayerClientAdapters.java 8 Jul 2004 15:58:43 -0000 1.1 --- PlayerClientAdapters.java 20 Aug 2004 21:29:58 -0000 1.2 *************** *** 35,39 **** // Gross, ugly, disgustuing hack section // ! // this function is an ugly as hell hack to fix some map flaws // --- 35,39 ---- // Gross, ugly, disgustuing hack section // ! // this function is an ugly as hell hack to fix some map flaws // *************** *** 43,59 **** // we use carnal knowledge of the maps to fix the coop spot targetnames to match // that of the nearest named single player spot ! ! static EntThinkAdapter SP_FixCoopSpots = new EntThinkAdapter() { public boolean think(edict_t self) { ! edict_t spot; ! float[] d = { 0, 0, 0 }; ! ! spot = null; ! EdictIterator es = null; ! while (true) { ! es = GameBase.G_Find(es, GameBase.findByClass, "info_player_start"); ! spot = es.o; if (spot == null) return true; --- 43,59 ---- // we use carnal knowledge of the maps to fix the coop spot targetnames to match // that of the nearest named single player spot ! ! static EntThinkAdapter SP_FixCoopSpots= new EntThinkAdapter() { public boolean think(edict_t self) { ! edict_t spot; ! float[] d= { 0, 0, 0 }; ! ! spot= null; ! EdictIterator es= null; ! while (true) { ! es= GameBase.G_Find(es, GameBase.findByClass, "info_player_start"); ! spot= es.o; if (spot == null) return true; *************** *** 64,68 **** if ((self.targetname == null) || Lib.Q_stricmp(self.targetname, spot.targetname) != 0) { // gi.dprintf("FixCoopSpots changed %s at %s targetname from %s to %s\n", self.classname, vtos(self.s.origin), self.targetname, spot.targetname); ! self.targetname = spot.targetname; } return true; --- 64,68 ---- if ((self.targetname == null) || Lib.Q_stricmp(self.targetname, spot.targetname) != 0) { // gi.dprintf("FixCoopSpots changed %s at %s targetname from %s to %s\n", self.classname, vtos(self.s.origin), self.targetname, spot.targetname); ! self.targetname= spot.targetname; } return true; *************** *** 74,107 **** // some maps don't have any coop spots at all, so we need to create them // where they should have been ! ! static EntThinkAdapter SP_CreateCoopSpots = new EntThinkAdapter() { public boolean think(edict_t self) { ! edict_t spot; ! if (Lib.Q_stricmp(GameBase.level.mapname, "security") == 0) { ! spot = GameUtil.G_Spawn(); ! spot.classname = "info_player_coop"; ! spot.s.origin[0] = 188 - 64; ! spot.s.origin[1] = -164; ! spot.s.origin[2] = 80; ! spot.targetname = "jail3"; ! spot.s.angles[1] = 90; ! ! spot = GameUtil.G_Spawn(); ! spot.classname = "info_player_coop"; ! spot.s.origin[0] = 188 + 64; ! spot.s.origin[1] = -164; ! spot.s.origin[2] = 80; ! spot.targetname = "jail3"; ! spot.s.angles[1] = 90; ! ! spot = GameUtil.G_Spawn(); ! spot.classname = "info_player_coop"; ! spot.s.origin[0] = 188 + 128; ! spot.s.origin[1] = -164; ! spot.s.origin[2] = 80; ! spot.targetname = "jail3"; ! spot.s.angles[1] = 90; } return true; --- 74,107 ---- // some maps don't have any coop spots at all, so we need to create them // where they should have been ! ! static EntThinkAdapter SP_CreateCoopSpots= new EntThinkAdapter() { public boolean think(edict_t self) { ! edict_t spot; ! if (Lib.Q_stricmp(GameBase.level.mapname, "security") == 0) { ! spot= GameUtil.G_Spawn(); ! spot.classname= "info_player_coop"; ! spot.s.origin[0]= 188 - 64; ! spot.s.origin[1]= -164; ! spot.s.origin[2]= 80; ! spot.targetname= "jail3"; ! spot.s.angles[1]= 90; ! ! spot= GameUtil.G_Spawn(); ! spot.classname= "info_player_coop"; ! spot.s.origin[0]= 188 + 64; ! spot.s.origin[1]= -164; ! spot.s.origin[2]= 80; ! spot.targetname= "jail3"; ! spot.s.angles[1]= 90; ! ! spot= GameUtil.G_Spawn(); ! spot.classname= "info_player_coop"; ! spot.s.origin[0]= 188 + 128; ! spot.s.origin[1]= -164; ! spot.s.origin[2]= 80; ! spot.targetname= "jail3"; ! spot.s.angles[1]= 90; } return true; *************** *** 109,139 **** }; //======================================================================= ! ! static EntPainAdapter player_pain = new EntPainAdapter() { public void pain(edict_t self, edict_t other, float kick, int damage) { ! // player pain is handled at the end of the frame in P_DamageFeedback ! } }; ! static EntDieAdapter body_die = new EntDieAdapter() { public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { ! int n; ! if (self.health < -40) { GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi.soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); ! for (n = 0; n < 4; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); self.s.origin[2] -= 48; GameAI.ThrowClientHead(self, damage); ! self.takedamage = Defines.DAMAGE_NO; } } }; //============================================================== ! static edict_t pm_passent; // pmove doesn't need to know about passent and contentmask ! public static pmove_t.TraceAdapter PM_trace = new pmove_t.TraceAdapter() { ! public trace_t trace(float[] start, float[] mins, float[] maxs, float[] end) { if (pm_passent.health > 0) --- 109,139 ---- }; //======================================================================= ! ! // player pain is handled at the end of the frame in P_DamageFeedback ! static EntPainAdapter player_pain= new EntPainAdapter() { public void pain(edict_t self, edict_t other, float kick, int damage) { ! } }; ! static EntDieAdapter body_die= new EntDieAdapter() { public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { ! int n; ! if (self.health < -40) { GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi.soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); ! for (n= 0; n < 4; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); self.s.origin[2] -= 48; GameAI.ThrowClientHead(self, damage); ! self.takedamage= Defines.DAMAGE_NO; } } }; //============================================================== ! static edict_t pm_passent; // pmove doesn't need to know about passent and contentmask ! public static pmove_t.TraceAdapter PM_trace= new pmove_t.TraceAdapter() { ! public trace_t trace(float[] start, float[] mins, float[] maxs, float[] end) { if (pm_passent.health > 0) *************** *** 142,146 **** return GameBase.gi.trace(start, mins, maxs, end, pm_passent, Defines.MASK_DEADSOLID); } ! }; } --- 142,146 ---- return GameBase.gi.trace(start, mins, maxs, end, pm_passent, Defines.MASK_DEADSOLID); } ! }; } Index: game_export_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/game_export_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** game_export_t.java 9 Jul 2004 06:50:49 -0000 1.3 --- game_export_t.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 24,28 **** --- 24,33 ---- package jake2.game; + import java.io.FileNotFoundException; + import java.io.IOException; + import java.io.RandomAccessFile; + import jake2.qcommon.Com; + import jake2.util.QuakeFile; // *************** *** 59,64 **** public void WriteGame(String filename, boolean autosave) { ! // TODO WriteGame not implemented. ! Com.Println("WriteGame not implemented."); } --- 64,68 ---- public void WriteGame(String filename, boolean autosave) { ! GameSave.WriteGame(filename, autosave); } *************** *** 72,83 **** public void WriteLevel(String filename) { ! // TODO WriteLevel not implemented. ! Com.Println("WriteLevel not implemented."); } public void ReadLevel(String filename) { ! // TODO ReadLevel not implemented. ! Com.Println("ReadLevel not implemented."); } --- 76,99 ---- public void WriteLevel(String filename) { ! try ! { ! GameSave.WriteLevel(filename); ! } ! catch (IOException e) ! { ! e.printStackTrace(); ! } } public void ReadLevel(String filename) { ! try ! { ! GameSave.ReadLevel(filename); ! } ! catch (IOException e) ! { ! e.printStackTrace(); ! } } *************** *** 86,97 **** --- 102,116 ---- return PlayerClient.ClientConnect(ent, userinfo); } + public void ClientBegin(edict_t ent) { PlayerClient.ClientBegin(ent); } + public void ClientUserinfoChanged(edict_t ent, String userinfo) { PlayerClient.ClientUserinfoChanged(ent, userinfo); } + public void ClientDisconnect(edict_t ent) { *************** *** 133,135 **** public int num_edicts; // current number, <= max_edicts public int max_edicts; ! } --- 152,154 ---- public int num_edicts; // current number, <= max_edicts public int max_edicts; ! } \ No newline at end of file Index: SuperAdapter.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/SuperAdapter.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SuperAdapter.java 7 Jul 2004 19:59:24 -0000 1.1.1.1 --- SuperAdapter.java 20 Aug 2004 21:29:58 -0000 1.2 *************** *** 26,69 **** import jake2.qcommon.Com; import java.util.Vector; ! // import jake2.*; ! // import jake2.client.*; ! // import jake2.game.*; ! // import jake2.qcommon.*; ! // import jake2.render.*; ! // import jake2.server.*; ! ! public class SuperAdapter { ! ! // registration ! private static void register(SuperAdapter sa) { ! adapters.add(sa); ! //Com.Println("registering adapter " + sa.getID() + " (" + sa.getClass().getSuperclass() + ")"); } ! ! private static int id=0; ! private static Vector adapters = new Vector(); ! ! ! private static SuperAdapter find(int num) { ! return (SuperAdapter) adapters.elementAt(num); } ! ! // constructor public SuperAdapter() ! { ! adapterid = id++; ! register(this); } ! ! public int getID() { return adapterid; } ! private int adapterid; } --- 26,98 ---- import jake2.qcommon.Com; + import java.util.Hashtable; import java.util.Vector; + public class SuperAdapter + { ! /** Adapter registration. */ ! private static void register(SuperAdapter sa, String id) { ! adapters.put(id, sa); } ! ! /** Adapter repository. */ ! private static Hashtable adapters= new Hashtable(); ! ! /** Returns the adapter from the repository given by its ID. */ ! public static SuperAdapter getFromID(String key) { ! System.out.println("SuperAdapter.getFromID(\"" + key + "\")"); ! SuperAdapter sa = (SuperAdapter) adapters.get(key); ! ! // try to create the adapter ! if (sa == null) ! { ! System.out.println("adapter not found:" + key); ! int pos = key.indexOf('$'); ! String classname = key; ! if (pos != -1) ! classname = key.substring(0, pos); ! ! // load class and instantiate ! try ! { ! System.err.println("loading class " + classname); ! Class.forName(classname).newInstance(); ! } ! catch(Exception e) ! { ! System.err.println("jake2: class not found:" + classname); ! } ! ! // try it again... ! sa = (SuperAdapter) adapters.get(key); ! ! if (sa == null) ! System.err.println("jake2: could not load adapter:" + key); ! } ! ! return sa; } ! ! /** Constructor, does the adapter registration. */ public SuperAdapter() ! { ! StackTraceElement tr[] = new Throwable().getStackTrace(); ! adapterid= tr[2].getClassName(); ! if (adapterid == "") ! new Throwable("error in creating an adapter id!").printStackTrace(); ! else ! register(this, adapterid); } ! ! /** Returns the Adapter-ID. */ ! public String getID() { return adapterid; } ! /** Adapter id. */ ! private String adapterid; } Index: pmove_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/pmove_state_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** pmove_state_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- pmove_state_t.java 20 Aug 2004 21:29:58 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 40,49 **** public short origin[] = { 0, 0, 0 }; // 12.3 public short velocity[] = { 0, 0, 0 }; // 12.3 ! public byte pm_flags; // ducked, jump_held, etc ! public byte pm_time; // each unit = 8 ms public short gravity; ! public short delta_angles[] = { 0, 0, 0 }; // add to command angles to get view direction ! // changed by spawns, rotating objects, and teleporters ! private static pmove_state_t prototype = new pmove_state_t(); --- 41,53 ---- public short origin[] = { 0, 0, 0 }; // 12.3 public short velocity[] = { 0, 0, 0 }; // 12.3 ! /** ducked, jump_held, etc. */ ! public byte pm_flags; ! /** each unit = 8 ms. */ ! public byte pm_time; public short gravity; ! /** add to command angles to get view direction. */ ! public short delta_angles[] = { 0, 0, 0 }; ! /** changed by spawns, rotating objects, and teleporters.*/ ! private static pmove_state_t prototype = new pmove_state_t(); *************** *** 82,107 **** } ! public void load(ByteBuffer bb) throws IOException { ! pm_type = bb.getInt(); ! origin[0] = bb.getShort(); ! origin[1] = bb.getShort(); ! origin[2] = bb.getShort(); ! velocity[0] = bb.getShort(); ! velocity[1] = bb.getShort(); ! velocity[2] = bb.getShort(); ! pm_flags = bb.get(); ! pm_time = bb.get(); ! gravity = bb.getShort(); ! bb.getShort(); ! delta_angles[0] = bb.getShort(); ! delta_angles[1] = bb.getShort(); ! delta_angles[2] = bb.getShort(); } --- 86,136 ---- } ! /** Reads the playermove from the file.*/ ! public void load(RandomAccessFile f) throws IOException { ! pm_type = f.readInt(); ! origin[0] = f.readShort(); ! origin[1] = f.readShort(); ! origin[2] = f.readShort(); ! velocity[0] = f.readShort(); ! velocity[1] = f.readShort(); ! velocity[2] = f.readShort(); ! pm_flags = f.readByte(); ! pm_time = f.readByte(); ! gravity = f.readShort(); ! f.readShort(); ! delta_angles[0] = f.readShort(); ! delta_angles[1] = f.readShort(); ! delta_angles[2] = f.readShort(); ! ! } ! ! /** Writes the playermove to the file. */ ! public void write (RandomAccessFile f) throws IOException { ! ! f.writeInt(pm_type); ! ! f.writeShort(origin[0]); ! f.writeShort(origin[1]); ! f.writeShort(origin[2]); ! ! f.writeShort(velocity[0]); ! f.writeShort(velocity[1]); ! f.writeShort(velocity[2]); ! ! f.writeByte(pm_flags); ! f.writeByte(pm_time); ! f.writeShort(gravity); ! ! f.writeShort(0); + f.writeShort(delta_angles[0]); + f.writeShort(delta_angles[1]); + f.writeShort(delta_angles[2]); } *************** *** 125,130 **** Com.Println("delta-angle[2]: " + delta_angles[0]); } - - - } \ No newline at end of file --- 154,156 ---- Index: client_persistant_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/client_persistant_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** client_persistant_t.java 12 Jul 2004 20:47:01 -0000 1.4 --- client_persistant_t.java 20 Aug 2004 21:29:58 -0000 1.5 *************** *** 26,30 **** --- 26,33 ---- import jake2.Defines; import jake2.util.Lib; + import jake2.util.QuakeFile; + import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 90,129 **** boolean spectator; // client is a spectator - public void load(ByteBuffer bb) { - // client persistant_t ! userinfo = Lib.readString(bb, Defines.MAX_INFO_STRING); ! netname = Lib.readString(bb, 16); ! hand = bb.getInt(); ! connected = bb.getInt() != 0; ! health = bb.getInt(); ! max_health = bb.getInt(); ! savedFlags = bb.getInt(); ! selected_item = bb.getInt(); for (int n = 0; n < Defines.MAX_ITEMS; n++) ! inventory[n] = bb.getInt(); ! max_bullets = bb.getInt(); ! max_shells = bb.getInt(); ! max_rockets = bb.getInt(); ! max_grenades = bb.getInt(); ! max_cells = bb.getInt(); ! max_slugs = bb.getInt(); ! weapon = GameAI.itemlist[bb.getInt()]; ! lastweapon = GameAI.itemlist[bb.getInt()]; ! power_cubes = bb.getInt(); ! score = bb.getInt(); ! game_helpchanged = bb.getInt(); ! helpchanged = bb.getInt(); ! spectator = bb.getInt() != 0; } public void dump() { // client persistant_t --- 93,168 ---- boolean spectator; // client is a spectator ! /** Reads a client_persistant structure from a file. */ ! public void read(QuakeFile f) throws IOException { ! userinfo = f.readString(); ! netname = f.readString(); ! hand = f.readInt(); ! connected = f.readInt() != 0; ! health = f.readInt(); ! ! max_health = f.readInt(); ! savedFlags = f.readInt(); ! selected_item = f.readInt(); for (int n = 0; n < Defines.MAX_ITEMS; n++) ! inventory[n] = f.readInt(); ! max_bullets = f.readInt(); ! max_shells = f.readInt(); ! max_rockets = f.readInt(); ! max_grenades = f.readInt(); ! max_cells = f.readInt(); ! max_slugs = f.readInt(); ! weapon = f.readItem(); ! lastweapon = f.readItem(); ! power_cubes = f.readInt(); ! score = f.readInt(); ! game_helpchanged = f.readInt(); ! helpchanged = f.readInt(); ! spectator = f.readInt() != 0; ! } ! ! /** Writes a client_persistant structure to a file. */ ! public void write(QuakeFile f) throws IOException { ! // client persistant_t ! f.writeString(userinfo); ! f.writeString(netname); ! ! f.writeInt(hand); + f.writeInt(connected ? 1:0); + f.writeInt(health); + + f.writeInt(max_health); + f.writeInt(savedFlags); + f.writeInt(selected_item); + + for (int n = 0; n < Defines.MAX_ITEMS; n++) + f.writeInt(inventory[n]); + + f.writeInt(max_bullets); + f.writeInt(max_shells); + f.writeInt(max_rockets); + f.writeInt(max_grenades); + f.writeInt(max_cells); + f.writeInt(max_slugs); + + f.writeItem(weapon); + f.writeItem(lastweapon); + f.writeInt(power_cubes); + f.writeInt(score); + + f.writeInt(game_helpchanged); + f.writeInt(helpchanged); + f.writeInt(spectator?1:0); } + public void dump() { // client persistant_t Index: edict_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/edict_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edict_t.java 8 Jul 2004 15:58:44 -0000 1.2 --- edict_t.java 20 Aug 2004 21:29:57 -0000 1.3 *************** *** 19,110 **** */ package jake2.game; import jake2.*; import jake2.util.*; ! public class edict_t { ! ! public edict_t(int i) { [...1138 lines suppressed...] + style= f.readInt(); + + item= f.readItem(); + + moveinfo.read(f); + monsterinfo.read(f); + + int ndx= f.readInt(); + if (ndx == -1) + client= null; + else + client= Game.game.clients[ndx]; + + owner= f.readEdictRef(); + + // rst's checker :-) + if (f.readInt() != 9876) + System.err.println("ent load check failed for num " + index); + } } Index: monsterinfo_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/monsterinfo_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** monsterinfo_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- monsterinfo_t.java 20 Aug 2004 21:29:58 -0000 1.2 *************** *** 24,27 **** --- 24,32 ---- package jake2.game; + import jake2.util.QuakeFile; + + import java.io.IOException; + import java.io.RandomAccessFile; + public class monsterinfo_t { *************** *** 61,63 **** --- 66,162 ---- public int power_armor_power; + /** Writes the monsterinfo to the file.*/ + public void write(QuakeFile f) throws IOException + { + f.writeBoolean(currentmove != null); + if (currentmove != null) + currentmove.write(f); + f.writeInt(aiflags); + f.writeInt(nextframe); + f.writeFloat(scale); + f.writeAdapter(stand); + f.writeAdapter(idle); + f.writeAdapter(search); + f.writeAdapter(walk); + f.writeAdapter(run); + + f.writeAdapter(dodge); + + f.writeAdapter(attack); + f.writeAdapter(melee); + + f.writeAdapter(sight); + + f.writeAdapter(checkattack); + + f.writeFloat(pausetime); + f.writeFloat(attack_finished); + + f.writeVector(saved_goal); + + f.writeFloat(search_time); + f.writeFloat(trail_time); + + f.writeVector(last_sighting); + + f.writeInt(attack_state); + f.writeInt(lefty); + + f.writeFloat(idle_time); + f.writeInt(linkcount); + + f.writeInt(power_armor_power); + f.writeInt(power_armor_type); + } + + /** Writes the monsterinfo to the file.*/ + public void read(QuakeFile f) throws IOException + { + if (f.readBoolean()) + { + currentmove= new mmove_t(); + currentmove.read(f); + } + else + currentmove= null; + aiflags = f.readInt(); + nextframe = f.readInt(); + scale = f.readFloat(); + stand = (EntThinkAdapter) f.readAdapter(); + idle = (EntThinkAdapter) f.readAdapter(); + search = (EntThinkAdapter) f.readAdapter(); + walk = (EntThinkAdapter) f.readAdapter(); + run = (EntThinkAdapter) f.readAdapter(); + + dodge = (EntDodgeAdapter) f.readAdapter(); + + attack = (EntThinkAdapter) f.readAdapter(); + melee = (EntThinkAdapter) f.readAdapter(); + + sight = (EntInteractAdapter) f.readAdapter(); + + checkattack = (EntThinkAdapter) f.readAdapter(); + + pausetime = f.readFloat(); + attack_finished = f.readFloat(); + + saved_goal = f.readVector(); + + search_time = f.readFloat(); + trail_time = f.readFloat(); + + last_sighting = f.readVector(); + + attack_state = f.readInt(); + lefty = f.readInt(); + + idle_time = f.readFloat(); + linkcount = f.readInt(); + + power_armor_power = f.readInt(); + power_armor_type = f.readInt(); + + } + + } Index: client_respawn_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/client_respawn_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** client_respawn_t.java 12 Jul 2004 20:47:01 -0000 1.4 --- client_respawn_t.java 20 Aug 2004 21:29:57 -0000 1.5 *************** *** 26,42 **** import jake2.util.Lib; import jake2.util.Math3D; import java.io.IOException; import java.nio.ByteBuffer; public class client_respawn_t ! // client data that stays across deathmatch respawns { ! client_persistant_t coop_respawn = new client_persistant_t(); // what to set client->pers to on a respawn ! int enterframe; // level.framenum the client entered the game ! int score; // frags, etc ! float cmd_angles[] = { 0, 0, 0 }; // angles sent over in the last command ! boolean spectator; // client is a spectator public void set(client_respawn_t from) { --- 26,56 ---- import jake2.util.Lib; import jake2.util.Math3D; + import jake2.util.QuakeFile; import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; + /** Client data that stays across deathmatch respawns.*/ public class client_respawn_t ! { ! /** What to set client->pers to on a respawn */ ! protected client_persistant_t coop_respawn = new client_persistant_t(); ! ! /** Level.framenum the client entered the game. */ ! protected int enterframe; ! ! /** frags, etc. */ ! protected int score; ! ! /** angles sent over in the last command. */ ! protected float cmd_angles[] = { 0, 0, 0 }; ! ! /** client is a spectator. */ ! protected boolean spectator; + + /** Copies the client respawn data. */ public void set(client_respawn_t from) { *************** *** 48,52 **** } ! //ok public void clear() { --- 62,66 ---- } ! /** Clears the client reaspawn informations. */ public void clear() { *************** *** 58,72 **** } ! public void load(ByteBuffer bb) throws IOException { ! coop_respawn.load(bb); ! enterframe = bb.getInt(); ! score = bb.getInt(); ! cmd_angles[0] = bb.getFloat(); ! cmd_angles[1] = bb.getFloat(); ! cmd_angles[2] = bb.getFloat(); ! spectator = bb.getInt() != 0; } public void dump() { --- 72,102 ---- } ! /** Reads a client_respawn from a file. */ ! public void read(QuakeFile f) throws IOException { ! coop_respawn.read(f); ! enterframe = f.readInt(); ! score = f.readInt(); ! cmd_angles[0] = f.readFloat(); ! cmd_angles[1] = f.readFloat(); ! cmd_angles[2] = f.readFloat(); ! spectator = f.readInt() != 0; ! } ! ! /** Writes a client_respawn to a file. */ ! public void write(QuakeFile f) throws IOException ! { ! coop_respawn.write(f); ! f.writeInt(enterframe); ! f.writeInt(score); ! f.writeFloat(cmd_angles[0]); ! f.writeFloat(cmd_angles[1]); ! f.writeFloat(cmd_angles[2]); ! f.writeInt(spectator?1:0); } + + + /** Prints out a client_respawn_t to the quake console.*/ public void dump() { Index: gitem_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/gitem_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gitem_t.java 8 Jul 2004 15:58:44 -0000 1.2 --- gitem_t.java 20 Aug 2004 21:29:57 -0000 1.3 *************** *** 142,145 **** } ! int index; } --- 142,145 ---- } ! public int index; } Index: gclient_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/gclient_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gclient_t.java 8 Jul 2004 15:58:44 -0000 1.2 --- gclient_t.java 20 Aug 2004 21:29:58 -0000 1.3 *************** *** 26,32 **** --- 26,34 ---- import jake2.qcommon.Com; import jake2.util.Lib; + import jake2.util.QuakeFile; import java.awt.event.ItemListener; import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 124,127 **** --- 126,132 ---- public int index; + + + public void clear() { *************** *** 164,277 **** } ! public void load(ByteBuffer bb) throws IOException { ! ps.load(bb); ! ping = bb.getInt(); ! pers.load(bb); ! resp.load(bb); ! old_pmove.load(bb); ! showscores = bb.getInt() != 0; ! showinventory = bb.getInt() != 0; ! showhelp = bb.getInt() != 0; ! showhelpicon = bb.getInt() != 0; ! ammo_index = bb.getInt(); ! buttons = bb.getInt(); ! oldbuttons = bb.getInt(); ! latched_buttons = bb.getInt(); ! //weapon_thunk=bb.getInt()!=0; ! bb.getInt(); ! //newweapon=GameTarget.itemlist[bb.getInt()]; ! bb.getInt(); ! damage_armor = bb.getInt(); ! damage_parmor = bb.getInt(); ! damage_blood = bb.getInt(); ! damage_knockback = bb.getInt(); ! damage_from[0] = bb.getFloat(); ! damage_from[1] = bb.getFloat(); ! damage_from[2] = bb.getFloat(); ! killer_yaw = bb.getFloat(); ! weaponstate = bb.getInt(); ! kick_angles[0] = bb.getFloat(); ! kick_angles[1] = bb.getFloat(); ! kick_angles[2] = bb.getFloat(); ! kick_origin[0] = bb.getFloat(); ! kick_origin[1] = bb.getFloat(); ! kick_origin[2] = bb.getFloat(); ! v_dmg_roll = bb.getFloat(); ! v_dmg_pitch = bb.getFloat(); ! v_dmg_time = bb.getFloat(); ! fall_time = bb.getFloat(); ! fall_value = bb.getFloat(); ! damage_alpha = bb.getFloat(); ! bonus_alpha = bb.getFloat(); ! damage_blend[0] = bb.getFloat(); ! damage_blend[1] = bb.getFloat(); ! damage_blend[2] = bb.getFloat(); ! v_angle[0] = bb.getFloat(); ! v_angle[1] = bb.getFloat(); ! v_angle[2] = bb.getFloat(); ! bobtime = bb.getFloat(); ! oldviewangles[0] = bb.getFloat(); ! oldviewangles[1] = bb.getFloat(); ! oldviewangles[2] = bb.getFloat(); ! oldvelocity[0] = bb.getFloat(); ! oldvelocity[1] = bb.getFloat(); ! oldvelocity[2] = bb.getFloat(); ! next_drown_time = bb.getFloat(); ! old_waterlevel = bb.getInt(); ! breather_sound = bb.getInt(); ! machinegun_shots = bb.getInt(); ! anim_end = bb.getInt(); ! anim_priority = bb.getInt(); ! anim_duck = bb.getInt() != 0; ! anim_run = bb.getInt() != 0; ! quad_framenum = bb.getFloat(); ! invincible_framenum = bb.getFloat(); ! breather_framenum = bb.getFloat(); ! enviro_framenum = bb.getFloat(); ! grenade_blew_up = bb.getInt() != 0; ! grenade_time = bb.getFloat(); ! silencer_shots = bb.getInt(); ! weapon_sound = bb.getInt(); ! pickup_msg_time = bb.getFloat(); ! flood_locktill = bb.getFloat(); ! flood_when[0] = bb.getFloat(); ! flood_when[1] = bb.getFloat(); ! flood_when[2] = bb.getFloat(); ! flood_when[3] = bb.getFloat(); ! flood_when[4] = bb.getFloat(); ! flood_when[5] = bb.getFloat(); ! flood_when[6] = bb.getFloat(); ! flood_when[7] = bb.getFloat(); ! flood_when[8] = bb.getFloat(); ! flood_when[9] = bb.getFloat(); ! flood_whenhead = bb.getInt(); ! respawn_time = bb.getFloat(); ! chase_target = GameUtil.g_edicts[bb.getInt()]; ! update_chase = bb.getInt() != 0; } public void dump() { --- 169,399 ---- } ! /** Reads a game client from the file. */ ! public void read(QuakeFile f) throws IOException { ! ps.load(f); ! ping = f.readInt(); ! pers.read(f); ! resp.read(f); ! old_pmove.load(f); ! showscores = f.readInt() != 0; ! showinventory = f.readInt() != 0; ! showhelp = f.readInt() != 0; ! showhelpicon = f.readInt() != 0; ! ammo_index = f.readInt(); ! buttons = f.readInt(); ! oldbuttons = f.readInt(); ! latched_buttons = f.readInt(); ! weapon_thunk=f.readInt()!=0; ! ! newweapon=f.readItem(); ! ! damage_armor = f.readInt(); ! damage_parmor = f.readInt(); ! damage_blood = f.readInt(); ! damage_knockback = f.readInt(); ! damage_from[0] = f.readFloat(); ! damage_from[1] = f.readFloat(); ! damage_from[2] = f.readFloat(); ! killer_yaw = f.readFloat(); ! weaponstate = f.readInt(); ! kick_angles[0] = f.readFloat(); ! kick_angles[1] = f.readFloat(); ! kick_angles[2] = f.readFloat(); ! kick_origin[0] = f.readFloat(); ! kick_origin[1] = f.readFloat(); ! kick_origin[2] = f.readFloat(); ! v_dmg_roll = f.readFloat(); ! v_dmg_pitch = f.readFloat(); ! v_dmg_time = f.readFloat(); ! fall_time = f.readFloat(); ! fall_value = f.readFloat(); ! damage_alpha = f.readFloat(); ! bonus_alpha = f.readFloat(); ! damage_blend[0] = f.readFloat(); ! damage_blend[1] = f.readFloat(); ! damage_blend[2] = f.readFloat(); ! v_angle[0] = f.readFloat(); ! v_angle[1] = f.readFloat(); ! v_angle[2] = f.readFloat(); ! bobtime = f.readFloat(); ! oldviewangles[0] = f.readFloat(); ! oldviewangles[1] = f.readFloat(); ! oldviewangles[2] = f.readFloat(); ! oldvelocity[0] = f.readFloat(); ! oldvelocity[1] = f.readFloat(); ! oldvelocity[2] = f.readFloat(); ! next_drown_time = f.readFloat(); ! old_waterlevel = f.readInt(); ! breather_sound = f.readInt(); ! machinegun_shots = f.readInt(); ! anim_end = f.readInt(); ! anim_priority = f.readInt(); ! anim_duck = f.readInt() != 0; ! anim_run = f.readInt() != 0; ! quad_framenum = f.readFloat(); ! invincible_framenum = f.readFloat(); ! breather_framenum = f.readFloat(); ! enviro_framenum = f.readFloat(); ! grenade_blew_up = f.readInt() != 0; ! grenade_time = f.readFloat(); ! silencer_shots = f.readInt(); ! weapon_sound = f.readInt(); ! pickup_msg_time = f.readFloat(); ! flood_locktill = f.readFloat(); ! flood_when[0] = f.readFloat(); ! flood_when[1] = f.readFloat(); ! flood_when[2] = f.readFloat(); ! flood_when[3] = f.readFloat(); ! flood_when[4] = f.readFloat(); ! flood_when[5] = f.readFloat(); ! flood_when[6] = f.readFloat(); ! flood_when[7] = f.readFloat(); ! flood_when[8] = f.readFloat(); ! flood_when[9] = f.readFloat(); ! flood_whenhead = f.readInt(); ! respawn_time = f.readFloat(); ! chase_target = f.readEdictRef(); ! update_chase = f.readInt() != 0; ! ! if (f.readInt() != 8765) ! System.err.println("game client load failed for num=" + index); } + + /** Writes a game_client_t (a player) to a file. */ + public void write(QuakeFile f) throws IOException + { + ps.write(f); + + f.writeInt(ping); + + pers.write(f); + resp.write(f); + + old_pmove.write(f); + + f.writeInt(showscores?1:0); + f.writeInt(showinventory?1:0); + f.writeInt(showhelp?1:0); + f.writeInt(showhelpicon?1:0); + f.writeInt(ammo_index); + + f.writeInt(buttons); + f.writeInt(oldbuttons); + f.writeInt(latched_buttons); + + f.writeInt(weapon_thunk?1:0); + f.writeItem(newweapon); + + + f.writeInt(damage_armor); + f.writeInt(damage_parmor); + f.writeInt(damage_blood); + f.writeInt(damage_knockback); + + f.writeFloat(damage_from[0]); + f.writeFloat(damage_from[1]); + f.writeFloat(damage_from[2]); + + f.writeFloat(killer_yaw); + + f.writeInt(weaponstate); + + f.writeFloat(kick_angles[0]); + f.writeFloat(kick_angles[1]); + f.writeFloat(kick_angles[2]); + + f.writeFloat(kick_origin[0]); + f.writeFloat(kick_origin[1]); + f.writeFloat(kick_origin[2]); + + f.writeFloat(v_dmg_roll); + f.writeFloat(v_dmg_pitch); + f.writeFloat(v_dmg_time); + f.writeFloat(fall_time); + f.writeFloat(fall_value); + f.writeFloat(damage_alpha); + f.writeFloat(bonus_alpha); + + f.writeFloat(damage_blend[0]); + f.writeFloat(damage_blend[1]); + f.writeFloat(damage_blend[2]); + + f.writeFloat(v_angle[0]); + f.writeFloat(v_angle[1]); + f.writeFloat(v_angle[2]); + + f.writeFloat(bobtime); + + f.writeFloat(oldviewangles[0]); + f.writeFloat(oldviewangles[1]); + f.writeFloat(oldviewangles[2]); + + f.writeFloat(oldvelocity[0]); + f.writeFloat(oldvelocity[1]); + f.writeFloat(oldvelocity[2]); + + f.writeFloat(next_drown_time); + + f.writeInt(old_waterlevel); + f.writeInt(breather_sound); + f.writeInt(machinegun_shots); + f.writeInt(anim_end); + f.writeInt(anim_priority); + f.writeInt(anim_duck?1:0); + f.writeInt(anim_run?1:0); + + f.writeFloat(quad_framenum); + f.writeFloat(invincible_framenum); + f.writeFloat(breather_framenum); + f.writeFloat(enviro_framenum); + + f.writeInt(grenade_blew_up?1:0); + f.writeFloat(grenade_time); + f.writeInt(silencer_shots); + f.writeInt(weapon_sound); + f.writeFloat(pickup_msg_time); + f.writeFloat(flood_locktill); + f.writeFloat(flood_when[0]); + f.writeFloat(flood_when[1]); + f.writeFloat(flood_when[2]); + f.writeFloat(flood_when[3]); + f.writeFloat(flood_when[4]); + f.writeFloat(flood_when[5]); + f.writeFloat(flood_when[6]); + f.writeFloat(flood_when[7]); + f.writeFloat(flood_when[8]); + f.writeFloat(flood_when[9]); + f.writeInt(flood_whenhead); + f.writeFloat(respawn_time); + f.writeEdictRef(chase_target); + f.writeInt(update_chase?1:0); + + f.writeInt(8765); + } + public void dump() { *************** *** 358,363 **** Com.Println("chase_target: " + chase_target); Com.Println("update_chase: " + update_chase); - } - } --- 480,483 ---- Index: player_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/player_state_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** player_state_t.java 9 Jul 2004 06:50:49 -0000 1.3 --- player_state_t.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 33,56 **** import jake2.util.Math3D; public class player_state_t { - // player_state_t is the information needed in addition to pmove_state_t - // to rendered a view. There will only be 10 player_state_t sent each second, - // but the number of pmove_state_t changes will be reletive to client - // frame rates ! public pmove_state_t pmove = new pmove_state_t(); // for prediction // these fields do not need to be communicated bit-precise ! public float[] viewangles = { 0, 0, 0 }; // for fixed views ! public float[] viewoffset = { 0, 0, 0 }; // add to pmovestate->origin ! public float[] kick_angles = { 0, 0, 0 }; // add to view direction to get render angles // set by weapon kicks, pain effects, etc ! public float[] gunangles = { 0, 0, 0 }; ! public float[] gunoffset = { 0, 0, 0 }; public int gunindex; public int gunframe; ! public float blend[] = new float[4]; // rgba full screen effect public float fov; // horizontal field of view --- 34,60 ---- import jake2.util.Math3D; + /** + Player_state_t is the information needed in addition to pmove_state_t + to rendered a view. There will only be 10 player_state_t sent each second, + but the number of pmove_state_t changes will be relative to client + frame rates. + */ + public class player_state_t { ! public pmove_state_t pmove= new pmove_state_t(); // for prediction // these fields do not need to be communicated bit-precise ! public float[] viewangles= { 0, 0, 0 }; // for fixed views ! public float[] viewoffset= { 0, 0, 0 }; // add to pmovestate->origin ! public float[] kick_angles= { 0, 0, 0 }; // add to view direction to get render angles // set by weapon kicks, pain effects, etc ! public float[] gunangles= { 0, 0, 0 }; ! public float[] gunoffset= { 0, 0, 0 }; public int gunindex; public int gunframe; ! public float blend[]= new float[4]; // rgba full screen effect public float fov; // horizontal field of view *************** *** 58,144 **** public int rdflags; // refdef flags ! public short stats[] = new short[Defines.MAX_STATS]; ! /** ! * ! */ ! private static player_state_t prototype = new player_state_t(); ! public void clear() { this.set(prototype); } ! ! public player_state_t getClone() ! { return new player_state_t().set(this); } ! ! public player_state_t set(player_state_t from) ! { pmove.set(from.pmove); Math3D.VectorCopy(from.viewangles, viewangles); ! Math3D.VectorCopy(from.viewoffset,viewoffset); Math3D.VectorCopy(from.kick_angles, kick_angles); ! Math3D.VectorCopy(from.gunangles,gunangles); Math3D.VectorCopy(from.gunoffset, gunoffset); ! gunindex = from.gunindex; ! gunframe = from.gunframe; - blend[0] = from.blend[0]; - blend[1] = from.blend[1]; - blend[2] = from.blend[2]; - blend[3] = from.blend[3]; - - fov = from.fov; - rdflags = from.rdflags; - - //stats = new short[Defines.MAX_STATS]; - System.arraycopy(from.stats, 0, stats,0, Defines.MAX_STATS); - return this; } ! public void load(ByteBuffer bb) throws IOException { ! pmove.load(bb); ! viewangles[0] = bb.getFloat(); ! viewangles[1] = bb.getFloat(); ! viewangles[2] = bb.getFloat(); ! viewoffset[0] = bb.getFloat(); ! viewoffset[1] = bb.getFloat(); ! viewoffset[2] = bb.getFloat(); ! kick_angles[0] = bb.getFloat(); ! kick_angles[1] = bb.getFloat(); ! kick_angles[2] = bb.getFloat(); ! gunangles[0] = bb.getFloat(); ! gunangles[1] = bb.getFloat(); ! gunangles[2] = bb.getFloat(); ! gunoffset[0] = bb.getFloat(); ! gunoffset[1] = bb.getFloat(); ! gunoffset[2] = bb.getFloat(); ! gunindex = bb.getInt(); ! gunframe = bb.getInt(); ! blend[0] = bb.getFloat(); ! blend[1] = bb.getFloat(); ! blend[2] = bb.getFloat(); ! blend[3] = bb.getFloat(); ! fov = bb.getFloat(); ! rdflags = bb.getInt(); ! for (int n = 0; n < Defines.MAX_STATS; n++) ! stats[n] = bb.getShort(); } public void dump() { pmove.dump(); --- 62,187 ---- public int rdflags; // refdef flags ! public short stats[]= new short[Defines.MAX_STATS]; ! /** Lets cleverly reset the structure. */ ! private static player_state_t prototype= new player_state_t(); ! ! /** Clears the player_state.*/ public void clear() { this.set(prototype); } ! ! /** Clones the object.*/ ! public player_state_t getClone() { return new player_state_t().set(this); } ! ! /** Copies the player state data. */ ! public player_state_t set(player_state_t from) { pmove.set(from.pmove); Math3D.VectorCopy(from.viewangles, viewangles); ! Math3D.VectorCopy(from.viewoffset, viewoffset); Math3D.VectorCopy(from.kick_angles, kick_angles); ! Math3D.VectorCopy(from.gunangles, gunangles); Math3D.VectorCopy(from.gunoffset, gunoffset); ! gunindex= from.gunindex; ! gunframe= from.gunframe; ! ! blend[0]= from.blend[0]; ! blend[1]= from.blend[1]; ! blend[2]= from.blend[2]; ! blend[3]= from.blend[3]; ! ! fov= from.fov; ! rdflags= from.rdflags; ! ! System.arraycopy(from.stats, 0, stats, 0, Defines.MAX_STATS); return this; } ! /** Reads a player_state from a file.*/ ! public void load(RandomAccessFile f) throws IOException { ! pmove.load(f); ! viewangles[0]= f.readFloat(); ! viewangles[1]= f.readFloat(); ! viewangles[2]= f.readFloat(); ! viewoffset[0]= f.readFloat(); ! viewoffset[1]= f.readFloat(); ! viewoffset[2]= f.readFloat(); ! kick_angles[0]= f.readFloat(); ! kick_angles[1]= f.readFloat(); ! kick_angles[2]= f.readFloat(); ! gunangles[0]= f.readFloat(); ! gunangles[1]= f.readFloat(); ! gunangles[2]= f.readFloat(); ! gunoffset[0]= f.readFloat(); ! gunoffset[1]= f.readFloat(); ! gunoffset[2]= f.readFloat(); ! gunindex= f.readInt(); ! gunframe= f.readInt(); ! blend[0]= f.readFloat(); ! blend[1]= f.readFloat(); ! blend[2]= f.readFloat(); ! blend[3]= f.readFloat(); ! fov= f.readFloat(); ! rdflags= f.readInt(); ! for (int n= 0; n < Defines.MAX_STATS; n++) ! stats[n]= f.readShort(); ! } ! ! /** Writes a player_state to a file.*/ ! public void write(RandomAccessFile f) throws IOException { ! pmove.write(f); ! ! f.writeFloat(viewangles[0]); ! f.writeFloat(viewangles[1]); ! f.writeFloat(viewangles[2]); ! ! f.writeFloat(viewoffset[0]); ! f.writeFloat(viewoffset[1]); ! f.writeFloat(viewoffset[2]); ! ! f.writeFloat(kick_angles[0]); ! f.writeFloat(kick_angles[1]); ! f.writeFloat(kick_angles[2]); ! ! f.writeFloat(gunangles[0]); ! f.writeFloat(gunangles[1]); ! f.writeFloat(gunangles[2]); + f.writeFloat(gunoffset[0]); + f.writeFloat(gunoffset[1]); + f.writeFloat(gunoffset[2]); + + f.writeInt(gunindex); + f.writeInt(gunframe); + + f.writeFloat(blend[0]); + f.writeFloat(blend[1]); + f.writeFloat(blend[2]); + f.writeFloat(blend[3]); + + f.writeFloat(fov); + + f.writeInt(rdflags); + + for (int n= 0; n < Defines.MAX_STATS; n++) + f.writeShort(stats[n]); } + /** Prints the player state. */ public void dump() { pmove.dump(); *************** *** 159,163 **** Com.Println("rdflags: " + rdflags); ! for (int n = 0; n < Defines.MAX_STATS; n++) System.out.println("stats[" + n + "]: " + stats[n]); } --- 202,206 ---- Com.Println("rdflags: " + rdflags); ! for (int n= 0; n < Defines.MAX_STATS; n++) System.out.println("stats[" + n + "]: " + stats[n]); } Index: PlayerClient.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerClient.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlayerClient.java 8 Jul 2004 20:24:29 -0000 1.3 --- PlayerClient.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 356,362 **** --- 356,364 ---- if (!ent.inuse) continue; + game.clients[i].pers.health = ent.health; game.clients[i].pers.max_health = ent.max_health; game.clients[i].pers.savedFlags = (ent.flags & (FL_GODMODE | FL_NOTARGET | FL_POWER_ARMOR)); + if (coop.value != 0) game.clients[i].pers.score = ent.client.resp.score; *************** *** 372,382 **** } - /* - ======================================================================= - - SelectSpawnPoint - - ======================================================================= - */ /* --- 374,377 ---- Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GameUtil.java 9 Jul 2004 06:50:49 -0000 1.3 --- GameUtil.java 20 Aug 2004 21:29:57 -0000 1.4 *************** *** 888,892 **** static gitem_t FindItem(String pickup_name) { - //Com.Printf("FindItem:" + pickup_name + "\n"); for (int i = 1; i < game.num_items; i++) { --- 888,891 ---- Index: GameBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameBase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GameBase.java 9 Jul 2004 06:50:49 -0000 1.3 --- GameBase.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 22,26 **** // $Id$ ! /** Father of all Objects. */ package jake2.game; --- 22,26 ---- // $Id$ ! /** Father of all GameObjects. */ package jake2.game; *************** *** 442,445 **** --- 442,446 ---- public static void G_RunEntity(edict_t ent) { + if (ent.prethink != null) ent.prethink.think(ent); Index: level_locals_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/level_locals_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** level_locals_t.java 7 Jul 2004 19:59:25 -0000 1.1.1.1 --- level_locals_t.java 20 Aug 2004 21:29:57 -0000 1.2 *************** *** 24,29 **** package jake2.game; ! public class level_locals_t { ! // // this structure is cleared as each map is entered // it is read/written to the level.sav file for savegames --- 24,36 ---- package jake2.game; ! import jake2.util.Lib; ! import jake2.util.QuakeFile; ! ! import java.io.IOException; ! import java.io.RandomAccessFile; ! ! public class level_locals_t ! { ! // this structure is cleared as each map is entered // it is read/written to the level.sav file for savegames *************** *** 47,52 **** --- 54,61 ---- public edict_t sight_entity; public int sight_entity_framenum; + public edict_t sound_entity; public int sound_entity_framenum; + public edict_t sound2_entity; public int sound2_entity_framenum; *************** *** 67,69 **** --- 76,161 ---- public int power_cubes; // ugly necessity for coop + + /** Writes the levellocales to the file.*/ + public void write(QuakeFile f) throws IOException + { + f.writeInt(framenum); + f.writeFloat(time); + f.writeString(level_name); + f.writeString(mapname); + f.writeString(nextmap); + f.writeFloat(intermissiontime); + f.writeString(changemap); + f.writeBoolean(exitintermission); + f.writeVector(intermission_origin); + f.writeVector(intermission_angle); + f.writeEdictRef(sight_client); + + f.writeEdictRef(sight_entity); + f.writeInt(sight_entity_framenum); + + f.writeEdictRef(sound_entity); + f.writeInt(sound_entity_framenum); + f.writeEdictRef(sound2_entity); + f.writeInt(sound2_entity_framenum); + + f.writeInt(pic_health); + + f.writeInt(total_secrets); + f.writeInt(found_secrets); + + f.writeInt(total_goals); + f.writeInt(found_goals); + f.writeInt(total_monsters); + f.writeInt(killed_monsters); + + f.writeEdictRef(current_entity); + f.writeInt(body_que); // dead bodies + f.writeInt(power_cubes); // ugly necessity for coop + + // rst's checker :-) + f.writeInt(4711); + } + + /** Reads the level locals from the file. */ + public void read(QuakeFile f) throws IOException + { + framenum = f.readInt(); + time = f.readFloat(); + level_name = f.readString(); + mapname = f.readString(); + nextmap = f.readString(); + intermissiontime = f.readFloat(); + changemap = f.readString(); + exitintermission = f.readBoolean(); + intermission_origin = f.readVector(); + intermission_angle = f.readVector(); + sight_client = f.readEdictRef(); + + sight_entity = f.readEdictRef(); + sight_entity_framenum = f.readInt(); + + sound_entity = f.readEdictRef(); + sound_entity_framenum = f.readInt(); + sound2_entity = f.readEdictRef(); + sound2_entity_framenum = f.readInt(); + + pic_health = f.readInt(); + + total_secrets = f.readInt(); + found_secrets = f.readInt(); + + total_goals = f.readInt(); + found_goals = f.readInt(); + total_monsters = f.readInt(); + killed_monsters = f.readInt(); + + current_entity = f.readEdictRef(); + body_que = f.readInt(); // dead bodies + power_cubes = f.readInt(); // ugly necessity for coop + + // rst's checker :-) + if (f.readInt()!= 4711) + System.out.println("error in reading level_locals."); + } } Index: moveinfo_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/moveinfo_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** moveinfo_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- moveinfo_t.java 20 Aug 2004 21:29:58 -0000 1.2 *************** *** 24,27 **** --- 24,31 ---- package jake2.game; + import java.io.IOException; + + import jake2.util.QuakeFile; + public class moveinfo_t { // fixed data *************** *** 52,54 **** --- 56,116 ---- float decel_distance; EntThinkAdapter endfunc; + + /** saves the moveinfo to the file.*/ + public void write(QuakeFile f) throws IOException { + f.writeVector(start_origin); + f.writeVector(start_angles); + f.writeVector(end_origin); + f.writeVector(end_angles); + + f.writeInt(sound_start); + f.writeInt(sound_middle); + f.writeInt(sound_end); + + f.writeFloat(accel); + f.writeFloat(speed); + f.writeFloat(decel); + f.writeFloat(distance); + + f.writeFloat(wait); + + f.writeInt(state); + f.writeVector(dir); + + f.writeFloat(current_speed); + f.writeFloat(move_speed); + f.writeFloat(next_speed); + f.writeFloat(remaining_distance); + f.writeFloat(decel_distance); + f.writeAdapter(endfunc); + } + + /** Reads the moveinfo from a file. */ + public void read(QuakeFile f) throws IOException { + start_origin= f.readVector(); + start_angles= f.readVector(); + end_origin= f.readVector(); + end_angles= f.readVector(); + + sound_start= f.readInt(); + sound_middle= f.readInt(); + sound_end= f.readInt(); + + accel= f.readFloat(); + speed= f.readFloat(); + decel= f.readFloat(); + distance= f.readFloat(); + + wait= f.readFloat(); + + state= f.readInt(); + dir= f.readVector(); + + current_speed= f.readFloat(); + move_speed= f.readFloat(); + next_speed= f.readFloat(); + remaining_distance= f.readFloat(); + decel_distance= f.readFloat(); + endfunc= (EntThinkAdapter) f.readAdapter(); + } } Index: game_locals_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/game_locals_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** game_locals_t.java 12 Jul 2004 20:47:01 -0000 1.3 --- game_locals_t.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 27,32 **** --- 27,36 ---- import jake2.qcommon.Com; import jake2.util.Lib; + import jake2.util.QuakeFile; + import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; + import java.util.Date; public class game_locals_t extends Defines *************** *** 60,85 **** public boolean autosaved; ! public void load(ByteBuffer bb) { ! String date = Lib.readString(bb, 16); ! helpmessage1 = Lib.readString(bb, 512); ! helpmessage2 = Lib.readString(bb, 512); ! helpchanged = bb.getInt(); // gclient_t* ! bb.getInt(); ! spawnpoint = Lib.readString(bb, 512); ! maxclients = bb.getInt(); ! maxentities = bb.getInt(); ! serverflags = bb.getInt(); ! num_items = bb.getInt(); ! autosaved = bb.getInt() != 0; } public void dump() { - Com.Println("String helpmessage1: " + helpmessage1); Com.Println("String helpmessage2: " + helpmessage2); --- 64,115 ---- public boolean autosaved; ! /** Reads the game locals from a file. */ ! public void load(QuakeFile f) throws IOException { ! String date = f.readString(); ! helpmessage1 = f.readString(); ! helpmessage2 = f.readString(); ! helpchanged = f.readInt(); // gclient_t* ! ! spawnpoint = f.readString(); ! maxclients = f.readInt(); ! maxentities = f.readInt(); ! serverflags = f.readInt(); ! num_items = f.readInt(); ! autosaved = f.readInt() != 0; ! ! // rst's checker :-) ! if (f.readInt()!=1928) ! System.err.println("error in loading game_locals."); ! ! } ! ! /** Writes the game locals to a file. */ ! public void write(QuakeFile f) throws IOException ! { ! f.writeString(new Date().toString()); ! ! f.writeString(helpmessage1); ! f.writeString(helpmessage2); + f.writeInt(helpchanged); + // gclient_t* + + f.writeString(spawnpoint); + f.writeInt(maxclients); + f.writeInt(maxentities); + f.writeInt(serverflags); + f.writeInt(num_items); + f.writeInt(autosaved?1:0); + // rst's checker :-) + f.writeInt(1928); } + /** Prints the game locals.*/ public void dump() { Com.Println("String helpmessage1: " + helpmessage1); Com.Println("String helpmessage2: " + helpmessage2); Index: GameSave.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSave.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** GameSave.java 7 Jul 2004 19:59:01 -0000 1.1.1.1 --- GameSave.java 20 Aug 2004 21:29:57 -0000 1.2 *************** *** 58,61 **** --- 58,62 ---- for (int i = 0; i < game.maxentities; i++) g_edicts[i] = new edict_t(i); + SV_GAME.ge.edicts = g_edicts; } *************** *** 132,145 **** InitItems(); - //Com_sprintf (game.helpmessage1, sizeof(game.helpmessage1), ""); game.helpmessage1 = ""; - - //Com_sprintf (game.helpmessage2, sizeof(game.helpmessage2), ""); game.helpmessage2 = ""; // initialize all entities for this game game.maxentities = (int) maxentities.value; - - //g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME); CreateEdicts(); --- 133,141 ---- *************** *** 150,733 **** game.maxclients = (int) maxclients.value; - //game.clients = gi.TagMalloc(game.maxclients * sizeof(game.clients[0]), TAG_GAME); CreateClients(); ! globals.num_edicts = game.maxclients + 1; } - ////========================================================= - // - //public static void WriteField1 (FILE *f, field_t field, byte base) - //{ - // void *p; - // int len; - // int index; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_INT: - // case F_FLOAT: - // case F_ANGLEHACK: - // case F_VECTOR: - // case F_IGNORE: - // break; - // - // case F_LSTRING: - // case F_GSTRING: - // if ( *(char **)p ) - // len = strlen(*(char **)p) + 1; - // else - // len = 0; - // *(int *)p = len; - // break; - // case F_EDICT: - // if ( *(edict_t **)p == NULL) - // index = -1; - // else - // index = *(edict_t **)p - g_edicts; - // *(int *)p = index; - // break; - // case F_CLIENT: - // if ( *(gclient_t **)p == NULL) - // index = -1; - // else - // index = *(gclient_t **)p - game.clients; - // *(int *)p = index; - // break; - // case F_ITEM: - // if ( *(edict_t **)p == NULL) - // index = -1; - // else - // index = *(gitem_t **)p - itemlist; - // *(int *)p = index; - // break; - // - // //relative to code segment - // case F_FUNCTION: - // if (*(byte **)p == NULL) - // index = 0; - // else - // index = *(byte **)p - ((byte *)InitGame); - // *(int *)p = index; - // break; - // - // //relative to data segment - // case F_MMOVE: - // if (*(byte **)p == NULL) - // index = 0; - // else - // index = *(byte **)p - (byte *)&mmove_reloc; - // *(int *)p = index; - // break; - // - // default: - // gi.error ("WriteEdict: unknown field type"); - // } - //} - // - // - //void WriteField2 (FILE *f, field_t *field, byte *base) - //{ - // int len; - // void *p; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_LSTRING: - // if ( *(char **)p ) - // { - // len = strlen(*(char **)p) + 1; - // fwrite (*(char **)p, len, 1, f); - // } - // break; - // } - //} - // - //void ReadField (FILE *f, field_t *field, byte *base) - //{ - // void *p; - // int len; - // int index; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_INT: - // case F_FLOAT: - // case F_ANGLEHACK: - // case F_VECTOR: - // case F_IGNORE: - // break; - // - // case F_LSTRING: - // len = *(int *)p; - // if (!len) - // *(char **)p = NULL; - // else - // { - // *(char **)p = gi.TagMalloc (len, TAG_LEVEL); - // fread (*(char **)p, len, 1, f); - // } - // break; - // case F_EDICT: - // index = *(int *)p; - // if ( index == -1 ) - // *(edict_t **)p = NULL; - // else - // *(edict_t **)p = &g_edicts[index]; - // break; - // case F_CLIENT: - // index = *(int *)p; - // if ( index == -1 ) - // *(gclient_t **)p = NULL; - // else - // *(gclient_t **)p = &game.clients[index]; - // break; - // case F_ITEM: - // index = *(int *)p; - // if ( index == -1 ) - // *(gitem_t **)p = NULL; - // else - // *(gitem_t **)p = &itemlist[index]; - // break; - // - // //relative to code segment - // case F_FUNCTION: - // index = *(int *)p; - // if ( index == 0 ) - // *(byte **)p = NULL; - // else - // *(byte **)p = ((byte *)InitGame) + index; - // break; - // - // //relative to data segment - // case F_MMOVE: - // index = *(int *)p; - // if (index == 0) - // *(byte **)p = NULL; - // else - // *(byte **)p = (byte *)&mmove_reloc + index; - // break; - // - // default: - // gi.error ("ReadEdict: unknown field type"); - // } - //} - // - ////========================================================= - // - /... [truncated message content] |
From: Rene S. <sa...@us...> - 2004-08-20 21:30:09
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2/server Modified Files: SV_CCMDS.java SV_INIT.java SV.java SV_WORLD.java Log Message: savegames now seem to work. Index: SV_WORLD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_WORLD.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV_WORLD.java 9 Jul 2004 06:50:49 -0000 1.4 --- SV_WORLD.java 20 Aug 2004 21:29:57 -0000 1.5 *************** *** 177,180 **** --- 177,181 ---- if (null == ent.area.prev) return; // not linked in anywhere + RemoveLink(ent.area); ent.area.prev= ent.area.next= null; *************** *** 213,217 **** // encode the size into the entity_state for client prediction if (ent.solid == SOLID_BBOX && 0 == (ent.svflags & SVF_DEADMONSTER)) ! { // assume that x/y are equal and symetric int i= (int) (ent.maxs[0] / 8); if (i < 1) --- 214,219 ---- // encode the size into the entity_state for client prediction if (ent.solid == SOLID_BBOX && 0 == (ent.svflags & SVF_DEADMONSTER)) ! { ! // assume that x/y are equal and symetric int i= (int) (ent.maxs[0] / 8); if (i < 1) *************** *** 245,249 **** // set the abs box if (ent.solid == SOLID_BSP && (ent.s.angles[0] != 0 || ent.s.angles[1] != 0 || ent.s.angles[2] != 0)) ! { // expand for rotation float max, v; --- 247,252 ---- // set the abs box if (ent.solid == SOLID_BSP && (ent.s.angles[0] != 0 || ent.s.angles[1] != 0 || ent.s.angles[2] != 0)) ! { ! // expand for rotation float max, v; *************** *** 265,269 **** } else ! { // normal VectorAdd(ent.s.origin, ent.mins, ent.absmin); VectorAdd(ent.s.origin, ent.maxs, ent.absmax); --- 268,273 ---- } else ! { ! // normal VectorAdd(ent.s.origin, ent.mins, ent.absmin); VectorAdd(ent.s.origin, ent.maxs, ent.absmax); *************** *** 285,289 **** ent.areanum2= 0; ! //get all leafs, including solids int iw[] = {topnode}; --- 289,293 ---- ent.areanum2= 0; ! // get all leafs, including solids int iw[] = {topnode}; Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV.java 30 Jul 2004 06:07:23 -0000 1.5 --- SV.java 20 Aug 2004 21:29:57 -0000 1.6 *************** *** 5,9 **** * $Id$ */ ! /* Copyright (C) 1997-2001 Id Software, Inc. --- 5,9 ---- * $Id$ */ ! /* Copyright (C) 1997-2001 Id Software, Inc. [...2050 lines suppressed...] ====================== ! *///ok ! public static boolean SV_CloseEnough(edict_t ent, edict_t goal, float dist) { int i; ! ! for (i = 0; i < 3; i++) { if (goal.absmin[i] > ent.absmax[i] + dist) return false; --- 1194,1204 ---- ====================== ! */ //ok ! public static boolean SV_CloseEnough(edict_t ent, edict_t goal, float dist) ! { int i; ! ! for (i= 0; i < 3; i++) ! { if (goal.absmin[i] > ent.absmax[i] + dist) return false; Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_INIT.java 30 Jul 2004 06:07:23 -0000 1.5 --- SV_INIT.java 20 Aug 2004 21:29:57 -0000 1.6 *************** *** 34,41 **** import java.io.RandomAccessFile; ! public class SV_INIT extends Globals { ! public static server_static_t svs = new server_static_t(); // persistant server info ! public static server_t sv = new server_t(); // local server /* --- 34,42 ---- import java.io.RandomAccessFile; ! public class SV_INIT extends Globals ! { ! public static server_static_t svs= new server_static_t(); // persistant server info ! public static server_t sv= new server_t(); // local server /* *************** *** 45,49 **** ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) { int i; --- 46,51 ---- ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) ! { int i; *************** *** 51,55 **** return 0; ! for (i = 1; i < max && sv.configstrings[start + i] != null; i++) if (0 == strcmp(sv.configstrings[start + i], name)) return i; --- 53,57 ---- return 0; ! for (i= 1; i < max && sv.configstrings[start + i] != null; i++) if (0 == strcmp(sv.configstrings[start + i], name)) return i; *************** *** 62,68 **** //strncpy (sv.configstrings[start+i], name, sizeof(sv.configstrings[i])); ! sv.configstrings[start + i] = name; ! if (sv.state != ss_loading) { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); --- 64,71 ---- //strncpy (sv.configstrings[start+i], name, sizeof(sv.configstrings[i])); ! sv.configstrings[start + i]= name; ! if (sv.state != ss_loading) ! { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); *************** *** 75,87 **** } ! public static int SV_ModelIndex(String name) { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } --- 78,93 ---- } ! public static int SV_ModelIndex(String name) ! { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) ! { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) ! { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } *************** *** 96,106 **** ================ */ ! public static void SV_CreateBaseline() { edict_t svent; int entnum; ! for (entnum = 1; entnum < SV_GAME.ge.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); ! svent = SV_GAME.ge.edicts[entnum]; if (!svent.inuse) --- 102,114 ---- ================ */ ! public static void SV_CreateBaseline() ! { edict_t svent; int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) ! { //svent = EDICT_NUM(entnum); ! svent= SV_GAME.ge.edicts[entnum]; if (!svent.inuse) *************** *** 108,112 **** if (0 == svent.s.modelindex && 0 == svent.s.sound && 0 == svent.s.effects) continue; ! svent.s.number = entnum; // --- 116,120 ---- if (0 == svent.s.modelindex && 0 == svent.s.sound && 0 == svent.s.effects) continue; ! svent.s.number= entnum; // *************** *** 115,119 **** VectorCopy(svent.s.origin, svent.s.old_origin); // rst: bugfix ! sv.baselines[entnum].set(svent.s);// = svent.s.getClone(); } } --- 123,127 ---- VectorCopy(svent.s.origin, svent.s.old_origin); // rst: bugfix ! sv.baselines[entnum].set(svent.s); // = svent.s.getClone(); } } *************** *** 124,128 **** ================= */ ! public static void SV_CheckForSavegame() { //char name[MAX_OSPATH]; String name; --- 132,137 ---- ================= */ ! public static void SV_CheckForSavegame() ! { //char name[MAX_OSPATH]; String name; *************** *** 138,154 **** return; ! name = FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try { ! f = new RandomAccessFile(name, "r"); } ! catch (Exception e) { return; // no savegame } ! try { f.close(); } ! catch (IOException e1) { e1.printStackTrace(); } --- 147,167 ---- return; ! name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try ! { ! f= new RandomAccessFile(name, "r"); } ! catch (Exception e) ! { return; // no savegame } ! try ! { f.close(); } ! catch (IOException e1) ! { e1.printStackTrace(); } *************** *** 159,163 **** SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) { // coming back to a level after being in a different // level, so run it for ten seconds --- 172,177 ---- SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) ! { // coming back to a level after being in a different // level, so run it for ten seconds *************** *** 167,176 **** int previousState; // PGM ! previousState = sv.state; // PGM ! sv.state = ss_loading; // PGM ! for (i = 0; i < 100; i++) SV_GAME.ge.RunFrame(); ! sv.state = previousState; // PGM } } --- 181,190 ---- int previousState; // PGM ! previousState= sv.state; // PGM ! sv.state= ss_loading; // PGM ! for (i= 0; i < 100; i++) SV_GAME.ge.RunFrame(); ! sv.state= previousState; // PGM } } *************** *** 185,196 **** ================ */ ! public static void SV_SpawnServer( ! String server, ! String spawnpoint, ! int serverstate, ! boolean attractloop, ! boolean loadgame) { int i; ! int checksum = 0; if (attractloop) --- 199,206 ---- ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) ! { int i; ! int checksum= 0; if (attractloop) *************** *** 201,264 **** Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try { sv.demofile.close(); } ! catch (Exception e) { } svs.spawncount++; // any partially connected client will be // restarted sv.state = ss_dead; Globals.server_state= sv.state; // wipe the entire per-level structure //memset(sv, 0, sizeof(sv)); ! sv = new server_t(); ! ! svs.realtime = 0; ! sv.loadgame = loadgame; ! sv.attractloop = attractloop; // save name for levels that don't set message sv.configstrings[CS_NAME]= server; ! ! if (Cvar.VariableValue("deathmatch")!=0) { ! sv.configstrings[CS_AIRACCEL] = ""+SV_MAIN.sv_airaccelerate.value; ! PMove.pm_airaccelerate = SV_MAIN.sv_airaccelerate.value; } ! else { ! sv.configstrings[CS_AIRACCEL] = "0"; ! PMove.pm_airaccelerate = 0; } SZ.Init(sv.multicast, sv.multicast_buf, sv.multicast_buf.length); ! sv.name = server; // leave slots at start for clients only ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { // needs to reconnect if (svs.clients[i].state > cs_connected) ! svs.clients[i].state = cs_connected; ! svs.clients[i].lastframe = -1; } ! sv.time = 1000; ! sv.name=server; ! sv.configstrings[CS_NAME] = server; ! ! int iw[] = {checksum}; ! if (serverstate != ss_game) { ! sv.models[1] = CM.CM_LoadMap("", false, iw); // no real map } ! else { ! sv.configstrings[CS_MODELS + 1] = "maps/" + server + ".bsp"; ! sv.models[1] = CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); } ! checksum = iw[0]; ! sv.configstrings[CS_MAPCHECKSUM] = "" + checksum; // --- 211,283 ---- Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try ! { sv.demofile.close(); } ! catch (Exception e) ! { } svs.spawncount++; // any partially connected client will be // restarted + sv.state = ss_dead; Globals.server_state= sv.state; + // wipe the entire per-level structure //memset(sv, 0, sizeof(sv)); ! sv= new server_t(); ! ! svs.realtime= 0; ! sv.loadgame= loadgame; ! sv.attractloop= attractloop; // save name for levels that don't set message sv.configstrings[CS_NAME]= server; ! ! if (Cvar.VariableValue("deathmatch") != 0) ! { ! sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; ! PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } ! else ! { ! sv.configstrings[CS_AIRACCEL]= "0"; ! PMove.pm_airaccelerate= 0; } SZ.Init(sv.multicast, sv.multicast_buf, sv.multicast_buf.length); ! sv.name= server; // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { // needs to reconnect if (svs.clients[i].state > cs_connected) ! svs.clients[i].state= cs_connected; ! svs.clients[i].lastframe= -1; } ! sv.time= 1000; ! sv.name= server; ! sv.configstrings[CS_NAME]= server; ! int iw[]= { checksum }; ! ! if (serverstate != ss_game) ! { ! sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } ! else ! { ! sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; ! sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); } ! checksum= iw[0]; ! sv.configstrings[CS_MAPCHECKSUM]= "" + checksum; // *************** *** 267,274 **** SV_WORLD.SV_ClearWorld(); ! for (i = 1; i < CM.CM_NumInlineModels(); i++) { ! sv.configstrings[CS_MODELS + 1 + i] = "*" + i; // copy references ! sv.models[i + 1] = CM.InlineModel(sv.configstrings[CS_MODELS + 1 + i]); } --- 286,294 ---- SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) ! { ! sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references ! sv.models[i + 1]= CM.InlineModel(sv.configstrings[CS_MODELS + 1 + i]); } *************** *** 279,282 **** --- 299,303 ---- // precache and static commands can be issued during // map initialization + sv.state = ss_loading; Globals.server_state= sv.state; *************** *** 312,326 **** ============== */ ! public static void SV_InitGame() { int i; ! edict_t ent; //char idmaster[32]; String idmaster; ! if (svs.initialized) { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else { // make sure the client is down CL.Drop(); --- 333,350 ---- ============== */ ! public static void SV_InitGame() ! { int i; ! edict_t ent; //char idmaster[32]; String idmaster; ! if (svs.initialized) ! { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else ! { // make sure the client is down CL.Drop(); *************** *** 331,337 **** Cvar.GetLatchedVars(); ! svs.initialized = true; ! if (Cvar.VariableValue("coop")!=0 && Cvar.VariableValue("deathmatch")!=0) { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); --- 355,362 ---- Cvar.GetLatchedVars(); ! svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) ! { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 340,356 **** // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value!=0) { ! if (0==Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); } // init clients ! if (Cvar.VariableValue("deathmatch")!=0) { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); else if (SV_MAIN.maxclients.value > MAX_CLIENTS) ! Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop")!=0) { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); --- 365,384 ---- // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) ! { ! if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); } // init clients ! if (Cvar.VariableValue("deathmatch") != 0) ! { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); else if (SV_MAIN.maxclients.value > MAX_CLIENTS) ! Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) ! { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 362,377 **** } ! svs.spawncount = rand(); //svs.clients = Z_Malloc(sizeof(client_t) * maxclients.value); ! svs.clients = new client_t[(int) SV_MAIN.maxclients.value]; ! for (int n=0; n < svs.clients.length; n++) svs.clients[n]= new client_t(); ! ! svs.num_client_entities = ((int) SV_MAIN.maxclients.value) * UPDATE_BACKUP * 64; //ok. ! //svs.client_entities = Z_Malloc(sizeof(entity_state_t) * svs.num_client_entities); ! svs.client_entities = new entity_state_t[svs.num_client_entities]; ! for (int n=0; n < svs.client_entities.length; n++) ! svs.client_entities[n] = new entity_state_t(null); // init network stuff --- 390,405 ---- } ! svs.spawncount= rand(); //svs.clients = Z_Malloc(sizeof(client_t) * maxclients.value); ! svs.clients= new client_t[(int) SV_MAIN.maxclients.value]; ! for (int n= 0; n < svs.clients.length; n++) svs.clients[n]= new client_t(); ! ! svs.num_client_entities= ((int) SV_MAIN.maxclients.value) * UPDATE_BACKUP * 64; //ok. ! //svs.client_entities = Z_Malloc(sizeof(entity_state_t) * svs.num_client_entities); ! svs.client_entities= new entity_state_t[svs.num_client_entities]; ! for (int n= 0; n < svs.client_entities.length; n++) ! svs.client_entities[n]= new entity_state_t(null); // init network stuff *************** *** 379,396 **** // heartbeats will always be sent to the id master ! svs.last_heartbeat = -99999; // send immediately ! idmaster = "192.246.40.37:" + PORT_MASTER; NET.StringToAdr(idmaster, SV_MAIN.master_adr[0]); // init game SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { ! ent = SV_GAME.ge.edicts[i + 1]; ! //ent.s.number = i + 1; //dont need this, ent.s.number already set. ! svs.clients[i].edict = ent; //memset(& svs.clients[i].lastcmd, 0, sizeof(svs.clients[i].lastcmd)); ! svs.clients[i].lastcmd = new usercmd_t(); } } --- 407,425 ---- // heartbeats will always be sent to the id master ! svs.last_heartbeat= -99999; // send immediately ! idmaster= "192.246.40.37:" + PORT_MASTER; NET.StringToAdr(idmaster, SV_MAIN.master_adr[0]); // init game SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { ! ent= SV_GAME.ge.edicts[i + 1]; ! //ent.s.number = i + 1; //dont need this, ent.s.number already set. ! svs.clients[i].edict= ent; //memset(& svs.clients[i].lastcmd, 0, sizeof(svs.clients[i].lastcmd)); ! svs.clients[i].lastcmd= new usercmd_t(); } } *************** *** 412,416 **** ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) { //char level[MAX_QPATH]; //char *ch; --- 441,446 ---- ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) ! { //char level[MAX_QPATH]; //char *ch; *************** *** 420,430 **** String level, ch, spawnpoint; ! sv.loadgame = loadgame; ! sv.attractloop = attractloop; if (sv.state == ss_dead && !sv.loadgame) SV_InitGame(); // the game is just starting ! level = levelstring; // bis hier her ok. // if there is a + in the map, set nextserver to the remainder --- 450,460 ---- String level, ch, spawnpoint; ! sv.loadgame= loadgame; ! sv.attractloop= attractloop; if (sv.state == ss_dead && !sv.loadgame) SV_InitGame(); // the game is just starting ! level= levelstring; // bis hier her ok. // if there is a + in the map, set nextserver to the remainder *************** *** 440,489 **** // Cvar_Set ("nextserver", ""); ! int c = level.indexOf('+'); ! if (c != -1) { ! Cvar.Set("nextserver","gamemap \"" + level.substring(c+1) + "\""); ! level = level.substring(0, c); } ! else { Cvar.Set("nextserver", ""); } //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop")!=0 && !level.equals( "victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); // if there is a $, use the remainder as a spawnpoint ! int pos = level.indexOf('$'); ! if (pos!=-1) { //* ch = 0; ! spawnpoint = level.substring(pos + 1); ! level = level.substring(0,pos); ! } else //spawnpoint[0] = 0; ! spawnpoint = ""; // skip the end-of-unit flag if necessary if (level.charAt(0) == '*') ! level = level.substring(1); ! l = level.length(); ! if (l > 4 && level.endsWith(".cin")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); --- 470,526 ---- // Cvar_Set ("nextserver", ""); ! int c= level.indexOf('+'); ! if (c != -1) ! { ! Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); ! level= level.substring(0, c); } ! else ! { Cvar.Set("nextserver", ""); } //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop") != 0 && !level.equals("victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); // if there is a $, use the remainder as a spawnpoint ! int pos= level.indexOf('$'); ! if (pos != -1) ! { //* ch = 0; ! spawnpoint= level.substring(pos + 1); ! level= level.substring(0, pos); ! } else //spawnpoint[0] = 0; ! spawnpoint= ""; // skip the end-of-unit flag if necessary if (level.charAt(0) == '*') ! level= level.substring(1); ! l= level.length(); ! if (l > 4 && level.endsWith(".cin")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_CCMDS.java 23 Jul 2004 10:09:01 -0000 1.5 --- SV_CCMDS.java 20 Aug 2004 21:29:57 -0000 1.6 *************** *** 30,33 **** --- 30,34 ---- import jake2.sys.Sys; import jake2.util.Lib; + import jake2.util.QuakeFile; import jake2.util.Vargs; *************** *** 35,39 **** import java.util.Calendar; [...1909 lines suppressed...] ! public void execute() ! { SV_Loadgame_f(); } }); ! Cmd.AddCommand("killserver", new xcommand_t() ! { ! public void execute() ! { SV_KillServer_f(); } }); ! Cmd.AddCommand("sv", new xcommand_t() ! { ! public void execute() ! { SV_ServerCommand_f(); } |
From: Rene S. <sa...@us...> - 2004-08-20 21:30:09
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2/qcommon Modified Files: FS.java Log Message: savegames now seem to work. Index: FS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/FS.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FS.java 9 Jul 2004 06:50:49 -0000 1.3 --- FS.java 20 Aug 2004 21:29:58 -0000 1.4 *************** *** 117,121 **** File f = new File(path.substring(0, index)); if (!f.mkdirs()) { ! Com.Printf("can't create path \"" + path + '"' + "\n" ); } } --- 117,121 ---- File f = new File(path.substring(0, index)); if (!f.mkdirs()) { ! //Com.Printf("can't create path \"" + path + '"' + "\n" ); } } |