From: Carsten W. <ca...@us...> - 2005-12-25 18:11:57
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27365/src/jake2/server Modified Files: Tag: render-refactoring SV_INIT.java SV_CCMDS.java SV_SEND.java SV_ENTS.java SV_MAIN.java SV_USER.java Log Message: merge with current HEAD Index: SV_MAIN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_MAIN.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** SV_MAIN.java 1 Jul 2005 14:20:55 -0000 1.11 --- SV_MAIN.java 25 Dec 2005 18:11:18 -0000 1.11.2.1 *************** *** 437,454 **** } ! /* ! * =============== SVC_RemoteCommand ! * * A client issued an rcon command. Shift down the remaining args Redirect ! * all printfs =============== */ public static void SVC_RemoteCommand() { int i; - //char remaining[1024]; String remaining; i = Rcon_Validate(); ! String msg = new String(Globals.net_message.data, 4, -1); if (i == 0) --- 437,451 ---- } ! /** * A client issued an rcon command. Shift down the remaining args Redirect ! * all printfs fromt hte server to the client. */ public static void SVC_RemoteCommand() { int i; String remaining; i = Rcon_Validate(); ! String msg = Lib.CtoJava(Globals.net_message.data, 4, 1024); if (i == 0) *************** *** 461,466 **** Com.BeginRedirect(Defines.RD_PACKET, SV_SEND.sv_outputbuf, Defines.SV_OUTPUTBUF_LENGTH, new Com.RD_Flusher() { ! public void rd_flush(int target, byte[] buffer) { ! SV_SEND.SV_FlushRedirect(target, buffer); } }); --- 458,463 ---- Com.BeginRedirect(Defines.RD_PACKET, SV_SEND.sv_outputbuf, Defines.SV_OUTPUTBUF_LENGTH, new Com.RD_Flusher() { ! public void rd_flush(int target, StringBuffer buffer) { ! SV_SEND.SV_FlushRedirect(target, Lib.stringToBytes(buffer.toString())); } }); *************** *** 919,924 **** Cvar.Get("fraglimit", "0", Defines.CVAR_SERVERINFO); Cvar.Get("timelimit", "0", Defines.CVAR_SERVERINFO); ! //TODO: set cheats 0 ! Cvar.Get("cheats", "1", Defines.CVAR_SERVERINFO | Defines.CVAR_LATCH); Cvar.Get("protocol", "" + Defines.PROTOCOL_VERSION, Defines.CVAR_SERVERINFO | Defines.CVAR_NOSET); --- 916,920 ---- Cvar.Get("fraglimit", "0", Defines.CVAR_SERVERINFO); Cvar.Get("timelimit", "0", Defines.CVAR_SERVERINFO); ! Cvar.Get("cheats", "0", Defines.CVAR_SERVERINFO | Defines.CVAR_LATCH); Cvar.Get("protocol", "" + Defines.PROTOCOL_VERSION, Defines.CVAR_SERVERINFO | Defines.CVAR_NOSET); *************** *** 935,940 **** SV_MAIN.sv_enforcetime = Cvar.Get("sv_enforcetime", "0", 0); ! // TODO: carsten, re-allow downloads per default ! SV_MAIN.allow_download = Cvar.Get("allow_download", "0", Defines.CVAR_ARCHIVE); SV_MAIN.allow_download_players = Cvar.Get("allow_download_players", --- 931,935 ---- SV_MAIN.sv_enforcetime = Cvar.Get("sv_enforcetime", "0", 0); ! SV_MAIN.allow_download = Cvar.Get("allow_download", "1", Defines.CVAR_ARCHIVE); SV_MAIN.allow_download_players = Cvar.Get("allow_download_players", Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.13 retrieving revision 1.13.6.1 diff -C2 -d -r1.13 -r1.13.6.1 *** SV_INIT.java 19 Feb 2005 21:21:46 -0000 1.13 --- SV_INIT.java 25 Dec 2005 18:11:18 -0000 1.13.6.1 *************** *** 392,395 **** --- 392,397 ---- } + private static String firstmap = ""; + /* * ====================== SV_Map *************** *** 432,446 **** int c = level.indexOf('+'); if (c != -1) { ! Cvar ! .Set("nextserver", "gamemap \"" + level.substring(c + 1) ! + "\""); level = level.substring(0, c); } else { Cvar.Set("nextserver", ""); } //ZOID special hack for end game screen in coop mode if (Cvar.VariableValue("coop") != 0 && level.equals("victory.pcx")) ! Cvar.Set("nextserver", "gamemap \"*base1\""); // if there is a $, use the remainder as a spawnpoint --- 434,456 ---- int c = level.indexOf('+'); if (c != -1) { ! Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level = level.substring(0, c); } else { Cvar.Set("nextserver", ""); } + + // rst: base1 works for full, damo1 works for demo, so we need to store first map. + if (firstmap.length() == 0) + { + if (!levelstring.endsWith(".cin") && !levelstring.endsWith(".pcx") && !levelstring.endsWith(".dm2")) + { + int pos = levelstring.indexOf('+'); + firstmap = levelstring.substring(pos + 1); + } + } //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 Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -C2 -d -r1.14 -r1.14.6.1 *** SV_CCMDS.java 19 Feb 2005 21:21:19 -0000 1.14 --- SV_CCMDS.java 25 Dec 2005 18:11:18 -0000 1.14.6.1 *************** *** 174,184 **** } } - /* - ===================== - SV_WipeSavegame ! Delete save/<XXX>/ ! ===================== ! */ public static void SV_WipeSavegame(String savename) { --- 174,179 ---- } } ! /** Delete save files save/(number)/. */ public static void SV_WipeSavegame(String savename) { Index: SV_ENTS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_ENTS.java,v retrieving revision 1.5 retrieving revision 1.5.12.1 diff -C2 -d -r1.5 -r1.5.12.1 *** SV_ENTS.java 22 Sep 2004 19:22:12 -0000 1.5 --- SV_ENTS.java 25 Dec 2005 18:11:18 -0000 1.5.12.1 *************** *** 360,369 **** } ! /* ! * ============ SV_FatPVS ! * ! * The client will interpolate the view position, so we can't use a single ! * PVS point =========== ! */ public static void SV_FatPVS(float[] org) { int leafs[] = new int[64]; --- 360,365 ---- } ! /** The client will interpolate the view position, so we can't use a single ! * PVS point. */ public static void SV_FatPVS(float[] org) { int leafs[] = new int[64]; *************** *** 413,421 **** } ! /* ! * ============= SV_BuildClientFrame ! * * Decides which entities are going to be visible to the client, and copies ! * off the playerstat and areabits. ============= */ public static void SV_BuildClientFrame(client_t client) { --- 409,415 ---- } ! /** * Decides which entities are going to be visible to the client, and copies ! * off the playerstat and areabits. */ public static void SV_BuildClientFrame(client_t client) { *************** *** 479,494 **** // ignore if not touching a PV leaf - if (ent != clent) { // check area ! if (!CM.CM_AreasConnected(clientarea, ent.areanum)) { // doors ! // can ! // legally ! // straddle ! // two ! // areas, ! // so ! // we may need to check another one ! if (0 == ent.areanum2 ! || !CM.CM_AreasConnected(clientarea, ent.areanum2)) continue; // blocked by a door } --- 473,481 ---- // ignore if not touching a PV leaf // check area ! if (ent != clent) { ! if (!CM.CM_AreasConnected(clientarea, ent.areanum)) { ! // doors can legally straddle two areas, so we may need to check another one ! if (0 == ent.areanum2 || !CM.CM_AreasConnected(clientarea, ent.areanum2)) continue; // blocked by a door } Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** SV_SEND.java 17 Jan 2005 23:09:41 -0000 1.8 --- SV_SEND.java 25 Dec 2005 18:11:18 -0000 1.8.6.1 *************** *** 31,34 **** --- 31,35 ---- import jake2.qcommon.*; import jake2.render.*; + import jake2.util.Lib; import jake2.util.Math3D; *************** *** 42,51 **** */ ! public static byte sv_outputbuf[] = new byte[Defines.SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == Defines.RD_PACKET) { ! String s = ("print\n" + outputbuf); ! Netchan.Netchan_OutOfBand(Defines.NS_SERVER, Globals.net_from, s.length(), s.getBytes()); } else if (sv_redirected == Defines.RD_CLIENT) { --- 43,52 ---- */ ! public static StringBuffer sv_outputbuf = new StringBuffer(); public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == Defines.RD_PACKET) { ! String s = ("print\n" + Lib.CtoJava(outputbuf)); ! Netchan.Netchan_OutOfBand(Defines.NS_SERVER, Globals.net_from, s.length(), Lib.stringToBytes(s)); } else if (sv_redirected == Defines.RD_CLIENT) { Index: SV_USER.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_USER.java,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** SV_USER.java 6 Feb 2005 19:28:16 -0000 1.8 --- SV_USER.java 25 Dec 2005 18:11:18 -0000 1.8.6.1 *************** *** 418,421 **** --- 418,428 ---- SV_MAIN.sv_client.download = FS.LoadFile(name); + + // rst: this handles loading errors, no message yet visible + if (SV_MAIN.sv_client.download == null) + { + return; + } + SV_MAIN.sv_client.downloadsize = SV_MAIN.sv_client.download.length; SV_MAIN.sv_client.downloadcount = offset; *************** *** 427,431 **** // came from a pak file, don't // allow ! // download ZOID || (name.startsWith("maps/") && FS.file_from_pak != 0)) { Com.DPrintf("Couldn't download " + name + " to " --- 434,438 ---- // came from a pak file, don't // allow ! // download ZOID || (name.startsWith("maps/") && FS.file_from_pak != 0)) { Com.DPrintf("Couldn't download " + name + " to " *************** *** 532,536 **** if (i == SV_USER.ucmds.length && SV_INIT.sv.state == Defines.ss_game) ! GameAI.ClientCommand(SV_USER.sv_player); // SV_EndRedirect (); --- 539,543 ---- if (i == SV_USER.ucmds.length && SV_INIT.sv.state == Defines.ss_game) ! Cmd.ClientCommand(SV_USER.sv_player); // SV_EndRedirect (); |