aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRene Stoeckel <[email protected]>2006-01-20 22:44:07 +0000
committerRene Stoeckel <[email protected]>2006-01-20 22:44:07 +0000
commitbc544922ce34dd0a1dce39ce41e2956b607763e0 (patch)
tree76241e48a0d28f805978bc8863948a3d7f8a236d /src
parentaf7d77a88b04e619534cfefefc84c63ea6049273 (diff)
comment beautification
Diffstat (limited to 'src')
-rw-r--r--src/jake2/server/SV_GAME.java70
-rw-r--r--src/jake2/server/SV_INIT.java90
-rw-r--r--src/jake2/server/SV_MAIN.java4
3 files changed, 67 insertions, 97 deletions
diff --git a/src/jake2/server/SV_GAME.java b/src/jake2/server/SV_GAME.java
index 33f35b4..b930136 100644
--- a/src/jake2/server/SV_GAME.java
+++ b/src/jake2/server/SV_GAME.java
@@ -19,7 +19,7 @@
*/
// Created on 14.01.2004 by RST.
-// $Id: SV_GAME.java,v 1.8 2004-09-22 19:22:12 salomo Exp $
+// $Id: SV_GAME.java,v 1.9 2006-01-20 22:44:07 salomo Exp $
package jake2.server;
import jake2.Defines;
@@ -30,11 +30,10 @@ import jake2.util.Math3D;
public class SV_GAME {
- /*
- * =============== PF_Unicast
+ /**
+ * PF_Unicast
*
- * Sends the contents of the mutlicast buffer to a single client
- * ===============
+ * Sends the contents of the mutlicast buffer to a single client.
*/
public static void PF_Unicast(edict_t ent, boolean reliable) {
int p;
@@ -59,19 +58,19 @@ public class SV_GAME {
SZ.Clear(SV_INIT.sv.multicast);
}
- /*
- * =============== PF_dprintf
+ /**
+ * PF_dprintf
*
- * Debug print to server console ===============
+ * Debug print to server console.
*/
public static void PF_dprintf(String fmt) {
Com.Printf(fmt);
}
- /*
- * =============== PF_cprintf
+ /**
+ * PF_cprintf
*
- * Print to a single client ===============
+ * Print to a single client.
*/
public static void PF_cprintf(edict_t ent, int level, String fmt) {
@@ -89,10 +88,10 @@ public class SV_GAME {
Com.Printf(fmt);
}
- /*
- * =============== PF_centerprintf
+ /**
+ * PF_centerprintf
*
- * centerprint to a single client ===============
+ * centerprint to a single client.
*/
public static void PF_centerprintf(edict_t ent, String fmt) {
int n;
@@ -106,10 +105,10 @@ public class SV_GAME {
PF_Unicast(ent, true);
}
- /*
- * =============== PF_error
+ /**
+ * PF_error
*
- * Abort the server with a game error ===============
+ * Abort the server with a game error.
*/
public static void PF_error(String fmt) {
Com.Error(Defines.ERR_DROP, "Game Error: " + fmt);
@@ -119,10 +118,10 @@ public class SV_GAME {
Com.Error(level, fmt);
}
- /*
- * ================= PF_setmodel
+ /**
+ * PF_setmodel
*
- * Also sets mins and maxs for inline bmodels =================
+ * Also sets mins and maxs for inline bmodels.
*/
public static void PF_setmodel(edict_t ent, String name) {
int i;
@@ -144,10 +143,8 @@ public class SV_GAME {
}
}
- /*
- * =============== PF_Configstring
- *
- * ===============
+ /**
+ * PF_Configstring
*/
public static void PF_Configstring(int index, String val) {
if (index < 0 || index >= Defines.MAX_CONFIGSTRINGS)
@@ -207,10 +204,10 @@ public class SV_GAME {
MSG.WriteAngle(SV_INIT.sv.multicast, f);
}
- /*
- * ================= PF_inPVS
+ /**
+ * PF_inPVS
*
- * Also checks portalareas so that doors block sight =================
+ * Also checks portalareas so that doors block sight.
*/
public static boolean PF_inPVS(float[] p1, float[] p2) {
int leafnum;
@@ -239,10 +236,10 @@ public class SV_GAME {
return true;
}
- /*
- * ================= PF_inPHS
+ /**
+ * PF_inPHS.
*
- * Also checks portalareas so that doors block sound =================
+ * Also checks portalareas so that doors block sound.
*/
public static boolean PF_inPHS(float[] p1, float[] p2) {
int leafnum;
@@ -280,22 +277,21 @@ public class SV_GAME {
}
- //==============================================
- /*
- * =============== SV_ShutdownGameProgs
+ /**
+ * SV_ShutdownGameProgs
*
* Called when either the entire server is being killed, or it is changing
- * to a different game directory. ===============
+ * to a different game directory.
*/
public static void SV_ShutdownGameProgs() {
GameBase.ShutdownGame();
}
- /*
- * =============== SV_InitGameProgs
+ /**
+ * SV_InitGameProgs
*
- * Init the game subsystem for a new map ===============
+ * Init the game subsystem for a new map.
*/
public static void SV_InitGameProgs() {
diff --git a/src/jake2/server/SV_INIT.java b/src/jake2/server/SV_INIT.java
index 3d95e6a..ae0a53d 100644
--- a/src/jake2/server/SV_INIT.java
+++ b/src/jake2/server/SV_INIT.java
@@ -19,7 +19,7 @@
*/
// Created on 14.01.2004 by RST.
-// $Id: SV_INIT.java,v 1.16 2005-12-05 00:11:47 salomo Exp $
+// $Id: SV_INIT.java,v 1.17 2006-01-20 22:44:07 salomo Exp $
package jake2.server;
import jake2.Defines;
@@ -37,10 +37,8 @@ import java.io.RandomAccessFile;
public class SV_INIT {
- /*
- * ================ SV_FindIndex
- *
- * ================
+ /**
+ * SV_FindIndex.
*/
public static int SV_FindIndex(String name, int start, int max,
boolean create) {
@@ -85,19 +83,17 @@ public class SV_INIT {
return SV_FindIndex(name, Defines.CS_IMAGES, Defines.MAX_IMAGES, true);
}
- /*
- * ================ SV_CreateBaseline
+ /**
+ * SV_CreateBaseline
*
* Entity baselines are used to compress the update messages to the clients --
- * only the fields that differ from the baseline will be transmitted
- * ================
+ * only the fields that differ from the baseline will be transmitted.
*/
public static void SV_CreateBaseline() {
edict_t svent;
int entnum;
for (entnum = 1; entnum < GameBase.num_edicts; entnum++) {
- //svent = EDICT_NUM(entnum);
svent = GameBase.g_edicts[entnum];
if (!svent.inuse)
@@ -105,17 +101,17 @@ public class SV_INIT {
if (0 == svent.s.modelindex && 0 == svent.s.sound
&& 0 == svent.s.effects)
continue;
+
svent.s.number = entnum;
// take current state as baseline
Math3D.VectorCopy(svent.s.origin, svent.s.old_origin);
- // rst: bugfix
- sv.baselines[entnum].set(svent.s); // = svent.s.getClone();
+ sv.baselines[entnum].set(svent.s);
}
}
- /*
- * ================= SV_CheckForSavegame =================
+ /**
+ * SV_CheckForSavegame.
*/
public static void SV_CheckForSavegame() {
@@ -168,13 +164,11 @@ public class SV_INIT {
}
}
- /*
- * ================ SV_SpawnServer
+ /**
+ * SV_SpawnServer.
*
* Change the server to a new map, taking all connected clients along with
* it.
- *
- * ================
*/
public static void SV_SpawnServer(String server, String spawnpoint,
int serverstate, boolean attractloop, boolean loadgame) {
@@ -190,7 +184,8 @@ public class SV_INIT {
if (sv.demofile != null)
try {
sv.demofile.close();
- } catch (Exception e) {
+ }
+ catch (Exception e) {
}
// any partially connected client will be restarted
@@ -248,21 +243,20 @@ public class SV_INIT {
checksum = iw[0];
sv.configstrings[Defines.CS_MAPCHECKSUM] = "" + checksum;
- //
+
// clear physics interaction links
- //
+
SV_WORLD.SV_ClearWorld();
for (i = 1; i < CM.CM_NumInlineModels(); i++) {
sv.configstrings[Defines.CS_MODELS + 1 + i] = "*" + i;
+
// copy references
- sv.models[i + 1] = CM
- .InlineModel(sv.configstrings[Defines.CS_MODELS + 1 + i]);
+ sv.models[i + 1] = CM.InlineModel(sv.configstrings[Defines.CS_MODELS + 1 + i]);
}
- //
+
// spawn the rest of the entities on the map
- //
// precache and static commands can be issued during
// map initialization
@@ -290,14 +284,12 @@ public class SV_INIT {
// set serverinfo variable
Cvar.FullSet("mapname", sv.name, Defines.CVAR_SERVERINFO
| Defines.CVAR_NOSET);
-
- //Com.Printf("-------------------------------------\n");
}
- /*
- * ============== SV_InitGame
+ /**
+ * SV_InitGame.
*
- * A brand new game has been started ==============
+ * A brand new game has been started.
*/
public static void SV_InitGame() {
int i;
@@ -356,21 +348,18 @@ public class SV_INIT {
svs.spawncount = Lib.rand();
svs.clients = new client_t[(int) SV_MAIN.maxclients.value];
for (int n = 0; n < svs.clients.length; n++) {
- // fixed nasty multiplayer bug (rst).
svs.clients[n] = new client_t();
svs.clients[n].serverindex = n;
}
svs.num_client_entities = ((int) SV_MAIN.maxclients.value)
* Defines.UPDATE_BACKUP * 64; //ok.
- //svs.client_entities = Z_Malloc(sizeof(entity_state_t) *
- // svs.num_client_entities);
svs.client_entities = new entity_state_t[svs.num_client_entities];
for (int n = 0; n < svs.client_entities.length; n++)
svs.client_entities[n] = new entity_state_t(null);
// init network stuff
- NET.Config((SV_MAIN.maxclients.value > 1)); //ok!
+ NET.Config((SV_MAIN.maxclients.value > 1));
// heartbeats will always be sent to the id master
svs.last_heartbeat = -99999; // send immediately
@@ -378,33 +367,30 @@ public class SV_INIT {
NET.StringToAdr(idmaster, SV_MAIN.master_adr[0]);
// init game
- SV_GAME.SV_InitGameProgs(); // bis hier alles ok!
+ SV_GAME.SV_InitGameProgs();
for (i = 0; i < SV_MAIN.maxclients.value; i++) {
ent = GameBase.g_edicts[i + 1];
-
- //ent.s.number = i + 1; //dont need this, ent.s.number already set.
svs.clients[i].edict = ent;
- //memset(& svs.clients[i].lastcmd, 0,
- // sizeof(svs.clients[i].lastcmd));
svs.clients[i].lastcmd = new usercmd_t();
}
}
private static String firstmap = "";
- /*
- * ====================== SV_Map
+ /**
+ * SV_Map
*
* the full syntax is:
*
* map [*] <map>$ <startspot>+ <nextserver>
*
- * command from the console or progs. Map can also be a.cin, .pcx, or .dm2
- * file Nextserver is used to allow a cinematic to play, then proceed to
+ * command from the console or progs. Map can also be a.cin, .pcx, or .dm2 file.
+ *
+ * Nextserver is used to allow a cinematic to play, then proceed to
* another level:
*
- * map tram.cin+jail_e3 ======================
+ * map tram.cin+jail_e3
*/
public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) {
@@ -421,16 +407,6 @@ public class SV_INIT {
// if there is a + in the map, set nextserver to the remainder
- //was:
- // ch = strstr(level, "+");
- // if (ch)
- // {
- // *ch = 0;
- // Cvar_Set ("nextserver", va("gamemap \"%s\"", ch+1));
- // }
- // else
- // Cvar_Set ("nextserver", "");
-
int c = level.indexOf('+');
if (c != -1) {
Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\"");
@@ -449,22 +425,20 @@ public class SV_INIT {
}
}
- //ZOID special hack for end game screen in coop mode
+ // ZOID: special hack for end game screen in coop mode
if (Cvar.VariableValue("coop") != 0 && level.equals("victory.pcx"))
Cvar.Set("nextserver", "gamemap \"*" + firstmap + "\"");
// if there is a $, use the remainder as a spawnpoint
int pos = level.indexOf('$');
if (pos != -1) {
- //* ch = 0;
spawnpoint = level.substring(pos + 1);
level = level.substring(0, pos);
} else
- //spawnpoint[0] = 0;
spawnpoint = "";
- // skip the end-of-unit flag if necessary
+ // skip the end-of-unit flag * if necessary
if (level.charAt(0) == '*')
level = level.substring(1);
diff --git a/src/jake2/server/SV_MAIN.java b/src/jake2/server/SV_MAIN.java
index e325aef..89308d3 100644
--- a/src/jake2/server/SV_MAIN.java
+++ b/src/jake2/server/SV_MAIN.java
@@ -19,7 +19,7 @@
*/
// Created on 13.01.2004 by RST.
-// $Id: SV_MAIN.java,v 1.15 2005-12-27 21:02:30 salomo Exp $
+// $Id: SV_MAIN.java,v 1.16 2006-01-20 22:44:07 salomo Exp $
package jake2.server;
import jake2.Defines;
@@ -859,7 +859,7 @@ public class SV_MAIN {
}
/**
- * Only called at quake2.exe startup, not for each game ===============
+ * Only called at quake2.exe startup, not for each game
*/
public static void SV_Init() {
SV_CCMDS.SV_InitOperatorCommands(); //ok.