[Bug 3999] New: Fix for net_qport always set to 0.
bugzilla-daemon at icculus.org
bugzilla-daemon at icculus.org
Sun Mar 1 20:48:28 EST 2009
http://bugzilla.icculus.org/show_bug.cgi?id=3999
Summary: Fix for net_qport always set to 0.
Product: Quake 3
Version: SVN HEAD
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: Misc
AssignedTo: zakk at icculus.org
ReportedBy: monson.kyle at gmail.com
QAContact: quake3-bugzilla at icculus.org
The randomization of net_qport is broken. This will fix it.
*** current ioquake3/code/qcommon/common.c Sat Jan 3 13:06:28 2009
--- code/code/qcommon/common.c Sun Mar 1 16:45:40 2009
*************** Com_Init
*** 2509,2514 ****
--- 2509,2515 ----
*/
void Com_Init( char *commandLine ) {
char *s;
+ int qport;
Com_Printf( "%s %s %s\n", Q3_VERSION, PLATFORM_STRING, __DATE__ );
*************** void Com_Init( char *commandLine ) {
*** 2627,2633 ****
com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO );
Sys_Init();
! Netchan_Init( Com_Milliseconds() & 0xffff ); // pick a port value
that should be nice and random
VM_Init();
SV_Init();
--- 2628,2639 ----
com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO );
Sys_Init();
!
! // Pick a port value that should be nice and random.
! // As machines get faster continuing to use Com_Milliseconds
! // results in a smaller and smaller range of qport values.
! Com_RandomBytes( (byte*)&qport, sizeof(int) );
! Netchan_Init( qport & 0xffff );
VM_Init();
SV_Init();
*** current ioquake3/code/sys/sys_main.c Sat Jan 3 13:06:46 2009
--- code/code/sys/sys_main.c Sun Mar 1 16:17:31 2009
*************** int main( int argc, char **argv )
*** 534,539 ****
--- 534,544 ----
Sys_PlatformInit( );
+ // Set the initial time base.
+ // If not called here com_frameTime will always be zero.
+ // com_frameTime should be pseudo random.
+ Sys_Milliseconds();
+
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );
--
Configure bugmail: http://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the quake3-bugzilla
mailing list