aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/qcommon/Com.java
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2004-07-08 15:58:48 +0000
committerHolger Zickner <[email protected]>2004-07-08 15:58:48 +0000
commit4f13ea26c4f47e54e66926f0700cf631e7bb3352 (patch)
treea9d434fc462417bb981b1565fd64cea5e7c82c15 /src/jake2/qcommon/Com.java
parent76839da3568e20f51220584d1fc92841b216505a (diff)
import of Jake2 version hannover
Diffstat (limited to 'src/jake2/qcommon/Com.java')
-rw-r--r--src/jake2/qcommon/Com.java46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/jake2/qcommon/Com.java b/src/jake2/qcommon/Com.java
index 63b7d0e..c938fdb 100644
--- a/src/jake2/qcommon/Com.java
+++ b/src/jake2/qcommon/Com.java
@@ -2,7 +2,7 @@
* Com.java
* Copyright (C) 2003
*
- * $Id: Com.java,v 1.1 2004-07-07 19:59:30 hzi Exp $
+ * $Id: Com.java,v 1.2 2004-07-08 15:58:46 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -30,27 +30,23 @@ import jake2.Globals;
import jake2.client.CL;
import jake2.client.Console;
import jake2.game.Cmd;
-import jake2.server.SV;
import jake2.server.SV_MAIN;
import jake2.sys.Sys;
-import jake2.util.Lib;
-import jake2.util.PrintfFormat;
-import jake2.util.Vargs;
+import jake2.util.*;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.util.logging.Logger;
+import java.io.*;
/**
* Com
* TODO complete Com interface
*/
public final class Com {
-
- public static class RD_Flusher {
- public void rd_flush(int target, byte [] buffer) {
- }
+
+ static int com_argc;
+ static String[] com_argv = new String[Defines.MAX_NUM_ARGVS];
+
+ public abstract static class RD_Flusher {
+ public abstract void rd_flush(int target, byte [] buffer);
}
static int rd_target;
@@ -83,8 +79,6 @@ public final class Com {
static String msg = "";
- private static Logger logger = Logger.getLogger(Com.class.getName());
-
// helper class to replace the pointer-pointer
public static class ParseHelp {
@@ -211,7 +205,7 @@ public final class Com {
c = hlp.nextchar();
if (c == '\"' || c == 0) {
- char xxx = hlp.nextchar();
+ hlp.nextchar();
com_token[len] = '?';
return new String(com_token, 0, len);
}
@@ -276,7 +270,7 @@ public final class Com {
SV_MAIN.SV_Shutdown("Server crashed: " + msg + "\n", false);
CL.Drop();
recursive = false;
- //throw new longjmpException();
+ throw new longjmpException();
}
else {
SV_MAIN.SV_Shutdown("Server fatal crashed: %s" + msg + "\n", false);
@@ -296,12 +290,12 @@ public final class Com {
Com.Error(Globals.ERR_FATAL, "argc > MAX_NUM_ARGVS");
}
- Globals.com_argc = args.length;
- for (int i = 0; i < Globals.com_argc; i++) {
+ Com.com_argc = args.length;
+ for (int i = 0; i < Com.com_argc; i++) {
if (args[i].length() >= Globals.MAX_TOKEN_CHARS)
- Globals.com_argv[i] = "";
+ Com.com_argv[i] = "";
else
- Globals.com_argv[i] = args[i];
+ Com.com_argv[i] = args[i];
}
}
@@ -417,19 +411,19 @@ public final class Com {
}
public static int Argc() {
- return Globals.com_argc;
+ return Com.com_argc;
}
public static String Argv(int arg) {
- if (arg < 0 || arg >= Globals.com_argc || Globals.com_argv[arg].length() < 1)
+ if (arg < 0 || arg >= Com.com_argc || Com.com_argv[arg].length() < 1)
return "";
- return Globals.com_argv[arg];
+ return Com.com_argv[arg];
}
public static void ClearArgv(int arg) {
- if (arg < 0 || arg >= Globals.com_argc || Globals.com_argv[arg].length() < 1)
+ if (arg < 0 || arg >= Com.com_argc || Com.com_argv[arg].length() < 1)
return;
- Globals.com_argv[arg] = "";
+ Com.com_argv[arg] = "";
}
public static void Quit() {