From: Carsten W. <ca...@us...> - 2007-06-07 10:31:16
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30060/src/jake2/server Modified Files: SV_CCMDS.java Log Message: code clean up (shift the variable declarations down) Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SV_CCMDS.java 3 Dec 2005 19:45:42 -0000 1.15 --- SV_CCMDS.java 7 Jun 2007 10:31:10 -0000 1.16 *************** *** 178,186 **** public static void SV_WipeSavegame(String savename) { ! String name, s; ! ! Com.DPrintf("SV_WipeSaveGame(" + savename + ")\n"); ! name = FS.Gamedir() + "/save/" + savename + "/server.ssv"; remove(name); --- 178,184 ---- public static void SV_WipeSavegame(String savename) { ! Com.DPrintf("SV_WipeSaveGame(" + savename + ")\n"); ! String name = FS.Gamedir() + "/save/" + savename + "/server.ssv"; remove(name); *************** *** 278,286 **** */ public static void SV_CopySaveGame(String src, String dst) { - //char name[MAX_OSPATH], name2[MAX_OSPATH]; - int l, len; - File found; - - String name, name2; Com.DPrintf("SV_CopySaveGame(" + src + "," + dst + ")\n"); --- 276,279 ---- *************** *** 289,294 **** // copy the savegame over ! name = FS.Gamedir() + "/save/" + src + "/server.ssv"; ! name2 = FS.Gamedir() + "/save/" + dst + "/server.ssv"; FS.CreatePath(name2); CopyFile(name, name2); --- 282,287 ---- // copy the savegame over ! String name = FS.Gamedir() + "/save/" + src + "/server.ssv"; ! String name2 = FS.Gamedir() + "/save/" + dst + "/server.ssv"; FS.CreatePath(name2); CopyFile(name, name2); *************** *** 299,306 **** String name1 = FS.Gamedir() + "/save/" + src + "/"; - len = name1.length(); name = FS.Gamedir() + "/save/" + src + "/*.sav"; ! found = Sys.FindFirst(name, 0, 0); while (found != null) { --- 292,298 ---- String name1 = FS.Gamedir() + "/save/" + src + "/"; name = FS.Gamedir() + "/save/" + src + "/*.sav"; ! File found = Sys.FindFirst(name, 0, 0); while (found != null) { *************** *** 461,465 **** */ public static void SV_ReadServerFile() { ! String filename="", name = "", string, comment, mapcmd; try { QuakeFile f; --- 453,457 ---- */ public static void SV_ReadServerFile() { ! String filename="", name = "", string, mapcmd; try { QuakeFile f; *************** *** 473,478 **** f = new QuakeFile(filename, "r"); ! // read the comment field ! comment = f.readString(); // read the mapcmd --- 465,470 ---- f = new QuakeFile(filename, "r"); ! // read the comment field but ignore ! f.readString(); // read the mapcmd *************** *** 538,545 **** */ public static void SV_GameMap_f() { - String map; - int i; - client_t cl; - boolean savedInuse[]; if (Cmd.Argc() != 2) { --- 530,533 ---- *************** *** 553,557 **** // check for clearing the current savegame ! map = Cmd.Argv(1); if (map.charAt(0) == '*') { // wipe all the *.sav files --- 541,545 ---- // check for clearing the current savegame ! String map = Cmd.Argv(1); if (map.charAt(0) == '*') { // wipe all the *.sav files *************** *** 563,568 **** // when the level is re-entered, the clients will spawn // at spawn points instead of occupying body shells ! savedInuse = new boolean[(int) SV_MAIN.maxclients.value]; ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { cl = SV_INIT.svs.clients[i]; savedInuse[i] = cl.edict.inuse; --- 551,557 ---- // when the level is re-entered, the clients will spawn // at spawn points instead of occupying body shells ! client_t cl; ! boolean[] savedInuse = new boolean[(int) SV_MAIN.maxclients.value]; ! for (int i = 0; i < SV_MAIN.maxclients.value; i++) { cl = SV_INIT.svs.clients[i]; savedInuse[i] = cl.edict.inuse; *************** *** 573,577 **** // we must restore these for clients to transfer over correctly ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { cl = SV_INIT.svs.clients[i]; cl.edict.inuse = savedInuse[i]; --- 562,566 ---- // we must restore these for clients to transfer over correctly ! for (int i = 0; i < SV_MAIN.maxclients.value; i++) { cl = SV_INIT.svs.clients[i]; cl.edict.inuse = savedInuse[i]; *************** *** 639,646 **** public static void SV_Loadgame_f() { - String name; - RandomAccessFile f; - String dir; - if (Cmd.Argc() != 2) { Com.Printf("USAGE: loadgame <directory>\n"); --- 628,631 ---- *************** *** 650,654 **** Com.Printf("Loading game...\n"); ! dir = Cmd.Argv(1); if ( (dir.indexOf("..") > -1) || (dir.indexOf("/") > -1) || (dir.indexOf("\\") > -1)) { Com.Printf("Bad savedir.\n"); --- 635,639 ---- Com.Printf("Loading game...\n"); ! String dir = Cmd.Argv(1); if ( (dir.indexOf("..") > -1) || (dir.indexOf("/") > -1) || (dir.indexOf("\\") > -1)) { Com.Printf("Bad savedir.\n"); *************** *** 656,660 **** // make sure the server.ssv file exists ! name = FS.Gamedir() + "/save/" + Cmd.Argv(1) + "/server.ssv"; try { f = new RandomAccessFile(name, "r"); --- 641,646 ---- // make sure the server.ssv file exists ! String name = FS.Gamedir() + "/save/" + Cmd.Argv(1) + "/server.ssv"; ! RandomAccessFile f; try { f = new RandomAccessFile(name, "r"); |