From: Rene S. <sa...@us...> - 2004-08-22 14:25:29
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8042/src/jake2/server Modified Files: SV.java SV_GAME.java SV_CCMDS.java client_t.java SV_INIT.java SV_SEND.java Log Message: cleanups and base3 bugfix for the load and save routines. Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_CCMDS.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV_CCMDS.java 22 Aug 2004 14:25:12 -0000 1.7 *************** *** 36,41 **** import java.util.Calendar; ! public class SV_CCMDS extends SV_ENTS ! { /* --- 36,40 ---- import java.util.Calendar; ! public class SV_CCMDS extends SV_ENTS { [...1476 lines suppressed...] ! public void execute() { SV_Savegame_f(); } }); ! Cmd.AddCommand("load", new xcommand_t() { ! public void execute() { SV_Loadgame_f(); } }); ! Cmd.AddCommand("killserver", new xcommand_t() { ! public void execute() { SV_KillServer_f(); } }); ! Cmd.AddCommand("sv", new xcommand_t() { ! public void execute() { SV_ServerCommand_f(); } Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SV_SEND.java 8 Jul 2004 20:56:54 -0000 1.3 --- SV_SEND.java 22 Aug 2004 14:25:13 -0000 1.4 *************** *** 41,49 **** */ ! public static byte sv_outputbuf[] = new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s = ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } --- 41,49 ---- */ ! public static byte sv_outputbuf[]= new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s= ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } *************** *** 104,124 **** // 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); ! } ! for (int i = 0; i < SV_MAIN.maxclients.value; i++) { ! cl = SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; --- 104,123 ---- // 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); ! } ! ! for (int i= 0; i < SV_MAIN.maxclients.value; i++) { ! cl= SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; *************** *** 174,186 **** int area1, area2; ! reliable = false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum = CM.CM_PointLeafnum(origin); ! area1 = CM.CM_LeafArea(leafnum); } else { ! leafnum = 0; // just to avoid compiler warnings ! area1 = 0; } --- 173,185 ---- int area1, area2; ! reliable= false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum= CM.CM_PointLeafnum(origin); ! area1= CM.CM_LeafArea(leafnum); } else { ! leafnum= 0; // just to avoid compiler warnings ! area1= 0; } *************** *** 191,224 **** switch (to) { case MULTICAST_ALL_R : ! reliable = true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum = 0; ! mask = null; break; case MULTICAST_PHS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PHS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PVS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPVS(cluster); break; default : ! mask = null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j = 0; j < maxclients.value; j++) { ! client = svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) --- 190,223 ---- switch (to) { case MULTICAST_ALL_R : ! reliable= true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum= 0; ! mask= null; break; case MULTICAST_PHS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PHS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PVS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPVS(cluster); break; default : ! mask= null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j= 0; j < maxclients.value; j++) { ! client= svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) *************** *** 228,237 **** if (mask != null) { ! leafnum = CM.CM_PointLeafnum(client.edict.s.origin); ! cluster = CM.CM_LeafCluster(leafnum); ! area2 = CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) --- 227,236 ---- if (mask != null) { ! leafnum= CM.CM_PointLeafnum(client.edict.s.origin); ! cluster= CM.CM_LeafCluster(leafnum); ! area2= CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) *************** *** 288,292 **** int i; int ent; ! float[] origin_v = {0,0,0}; boolean use_phs; --- 287,291 ---- int i; int ent; ! float[] origin_v= { 0, 0, 0 }; boolean use_phs; *************** *** 303,321 **** Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! //ent = NUM_FOR_EDICT(entity); ! //TODO: somehow risky (dont know if constant correct index) ! ent = entity.index; ! if ((channel & 8) != 0) // no PHS flag ! { ! use_phs = false; channel &= 7; } else ! use_phs = true; ! sendchan = (ent << 3) | (channel & 7); ! flags = 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; --- 302,318 ---- Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! ent= entity.index; ! // no PHS flag ! if ((channel & 8) != 0) { ! use_phs= false; channel &= 7; } else ! use_phs= true; ! sendchan= (ent << 3) | (channel & 7); ! flags= 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; *************** *** 336,343 **** // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin = origin_v; if (entity.solid == SOLID_BSP) { ! for (i = 0; i < 3; i++) ! origin_v[i] = entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { --- 333,340 ---- // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin= origin_v; if (entity.solid == SOLID_BSP) { ! for (i= 0; i < 3; i++) ! origin_v[i]= entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { *************** *** 366,370 **** // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs = false; if ((channel & CHAN_RELIABLE) != 0) { --- 363,367 ---- // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs= false; if ((channel & CHAN_RELIABLE) != 0) { *************** *** 396,410 **** */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[] = new byte[MAX_MSGLEN]; ! sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow = true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient (client, msg); // copy the accumulated multicast datagram --- 393,407 ---- */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[]= new byte[MAX_MSGLEN]; ! sizebuf_t msg= new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow= true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient(client, msg); // copy the accumulated multicast datagram *************** *** 427,431 **** // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES] = msg.cursize; return true; --- 424,428 ---- // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES]= msg.cursize; return true; *************** *** 445,449 **** Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile = null; } SV_ENTS.SV_Nextserver(); --- 442,446 ---- Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile= null; } SV_ENTS.SV_Nextserver(); *************** *** 466,472 **** return false; ! total = 0; ! for (i = 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } --- 463,469 ---- return false; ! total= 0; ! for (i= 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } *************** *** 474,478 **** if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES] = 0; return true; } --- 471,475 ---- if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES]= 0; return true; } *************** *** 490,507 **** client_t c; int msglen; ! byte msgbuf[] = new byte[MAX_MSGLEN]; int r; ! msglen = 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen = 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen = EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { --- 487,504 ---- client_t c; int msglen; ! byte msgbuf[]= new byte[MAX_MSGLEN]; int r; ! msglen= 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen= 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen= EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { *************** *** 519,525 **** //r = fread (msgbuf, msglen, 1, sv.demofile); ! r = 0; try { ! r = sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { --- 516,522 ---- //r = fread (msgbuf, msglen, 1, sv.demofile); ! r= 0; try { ! r= sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { *************** *** 534,539 **** // send a message to each connected client ! for (i = 0; i < maxclients.value; i++) { ! c = svs.clients[i]; if (c.state == 0) --- 531,536 ---- // send a message to each connected client ! for (i= 0; i < maxclients.value; i++) { ! c= svs.clients[i]; if (c.state == 0) Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_INIT.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV_INIT.java 22 Aug 2004 14:25:13 -0000 1.7 *************** *** 34,39 **** import java.io.RandomAccessFile; ! public class SV_INIT extends Globals ! { public static server_static_t svs= new server_static_t(); // persistant server info --- 34,38 ---- import java.io.RandomAccessFile; ! public class SV_INIT extends Globals { public static server_static_t svs= new server_static_t(); // persistant server info *************** *** 46,51 **** ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) ! { int i; --- 45,49 ---- ================ */ ! public static int SV_FindIndex(String name, int start, int max, boolean create) { int i; *************** *** 66,71 **** sv.configstrings[start + i]= name; ! if (sv.state != ss_loading) ! { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); --- 64,68 ---- sv.configstrings[start + i]= name; ! if (sv.state != ss_loading) { // send the update to everyone SZ.Clear(sv.multicast); MSG.WriteChar(sv.multicast, svc_configstring); *************** *** 78,93 **** } ! public static int SV_ModelIndex(String name) ! { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) ! { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) ! { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } --- 75,87 ---- } ! public static int SV_ModelIndex(String name) { return SV_FindIndex(name, CS_MODELS, MAX_MODELS, true); } ! public static int SV_SoundIndex(String name) { return SV_FindIndex(name, CS_SOUNDS, MAX_SOUNDS, true); } ! public static int SV_ImageIndex(String name) { return SV_FindIndex(name, CS_IMAGES, MAX_IMAGES, true); } *************** *** 102,112 **** ================ */ ! public static void SV_CreateBaseline() ! { edict_t svent; int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) ! { //svent = EDICT_NUM(entnum); svent= SV_GAME.ge.edicts[entnum]; --- 96,104 ---- ================ */ ! public static void SV_CreateBaseline() { edict_t svent; int entnum; ! for (entnum= 1; entnum < SV_GAME.ge.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); svent= SV_GAME.ge.edicts[entnum]; *************** *** 132,140 **** ================= */ ! public static void SV_CheckForSavegame() ! { ! //char name[MAX_OSPATH]; String name; - //FILE *f; RandomAccessFile f; --- 124,130 ---- ================= */ ! public static void SV_CheckForSavegame() { ! String name; RandomAccessFile f; *************** *** 148,167 **** name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try ! { f= new RandomAccessFile(name, "r"); } ! catch (Exception e) ! { ! return; // no savegame } ! try ! { f.close(); } ! catch (IOException e1) ! { e1.printStackTrace(); } --- 138,153 ---- name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; ! try { f= new RandomAccessFile(name, "r"); } ! catch (Exception e) { ! return; } ! try { f.close(); } ! catch (IOException e1) { e1.printStackTrace(); } *************** *** 172,177 **** SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) ! { // coming back to a level after being in a different // level, so run it for ten seconds --- 158,162 ---- SV_CCMDS.SV_ReadLevelFile(); ! if (!sv.loadgame) { // coming back to a level after being in a different // level, so run it for ten seconds *************** *** 199,204 **** ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) ! { int i; int checksum= 0; --- 184,188 ---- ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) { int i; int checksum= 0; *************** *** 211,220 **** Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try ! { sv.demofile.close(); } ! catch (Exception e) ! { } --- 195,202 ---- Com.DPrintf("SpawnServer: " + server + "\n"); if (sv.demofile != null) ! try { sv.demofile.close(); } ! catch (Exception e) { } *************** *** 222,229 **** // restarted ! sv.state = ss_dead; ! ! Globals.server_state= sv.state; // wipe the entire per-level structure --- 204,210 ---- // restarted ! sv.state= ss_dead; + Globals.server_state= sv.state; // wipe the entire per-level structure *************** *** 238,248 **** sv.configstrings[CS_NAME]= server; ! if (Cvar.VariableValue("deathmatch") != 0) ! { sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } ! else ! { sv.configstrings[CS_AIRACCEL]= "0"; PMove.pm_airaccelerate= 0; --- 219,227 ---- sv.configstrings[CS_NAME]= server; ! if (Cvar.VariableValue("deathmatch") != 0) { sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } ! else { sv.configstrings[CS_AIRACCEL]= "0"; PMove.pm_airaccelerate= 0; *************** *** 254,259 **** // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { // needs to reconnect if (svs.clients[i].state > cs_connected) --- 233,237 ---- // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { // needs to reconnect if (svs.clients[i].state > cs_connected) *************** *** 269,278 **** int iw[]= { checksum }; ! if (serverstate != ss_game) ! { sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } ! else ! { sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); --- 247,254 ---- int iw[]= { checksum }; ! if (serverstate != ss_game) { sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } ! else { sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); *************** *** 286,291 **** SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) ! { sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references --- 262,266 ---- SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) { sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references *************** *** 300,304 **** // map initialization ! sv.state = ss_loading; Globals.server_state= sv.state; --- 275,279 ---- // map initialization ! sv.state= ss_loading; Globals.server_state= sv.state; *************** *** 311,315 **** // all precaches are complete ! sv.state = serverstate; Globals.server_state= sv.state; --- 286,290 ---- // all precaches are complete ! sv.state= serverstate; Globals.server_state= sv.state; *************** *** 333,338 **** ============== */ ! public static void SV_InitGame() ! { int i; edict_t ent; --- 308,312 ---- ============== */ ! public static void SV_InitGame() { int i; edict_t ent; *************** *** 340,350 **** String idmaster; ! if (svs.initialized) ! { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else ! { // make sure the client is down CL.Drop(); --- 314,322 ---- String idmaster; ! if (svs.initialized) { // cause any connected clients to reconnect SV_MAIN.SV_Shutdown("Server restarted\n", true); } ! else { // make sure the client is down CL.Drop(); *************** *** 357,362 **** svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) ! { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); --- 329,333 ---- svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 365,370 **** // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) ! { if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); --- 336,340 ---- // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) { if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 372,377 **** // init clients ! if (Cvar.VariableValue("deathmatch") != 0) ! { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); --- 342,346 ---- // init clients ! if (Cvar.VariableValue("deathmatch") != 0) { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 379,384 **** Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) ! { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); --- 348,352 ---- Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 414,419 **** SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) ! { ent= SV_GAME.ge.edicts[i + 1]; --- 382,386 ---- SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { ent= SV_GAME.ge.edicts[i + 1]; *************** *** 441,446 **** ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) ! { //char level[MAX_QPATH]; //char *ch; --- 408,412 ---- ====================== */ ! public static void SV_Map(boolean attractloop, String levelstring, boolean loadgame) { //char level[MAX_QPATH]; //char *ch; *************** *** 471,481 **** int c= level.indexOf('+'); ! if (c != -1) ! { Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level= level.substring(0, c); } ! else ! { Cvar.Set("nextserver", ""); } --- 437,445 ---- int c= level.indexOf('+'); ! if (c != -1) { Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level= level.substring(0, c); } ! else { Cvar.Set("nextserver", ""); } *************** *** 487,492 **** // if there is a $, use the remainder as a spawnpoint int pos= level.indexOf('$'); ! if (pos != -1) ! { //* ch = 0; spawnpoint= level.substring(pos + 1); --- 451,455 ---- // if there is a $, use the remainder as a spawnpoint int pos= level.indexOf('$'); ! if (pos != -1) { //* ch = 0; spawnpoint= level.substring(pos + 1); *************** *** 503,526 **** l= level.length(); ! if (l > 4 && level.endsWith(".cin")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else ! { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); --- 466,485 ---- l= level.length(); ! if (l > 4 && level.endsWith(".cin")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_cinematic, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".dm2")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_demo, attractloop, loadgame); } ! else if (l > 4 && level.endsWith(".pcx")) { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); SV_SpawnServer(level, spawnpoint, ss_pic, attractloop, loadgame); } ! else { SCR.BeginLoadingPlaque(); // for local system SV_SEND.SV_BroadcastCommand("changing\n"); Index: SV_GAME.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_GAME.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SV_GAME.java 9 Jul 2004 06:50:49 -0000 1.5 --- SV_GAME.java 22 Aug 2004 14:25:12 -0000 1.6 *************** *** 33,38 **** public class SV_GAME extends SV_INIT { - // sv_game.c -- interface to the game dll - public static game_export_t ge; --- 33,36 ---- *************** *** 51,55 **** return; - //p = NUM_FOR_EDICT(ent); p = ent.index; if (p < 1 || p > SV_MAIN.maxclients.value) --- 49,52 ---- *************** *** 74,87 **** */ public static void PF_dprintf(String fmt) { - /* - char msg[1024]; - va_list argptr; - - va_start (argptr,fmt); - vsprintf (msg, fmt, argptr); - va_end (argptr); - - */ - Com.Printf(fmt); } --- 71,74 ---- *************** *** 95,105 **** */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! //char msg[1024]; ! //va_list argptr; int n = 0; if (ent != null) { - - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) --- 82,89 ---- */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! int n = 0; if (ent != null) { n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) *************** *** 107,114 **** } - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - if (ent != null) SV_SEND.SV_ClientPrintf(svs.clients[n - 1], level, fmt); --- 91,94 ---- *************** *** 125,142 **** */ public static void PF_centerprintf(edict_t ent, String fmt) { - //char msg[1024]; - //va_list argptr; int n; - //TODO: NUM_FOR_EDICT - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) return; // Com_Error (ERR_DROP, "centerprintf to a non-client"); - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - MSG.WriteByte(sv.multicast, svc_centerprint); MSG.WriteString(sv.multicast, fmt); --- 105,114 ---- *************** *** 175,179 **** i = SV_ModelIndex(name); - //ent.model = name; ent.s.modelindex = i; --- 147,150 ---- Index: client_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/client_t.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** client_t.java 7 Jul 2004 19:59:50 -0000 1.1 --- client_t.java 22 Aug 2004 14:25:13 -0000 1.2 *************** *** 44,48 **** int state; - //char userinfo[MAX_INFO_STRING]; // name, etc String userinfo = ""; --- 44,47 ---- *************** *** 86,90 **** netchan_t netchan = new netchan_t(); ! //TODO: this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } --- 85,89 ---- netchan_t netchan = new netchan_t(); ! //this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV.java 20 Aug 2004 21:29:57 -0000 1.6 --- SV.java 22 Aug 2004 14:25:12 -0000 1.7 *************** *** 850,854 **** } ! // regular thinking SV_RunThink(ent); } --- 850,854 ---- } ! // regular thinking SV_RunThink(ent); } |