From c7adb77c3b6aec488a0328dc6c2cead172589f76 Mon Sep 17 00:00:00 2001 From: Holger Zickner Date: Sun, 29 Aug 2004 21:39:26 +0000 Subject: remove game_export_t and other dll related stuff --- src/jake2/game/GameBase.java | 34 +++------ src/jake2/game/GameSave.java | 37 ++++------ src/jake2/game/GameSpawn.java | 8 +-- src/jake2/game/GameTargetAdapters.java | 11 ++- src/jake2/game/GameUtil.java | 12 ++-- src/jake2/game/game_export_t.java | 124 --------------------------------- src/jake2/server/SV.java | 4 +- src/jake2/server/SV_CCMDS.java | 17 ++--- src/jake2/server/SV_ENTS.java | 12 ++-- src/jake2/server/SV_GAME.java | 25 ++----- src/jake2/server/SV_INIT.java | 16 ++--- src/jake2/server/SV_MAIN.java | 16 ++--- src/jake2/server/SV_USER.java | 10 +-- src/jake2/server/SV_WORLD.java | 16 ++--- src/jake2/sys/Sys.java | 11 +-- 15 files changed, 81 insertions(+), 272 deletions(-) delete mode 100644 src/jake2/game/game_export_t.java diff --git a/src/jake2/game/GameBase.java b/src/jake2/game/GameBase.java index cdec20b..323f6c8 100644 --- a/src/jake2/game/GameBase.java +++ b/src/jake2/game/GameBase.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 30.11.2003 by RST. -// $Id: GameBase.java,v 1.5 2004-08-22 14:25:11 salomo Exp $ +// $Id: GameBase.java,v 1.6 2004-08-29 21:39:24 hzi Exp $ /** Father of all GameObjects. */ @@ -38,12 +38,12 @@ public class GameBase extends Globals { 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(); public static int sm_meat_index; 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]; static { @@ -156,7 +156,7 @@ public class GameBase extends Globals { else from.i++; - for (; from.i < globals.num_edicts; from.i++) { + for (; from.i < num_edicts; from.i++) { from.o= g_edicts[from.i]; if (from.o.classname == null) { Com.Printf("edict with classname = null" + from.o.index); @@ -193,7 +193,7 @@ public class GameBase extends Globals { else from.i++; - for (; from.i < globals.num_edicts; from.i++) { + for (; from.i < num_edicts; from.i++) { from.o= g_edicts[from.i]; if (!from.o.inuse) continue; @@ -375,21 +375,6 @@ public class GameBase extends Globals { ================ */ 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) { mins[0]= mins[1]= mins[2]= 99999; @@ -427,9 +412,6 @@ public class GameBase extends Globals { public static void ShutdownGame() { gi.dprintf("==== ShutdownGame ====\n"); - - //gi.FreeTags (TAG_LEVEL); - //gi.FreeTags (TAG_GAME); } //====================================================================== @@ -654,7 +636,7 @@ public class GameBase extends Globals { // even the world gets a chance to think // - for (i= 0; i < globals.num_edicts; i++) { + for (i= 0; i < num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) continue; @@ -698,7 +680,7 @@ public class GameBase extends Globals { ================= */ - public static game_export_t GetGameApi(game_import_t imp) { + public static void GetGameApi(game_import_t imp) { gi= imp; gi.pointcontents= new pmove_t.PointContentsAdapter() { @@ -707,7 +689,7 @@ public class GameBase extends Globals { } }; - globals.apiversion= GAME_API_VERSION; + //globals.apiversion= GAME_API_VERSION; /* globals.Init = InitGame; globals.Shutdown = ShutdownGame; @@ -728,6 +710,6 @@ public class GameBase extends Globals { globals.ServerCommand = ServerCommand; */ - return globals; + //return globals; } } \ No newline at end of file diff --git a/src/jake2/game/GameSave.java b/src/jake2/game/GameSave.java index 7db262e..90d9619 100644 --- a/src/jake2/game/GameSave.java +++ b/src/jake2/game/GameSave.java @@ -19,21 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 29.12.2003 by RST. -// $Id: GameSave.java,v 1.3 2004-08-22 14:25:12 salomo Exp $ +// $Id: GameSave.java,v 1.4 2004-08-29 21:39:24 hzi Exp $ 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.*; +import jake2.qcommon.Com; +import jake2.util.QuakeFile; public class GameSave extends GameFunc { @@ -57,7 +48,7 @@ public class GameSave extends GameFunc { 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; + GameBase.g_edicts= g_edicts; } public static void CreateClients() { @@ -139,15 +130,15 @@ public class GameSave extends GameFunc { game.maxentities= (int) maxentities.value; CreateEdicts(); - globals.edicts= g_edicts; - globals.max_edicts= game.maxentities; +// 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; + num_edicts= game.maxclients + 1; } /* @@ -221,7 +212,7 @@ public class GameSave extends GameFunc { ================= */ - static void WriteLevel(String filename) { + public static void WriteLevel(String filename) { try { int i; edict_t ent; @@ -235,7 +226,7 @@ public class GameSave extends GameFunc { level.write(f); // write out all the entities - for (i= 0; i < globals.num_edicts; i++) { + for (i= 0; i < num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) continue; @@ -270,7 +261,7 @@ public class GameSave extends GameFunc { No clients are connected yet. ================= */ - static void ReadLevel(String filename) { + public static void ReadLevel(String filename) { try { edict_t ent; @@ -282,7 +273,7 @@ public class GameSave extends GameFunc { // wipe all the entities Game.CreateEdicts(); - globals.num_edicts= (int) maxclients.value + 1; + num_edicts= (int) maxclients.value + 1; // load the level locals level.read(f); @@ -293,8 +284,8 @@ public class GameSave extends GameFunc { if (entnum == -1) break; - if (entnum >= globals.num_edicts) - globals.num_edicts= entnum + 1; + if (entnum >= num_edicts) + num_edicts= entnum + 1; ent= g_edicts[entnum]; System.out.println("readint ent" + entnum); @@ -313,7 +304,7 @@ public class GameSave extends GameFunc { } // do any load time things at this point - for (int i= 0; i < globals.num_edicts; i++) { + for (int i= 0; i < num_edicts; i++) { ent= g_edicts[i]; if (!ent.inuse) diff --git a/src/jake2/game/GameSpawn.java b/src/jake2/game/GameSpawn.java index c87c330..c93ebc0 100644 --- a/src/jake2/game/GameSpawn.java +++ b/src/jake2/game/GameSpawn.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 18.11.2003 by RST. -// $Id: GameSpawn.java,v 1.5 2004-08-29 19:27:37 hzi Exp $ +// $Id: GameSpawn.java,v 1.6 2004-08-29 21:39:24 hzi Exp $ package jake2.game; @@ -284,7 +284,7 @@ public class GameSpawn extends GameSave { int c, c2; c = 0; c2 = 0; - for (i = 1; i < globals.num_edicts; i++) { + for (i = 1; i < num_edicts; i++) { e = g_edicts[i]; if (!e.inuse) @@ -298,7 +298,7 @@ public class GameSpawn extends GameSave { c++; c2++; //Com.Printf("Team:" + e.team+" entity: " + e.index + "\n"); - for (j = i + 1; j < globals.num_edicts; j++) { + for (j = i + 1; j < num_edicts; j++) { e2 = g_edicts[j]; if (!e2.inuse) continue; @@ -328,7 +328,7 @@ public class GameSpawn extends GameSave { ============== */ - static void SpawnEntities(String mapname, String entities, String spawnpoint) { + public static void SpawnEntities(String mapname, String entities, String spawnpoint) { edict_t ent; int inhibit; String com_token; diff --git a/src/jake2/game/GameTargetAdapters.java b/src/jake2/game/GameTargetAdapters.java index e02975f..19a48c9 100644 --- a/src/jake2/game/GameTargetAdapters.java +++ b/src/jake2/game/GameTargetAdapters.java @@ -19,15 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 26.02.2004 by RST. -// $Id: GameTargetAdapters.java,v 1.2 2004-08-27 21:57:48 hzi Exp $ +// $Id: GameTargetAdapters.java,v 1.3 2004-08-29 21:39:24 hzi Exp $ package jake2.game; -import jake2.*; -import jake2.client.*; -import jake2.qcommon.*; -import jake2.render.*; -import jake2.server.*; +import jake2.Defines; +import jake2.Globals; import jake2.util.Lib; import jake2.util.Math3D; @@ -553,7 +550,7 @@ public class GameTargetAdapters { self.last_move_time = GameBase.level.time + 0.5f; } - for (i = 1; i < GameBase.globals.num_edicts; i++) { + for (i = 1; i < GameBase.num_edicts; i++) { e = GameBase.g_edicts[i]; if (!e.inuse) diff --git a/src/jake2/game/GameUtil.java b/src/jake2/game/GameUtil.java index 5769564..765659d 100644 --- a/src/jake2/game/GameUtil.java +++ b/src/jake2/game/GameUtil.java @@ -19,16 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 01.11.2003 by RST. -// $Id: GameUtil.java,v 1.4 2004-08-20 21:29:57 salomo Exp $ +// $Id: GameUtil.java,v 1.5 2004-08-29 21:39:24 hzi Exp $ package jake2.game; -import java.sql.Savepoint; - -import jake2.Defines; import jake2.client.M; import jake2.qcommon.Com; -import jake2.util.*; +import jake2.util.Lib; +import jake2.util.Math3D; public class GameUtil extends GameBase { @@ -165,7 +163,7 @@ public class GameUtil extends GameBase int i; edict_t e = null; - for (i = (int) maxclients.value + 1; i < globals.num_edicts; i++) + for (i = (int) maxclients.value + 1; i < num_edicts; i++) { e = g_edicts[i]; // the first couple seconds of server time can involve a lot of @@ -182,7 +180,7 @@ public class GameUtil extends GameBase gi.error("ED_Alloc: no free edicts"); e = g_edicts[i] = new edict_t(i); - globals.num_edicts++; + num_edicts++; G_InitEdict(e, i); return e; } diff --git a/src/jake2/game/game_export_t.java b/src/jake2/game/game_export_t.java deleted file mode 100644 index cfc0610..0000000 --- a/src/jake2/game/game_export_t.java +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright (C) 1997-2001 Id Software, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ - -// Created on 31.10.2003 by RST. -// $Id: game_export_t.java,v 1.5 2004-08-22 14:25:11 salomo Exp $ - -package jake2.game; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; - -import jake2.qcommon.Com; -import jake2.util.QuakeFile; - -// -//functions exported by the game subsystem -// - -public class game_export_t { - - public int apiversion; - - // the init function will only be called when a game starts, - // 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); - } - - // Read/Write Game is for storing persistant cross level information - // about the world state and the clients. - // 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); - } - - // 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(); - } - - // ServerCommand will be called when an "sv " command is issued on the - // server console. - // the game can issue gi.argc() / gi.argv() commands to get the rest - // of the parameters - public void ServerCommand() { - Game.ServerCommand(); - } - - // - // global variables shared between game and server - // - - // the edict array is allocated in the game dll so it - // can vary in size from one game to another. - - // 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; -} diff --git a/src/jake2/server/SV.java b/src/jake2/server/SV.java index fa98f32..701f767 100644 --- a/src/jake2/server/SV.java +++ b/src/jake2/server/SV.java @@ -2,7 +2,7 @@ * SV.java * Copyright (C) 2003 * - * $Id: SV.java,v 1.8 2004-08-22 20:39:03 salomo Exp $ + * $Id: SV.java,v 1.9 2004-08-29 21:39:25 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -378,7 +378,7 @@ public final class SV // see if any solid entities are inside the final position //check= g_edicts + 1; - for (e= 1; e < GameBase.globals.num_edicts; e++) + for (e= 1; e < GameBase.num_edicts; e++) { check= GameBase.g_edicts[e]; if (!check.inuse) diff --git a/src/jake2/server/SV_CCMDS.java b/src/jake2/server/SV_CCMDS.java index 8ab3e72..757fb0e 100644 --- a/src/jake2/server/SV_CCMDS.java +++ b/src/jake2/server/SV_CCMDS.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 18.01.2004 by RST. -// $Id: SV_CCMDS.java,v 1.7 2004-08-22 14:25:12 salomo Exp $ +// $Id: SV_CCMDS.java,v 1.8 2004-08-29 21:39:25 hzi Exp $ package jake2.server; @@ -28,7 +28,6 @@ import jake2.game.*; import jake2.qcommon.*; import jake2.sys.NET; import jake2.sys.Sys; -import jake2.util.Lib; import jake2.util.QuakeFile; import jake2.util.Vargs; @@ -353,7 +352,7 @@ public class SV_CCMDS extends SV_ENTS { } name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; - ge.WriteLevel(name); + GameSave.WriteLevel(name); } /* @@ -386,7 +385,7 @@ public class SV_CCMDS extends SV_ENTS { } name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; - ge.ReadLevel(name); + GameSave.ReadLevel(name); System.out.println("all done!"); } @@ -457,7 +456,7 @@ public class SV_CCMDS extends SV_ENTS { // write game state filename= FS.Gamedir() + "/save/current/game.ssv"; - ge.WriteGame(filename, autosave); + GameSave.WriteGame(filename, autosave); } /* @@ -508,7 +507,7 @@ public class SV_CCMDS extends SV_ENTS { // read game state filename= FS.Gamedir() + "/save/current/game.ssv"; - ge.ReadGame(filename); + GameSave.ReadGame(filename); } catch (Exception e) { Com.Printf("Couldn't read file " + name + "\n"); @@ -1055,12 +1054,8 @@ public class SV_CCMDS extends SV_ENTS { =============== */ public static void SV_ServerCommand_f() { - if (SV_GAME.ge == null) { - Com.Printf("No game loaded.\n"); - return; - } - SV_GAME.ge.ServerCommand(); + Game.ServerCommand(); } //=========================================================== diff --git a/src/jake2/server/SV_ENTS.java b/src/jake2/server/SV_ENTS.java index e3a5a2c..8b3db67 100644 --- a/src/jake2/server/SV_ENTS.java +++ b/src/jake2/server/SV_ENTS.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 17.01.2004 by RST. -// $Id: SV_ENTS.java,v 1.3 2004-07-12 20:47:02 hzi Exp $ +// $Id: SV_ENTS.java,v 1.4 2004-08-29 21:39:25 hzi Exp $ package jake2.server; @@ -456,8 +456,8 @@ public class SV_ENTS extends SV_USER { c_fullsend = 0; - for (e = 1; e < SV_GAME.ge.num_edicts; e++) { - ent = SV_GAME.ge.edicts[e]; + for (e = 1; e < GameBase.num_edicts; e++) { + ent = GameBase.g_edicts[e]; // ignore ents without visible models if ((ent.svflags & SVF_NOCLIENT) != 0) @@ -567,9 +567,9 @@ public class SV_ENTS extends SV_USER { MSG.WriteByte(buf, svc_packetentities); e = 1; - ent = SV_GAME.ge.edicts[e]; + ent = GameBase.g_edicts[e]; - while (e < SV_GAME.ge.num_edicts) { + while (e < GameBase.num_edicts) { // ignore ents without visible models unless they have an effect if (ent.inuse && ent.s.number != 0 @@ -578,7 +578,7 @@ public class SV_ENTS extends SV_USER { MSG.WriteDeltaEntity(nostate, ent.s, buf, false, true); e++; - ent = SV_GAME.ge.edicts[e]; + ent = GameBase.g_edicts[e]; } MSG.WriteShort(buf, 0); // end of packetentities diff --git a/src/jake2/server/SV_GAME.java b/src/jake2/server/SV_GAME.java index 0dc5a8b..844aacb 100644 --- a/src/jake2/server/SV_GAME.java +++ b/src/jake2/server/SV_GAME.java @@ -19,20 +19,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 14.01.2004 by RST. -// $Id: SV_GAME.java,v 1.6 2004-08-22 14:25:12 salomo Exp $ +// $Id: SV_GAME.java,v 1.7 2004-08-29 21:39:25 hzi Exp $ 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; /* =============== @@ -297,11 +292,7 @@ public class SV_GAME extends SV_INIT { =============== */ public static void SV_ShutdownGameProgs() { - if (ge == null) - return; - ge.Shutdown(); - Sys.UnloadGame(); - ge = null; + Game.ShutdownGame(); } /* @@ -315,19 +306,13 @@ public class SV_GAME extends SV_INIT { public static void SV_InitGameProgs() { // unload anything we have now - if (ge != null) - SV_ShutdownGameProgs(); + 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); + GameBase.GetGameApi(gimport); - ge.Init(); + Game.InitGame(); } } diff --git a/src/jake2/server/SV_INIT.java b/src/jake2/server/SV_INIT.java index c036d50..2325f22 100644 --- a/src/jake2/server/SV_INIT.java +++ b/src/jake2/server/SV_INIT.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 14.01.2004 by RST. -// $Id: SV_INIT.java,v 1.7 2004-08-22 14:25:13 salomo Exp $ +// $Id: SV_INIT.java,v 1.8 2004-08-29 21:39:25 hzi Exp $ package jake2.server; @@ -99,9 +99,9 @@ public class SV_INIT extends Globals { edict_t svent; int entnum; - for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) { + for (entnum= 1; entnum < GameBase.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); - svent= SV_GAME.ge.edicts[entnum]; + svent= GameBase.g_edicts[entnum]; if (!svent.inuse) continue; @@ -168,7 +168,7 @@ public class SV_INIT extends Globals { previousState= sv.state; // PGM sv.state= ss_loading; // PGM for (i= 0; i < 100; i++) - SV_GAME.ge.RunFrame(); + Game.G_RunFrame(); sv.state= previousState; // PGM } @@ -278,11 +278,11 @@ public class SV_INIT extends Globals { Globals.server_state= sv.state; // load and spawn all other entities - SV_GAME.ge.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); + Game.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); // run two frames to allow everything to settle - SV_GAME.ge.RunFrame(); - SV_GAME.ge.RunFrame(); + Game.G_RunFrame(); + Game.G_RunFrame(); // all precaches are complete sv.state= serverstate; @@ -382,7 +382,7 @@ public class SV_INIT extends Globals { 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= GameBase.g_edicts[i + 1]; //ent.s.number = i + 1; //dont need this, ent.s.number already set. svs.clients[i].edict= ent; diff --git a/src/jake2/server/SV_MAIN.java b/src/jake2/server/SV_MAIN.java index 99b74e9..7beff4e 100644 --- a/src/jake2/server/SV_MAIN.java +++ b/src/jake2/server/SV_MAIN.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 13.01.2004 by RST. -// $Id: SV_MAIN.java,v 1.5 2004-07-30 06:07:23 hzi Exp $ +// $Id: SV_MAIN.java,v 1.6 2004-08-29 21:39:25 hzi Exp $ package jake2.server; @@ -89,7 +89,7 @@ public class SV_MAIN extends SV_GAME { if (drop.state == Defines.cs_spawned) { // call the prog function for removing a client // this will remove the body, among other things - SV_GAME.ge.ClientDisconnect(drop.edict); + PlayerClient.ClientDisconnect(drop.edict); } if (drop.download != null) { @@ -363,12 +363,12 @@ public class SV_MAIN extends SV_GAME { sv_client = svs.clients[i]; //edictnum = (newcl-svs.clients)+1; int edictnum = i + 1; - edict_t ent = ge.edicts[edictnum]; + 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 (!(ge.ClientConnect(ent, userinfo))) { + if (!(PlayerClient.ClientConnect(ent, userinfo))) { if (Info.Info_ValueForKey(userinfo, "rejmsg") != null) Netchan.OutOfBandPrint( NS_SERVER, @@ -670,8 +670,8 @@ public class SV_MAIN extends SV_GAME { edict_t ent; int i; - for (i = 0; i < ge.num_edicts; i++) { - ent = SV_GAME.ge.edicts[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; } @@ -696,7 +696,7 @@ public class SV_MAIN extends SV_GAME { // don't run if paused if (0 == sv_paused.value || maxclients.value > 1) { - ge.RunFrame(); + Game.G_RunFrame(); // never get more than one tic behind if (sv.time < svs.realtime) { @@ -862,7 +862,7 @@ public class SV_MAIN extends SV_GAME { int i; // call prog code to allow overrides - SV_GAME.ge.ClientUserinfoChanged(cl.edict, cl.userinfo); + PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo); // name for C code cl.name = Info.Info_ValueForKey(cl.userinfo, "name"); diff --git a/src/jake2/server/SV_USER.java b/src/jake2/server/SV_USER.java index 65e5262..5a31de8 100644 --- a/src/jake2/server/SV_USER.java +++ b/src/jake2/server/SV_USER.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 17.01.2004 by RST. -// $Id: SV_USER.java,v 1.4 2004-07-09 06:50:49 hzi Exp $ +// $Id: SV_USER.java,v 1.5 2004-08-29 21:39:25 hzi Exp $ package jake2.server; @@ -124,7 +124,7 @@ public class SV_USER extends SV_SEND if (sv.state == ss_game) { // set up the entity for the client - ent= SV_GAME.ge.edicts[playernum + 1]; + ent= GameBase.g_edicts[playernum + 1]; ent.s.number= playernum + 1; sv_client.edict= ent; sv_client.lastcmd= new usercmd_t(); @@ -269,7 +269,7 @@ public class SV_USER extends SV_SEND sv_client.state= cs_spawned; // call the game begin function - SV_GAME.ge.ClientBegin(sv_player); + PlayerClient.ClientBegin(sv_player); Cbuf.InsertFromDefer(); } @@ -552,7 +552,7 @@ public class SV_USER extends SV_SEND } if (i == ucmds.length && sv.state == ss_game) - SV_GAME.ge.ClientCommand(sv_player); + PlayerClient.ClientCommand(sv_player); // SV_EndRedirect (); } @@ -575,7 +575,7 @@ public class SV_USER extends SV_SEND return; } - SV_GAME.ge.ClientThink(cl.edict, cmd); + PlayerClient.ClientThink(cl.edict, cmd); } public static final int MAX_STRINGCMDS= 8; diff --git a/src/jake2/server/SV_WORLD.java b/src/jake2/server/SV_WORLD.java index cb74e95..46caf89 100644 --- a/src/jake2/server/SV_WORLD.java +++ b/src/jake2/server/SV_WORLD.java @@ -19,19 +19,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 07.01.2000 by RST. -// $Id: SV_WORLD.java,v 1.5 2004-08-20 21:29:57 salomo Exp $ +// $Id: SV_WORLD.java,v 1.6 2004-08-29 21:39:25 hzi Exp $ 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; +import jake2.qcommon.CM; +import jake2.qcommon.Com; public class SV_WORLD extends SV_CCMDS { @@ -202,7 +196,7 @@ public class SV_WORLD extends SV_CCMDS if (ent.area.prev != null) SV_UnlinkEdict(ent); // unlink from old position - if (ent == ge.edicts[0]) + if (ent == GameBase.g_edicts[0]) return; // don't add the world if (!ent.inuse) @@ -663,7 +657,7 @@ public class SV_WORLD extends SV_CCMDS // clip to world clip.trace= CM.BoxTrace(start, end, mins, maxs, 0, contentmask); - clip.trace.ent= ge.edicts[0]; + clip.trace.ent= GameBase.g_edicts[0]; if (clip.trace.fraction == 0) return clip.trace; // blocked by the world diff --git a/src/jake2/sys/Sys.java b/src/jake2/sys/Sys.java index cd09fd6..cf8e154 100644 --- a/src/jake2/sys/Sys.java +++ b/src/jake2/sys/Sys.java @@ -2,7 +2,7 @@ * Sys.java * Copyright (C) 2003 * - * $Id: Sys.java,v 1.6 2004-07-28 11:59:32 hzi Exp $ + * $Id: Sys.java,v 1.7 2004-08-29 21:39:26 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -29,7 +29,6 @@ import jake2.Defines; import jake2.Globals; import jake2.client.CL; import jake2.qcommon.Com; -import jake2.util.Lib; import java.io.File; import java.io.FilenameFilter; @@ -226,14 +225,6 @@ public final class Sys extends Defines { fdir = null; } - - - public static void UnloadGame() - { - //TODO:implement UnloadGame - //Com.Error(Defines.ERR_FATAL, "UnloadGame not implemented!"); - - } public static void SendKeyEvents() { KBD.Update(); -- cgit v1.2.3