aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jake2/Defines.java16
-rw-r--r--src/jake2/game/BigEndianHandler.java74
-rw-r--r--src/jake2/game/Fire.java3
-rw-r--r--src/jake2/game/GameAI.java3
-rw-r--r--src/jake2/game/GameAIAdapters.java15
-rw-r--r--src/jake2/game/GameBase.java25
-rw-r--r--src/jake2/game/GameFunc.java3
-rw-r--r--src/jake2/game/GameMisc.java5
-rw-r--r--src/jake2/game/GamePWeapon.java19
-rw-r--r--src/jake2/game/GameSave.java21
-rw-r--r--src/jake2/game/GameSpawn.java97
-rw-r--r--src/jake2/game/GameTargetAdapters.java4
-rw-r--r--src/jake2/game/GameUtilAdapters.java22
-rw-r--r--src/jake2/game/Info.java6
-rw-r--r--src/jake2/game/LittleEndianHandler.java56
-rw-r--r--src/jake2/game/M_SoldierAdapters.java7
-rw-r--r--src/jake2/game/client_persistant_t.java144
-rw-r--r--src/jake2/game/client_respawn_t.java14
-rw-r--r--src/jake2/game/field_t.java45
-rw-r--r--src/jake2/game/game_locals_t.java19
-rw-r--r--src/jake2/game/gclient_t.java88
-rw-r--r--src/jake2/qcommon/PMove.java3
-rw-r--r--src/jake2/qcommon/SZ.java3
-rw-r--r--src/jake2/render/fastjogl/Light.java3
-rw-r--r--src/jake2/server/SV_CCMDS.java20
-rw-r--r--src/jake2/server/SV_MAIN.java293
-rw-r--r--src/jake2/server/SV_SEND.java33
-rw-r--r--src/jake2/sys/Sys.java79
-rw-r--r--src/jake2/util/Math3D.java42
-rw-r--r--src/jake2/util/QuakeFile.java8
30 files changed, 287 insertions, 883 deletions
diff --git a/src/jake2/Defines.java b/src/jake2/Defines.java
index f32845b..43bad3b 100644
--- a/src/jake2/Defines.java
+++ b/src/jake2/Defines.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: Defines.java,v 1.3 2004-07-09 06:50:51 hzi Exp $
+// $Id: Defines.java,v 1.4 2004-09-10 19:02:57 salomo Exp $
/** Contains the definitions for the game engine. */
@@ -138,7 +138,6 @@ public class Defines extends Math3D {
public final static int LAST_VISIBLE_CONTENTS = 64;
// remaining contents are non-visible, and don't eat brushes
-
public final static int CONTENTS_AREAPORTAL = 0x8000;
public final static int CONTENTS_PLAYERCLIP = 0x10000;
@@ -161,7 +160,6 @@ public class Defines extends Math3D {
public final static int CONTENTS_LADDER = 0x20000000;
public final static int SURF_LIGHT = 0x1; // value will hold the light strength
-
public final static int SURF_SLICK = 0x2; // effects game physics
public final static int SURF_SKY = 0x4; // don't draw, but add to skybox
@@ -171,17 +169,7 @@ public class Defines extends Math3D {
public final static int SURF_FLOWING = 0x40; // scroll towards angle
public final static int SURF_NODRAW = 0x80; // don't bother referencing the texture
- // structure offset for asm code
- public final static int CPLANE_NORMAL_X = 0;
- public final static int CPLANE_NORMAL_Y = 4;
- public final static int CPLANE_NORMAL_Z = 8;
- public final static int CPLANE_DIST = 12;
- public final static int CPLANE_TYPE = 16;
- public final static int CPLANE_SIGNBITS = 17;
- public final static int CPLANE_PAD0 = 18;
- public final static int CPLANE_PAD1 = 19;
-
- // pmove->pm_flags
+ // pmove->pm_flags
public final static int PMF_DUCKED = 1;
public final static int PMF_JUMP_HELD = 2;
public final static int PMF_ON_GROUND = 4;
diff --git a/src/jake2/game/BigEndianHandler.java b/src/jake2/game/BigEndianHandler.java
deleted file mode 100644
index c9e2830..0000000
--- a/src/jake2/game/BigEndianHandler.java
+++ /dev/null
@@ -1,74 +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.
-
-*/
-
-/*
- * $Id: BigEndianHandler.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
- */
-package jake2.game;
-
-
-/**
- * BigEndianHandler
- */
-public final class BigEndianHandler extends EndianHandler {
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigFloat(float)
- */
- public float BigFloat(float f) {
- return f;
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigShort(short)
- */
- public short BigShort(short s) {
- return s;
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigLong(int)
- */
- public int BigLong(int i) {
- return i;
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleFloat(float)
- */
- public float LittleFloat(float f) {
- return swapFloat(f);
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleShort(short)
- */
- public short LittleShort(short s) {
- return swapShort(s);
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleLong(int)
- */
- public int LittleLong(int i) {
- return swapInt(i);
- }
-
-}
diff --git a/src/jake2/game/Fire.java b/src/jake2/game/Fire.java
index 2c79b3a..73a6f18 100644
--- a/src/jake2/game/Fire.java
+++ b/src/jake2/game/Fire.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 04.12.2003 by RST.
-// $Id: Fire.java,v 1.2 2004-07-08 15:58:43 hzi Exp $
+// $Id: Fire.java,v 1.3 2004-09-10 19:02:53 salomo Exp $
package jake2.game;
@@ -310,6 +310,7 @@ public class Fire
for (i = 0; i < count; i++)
fire_lead(self, start, aimdir, damage, kick, Defines.TE_SHOTGUN, hspread, vspread, mod);
}
+
public static void fire_blaster(edict_t self, float[] start, float[] dir, int damage, int speed, int effect, boolean hyper)
{
edict_t bolt;
diff --git a/src/jake2/game/GameAI.java b/src/jake2/game/GameAI.java
index fa2cdbd..d4ff055 100644
--- a/src/jake2/game/GameAI.java
+++ b/src/jake2/game/GameAI.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 02.11.2003 by RST.
-// $Id: GameAI.java,v 1.3 2004-08-28 16:40:12 cawe Exp $
+// $Id: GameAI.java,v 1.4 2004-09-10 19:02:55 salomo Exp $
package jake2.game;
@@ -1668,7 +1668,6 @@ public class GameAI extends M_Flash
public static void InitItems()
{
- //game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1;
game.num_items = GameAI.itemlist.length - 1;
}
diff --git a/src/jake2/game/GameAIAdapters.java b/src/jake2/game/GameAIAdapters.java
index e344318..93f0a4d 100644
--- a/src/jake2/game/GameAIAdapters.java
+++ b/src/jake2/game/GameAIAdapters.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: GameAIAdapters.java,v 1.3 2004-08-22 15:46:19 salomo Exp $
+// $Id: GameAIAdapters.java,v 1.4 2004-09-10 19:02:53 salomo Exp $
package jake2.game;
@@ -166,13 +166,10 @@ public class GameAIAdapters {
};
public static EntThinkAdapter swimmonster_start= new EntThinkAdapter() {
public boolean think(edict_t self) {
-
- {
- self.flags |= Defines.FL_SWIM;
- self.think= swimmonster_start_go;
- Monster.monster_start(self);
- return true;
- }
+ self.flags |= Defines.FL_SWIM;
+ self.think= swimmonster_start_go;
+ Monster.monster_start(self);
+ return true;
}
};
/*
@@ -379,7 +376,7 @@ public class GameAIAdapters {
if ((self.monsterinfo.search_time != 0) && (GameBase.level.time > (self.monsterinfo.search_time + 20))) {
M.M_MoveToGoal(self, dist);
self.monsterinfo.search_time= 0;
- // dprint("search timeout\n");
+ //dprint("search timeout\n");
return;
}
diff --git a/src/jake2/game/GameBase.java b/src/jake2/game/GameBase.java
index 323f6c8..f71ba76 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.6 2004-08-29 21:39:24 hzi Exp $
+// $Id: GameBase.java,v 1.7 2004-09-10 19:02:54 salomo Exp $
/** Father of all GameObjects. */
@@ -688,28 +688,5 @@ public class GameBase extends Globals {
return SV_WORLD.SV_PointContents(o);
}
};
-
- //globals.apiversion= GAME_API_VERSION;
- /*
- globals.Init = InitGame;
- globals.Shutdown = ShutdownGame;
- globals.SpawnEntities = SpawnEntities;
-
- globals.WriteGame = WriteGame;
- globals.ReadGame = ReadGame;
- globals.WriteLevel = WriteLevel;
- globals.ReadLevel = ReadLevel;
-
- globals.ClientThink = ClientThink;
- globals.ClientConnect = ClientConnect;
- globals.ClientUserinfoChanged = ClientUserinfoChanged;
- globals.ClientDisconnect = ClientDisconnect;
- globals.ClientBegin = ClientBegin;
- globals.ClientCommand = ClientCommand;
- globals.RunFrame = G_RunFrame;
- globals.ServerCommand = ServerCommand;
- */
-
- //return globals;
}
} \ No newline at end of file
diff --git a/src/jake2/game/GameFunc.java b/src/jake2/game/GameFunc.java
index 091056f..cf24377 100644
--- a/src/jake2/game/GameFunc.java
+++ b/src/jake2/game/GameFunc.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: GameFunc.java,v 1.3 2004-07-09 06:50:49 hzi Exp $
+// $Id: GameFunc.java,v 1.4 2004-09-10 19:02:53 salomo Exp $
package jake2.game;
@@ -374,7 +374,6 @@ public class GameFunc extends PlayerView
t = edit.o;
if (Lib.Q_stricmp(t.classname, "func_areaportal") == 0)
{
- //Com.p("Setting portalstate to:" + open);
gi.SetAreaPortalState(t.style, open);
}
}
diff --git a/src/jake2/game/GameMisc.java b/src/jake2/game/GameMisc.java
index dbad217..1d4f4e8 100644
--- a/src/jake2/game/GameMisc.java
+++ b/src/jake2/game/GameMisc.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 27.12.2003 by RST.
-// $Id: GameMisc.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: GameMisc.java,v 1.3 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -132,7 +132,7 @@ public class GameMisc extends GameTrigger
// it must be TRIGGER_SPAWN
if (0 == (self.spawnflags & 1))
{
- // gi.dprintf("func_wall missing TRIGGER_SPAWN\n");
+ gi.dprintf("func_wall missing TRIGGER_SPAWN\n");
self.spawnflags |= 1;
}
@@ -686,7 +686,6 @@ public class GameMisc extends GameTrigger
func_clock_reset(self);
- //self.message = gi.TagMalloc(CLOCK_MESSAGE_SIZE, TAG_LEVEL);
self.message = new String();
self.think = GameMiscAdapters.func_clock_think;
diff --git a/src/jake2/game/GamePWeapon.java b/src/jake2/game/GamePWeapon.java
index e8247c4..cd915e8 100644
--- a/src/jake2/game/GamePWeapon.java
+++ b/src/jake2/game/GamePWeapon.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 16.11.2003 by RST.
-// $Id: GamePWeapon.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: GamePWeapon.java,v 1.3 2004-09-10 19:02:55 salomo Exp $
package jake2.game;
@@ -165,7 +165,6 @@ public class GamePWeapon {
Fire.fire_grenade(ent, start, forward, damage, 600, 2.5f, radius);
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_GRENADE | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -236,7 +235,7 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_ROCKET | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -455,7 +454,7 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_SHOTGUN | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -531,7 +530,7 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_SSHOTGUN | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -596,7 +595,7 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_RAILGUN | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -645,7 +644,7 @@ public class GamePWeapon {
if (ent.client.ps.gunframe == 9) {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_BFG | GamePWeapon.is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -881,7 +880,7 @@ public class GamePWeapon {
Defines.MOD_MACHINEGUN);
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte(Defines.MZ_MACHINEGUN | is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -1005,7 +1004,7 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
+
GameBase.gi.WriteShort(ent.index);
GameBase.gi.WriteByte((Defines.MZ_CHAINGUN1 + shots - 1) | is_silenced);
GameBase.gi.multicast(ent.s.origin, Defines.MULTICAST_PVS);
@@ -1065,7 +1064,6 @@ public class GamePWeapon {
i= ((ent.client.pers.weapon.weapmodel & 0xff) << 8);
else
i= 0;
- //ent.s.skinnum = (ent - g_edicts - 1) | i;
ent.s.skinnum= (ent.index - 1) | i;
}
@@ -1393,7 +1391,6 @@ public class GamePWeapon {
// send muzzle flash
GameBase.gi.WriteByte(Defines.svc_muzzleflash);
- //gi.WriteShort(ent - g_edicts);
GameBase.gi.WriteShort(ent.index);
if (hyper)
GameBase.gi.WriteByte(Defines.MZ_HYPERBLASTER | is_silenced);
diff --git a/src/jake2/game/GameSave.java b/src/jake2/game/GameSave.java
index b89ac21..25b102b 100644
--- a/src/jake2/game/GameSave.java
+++ b/src/jake2/game/GameSave.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 29.12.2003 by RST.
-// $Id: GameSave.java,v 1.5 2004-09-04 19:08:30 salomo Exp $
+// $Id: GameSave.java,v 1.6 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -28,22 +28,6 @@ import jake2.util.QuakeFile;
public class GameSave extends GameFunc {
- public static field_t levelfields[]=
- {
- new field_t("changemap", F_LSTRING),
- new field_t("sight_client", F_EDICT),
- new field_t("sight_entity", F_EDICT),
- new field_t("sound_entity", F_EDICT),
- new field_t("sound2_entity", F_EDICT),
- new field_t(null, F_INT)};
-
- public static field_t clientfields[]=
- {
- new field_t("pers.weapon", F_ITEM),
- new field_t("pers.lastweapon", F_ITEM),
- new field_t("newweapon", F_ITEM),
- new field_t(null, F_INT)};
-
public static void CreateEdicts() {
g_edicts= new edict_t[game.maxentities];
for (int i= 0; i < game.maxentities; i++)
@@ -130,9 +114,6 @@ public class GameSave extends GameFunc {
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;
diff --git a/src/jake2/game/GameSpawn.java b/src/jake2/game/GameSpawn.java
index 233cbff..2701fae 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.7 2004-09-04 19:08:30 salomo Exp $
+// $Id: GameSpawn.java,v 1.8 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -27,99 +27,7 @@ import jake2.qcommon.Com;
import jake2.util.Lib;
public class GameSpawn extends GameSave {
-
-// static EntThinkAdapter SP_func_killbox = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_trigger_always = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_once = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_multiple = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_relay = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_push = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_hurt = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_key = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_counter = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_elevator = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_gravity = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_trigger_monsterjump = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_target_temp_entity = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_speaker = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_explosion = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_changelevel = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_secret = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_goal = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_splash = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_spawner = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_blaster = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_crosslevel_trigger = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_crosslevel_target = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_laser = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_help = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_actor = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_lightramp = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_earthquake = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_character = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_target_string = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// //static EntThinkAdapter SP_worldspawn = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_viewthing = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_light = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_light_mine1 = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_light_mine2 = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_info_null = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_info_notnull = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_path_corner = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_point_combat = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_misc_explobox = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_banner = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_satellite_dish = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_actor = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_gib_arm = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_gib_leg = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_gib_head = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_insane = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_deadsoldier = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_viper = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_viper_bomb = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_bigviper = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_strogg_ship = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_teleporter = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_teleporter_dest = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_blackhole = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_eastertank = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_easterchick = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_misc_easterchick2 = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_monster_berserk = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_gladiator = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_gunner = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_infantry = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_soldier_light = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_soldier = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_soldier_ss = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_tank = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_medic = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_flipper = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_chick = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_parasite = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_flyer = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_brain = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_floater = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_hover = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_mutant = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_supertank = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_boss2 = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_jorg = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_monster_boss3_stand = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_monster_commander_body = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-//
-// static EntThinkAdapter SP_turret_breach = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_turret_base = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-// static EntThinkAdapter SP_turret_driver = new EntThinkAdapter() {public boolean think(edict_t ent){ return true;}};
-
+
/*
=============
ED_NewString
@@ -155,7 +63,6 @@ public class GameSpawn extends GameSave {
===============
*/
static void ED_ParseField(String key, String value, edict_t ent) {
- field_t f1;
byte b;
float v;
float[] vec = { 0, 0, 0 };
diff --git a/src/jake2/game/GameTargetAdapters.java b/src/jake2/game/GameTargetAdapters.java
index 19a48c9..5833c52 100644
--- a/src/jake2/game/GameTargetAdapters.java
+++ b/src/jake2/game/GameTargetAdapters.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: GameTargetAdapters.java,v 1.3 2004-08-29 21:39:24 hzi Exp $
+// $Id: GameTargetAdapters.java,v 1.4 2004-09-10 19:02:53 salomo Exp $
package jake2.game;
@@ -87,10 +87,8 @@ public class GameTargetAdapters {
public void use(edict_t ent, edict_t other, edict_t activator) {
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++;
diff --git a/src/jake2/game/GameUtilAdapters.java b/src/jake2/game/GameUtilAdapters.java
index 7b312d6..0cf439b 100644
--- a/src/jake2/game/GameUtilAdapters.java
+++ b/src/jake2/game/GameUtilAdapters.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: GameUtilAdapters.java,v 1.3 2004-09-08 20:19:12 cawe Exp $
+// $Id: GameUtilAdapters.java,v 1.4 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -66,6 +66,7 @@ public class GameUtilAdapters
return false;
}
};
+
static EntThinkAdapter DoRespawn = new EntThinkAdapter()
{
public boolean think(edict_t ent)
@@ -428,25 +429,6 @@ public class GameUtilAdapters
GameBase.gi.sound(ent, Defines.CHAN_ITEM, GameBase.gi.soundindex("items/damage.wav"), 1, Defines.ATTN_NORM, 0);
}
};
- // ======================================================================
- /*
- static ItemUseAdapter Use_Invulnerability = new ItemUseAdapter()
- {
- public void use(edict_t ent, gitem_t item)
- {
-
- ent.client.pers.inventory[ITEM_INDEX(item)]--;
- ValidateSelectedItem(ent);
-
- if (ent.client.invincible_framenum > level.framenum)
- ent.client.invincible_framenum += 300;
- else
- ent.client.invincible_framenum = level.framenum + 300;
-
- gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
- }
- };
- */
// ======================================================================
diff --git a/src/jake2/game/Info.java b/src/jake2/game/Info.java
index b81322c..b13b065 100644
--- a/src/jake2/game/Info.java
+++ b/src/jake2/game/Info.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 27.12.2003 by RST.
-// $Id: Info.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
+// $Id: Info.java,v 1.3 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -54,7 +54,7 @@ public class Info extends PlayerView {
return "";
}
- /** DANGEROUS, returns the modified userinfo string, was pointer-pointer manipulation first*/
+ /**TODO RST: DANGEROUS port, returns the modified userinfo string, was pointer-pointer manipulation first*/
public static String Info_SetValueForKey1(String s, String key, String value) {
if (value == null || value.length() == 0)
@@ -96,7 +96,7 @@ public class Info extends PlayerView {
- /** DANGEROUS, returns now the modified userinfo string.*/
+ /** TODO RST: DANGEROUS port, returns now the modified userinfo string.*/
public static String Info_RemoveKey1(String s, String key) {
StringBuffer sb = new StringBuffer(512);
diff --git a/src/jake2/game/LittleEndianHandler.java b/src/jake2/game/LittleEndianHandler.java
deleted file mode 100644
index 932a84b..0000000
--- a/src/jake2/game/LittleEndianHandler.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * LittleEndianHandler.java
- * Copyright (C) 2003
- *
- * $Id: LittleEndianHandler.java,v 1.1 2004-07-07 19:59:07 hzi Exp $
- */
-package jake2.game;
-
-/**
- * LittleEndianHandler</code>
- */
-public final class LittleEndianHandler extends EndianHandler {
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigFloat(float)
- */
- public float BigFloat(float f) {
- return swapFloat(f);
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigShort(short)
- */
- public short BigShort(short s) {
- return swapShort(s);
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#BigLong(int)
- */
- public int BigLong(int i) {
- return swapInt(i);
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleFloat(float)
- */
- public float LittleFloat(float f) {
- return f;
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleShort(short)
- */
- public short LittleShort(short s) {
- return s;
- }
-
- /* (non-Javadoc)
- * @see quake2.EndianHandler#LittleLong(int)
- */
- public int LittleLong(int i) {
- return i;
- }
-
-}
diff --git a/src/jake2/game/M_SoldierAdapters.java b/src/jake2/game/M_SoldierAdapters.java
index eab1171..31c89ff 100644
--- a/src/jake2/game/M_SoldierAdapters.java
+++ b/src/jake2/game/M_SoldierAdapters.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 26.02.2004 by RST.
-// $Id: M_SoldierAdapters.java,v 1.1 2004-07-08 15:58:44 hzi Exp $
+// $Id: M_SoldierAdapters.java,v 1.2 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -627,8 +627,9 @@ public class M_SoldierAdapters
}
};
- /*QUAKED monster_soldier_ss (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
- */
+ /**
+ * QUAKED monster_soldier_ss (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
+ */
static EntThinkAdapter SP_monster_soldier_ss = new EntThinkAdapter()
{
public boolean think(edict_t self)
diff --git a/src/jake2/game/client_persistant_t.java b/src/jake2/game/client_persistant_t.java
index 126d5d5..8421a35 100644
--- a/src/jake2/game/client_persistant_t.java
+++ b/src/jake2/game/client_persistant_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: client_persistant_t.java,v 1.5 2004-08-20 21:29:58 salomo Exp $
+// $Id: client_persistant_t.java,v 1.6 2004-09-10 19:02:55 salomo Exp $
package jake2.game;
@@ -32,36 +32,36 @@ import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
public class client_persistant_t {
-
- public void set(client_persistant_t from)
- {
- userinfo = from.userinfo;
- netname = from.netname;
- hand = from.hand;
- connected = from.connected;
- health = from.health;
- max_health = from.max_health;
- savedFlags = from.savedFlags;
- selected_item = from.selected_item;
+
+ public void set(client_persistant_t from) {
+
+ userinfo= from.userinfo;
+ netname= from.netname;
+ hand= from.hand;
+ connected= from.connected;
+ health= from.health;
+ max_health= from.max_health;
+ savedFlags= from.savedFlags;
+ selected_item= from.selected_item;
System.arraycopy(from.inventory, 0, inventory, 0, inventory.length);
- max_bullets = from.max_bullets;
- max_shells = from.max_shells;
- max_rockets = from.max_rockets;
- max_grenades = from.max_grenades;
- max_cells = from.max_cells;
- max_slugs = from.max_slugs;
- weapon = from.weapon;
- lastweapon = from.lastweapon;
- power_cubes = from.power_cubes;
- score = from.score;
- game_helpchanged = from.game_helpchanged;
- helpchanged = from.helpchanged;
- spectator = from.spectator;
+ max_bullets= from.max_bullets;
+ max_shells= from.max_shells;
+ max_rockets= from.max_rockets;
+ max_grenades= from.max_grenades;
+ max_cells= from.max_cells;
+ max_slugs= from.max_slugs;
+ weapon= from.weapon;
+ lastweapon= from.lastweapon;
+ power_cubes= from.power_cubes;
+ score= from.score;
+ game_helpchanged= from.game_helpchanged;
+ helpchanged= from.helpchanged;
+ spectator= from.spectator;
}
// client data that stays across multiple level loads
- String userinfo = "";
- String netname = "";
+ String userinfo= "";
+ String netname= "";
int hand;
boolean connected; // a loadgame will leave valid entities that
@@ -73,7 +73,7 @@ public class client_persistant_t {
int savedFlags;
int selected_item;
- int inventory[] = new int[Defines.MAX_ITEMS];
+ int inventory[]= new int[Defines.MAX_ITEMS];
// ammo capacities
int max_bullets;
@@ -92,40 +92,39 @@ public class client_persistant_t {
int helpchanged;
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();
+ userinfo= f.readString();
+ netname= f.readString();
- hand = f.readInt();
+ hand= f.readInt();
- connected = f.readInt() != 0;
- health = f.readInt();
+ connected= f.readInt() != 0;
+ health= f.readInt();
- max_health = f.readInt();
- savedFlags = f.readInt();
- selected_item = 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();
+ 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();
+ 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();
+ weapon= f.readItem();
+ lastweapon= f.readItem();
+ power_cubes= f.readInt();
+ score= f.readInt();
- game_helpchanged = f.readInt();
- helpchanged = f.readInt();
- spectator = f.readInt() != 0;
+ game_helpchanged= f.readInt();
+ helpchanged= f.readInt();
+ spectator= f.readInt() != 0;
}
/** Writes a client_persistant structure to a file. */
@@ -136,14 +135,14 @@ public class client_persistant_t {
f.writeInt(hand);
- f.writeInt(connected ? 1:0);
+ 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++)
+ for (int n= 0; n < Defines.MAX_ITEMS; n++)
f.writeInt(inventory[n]);
f.writeInt(max_bullets);
@@ -160,41 +159,6 @@ public class client_persistant_t {
f.writeInt(game_helpchanged);
f.writeInt(helpchanged);
- f.writeInt(spectator?1:0);
- }
-
-
- public void dump() {
- // client persistant_t
-
- System.out.println("userinfo: " + userinfo);
- System.out.println("netname: " + netname);
-
- System.out.println("hand: " + hand);
-
- System.out.println("connected: " + connected);
- System.out.println("health: " + health);
-
- System.out.println("max_health: " + max_health);
- System.out.println("savedFlags: " + savedFlags);
- System.out.println("selected_item: " + selected_item);
-
- for (int n = 0; n < Defines.MAX_ITEMS; n++)
- System.out.println("inventory[" + n + "]: " + inventory[n]);
-
- System.out.println("max_bullets: " + max_bullets);
- System.out.println("max_shells: " + max_shells);
- System.out.println("max_rockets: " + max_rockets);
- System.out.println("max_grenades: " + max_grenades);
- System.out.println("max_cells: " + max_cells);
- System.out.println("max_slugs: " + max_slugs);
- System.out.println("weapon: " + weapon);
- System.out.println("lastweapon: " + lastweapon);
- System.out.println("powercubes: " + power_cubes);
- System.out.println("score: " + score);
-
- System.out.println("gamehelpchanged: " + game_helpchanged);
- System.out.println("helpchanged: " + helpchanged);
- System.out.println("spectator: " + spectator);
+ f.writeInt(spectator ? 1 : 0);
}
} \ No newline at end of file
diff --git a/src/jake2/game/client_respawn_t.java b/src/jake2/game/client_respawn_t.java
index 26e69a2..e9c11de 100644
--- a/src/jake2/game/client_respawn_t.java
+++ b/src/jake2/game/client_respawn_t.java
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: client_respawn_t.java,v 1.5 2004-08-20 21:29:57 salomo Exp $
+// $Id: client_respawn_t.java,v 1.6 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -94,16 +94,4 @@ public class client_respawn_t
f.writeFloat(cmd_angles[2]);
f.writeInt(spectator?1:0);
}
-
-
-
- /** Prints out a client_respawn_t to the quake console.*/
- public void dump()
- {
- coop_respawn.dump();
- Com.Println("enterframe: " + enterframe);
- Com.Println("score: " + score);
- Lib.printv("cmd_angles", cmd_angles);
- Com.Println("spectator: " + spectator);
- }
}
diff --git a/src/jake2/game/field_t.java b/src/jake2/game/field_t.java
deleted file mode 100644
index ecdf156..0000000
--- a/src/jake2/game/field_t.java
+++ /dev/null
@@ -1,45 +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 20.11.2003 by RST
-// $Id: field_t.java,v 1.2 2004-07-08 15:58:44 hzi Exp $
-
-package jake2.game;
-
-public class field_t
-{
- public field_t(String name, int type, int flags)
- {
- this.name = name;
- this.type = type;
- this.flags = flags;
- }
-
- public field_t(String name, int type)
- {
-
- this.name = name;
- this.type = type;
- flags = 0;
- }
-
- public String name;
- public int type;
- public int flags;
-}
diff --git a/src/jake2/game/game_locals_t.java b/src/jake2/game/game_locals_t.java
index cf9718a..679bbd2 100644
--- a/src/jake2/game/game_locals_t.java
+++ b/src/jake2/game/game_locals_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: game_locals_t.java,v 1.5 2004-09-04 19:08:29 salomo Exp $
+// $Id: game_locals_t.java,v 1.6 2004-09-10 19:02:54 salomo Exp $
package jake2.game;
@@ -107,21 +107,4 @@ public class game_locals_t extends Defines
// rst's checker :-)
f.writeInt(1928);
}
-
- /** Prints the game locals.*/
- public void dump()
- {
- Com.Println("String helpmessage1: " + helpmessage1);
- Com.Println("String helpmessage2: " + helpmessage2);
-
- Com.Println("spawnpoit: " + spawnpoint);
- Com.Println("maxclients: " + maxclients);
- Com.Println("maxentities: " + maxentities);
- Com.Println("serverflags: " + serverflags);
- Com.Println("numitems: " + num_items);
- Com.Println("autosaved: " + autosaved);
-
- for (int i = 0; i < maxclients; i++)
- clients[i].dump();
- }
}
diff --git a/src/jake2/game/gclient_t.java b/src/jake2/game/gclient_t.java
index 2cbda59..cdccd02 100644
--- a/src/jake2/game/gclient_t.java
+++ b/src/jake2/game/gclient_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: gclient_t.java,v 1.3 2004-08-20 21:29:58 salomo Exp $
+// $Id: gclient_t.java,v 1.4 2004-09-10 19:02:56 salomo Exp $
package jake2.game;
@@ -394,90 +394,4 @@ public class gclient_t
f.writeInt(8765);
}
-
- public void dump()
- {
-
- Com.Println("ping: " + ping);
-
- pers.dump();
- resp.dump();
-
- old_pmove.dump();
-
- Com.Println("showscores: " + showscores);
- Com.Println("showinventury: " + showinventory);
- Com.Println("showhelp: " + showhelp);
- Com.Println("showhelpicon: " + showhelpicon);
- Com.Println("ammoindex: " + ammo_index);
-
- Com.Println("buttons: " + buttons);
- Com.Println("oldbuttons: " + oldbuttons);
- Com.Println("latchedbuttons: " + latched_buttons);
-
- Com.Println("weaponthunk: " + weapon_thunk);
-
- Com.Println("newweapon: " + newweapon);
-
- Com.Println("damage_armor: " + damage_armor);
- Com.Println("damage_parmor: " + damage_parmor);
- Com.Println("damage_blood: " + damage_blood);
- Com.Println("damage_knockback: " + damage_knockback);
-
- Lib.printv("damage_from", damage_from);
-
- Com.Println("killer_yaw: " + killer_yaw);
-
- Com.Println("weaponstate: " + weaponstate);
-
- Lib.printv("kick_angles", kick_angles);
- Lib.printv("kick_origin", kick_origin);
-
- Com.Println("v_dmg_roll: " + v_dmg_roll);
- Com.Println("v_dmg_pitch: " + v_dmg_pitch);
- Com.Println("v_dmg_time: " + v_dmg_time);
-
- Com.Println("fall_time: " + fall_time);
- Com.Println("fall_value: " + fall_value);
- Com.Println("damage_alpha: " + damage_alpha);
- Com.Println("bonus_alpha: " + bonus_alpha);
-
- Lib.printv("damage_blend", damage_blend);
-
- Lib.printv("v_angle", v_angle);
-
- Com.Println("bobtime: " + bobtime);
-
- Lib.printv("oldviewangles", oldviewangles);
- Lib.printv("oldvelocity", oldvelocity);
-
- Com.Println("next_downtime: " + next_drown_time);
-
- Com.Println("old_waterlevel: " + old_waterlevel);
- Com.Println("breathersound: " + breather_sound);
- Com.Println("machinegun_shots: " + machinegun_shots);
- Com.Println("anim_end: " + anim_end);
- Com.Println("anim_priority: " + anim_priority);
- Com.Println("anim_duck: " + anim_duck);
- Com.Println("anim_run: " + anim_run);
-
- Com.Println("quad_framenum: " + quad_framenum);
- Com.Println("invincible_framenum: " + invincible_framenum);
- Com.Println("breather_framenum: " + breather_framenum);
- Com.Println("enviro_framenum: " + enviro_framenum);
-
- Com.Println("grenade_blew_up: " + grenade_blew_up);
- Com.Println("grenade_time: " + grenade_time);
- Com.Println("silencer_shots: " + silencer_shots);
- Com.Println("weapon_sound: " + weapon_sound);
- Com.Println("pickup_msg_time: " + pickup_msg_time);
- Com.Println("flood_locktill: " + flood_locktill);
-
- Lib.printv("flood_when", flood_when);
-
- Com.Println("flood_whenhead: " + flood_whenhead);
- Com.Println("respawn_time: " + respawn_time);
- Com.Println("chase_target: " + chase_target);
- Com.Println("update_chase: " + update_chase);
- }
}
diff --git a/src/jake2/qcommon/PMove.java b/src/jake2/qcommon/PMove.java
index f8d0a2f..2043c8a 100644
--- a/src/jake2/qcommon/PMove.java
+++ b/src/jake2/qcommon/PMove.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 25.01.2004 by RST.
-// $Id: PMove.java,v 1.3 2004-08-22 14:25:14 salomo Exp $
+// $Id: PMove.java,v 1.4 2004-09-10 19:02:53 salomo Exp $
package jake2.qcommon;
@@ -1147,7 +1147,6 @@ public class PMove extends Game
pm.waterlevel = 0;
// clear all pmove local vars
- //memset(& pml, 0, sizeof(pml));
pml = new pml_t();
// convert origin and velocity to float values
diff --git a/src/jake2/qcommon/SZ.java b/src/jake2/qcommon/SZ.java
index 08ec6dc..97efa75 100644
--- a/src/jake2/qcommon/SZ.java
+++ b/src/jake2/qcommon/SZ.java
@@ -2,7 +2,7 @@
* SZ.java
* Copyright (C) 2003
*
- * $Id: SZ.java,v 1.2 2004-07-08 15:58:46 hzi Exp $
+ * $Id: SZ.java,v 1.3 2004-09-10 19:02:53 salomo Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -39,7 +39,6 @@ public final class SZ {
//===========================================================================
public static void Init(sizebuf_t buf, byte data[], int length) {
- //memset (buf, 0, sizeof(*buf));
buf.data = data;
buf.maxsize = length;
buf.cursize = 0;
diff --git a/src/jake2/render/fastjogl/Light.java b/src/jake2/render/fastjogl/Light.java
index 0608e2b..7dee8fe 100644
--- a/src/jake2/render/fastjogl/Light.java
+++ b/src/jake2/render/fastjogl/Light.java
@@ -2,7 +2,7 @@
* Light.java
* Copyright (C) 2003
*
- * $Id: Light.java,v 1.7 2004-07-27 11:58:29 hzi Exp $
+ * $Id: Light.java,v 1.8 2004-09-10 19:02:52 salomo Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -759,5 +759,4 @@ public abstract class Light extends Warp {
}
}
}
-
}
diff --git a/src/jake2/server/SV_CCMDS.java b/src/jake2/server/SV_CCMDS.java
index 2c97f31..e6fd004 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.10 2004-09-04 19:08:30 salomo Exp $
+// $Id: SV_CCMDS.java,v 1.11 2004-09-10 19:02:56 salomo Exp $
package jake2.server;
@@ -65,7 +65,6 @@ public class SV_CCMDS extends SV_ENTS {
Cvar.Set("public", "1");
for (i= 1; i < MAX_MASTERS; i++)
- //memset (&master_adr[i], 0, sizeof(master_adr[i]));
master_adr[i]= new netadr_t();
slot= 1; // slot 0 will always contain the id master
@@ -168,8 +167,6 @@ public class SV_CCMDS extends SV_ENTS {
=====================
*/
public static void SV_WipeSavegame(String savename) {
- //char name[MAX_OSPATH];
- //char *s;
String name, s;
@@ -219,7 +216,6 @@ public class SV_CCMDS extends SV_ENTS {
return;
}
try {
-
f2= new RandomAccessFile(dst, "rw");
}
catch (Exception e) {
@@ -307,10 +303,6 @@ public class SV_CCMDS extends SV_ENTS {
CopyFile(name, name2);
// change sav to sv2
- //l = strlen(name);
- //strcpy(name + l - 3, "sv2");
- //l = strlen(name2);
- //strcpy(name2 + l - 3, "sv2");
name= name.substring(0, name.length() - 3) + "sv2";
name2= name2.substring(0, name2.length() - 3) + "sv2";
@@ -477,11 +469,9 @@ public class SV_CCMDS extends SV_ENTS {
f= new QuakeFile(filename, "r");
// read the comment field
-
comment= f.readString();
// read the mapcmd
-
mapcmd= f.readString();
// read all CVAR_LATCH cvars
@@ -647,9 +637,6 @@ public class SV_CCMDS extends SV_ENTS {
==============
*/
public static void SV_Loadgame_f() {
- //char name[MAX_OSPATH];
- //FILE * f;
- //char * dir;
String name;
RandomAccessFile f;
@@ -685,7 +672,6 @@ public class SV_CCMDS extends SV_ENTS {
}
SV_CopySaveGame(Cmd.Argv(1), "current");
-
SV_ReadServerFile();
// go to the map
@@ -749,12 +735,10 @@ public class SV_CCMDS extends SV_ENTS {
// copy it off
SV_CopySaveGame("current", dir);
-
Com.Printf("Done.\n");
}
//===============================================================
-
/*
==================
SV_Kick_f
@@ -996,7 +980,7 @@ public class SV_CCMDS extends SV_ENTS {
//fwrite(buf.data, buf.cursize, 1, svs.demofile);
try {
svs.demofile.writeInt(len);
- svs.demofile.write(buf.data);
+ svs.demofile.write(buf.data,0, buf.cursize);
}
catch (IOException e1) {
// TODO: do quake2 error handling!
diff --git a/src/jake2/server/SV_MAIN.java b/src/jake2/server/SV_MAIN.java
index 7beff4e..5800a73 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.6 2004-08-29 21:39:25 hzi Exp $
+// $Id: SV_MAIN.java,v 1.7 2004-09-10 19:02:56 salomo Exp $
package jake2.server;
@@ -35,10 +35,10 @@ import java.io.IOException;
public class SV_MAIN extends SV_GAME {
- static netadr_t master_adr[] = new netadr_t[MAX_MASTERS]; // address of group servers
+ static netadr_t master_adr[]= new netadr_t[MAX_MASTERS]; // address of group servers
static {
- for (int i = 0; i < MAX_MASTERS; i++) {
- master_adr[i] = new netadr_t();
+ for (int i= 0; i < MAX_MASTERS; i++) {
+ master_adr[i]= new netadr_t();
}
}
public static client_t sv_client; // current client
@@ -94,11 +94,11 @@ public class SV_MAIN extends SV_GAME {
if (drop.download != null) {
FS.FreeFile(drop.download);
- drop.download = null;
+ drop.download= null;
}
- drop.state = Defines.cs_zombie; // become free in a few seconds
- drop.name = "";
+ drop.state= Defines.cs_zombie; // become free in a few seconds
+ drop.name= "";
}
/*
@@ -118,21 +118,21 @@ public class SV_MAIN extends SV_GAME {
*/
public static String SV_StatusString() {
String player;
- String status = "";
+ String status= "";
int i;
client_t cl;
int statusLength;
int playerLength;
- status = Cvar.Serverinfo() + "\n";
+ status= Cvar.Serverinfo() + "\n";
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state == Defines.cs_connected || cl.state == Defines.cs_spawned) {
- player = "" + cl.edict.client.ps.stats[Defines.STAT_FRAGS] + " " + cl.ping + "\"" + cl.name + "\"\n";
+ player= "" + cl.edict.client.ps.stats[Defines.STAT_FRAGS] + " " + cl.ping + "\"" + cl.name + "\"\n";
- playerLength = player.length();
- statusLength = status.length();
+ playerLength= player.length();
+ statusLength= status.length();
if (statusLength + playerLength >= 1024)
break; // can't hold any more
@@ -181,17 +181,17 @@ public class SV_MAIN extends SV_GAME {
if (maxclients.value == 1)
return; // ignore in single player
- version = atoi(Cmd.Argv(1));
+ version= atoi(Cmd.Argv(1));
if (version != PROTOCOL_VERSION)
- string = hostname.string + ": wrong version\n";
+ string= hostname.string + ": wrong version\n";
else {
- count = 0;
- for (i = 0; i < maxclients.value; i++)
+ count= 0;
+ for (i= 0; i < maxclients.value; i++)
if (svs.clients[i].state >= cs_connected)
count++;
- string = hostname.string + " " + sv.name + " " + count + "/" + (int) maxclients.value + "\n";
+ string= hostname.string + " " + sv.name + " " + count + "/" + (int) maxclients.value + "\n";
}
Netchan.OutOfBandPrint(NS_SERVER, Netchan.net_from, "info\n" + string);
@@ -224,25 +224,25 @@ public class SV_MAIN extends SV_GAME {
int oldest;
int oldestTime;
- oldest = 0;
- oldestTime = 0x7fffffff;
+ oldest= 0;
+ oldestTime= 0x7fffffff;
// see if we already have a challenge for this ip
- for (i = 0; i < MAX_CHALLENGES; i++) {
+ for (i= 0; i < MAX_CHALLENGES; i++) {
if (NET.NET_CompareBaseAdr(Netchan.net_from, svs.challenges[i].adr))
break;
if (svs.challenges[i].time < oldestTime) {
- oldestTime = svs.challenges[i].time;
- oldest = i;
+ oldestTime= svs.challenges[i].time;
+ oldest= i;
}
}
if (i == MAX_CHALLENGES) {
// overwrite the oldest
- svs.challenges[oldest].challenge = rand() & 0x7fff;
- svs.challenges[oldest].adr = Netchan.net_from;
- svs.challenges[oldest].time = (int) Globals.curtime;
- i = oldest;
+ svs.challenges[oldest].challenge= rand() & 0x7fff;
+ svs.challenges[oldest].adr= Netchan.net_from;
+ svs.challenges[oldest].time= (int) Globals.curtime;
+ i= oldest;
}
// send it back
@@ -257,36 +257,35 @@ public class SV_MAIN extends SV_GAME {
==================
*/
public static void SVC_DirectConnect() {
- //char userinfo[MAX_INFO_STRING];
String userinfo;
netadr_t adr;
int i;
client_t cl;
-
+
edict_t ent;
int edictnum;
int version;
int qport;
- adr = Netchan.net_from;
+ adr= Netchan.net_from;
Com.DPrintf("SVC_DirectConnect ()\n");
- version = atoi(Cmd.Argv(1));
+ version= atoi(Cmd.Argv(1));
if (version != PROTOCOL_VERSION) {
Netchan.OutOfBandPrint(NS_SERVER, adr, "print\nServer is version " + VERSION + "\n");
Com.DPrintf(" rejected connect from version " + version + "\n");
return;
}
- qport = atoi(Cmd.Argv(2));
- int challenge = atoi(Cmd.Argv(3));
- userinfo = Cmd.Argv(4);
+ qport= atoi(Cmd.Argv(2));
+ int challenge= atoi(Cmd.Argv(3));
+ userinfo= Cmd.Argv(4);
//userinfo[sizeof(userinfo) - 1] = 0;
// force the IP key/value pair so the game can filter based on ip
- userinfo = Info.Info_SetValueForKey1(userinfo, "ip", NET.AdrToString(Netchan.net_from));
+ userinfo= Info.Info_SetValueForKey1(userinfo, "ip", NET.AdrToString(Netchan.net_from));
// attractloop servers are ONLY for local clients
if (sv.attractloop) {
@@ -299,7 +298,7 @@ public class SV_MAIN extends SV_GAME {
// see if the challenge is valid
if (!NET.IsLocalAddress(adr)) {
- for (i = 0; i < MAX_CHALLENGES; i++) {
+ for (i= 0; i < MAX_CHALLENGES; i++) {
if (NET.NET_CompareBaseAdr(Netchan.net_from, svs.challenges[i].adr)) {
if (challenge == svs.challenges[i].challenge)
break; // good
@@ -313,13 +312,9 @@ public class SV_MAIN extends SV_GAME {
}
}
- //newcl = temp;
- //memset (newcl, 0, sizeof(client_t));
- //newcl = new client_t();
-
// if there is already a slot for this ip, reuse it
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state == cs_free)
continue;
@@ -338,11 +333,11 @@ public class SV_MAIN extends SV_GAME {
// find a client slot
//newcl = null;
- int index = -1;
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ int index= -1;
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state == cs_free) {
- index = i;
+ index= i;
break;
}
}
@@ -360,12 +355,12 @@ public class SV_MAIN extends SV_GAME {
// this is the only place a client_t is ever initialized
//*newcl = temp;
- sv_client = svs.clients[i];
+ sv_client= svs.clients[i];
//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
+ 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))) {
@@ -381,7 +376,7 @@ public class SV_MAIN extends SV_GAME {
}
// parse some info from the info strings
- svs.clients[i].userinfo = userinfo;
+ svs.clients[i].userinfo= userinfo;
SV_UserinfoChanged(svs.clients[i]);
// send the connect packet to the client
@@ -389,12 +384,12 @@ public class SV_MAIN extends SV_GAME {
Netchan.Setup(NS_SERVER, svs.clients[i].netchan, adr, qport);
- svs.clients[i].state = cs_connected;
+ svs.clients[i].state= cs_connected;
SZ.Init(svs.clients[i].datagram, svs.clients[i].datagram_buf, svs.clients[i].datagram_buf.length);
- svs.clients[i].datagram.allowoverflow = true;
- svs.clients[i].lastmessage = svs.realtime; // don't timeout
- svs.clients[i].lastconnect = svs.realtime;
+ svs.clients[i].datagram.allowoverflow= true;
+ svs.clients[i].lastmessage= svs.realtime; // don't timeout
+ svs.clients[i].lastconnect= svs.realtime;
Com.DPrintf("new client added.\n");
}
@@ -422,9 +417,9 @@ public class SV_MAIN extends SV_GAME {
//char remaining[1024];
String remaining;
- i = Rcon_Validate();
+ i= Rcon_Validate();
- String msg = new String(net_message.data, 4, -1);
+ String msg= new String(net_message.data, 4, -1);
if (i == 0)
Com.Printf("Bad rcon from " + NET.AdrToString(Netchan.net_from) + ":\n" + msg + "\n");
@@ -441,9 +436,9 @@ public class SV_MAIN extends SV_GAME {
Com.Printf("Bad rcon_password.\n");
}
else {
- remaining = "";
+ remaining= "";
- for (i = 2; i < Cmd.Argc(); i++) {
+ for (i= 2; i < Cmd.Argc(); i++) {
remaining += Cmd.Argv(i);
remaining += " ";
}
@@ -471,11 +466,11 @@ public class SV_MAIN extends SV_GAME {
MSG.BeginReading(net_message);
MSG.ReadLong(net_message); // skip the -1 marker
- s = MSG.ReadStringLine(net_message);
+ s= MSG.ReadStringLine(net_message);
Cmd.TokenizeString(s.toCharArray(), false);
- c = Cmd.Argv(0);
+ c= Cmd.Argv(0);
//Com.Printf("Packet " + NET.AdrToString(Netchan.net_from) + " : " + c + "\n");
//Com.Printf(Lib.hexDump(net_message.data, 64, false) + "\n");
@@ -493,8 +488,7 @@ public class SV_MAIN extends SV_GAME {
SVC_DirectConnect();
else if (0 == strcmp(c, "rcon"))
SVC_RemoteCommand();
- else
- {
+ else {
Com.Printf("bad connectionless packet from " + NET.AdrToString(Netchan.net_from) + "\n");
Com.Printf("[" + s + "]\n");
Com.Printf("" + Lib.hexDump(net_message.data, 128, false));
@@ -515,26 +509,26 @@ public class SV_MAIN extends SV_GAME {
client_t cl;
int total, count;
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state != cs_spawned)
continue;
- total = 0;
- count = 0;
- for (j = 0; j < LATENCY_COUNTS; j++) {
+ total= 0;
+ count= 0;
+ for (j= 0; j < LATENCY_COUNTS; j++) {
if (cl.frame_latency[j] > 0) {
count++;
total += cl.frame_latency[j];
}
}
if (0 == count)
- cl.ping = 0;
+ cl.ping= 0;
else
- cl.ping = total / count;
+ cl.ping= total / count;
// let the game dll know about the ping
- cl.edict.client.ping = cl.ping;
+ cl.edict.client.ping= cl.ping;
}
}
@@ -553,12 +547,12 @@ public class SV_MAIN extends SV_GAME {
if ((sv.framenum & 15) != 0)
return;
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state == cs_free)
continue;
- cl.commandMsec = 1800; // 1600 + some slop
+ cl.commandMsec= 1800; // 1600 + some slop
}
}
@@ -570,7 +564,7 @@ public class SV_MAIN extends SV_GAME {
public static void SV_ReadPackets() {
int i;
client_t cl;
- int qport =0;
+ int qport= 0;
while (NET.GetPacket(NS_SERVER, Netchan.net_from, net_message)) {
@@ -588,11 +582,11 @@ public class SV_MAIN extends SV_GAME {
MSG.BeginReading(net_message);
MSG.ReadLong(net_message); // sequence number
MSG.ReadLong(net_message); // sequence number
- qport = MSG.ReadShort(net_message) & 0xffff;
+ qport= MSG.ReadShort(net_message) & 0xffff;
// check for packets from connected clients
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state == cs_free)
continue;
if (!NET.NET_CompareBaseAdr(Netchan.net_from, cl.netchan.remote_address))
@@ -601,12 +595,12 @@ public class SV_MAIN extends SV_GAME {
continue;
if (cl.netchan.remote_address.port != Netchan.net_from.port) {
Com.Printf("SV_ReadPackets: fixing up a translated port\n");
- cl.netchan.remote_address.port = Netchan.net_from.port;
+ cl.netchan.remote_address.port= Netchan.net_from.port;
}
if (Netchan.Process(cl.netchan, net_message)) { // this is a valid, sequenced packet, so process it
if (cl.state != cs_zombie) {
- cl.lastmessage = svs.realtime; // don't timeout
+ cl.lastmessage= svs.realtime; // don't timeout
SV_USER.SV_ExecuteClientMessage(cl);
}
}
@@ -637,23 +631,23 @@ public class SV_MAIN extends SV_GAME {
int droppoint;
int zombiepoint;
- droppoint = (int) (svs.realtime - 1000 * timeout.value);
- zombiepoint = (int) (svs.realtime - 1000 * zombietime.value);
+ droppoint= (int) (svs.realtime - 1000 * timeout.value);
+ zombiepoint= (int) (svs.realtime - 1000 * zombietime.value);
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
// message times may be wrong across a changelevel
if (cl.lastmessage > svs.realtime)
- cl.lastmessage = svs.realtime;
+ cl.lastmessage= svs.realtime;
if (cl.state == cs_zombie && cl.lastmessage < zombiepoint) {
- cl.state = cs_free; // can now be reused
+ cl.state= cs_free; // can now be reused
continue;
}
if ((cl.state == cs_connected || cl.state == cs_spawned) && cl.lastmessage < droppoint) {
SV_SEND.SV_BroadcastPrintf(PRINT_HIGH, cl.name + " timed out\n");
SV_DropClient(cl);
- cl.state = cs_free; // don't bother with zombie state
+ cl.state= cs_free; // don't bother with zombie state
}
}
}
@@ -670,10 +664,10 @@ public class SV_MAIN extends SV_GAME {
edict_t ent;
int i;
- for (i = 0; i < GameBase.num_edicts; i++) {
- ent = GameBase.g_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;
+ ent.s.event= 0;
}
}
@@ -685,14 +679,14 @@ public class SV_MAIN extends SV_GAME {
*/
public static void SV_RunGameFrame() {
if (host_speeds.value != 0)
- time_before_game = Sys.Milliseconds();
+ time_before_game= Sys.Milliseconds();
// we always need to bump framenum, even if we
// don't run the world, otherwise the delta
// compression can get confused when a client
// has the "current" frame
sv.framenum++;
- sv.time = sv.framenum * 100;
+ sv.time= sv.framenum * 100;
// don't run if paused
if (0 == sv_paused.value || maxclients.value > 1) {
@@ -702,12 +696,12 @@ public class SV_MAIN extends SV_GAME {
if (sv.time < svs.realtime) {
if (sv_showclamp.value != 0)
Com.Printf("sv highclamp\n");
- svs.realtime = sv.time;
+ svs.realtime= sv.time;
}
}
if (host_speeds.value != 0)
- time_after_game = Sys.Milliseconds();
+ time_after_game= Sys.Milliseconds();
}
@@ -718,7 +712,7 @@ public class SV_MAIN extends SV_GAME {
==================
*/
public static void SV_Frame(long msec) {
- Globals.time_before_game = Globals.time_after_game = 0;
+ Globals.time_before_game= Globals.time_after_game= 0;
// if server is not active, do nothing
if (!svs.initialized)
@@ -734,17 +728,17 @@ public class SV_MAIN extends SV_GAME {
// get packets from clients
SV_ReadPackets();
-
+
//if (Game.g_edicts[1] !=null)
// Com.p("player at:" + Lib.vtofsbeaty(Game.g_edicts[1].s.origin ));
// move autonomous things around if enough time has passed
- if (0== sv_timedemo.value && svs.realtime < sv.time) {
+ if (0 == sv_timedemo.value && svs.realtime < sv.time) {
// never let the time get too far off
if (sv.time - svs.realtime > 100) {
if (sv_showclamp.value != 0)
Com.Printf("sv lowclamp\n");
- svs.realtime = sv.time - 100;
+ svs.realtime= sv.time - 100;
}
NET.NET_Sleep(sv.time - svs.realtime);
return;
@@ -787,7 +781,7 @@ public class SV_MAIN extends SV_GAME {
let it know we are alive, and log information
================
*/
- public static final int HEARTBEAT_SECONDS = 300;
+ public static final int HEARTBEAT_SECONDS= 300;
public static void Master_Heartbeat() {
String string;
int i;
@@ -802,18 +796,18 @@ public class SV_MAIN extends SV_GAME {
// check for time wraparound
if (svs.last_heartbeat > svs.realtime)
- svs.last_heartbeat = svs.realtime;
+ svs.last_heartbeat= svs.realtime;
if (svs.realtime - svs.last_heartbeat < HEARTBEAT_SECONDS * 1000)
return; // not time to send yet
- svs.last_heartbeat = svs.realtime;
+ svs.last_heartbeat= svs.realtime;
// send the same string that we would give for a status OOB command
- string = SV_StatusString();
+ string= SV_StatusString();
// send to group master
- for (i = 0; i < MAX_MASTERS; i++)
+ for (i= 0; i < MAX_MASTERS; i++)
if (master_adr[i].port != 0) {
Com.Printf("Sending heartbeat to " + NET.AdrToString(master_adr[i]) + "\n");
Netchan.OutOfBandPrint(NS_SERVER, master_adr[i], "heartbeat\n" + string);
@@ -839,7 +833,7 @@ public class SV_MAIN extends SV_GAME {
return; // a private dedicated game
// send to group master
- for (i = 0; i < MAX_MASTERS; i++)
+ for (i= 0; i < MAX_MASTERS; i++)
if (master_adr[i].port != 0) {
if (i > 0)
Com.Printf("Sending heartbeat to " + NET.AdrToString(master_adr[i]) + "\n");
@@ -865,7 +859,7 @@ public class SV_MAIN extends SV_GAME {
PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo);
// name for C code
- cl.name = Info.Info_ValueForKey(cl.userinfo, "name");
+ cl.name= Info.Info_ValueForKey(cl.userinfo, "name");
// mask off high bit
//TODO: masking for german umlaute
@@ -873,22 +867,22 @@ public class SV_MAIN extends SV_GAME {
// cl.name[i] &= 127;
// rate command
- val = Info.Info_ValueForKey(cl.userinfo, "rate");
+ val= Info.Info_ValueForKey(cl.userinfo, "rate");
if (val.length() > 0) {
- i = atoi(val);
- cl.rate = i;
+ i= atoi(val);
+ cl.rate= i;
if (cl.rate < 100)
- cl.rate = 100;
+ cl.rate= 100;
if (cl.rate > 15000)
- cl.rate = 15000;
+ cl.rate= 15000;
}
else
- cl.rate = 5000;
+ cl.rate= 5000;
// msg command
- val = Info.Info_ValueForKey(cl.userinfo, "msg");
+ val= Info.Info_ValueForKey(cl.userinfo, "msg");
if (val.length() > 0) {
- cl.messagelevel = atoi(val);
+ cl.messagelevel= atoi(val);
}
}
@@ -903,9 +897,9 @@ public class SV_MAIN extends SV_GAME {
===============
*/
public static void SV_Init() {
- SV_CCMDS.SV_InitOperatorCommands (); //ok.
+ SV_CCMDS.SV_InitOperatorCommands(); //ok.
- rcon_password = Cvar.Get("rcon_password", "", 0);
+ rcon_password= Cvar.Get("rcon_password", "", 0);
Cvar.Get("skill", "1", 0);
Cvar.Get("deathmatch", "0", CVAR_LATCH);
Cvar.Get("coop", "0", CVAR_LATCH);
@@ -915,27 +909,27 @@ public class SV_MAIN extends SV_GAME {
//TODO: set cheats 0
Cvar.Get("cheats", "1", CVAR_SERVERINFO | CVAR_LATCH);
Cvar.Get("protocol", "" + PROTOCOL_VERSION, CVAR_SERVERINFO | CVAR_NOSET);
-
- SV_MAIN.maxclients = Cvar.Get("maxclients", "1", CVAR_SERVERINFO | CVAR_LATCH);
- hostname = Cvar.Get("hostname", "noname", CVAR_SERVERINFO | CVAR_ARCHIVE);
- timeout = Cvar.Get("timeout", "125", 0);
- zombietime = Cvar.Get("zombietime", "2", 0);
- sv_showclamp = Cvar.Get("showclamp", "0", 0);
- sv_paused = Cvar.Get("paused", "0", 0);
- sv_timedemo = Cvar.Get("timedemo", "0", 0);
- sv_enforcetime = Cvar.Get("sv_enforcetime", "0", 0);
-
+
+ SV_MAIN.maxclients= Cvar.Get("maxclients", "1", CVAR_SERVERINFO | CVAR_LATCH);
+ hostname= Cvar.Get("hostname", "noname", CVAR_SERVERINFO | CVAR_ARCHIVE);
+ timeout= Cvar.Get("timeout", "125", 0);
+ zombietime= Cvar.Get("zombietime", "2", 0);
+ sv_showclamp= Cvar.Get("showclamp", "0", 0);
+ sv_paused= Cvar.Get("paused", "0", 0);
+ sv_timedemo= Cvar.Get("timedemo", "0", 0);
+ sv_enforcetime= Cvar.Get("sv_enforcetime", "0", 0);
+
// TODO: carsten, re-allow downloads per default
- allow_download = Cvar.Get("allow_download", "0", CVAR_ARCHIVE);
- allow_download_players = Cvar.Get("allow_download_players", "0", CVAR_ARCHIVE);
- allow_download_models = Cvar.Get("allow_download_models", "1", CVAR_ARCHIVE);
- allow_download_sounds = Cvar.Get("allow_download_sounds", "1", CVAR_ARCHIVE);
- allow_download_maps = Cvar.Get("allow_download_maps", "1", CVAR_ARCHIVE);
+ allow_download= Cvar.Get("allow_download", "0", CVAR_ARCHIVE);
+ allow_download_players= Cvar.Get("allow_download_players", "0", CVAR_ARCHIVE);
+ allow_download_models= Cvar.Get("allow_download_models", "1", CVAR_ARCHIVE);
+ allow_download_sounds= Cvar.Get("allow_download_sounds", "1", CVAR_ARCHIVE);
+ allow_download_maps= Cvar.Get("allow_download_maps", "1", CVAR_ARCHIVE);
- sv_noreload = Cvar.Get("sv_noreload", "0", 0);
- sv_airaccelerate = Cvar.Get("sv_airaccelerate", "0", CVAR_LATCH);
- public_server = Cvar.Get("public", "0", 0);
- sv_reconnect_limit = Cvar.Get("sv_reconnect_limit", "3", CVAR_ARCHIVE);
+ sv_noreload= Cvar.Get("sv_noreload", "0", 0);
+ sv_airaccelerate= Cvar.Get("sv_airaccelerate", "0", CVAR_LATCH);
+ public_server= Cvar.Get("public", "0", 0);
+ sv_reconnect_limit= Cvar.Get("sv_reconnect_limit", "3", CVAR_ARCHIVE);
SZ.Init(net_message, net_message_buffer, net_message_buffer.length);
}
@@ -967,13 +961,13 @@ public class SV_MAIN extends SV_GAME {
// send it twice
// stagger the packets to crutch operating system limited buffers
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state >= cs_connected)
Netchan.Transmit(cl.netchan, net_message.cursize, net_message.data);
}
- for (i = 0; i < maxclients.value; i++) {
- cl = svs.clients[i];
+ for (i= 0; i < maxclients.value; i++) {
+ cl= svs.clients[i];
if (cl.state >= cs_connected)
Netchan.Transmit(cl.netchan, net_message.cursize, net_message.data);
}
@@ -992,8 +986,8 @@ public class SV_MAIN extends SV_GAME {
SV_FinalMessage(finalmsg, reconnect);
Master_Shutdown();
-
- SV_GAME.SV_ShutdownGameProgs ();
+
+ SV_GAME.SV_ShutdownGameProgs();
// free current level
if (sv.demofile != null)
@@ -1004,16 +998,9 @@ public class SV_MAIN extends SV_GAME {
e.printStackTrace();
}
- //memset (&sv, 0, sizeof(sv));
- sv = new server_t();
-
- Globals.server_state= sv.state;
+ sv= new server_t();
- // free server static data
- //if (svs.clients!=null)
- // Z_Free (svs.clients);
- //if (svs.client_entities)
- // Z_Free (svs.client_entities);
+ Globals.server_state= sv.state;
if (svs.demofile != null)
try {
@@ -1022,7 +1009,7 @@ public class SV_MAIN extends SV_GAME {
catch (IOException e1) {
e1.printStackTrace();
}
- //memset (&svs, 0, sizeof(svs));
- svs = new server_static_t();
+
+ svs= new server_static_t();
}
}
diff --git a/src/jake2/server/SV_SEND.java b/src/jake2/server/SV_SEND.java
index 4fa3f45..9b30a99 100644
--- a/src/jake2/server/SV_SEND.java
+++ b/src/jake2/server/SV_SEND.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_SEND.java,v 1.4 2004-08-22 14:25:13 salomo Exp $
+// $Id: SV_SEND.java,v 1.5 2004-09-10 19:02:56 salomo Exp $
package jake2.server;
@@ -70,16 +70,10 @@ public class SV_SEND extends SV_MAIN {
=================
*/
public static void SV_ClientPrintf(client_t cl, int level, String s) {
- // va_list argptr;
- // char string[1024];
- //
+
if (level < cl.messagelevel)
return;
- // va_start (argptr,fmt);
- // vsprintf (string, fmt,argptr);
- // va_end (argptr);
-
MSG.WriteByte(cl.netchan.message, svc_print);
MSG.WriteByte(cl.netchan.message, level);
MSG.WriteString(cl.netchan.message, s);
@@ -93,27 +87,12 @@ public class SV_SEND extends SV_MAIN {
=================
*/
public static void SV_BroadcastPrintf(int level, String s) {
- //va_list argptr;
- //char string[2048];
- client_t cl;
- //int i;
- // va_start (argptr,fmt);
- // vsprintf (string, fmt,argptr);
- // va_end (argptr);
+ client_t cl;
// 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);
}
@@ -137,16 +116,10 @@ public class SV_SEND extends SV_MAIN {
=================
*/
public static void SV_BroadcastCommand(String s) {
- // va_list argptr;
- // char string[1024];
if (sv.state == 0)
return;
- // va_start (argptr,fmt);
- // vsprintf (string, fmt,argptr);
- // va_end (argptr);
-
MSG.WriteByte(sv.multicast, svc_stufftext);
MSG.WriteString(sv.multicast, s);
SV_Multicast(null, MULTICAST_ALL_R);
diff --git a/src/jake2/sys/Sys.java b/src/jake2/sys/Sys.java
index cf8e154..c27d98c 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.7 2004-08-29 21:39:26 hzi Exp $
+ * $Id: Sys.java,v 1.8 2004-09-10 19:02:56 salomo Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -57,27 +57,27 @@ public final class Sys extends Defines {
//ok!
public static File[] FindAll(String path, int musthave, int canthave) {
- int index = path.lastIndexOf('/');
+ int index= path.lastIndexOf('/');
if (index != -1) {
- findbase = path.substring(0, index);
- findpattern = path.substring(index + 1, path.length());
+ findbase= path.substring(0, index);
+ findpattern= path.substring(index + 1, path.length());
}
else {
- findbase = path;
- findpattern = "*";
+ findbase= path;
+ findpattern= "*";
}
if (findpattern.equals("*.*")) {
- findpattern = "*";
+ findpattern= "*";
}
- File fdir = new File(findbase);
+ File fdir= new File(findbase);
if (!fdir.exists())
return null;
- FilenameFilter filter = new FileFilter(findpattern, musthave, canthave);
+ FilenameFilter filter= new FileFilter(findpattern, musthave, canthave);
return fdir.listFiles(filter);
}
@@ -101,9 +101,9 @@ public final class Sys extends Defines {
int musthave, canthave;
FileFilter(String findpattern, int musthave, int canthave) {
- this.regexpr = convert2regexpr(findpattern);
- this.musthave = musthave;
- this.canthave = canthave;
+ this.regexpr= convert2regexpr(findpattern);
+ this.musthave= musthave;
+ this.canthave= canthave;
}
@@ -119,46 +119,46 @@ public final class Sys extends Defines {
String convert2regexpr(String pattern) {
- StringBuffer sb = new StringBuffer();
+ StringBuffer sb= new StringBuffer();
char c;
- boolean escape = false;
+ boolean escape= false;
String subst;
// convert pattern
- for (int i = 0; i < pattern.length(); i++) {
- c = pattern.charAt(i);
- subst = null;
+ for (int i= 0; i < pattern.length(); i++) {
+ c= pattern.charAt(i);
+ subst= null;
switch (c) {
case '*' :
- subst = (!escape) ? ".*" : "*";
+ subst= (!escape) ? ".*" : "*";
break;
case '.' :
- subst = (!escape) ? "\\." : ".";
+ subst= (!escape) ? "\\." : ".";
break;
case '!' :
- subst = (!escape) ? "^" : "!";
+ subst= (!escape) ? "^" : "!";
break;
case '?' :
- subst = (!escape) ? "." : "?";
+ subst= (!escape) ? "." : "?";
break;
case '\\' :
- escape = !escape;
+ escape= !escape;
break;
default :
- escape = false;
+ escape= false;
}
if (subst != null) {
sb.append(subst);
- escape = false;
+ escape= false;
}
else
sb.append(c);
}
// the converted pattern
- String regexpr = sb.toString();
+ String regexpr= sb.toString();
//Com.DPrintf("pattern: " + pattern + " regexpr: " + regexpr + '\n');
try {
@@ -173,7 +173,7 @@ public final class Sys extends Defines {
boolean CompareAttributes(File dir, int musthave, int canthave) {
// . and .. never match
- String name = dir.getName();
+ String name= dir.getName();
if (name.equals(".") || name.equals(".."))
return false;
@@ -183,9 +183,9 @@ public final class Sys extends Defines {
}
- private static long secbase = System.currentTimeMillis();
+ private static long secbase= System.currentTimeMillis();
public static int Milliseconds() {
- return Globals.curtime = (int) (System.currentTimeMillis() - secbase);
+ return Globals.curtime= (int) (System.currentTimeMillis() - secbase);
}
//============================================
@@ -203,10 +203,11 @@ public final class Sys extends Defines {
// COM_FilePath (path, findbase);
- fdir = FindAll(path, canthave, musthave);
- fileindex =0;
-
- if (fdir == null) return null;
+ fdir= FindAll(path, canthave, musthave);
+ fileindex= 0;
+
+ if (fdir == null)
+ return null;
return FindNext();
}
@@ -220,17 +221,14 @@ public final class Sys extends Defines {
}
public static void FindClose() {
-
- if (fdir != null)
- fdir = null;
-
+ fdir= null;
}
-
+
public static void SendKeyEvents() {
KBD.Update();
-
+
// grab frame time
- Globals.sys_frame_time = Sys.Milliseconds();
+ Globals.sys_frame_time= Sys.Milliseconds();
}
public static String GetClipboardData() {
@@ -238,8 +236,7 @@ public final class Sys extends Defines {
return null;
}
- public static void ConsoleOutput(String msg)
- {
+ public static void ConsoleOutput(String msg) {
if (Globals.nostdout != null && Globals.nostdout.value != 0)
return;
diff --git a/src/jake2/util/Math3D.java b/src/jake2/util/Math3D.java
index e949f07..5c1f2eb 100644
--- a/src/jake2/util/Math3D.java
+++ b/src/jake2/util/Math3D.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 09.12.2003 by RST.
-// $Id: Math3D.java,v 1.5 2004-07-19 19:32:12 hzi Exp $
+// $Id: Math3D.java,v 1.6 2004-09-10 19:02:56 salomo Exp $
package jake2.util;
@@ -116,18 +116,7 @@ public class Math3D extends Lib {
}
return length;
}
-// public static final float VectorNormalize2(float[] v, float[] to) {
-// float length, ilength;
-//
-// length = VectorLength(v);
-// if (length != 0.0f) {
-// ilength = 1.0f / length;
-// to[0] = v[0] * ilength;
-// to[1] = v[1] * ilength;
-// to[2] = v[2] * ilength;
-// }
-// return length;
-// }
+
public static final float VectorLength(float v[]) {
return (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}
@@ -199,13 +188,8 @@ public class Math3D extends Lib {
private static float im[][] = new float[3][3];
private static float tmpmat[][] = new float[3][3];
private static float zrot[][] = new float[3][3];
+
public static void RotatePointAroundVector(float[] dst, float[] dir, float[] point, float degrees) {
-
- //float m[][] = new float[3][3];
- //float im[][] = new float[3][3];
- //float zrot[][] = new float[3][3];
- //float tmpmat[][] = new float[3][3];
- //float rot[][] = new float[3][3];
float[] vr = { 0.0f, 0.0f, 0.0f };
float[] vup = { 0.0f, 0.0f, 0.0f };
@@ -230,8 +214,6 @@ public class Math3D extends Lib {
m[1][2] = vf[1];
m[2][2] = vf[2];
- //Math3D.MatCopy(m, im); // achtung: src -> dst
-
im[0][0] = m[0][0];
im[0][1] = m[1][0];
im[0][2] = m[2][0];
@@ -249,8 +231,6 @@ public class Math3D extends Lib {
zrot[0][0] = zrot[1][1] = (float) Math.cos(Math3D.DEG2RAD(degrees));
zrot[0][1] = (float) Math.sin(Math3D.DEG2RAD(degrees));
zrot[1][0] = -zrot[0][1];
- //zrot[1][0] = - (float) Math.sin(Math3D.DEG2RAD(degrees));
- //zrot[1][1] = (float) Math.cos(Math3D.DEG2RAD(degrees));
Math3D.R_ConcatRotations(m, zrot, tmpmat);
Math3D.R_ConcatRotations(tmpmat, im, zrot);
@@ -485,22 +465,6 @@ public class Math3D extends Lib {
}
}
-// public static void MatClear(float m[][]) {
-// m[0][0] = m[0][1] = m[0][2] = m[1][0] = m[1][1] = m[1][2] = m[2][0] = m[2][1] = m[2][2] = 0.0f;
-// }
-
-// private static final void MatCopy(float src[][], float dst[][]) {
-// dst[0][0]=src[0][0];
-// dst[0][1]=src[0][1];
-// dst[0][2]=src[0][2];
-// dst[1][0]=src[1][0];
-// dst[1][1]=src[1][1];
-// dst[1][2]=src[1][2];
-// dst[2][0]=src[2][0];
-// dst[2][1]=src[2][1];
-// dst[2][2]=src[2][2];
-// }
-
public static void G_ProjectSource(float[] point, float[] distance, float[] forward, float[] right, float[] result) {
result[0] = point[0] + forward[0] * distance[0] + right[0] * distance[1];
result[1] = point[1] + forward[1] * distance[0] + right[1] * distance[1];
diff --git a/src/jake2/util/QuakeFile.java b/src/jake2/util/QuakeFile.java
index 969248c..5b3c11b 100644
--- a/src/jake2/util/QuakeFile.java
+++ b/src/jake2/util/QuakeFile.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 24.07.2004 by RST.
-// $Id: QuakeFile.java,v 1.2 2004-09-04 19:08:30 salomo Exp $
+// $Id: QuakeFile.java,v 1.3 2004-09-10 19:02:56 salomo Exp $
package jake2.util;
@@ -31,8 +31,10 @@ import jake2.qcommon.Com;
import java.io.*;
-/** RandomAccessFile, bur handles readString/WriteString specially and
- * offers other helper functions */
+/**
+ * RandomAccessFile, but handles readString/WriteString specially and
+ * offers other helper functions
+ */
public class QuakeFile extends RandomAccessFile
{