{
lhnetaddress_t address;
lhnetsocket_t *s;
+ int port;
char addressstring2[1024];
- if (LHNETADDRESS_FromString(&address, addressstring, defaultport))
+
+ for (port = defaultport; port <= defaultport + 100; port++)
{
- if ((s = LHNET_OpenSocket_Connectionless(&address)))
+ if (LHNETADDRESS_FromString(&address, addressstring, port))
{
- sv_sockets[sv_numsockets++] = s;
- LHNETADDRESS_ToString(LHNET_AddressFromSocket(s), addressstring2, sizeof(addressstring2), true);
- Con_Printf("Server listening on address %s\n", addressstring2);
+ if ((s = LHNET_OpenSocket_Connectionless(&address)))
+ {
+ sv_sockets[sv_numsockets++] = s;
+ LHNETADDRESS_ToString(LHNET_AddressFromSocket(s), addressstring2, sizeof(addressstring2), true);
+ Con_Printf("Server listening on address %s\n", addressstring2);
+ }
+ else
+ {
+ LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
+ Con_Printf("Server failed to open socket on address %s\n", addressstring2);
+ }
}
- else
+ else
{
- LHNETADDRESS_ToString(&address, addressstring2, sizeof(addressstring2), true);
- Con_Printf("Server failed to open socket on address %s\n", addressstring2);
+ Con_Printf("Server unable to parse address %s\n", addressstring);
+ // if it cant parse one address, it wont be able to parse another for sure
+ break;
}
}
- else
- Con_Printf("Server unable to parse address %s\n", addressstring);
}
void NetConn_OpenServerPorts(int opennetports)
int edict_size; // in bytes
int edictareasize; // LordHavoc: in bytes (for bound checking)
+ int *statement_linenums; // NULL if not available
+
union {
float *generic;
globalvars_t *server;
memset(prog,0,sizeof(prvm_prog_t));
}
+/*
+===============
+PRVM_LoadLNO
+===============
+*/
+void PRVM_LoadLNO( const char *progname ) {
+ qbyte *lno;
+ unsigned long *header;
+ char filename[512];
+
+ FS_StripExtension( progname, filename, sizeof( filename ) );
+ strlcat( filename, ".lno", sizeof( filename ) );
+
+ lno = FS_LoadFile( filename, tempmempool, false );
+ if( !lno ) {
+ return;
+ }
+
+/*
+<Spike> SafeWrite (h, &lnotype, sizeof(int));
+<Spike> SafeWrite (h, &version, sizeof(int));
+<Spike> SafeWrite (h, &numglobaldefs, sizeof(int));
+<Spike> SafeWrite (h, &numpr_globals, sizeof(int));
+<Spike> SafeWrite (h, &numfielddefs, sizeof(int));
+<Spike> SafeWrite (h, &numstatements, sizeof(int));
+<Spike> SafeWrite (h, statement_linenums, numstatements*sizeof(int));
+*/
+ if( (unsigned) fs_filesize < (6 + prog->progs->numstatements) * sizeof( long ) ) {
+ return;
+ }
+
+ header = (unsigned long *) lno;
+ if( header[ 0 ] == *(unsigned long *) "LNOF" &&
+ LittleLong( header[ 1 ] ) == 1 &&
+ LittleLong( header[ 2 ] ) == prog->progs->numglobaldefs &&
+ LittleLong( header[ 3 ] ) == prog->progs->numglobals &&
+ LittleLong( header[ 4 ] ) == prog->progs->numfielddefs &&
+ LittleLong( header[ 5 ] ) == prog->progs->numstatements )
+ {
+ prog->statement_linenums = Mem_Alloc(prog->progs_mempool, prog->progs->numstatements * sizeof( long ) );
+ memcpy( prog->statement_linenums, (long *) lno + 6, prog->progs->numstatements * sizeof( long ) );
+ }
+ Mem_Free( lno );
+}
+
/*
===============
PRVM_LoadProgs
}
}
+ PRVM_LoadLNO( filename );
+
PRVM_Init_Exec();
prog->loaded = TRUE;
cvar_t sv_wallfriction = {CVAR_NOTIFY, "sv_wallfriction", "1"};
cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0"};
cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0"};
+cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1"};
#define MOVE_EPSILON 0.01
Cvar_RegisterVariable(&sv_wallfriction);
Cvar_RegisterVariable(&sv_newflymove);
Cvar_RegisterVariable(&sv_freezenonclients);
+
+ Cvar_RegisterVariable(&sv_playerphysicsqc);
}
/*
// make sure the velocity is sane (not a NaN)
SV_CheckVelocity(ent);
// LordHavoc: QuakeC replacement for SV_ClientThink (player movement)
- if (SV_PlayerPhysicsQC)
+ if (SV_PlayerPhysicsQC && sv_playerphysicsqc.integer)
{
prog->globals.server->time = sv.time;
prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
- todo: difficulty ratings are: 0 = trivial, 1 = easy, 2 = easy-moderate, 3 = moderate, 4 = moderate-hard, 5 = hard, 6 = hard++, 7 = nightmare, d = done, -d = done but have not notified the people who asked for it, f = failed, -f = failed but have not notified the people who asked for it
+-d feature darkplaces server: add sv_playerphysicsqc cvar to allow engine to ignore SV_PlayerPhysics function, this would also have to change the reported extensions (Gleeb)
-d (Baalz) bug darkplaces input: figure out what's wrong with ctrl key in Linux, hitting character keys tends to do nothing, and holding a character key and then hitting ctrl tends to leave the character key stuck on, this sounds like a window manager issue, but somehow quake3 works around it (Baalz)
-d (Gilgamesh) feature darkplaces protocol: add back colormod extension (FrikaC, Uffe, Gilgamesh, Wazat)
-d (Kinn, romi) bug darkplaces WGL client: default WGL input back to GDI, the DirectInput driver is malfunctioning, losing key release messages, stuttering mouse input, and lacks mouse wheel support (Wazat, Kinn)
0 feature darkplaces server: add cl_prydoncursor_centeredcursor cvar and PRYDON_CLIENTCURSOR_CENTEREDCURSOR extension (Wazat)
0 feature darkplaces server: add filename/line number reporting to progs stack and opcode printouts (Spike)
0 feature darkplaces server: add sv_antilag cvar which would upgrade the aim() builtin to aim at the creature the player's prydon cursor trace was hitting (Spike)
-0 feature darkplaces server: add sv_playerphysicsqc cvar to allow engine to ignore SV_PlayerPhysics function, this would also have to change the reported extensions (Gleeb)
-0 feature darkplaces server: automatically choose a server port if the bind fails, just keep incrementing the port until it finds an available port (tell Spike)
0 feature darkplaces server: make fopen builtin have the ability to disable fopen builtin access to read /, read data/, write data/, or disable fopen builtin entirely
0 feature darkplaces server: make noclip/fly cheats use MOVETYPE_CHEATNOCLIP/MOVETYPE_CHEATFLY which would have the nicer movement interface (Spikester)
0 feature darkplaces sound: Lordhavoc needs to talk to fuh about snd_macos.c (fuh)
7 feature darkplaces renderer: mirrors (Sajt)
7 feature darkplaces renderer: shadow volume clipping (romi)
d bug darkplaces Mac filesystem: on Mac dlopen is not finding dylib files alongside the executable, do a more thorough search (Zenex)
+d feature darkplaces server: automatically choose a server port if the bind fails, just keep incrementing the port until it finds an available port (tell Spike)
d bug darkplaces Mac filesystem: on Mac init the basedir to argv[0] truncated to not include the *.app/ part of the path onward (Zenex)
d bug darkplaces SDL input: changing video mode causes it to ignore all character events from then on
d bug darkplaces X11 keyboard: make sure that the XLookupString code is not little endian specific (Elric, jitspoe)