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]; |