aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/server
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2004-08-29 21:39:26 +0000
committerHolger Zickner <[email protected]>2004-08-29 21:39:26 +0000
commitc7adb77c3b6aec488a0328dc6c2cead172589f76 (patch)
treebe681d05ca19e5596dddd1a0f03a4b039fed7e2f /src/jake2/server
parent3721d58bf33af4a83cf973590d922eadf85d71d4 (diff)
remove game_export_t and other dll related stuff
Diffstat (limited to 'src/jake2/server')
-rw-r--r--src/jake2/server/SV.java4
-rw-r--r--src/jake2/server/SV_CCMDS.java17
-rw-r--r--src/jake2/server/SV_ENTS.java12
-rw-r--r--src/jake2/server/SV_GAME.java25
-rw-r--r--src/jake2/server/SV_INIT.java16
-rw-r--r--src/jake2/server/SV_MAIN.java16
-rw-r--r--src/jake2/server/SV_USER.java10
-rw-r--r--src/jake2/server/SV_WORLD.java16
8 files changed, 45 insertions, 71 deletions
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