mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 19:45:05 +08:00
Compare commits
8 Commits
continuous
...
continuous
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0242e8ac1c | ||
|
|
61ecbbcd6f | ||
|
|
bbc6043a91 | ||
|
|
11e1c38647 | ||
|
|
1d9a63db8b | ||
|
|
aa105a9bd6 | ||
|
|
067a95cd0d | ||
|
|
93c9f5286c |
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -27,13 +27,13 @@
|
|||||||
url = https://github.com/FWGS/MultiEmulator
|
url = https://github.com/FWGS/MultiEmulator
|
||||||
[submodule "3rdparty/libogg/libogg"]
|
[submodule "3rdparty/libogg/libogg"]
|
||||||
path = 3rdparty/libogg/libogg
|
path = 3rdparty/libogg/libogg
|
||||||
url = https://github.com/xiph/ogg.git
|
url = https://gitlab.xiph.org/xiph/ogg.git
|
||||||
[submodule "3rdparty/vorbis/vorbis-src"]
|
[submodule "3rdparty/vorbis/vorbis-src"]
|
||||||
path = 3rdparty/vorbis/vorbis-src
|
path = 3rdparty/vorbis/vorbis-src
|
||||||
url = https://github.com/xiph/vorbis.git
|
url = https://gitlab.xiph.org/xiph/vorbis.git
|
||||||
[submodule "3rdparty/opusfile/opusfile"]
|
[submodule "3rdparty/opusfile/opusfile"]
|
||||||
path = 3rdparty/opusfile/opusfile
|
path = 3rdparty/opusfile/opusfile
|
||||||
url = https://github.com/xiph/opusfile.git
|
url = https://gitlab.xiph.org/xiph/opusfile.git
|
||||||
[submodule "3rdparty/libbacktrace/libbacktrace"]
|
[submodule "3rdparty/libbacktrace/libbacktrace"]
|
||||||
path = 3rdparty/libbacktrace/libbacktrace
|
path = 3rdparty/libbacktrace/libbacktrace
|
||||||
url = https://github.com/ianlancetaylor/libbacktrace
|
url = https://github.com/ianlancetaylor/libbacktrace
|
||||||
|
|||||||
2
3rdparty/mainui
vendored
2
3rdparty/mainui
vendored
Submodule 3rdparty/mainui updated: 479010ac17...1b6929d663
@@ -874,7 +874,7 @@ To run this mods on specific platforms you may be need to compile libraries from
|
|||||||
6. [They Hunger: Route666 Demo](https://yadi.sk/d/XKWCseAPohkG6) by *MadMapper*
|
6. [They Hunger: Route666 Demo](https://yadi.sk/d/XKWCseAPohkG6) by *MadMapper*
|
||||||
|
|
||||||
## List of supported mods from mobile_hacks branch of HLSDK Portable by FWGS
|
## List of supported mods from mobile_hacks branch of HLSDK Portable by FWGS
|
||||||
Currently, fresh Xash3D FWGS builds for Android, PS Vita and Nintendo Switch uses libraries from this branch, so you can play mods below out-of-the-box.
|
Currently, fresh Xash3D FWGS builds uses libraries from this branch, so you can play mods below out-of-the-box.
|
||||||
|
|
||||||
1. **[Afraid of Monsters](https://www.moddb.com/mods/afraid-of-monsters/downloads/afraid-of-monsters-v1)**
|
1. **[Afraid of Monsters](https://www.moddb.com/mods/afraid-of-monsters/downloads/afraid-of-monsters-v1)**
|
||||||
2. **[Big Lolly](https://www.moddb.com/mods/big-lolly)**
|
2. **[Big Lolly](https://www.moddb.com/mods/big-lolly)**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.22)
|
cmake_minimum_required(VERSION 3.6)
|
||||||
|
|
||||||
# Only used to build Android project
|
# Only used to build Android project
|
||||||
|
|
||||||
|
|||||||
@@ -86,4 +86,8 @@ GNU General Public License for more details.
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
#if defined XASH_SDL && !defined REF_DLL
|
||||||
|
#include <SDL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // PORT_H
|
#endif // PORT_H
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if XASH_SDL
|
|
||||||
#include <SDL.h> // SDL_GetWindowPosition
|
|
||||||
#endif // XASH_SDL
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ CVAR_DEFINE_AUTO( hud_scale_minimal_width, "640", FCVAR_ARCHIVE|FCVAR_LATCH, "if
|
|||||||
CVAR_DEFINE_AUTO( cl_solid_players, "1", 0, "Make all players not solid (can't traceline them)" );
|
CVAR_DEFINE_AUTO( cl_solid_players, "1", 0, "Make all players not solid (can't traceline them)" );
|
||||||
CVAR_DEFINE_AUTO( cl_updaterate, "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" );
|
CVAR_DEFINE_AUTO( cl_updaterate, "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" );
|
||||||
CVAR_DEFINE_AUTO( cl_showevents, "0", FCVAR_ARCHIVE, "show events playback" );
|
CVAR_DEFINE_AUTO( cl_showevents, "0", FCVAR_ARCHIVE, "show events playback" );
|
||||||
CVAR_DEFINE_AUTO( cl_cmdrate, "30", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" );
|
CVAR_DEFINE_AUTO( cl_cmdrate, "60", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" );
|
||||||
CVAR_DEFINE( cl_interp, "ex_interp", "0.1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "Interpolate object positions starting this many seconds in past" );
|
CVAR_DEFINE( cl_interp, "ex_interp", "0.1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "Interpolate object positions starting this many seconds in past" );
|
||||||
CVAR_DEFINE_AUTO( cl_nointerp, "0", 0, "disable interpolation of entities and players" );
|
CVAR_DEFINE_AUTO( cl_nointerp, "0", 0, "disable interpolation of entities and players" );
|
||||||
static CVAR_DEFINE_AUTO( cl_dlmax, "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "max allowed outcoming fragment size" );
|
static CVAR_DEFINE_AUTO( cl_dlmax, "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "max allowed outcoming fragment size" );
|
||||||
@@ -94,7 +94,7 @@ static CVAR_DEFINE_AUTO( name, username, FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_PRIN
|
|||||||
static CVAR_DEFINE_AUTO( model, "", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player model ('player' is a singleplayer model)" );
|
static CVAR_DEFINE_AUTO( model, "", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player model ('player' is a singleplayer model)" );
|
||||||
static CVAR_DEFINE_AUTO( topcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player top color" );
|
static CVAR_DEFINE_AUTO( topcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player top color" );
|
||||||
static CVAR_DEFINE_AUTO( bottomcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player bottom color" );
|
static CVAR_DEFINE_AUTO( bottomcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player bottom color" );
|
||||||
CVAR_DEFINE_AUTO( rate, "25000", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" );
|
CVAR_DEFINE_AUTO( rate, "3500", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" );
|
||||||
|
|
||||||
static CVAR_DEFINE_AUTO( cl_ticket_generator, "revemu2013", FCVAR_ARCHIVE, "you wouldn't steal a car" );
|
static CVAR_DEFINE_AUTO( cl_ticket_generator, "revemu2013", FCVAR_ARCHIVE, "you wouldn't steal a car" );
|
||||||
|
|
||||||
@@ -1183,11 +1183,7 @@ Returns bandwidth test fragment size
|
|||||||
*/
|
*/
|
||||||
static int CL_GetTestFragmentSize( void )
|
static int CL_GetTestFragmentSize( void )
|
||||||
{
|
{
|
||||||
// const int fragmentSizes[CL_TEST_RETRIES] = { 64000, 32000, 10666, 5200, 1400 };
|
const int fragmentSizes[CL_TEST_RETRIES] = { 64000, 32000, 10666, 5200, 1400 };
|
||||||
|
|
||||||
// it turns out, even if we pass the bandwidth test, it doesn't mean we can use such large fragments
|
|
||||||
// as a temporary solution, use smaller fragment sizes
|
|
||||||
const int fragmentSizes[CL_TEST_RETRIES] = { 1400, 1200, 1000, 800, 508 };
|
|
||||||
if( cls.connect_retry >= 0 && cls.connect_retry < CL_TEST_RETRIES )
|
if( cls.connect_retry >= 0 && cls.connect_retry < CL_TEST_RETRIES )
|
||||||
return bound( FRAGMENT_MIN_SIZE, fragmentSizes[cls.connect_retry], FRAGMENT_MAX_SIZE );
|
return bound( FRAGMENT_MIN_SIZE, fragmentSizes[cls.connect_retry], FRAGMENT_MAX_SIZE );
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2031,7 +2031,7 @@ void Con_DrawVersion( void )
|
|||||||
int start, height = refState.height;
|
int start, height = refState.height;
|
||||||
string curbuild;
|
string curbuild;
|
||||||
|
|
||||||
if( !scr_drawversion.value )
|
if( !scr_drawversion.value || CL_IsDevOverviewMode() == 2 || net_graph.value )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( cls.key_dest == key_menu )
|
if( cls.key_dest == key_menu )
|
||||||
@@ -2043,9 +2043,6 @@ void Con_DrawVersion( void )
|
|||||||
{
|
{
|
||||||
qboolean draw_version;
|
qboolean draw_version;
|
||||||
|
|
||||||
if( CL_IsDevOverviewMode() == 2 || net_graph.value )
|
|
||||||
return;
|
|
||||||
|
|
||||||
draw_version = cls.scrshot_action == scrshot_normal
|
draw_version = cls.scrshot_action == scrshot_normal
|
||||||
|| cls.scrshot_action == scrshot_snapshot
|
|| cls.scrshot_action == scrshot_snapshot
|
||||||
|| host.force_draw_version_time > host.realtime;
|
|| host.force_draw_version_time > host.realtime;
|
||||||
|
|||||||
@@ -938,7 +938,7 @@ static void Touch_AddButton_f( void )
|
|||||||
// to let imagelib choose better format
|
// to let imagelib choose better format
|
||||||
//
|
//
|
||||||
// Remove this when old engine migration would be done
|
// Remove this when old engine migration would be done
|
||||||
if( !Q_stricmp( COM_FileExtension( texture ), "tga" ))
|
if( Q_stricmp( COM_FileExtension( texture ), "tga" ))
|
||||||
COM_StripExtension( texture );
|
COM_StripExtension( texture );
|
||||||
|
|
||||||
if( Cmd_Argc( ) >= 8 )
|
if( Cmd_Argc( ) >= 8 )
|
||||||
@@ -1180,6 +1180,14 @@ void Touch_Init( void )
|
|||||||
Cvar_RegisterVariable( &touch_enable );
|
Cvar_RegisterVariable( &touch_enable );
|
||||||
Cvar_RegisterVariable( &touch_emulate );
|
Cvar_RegisterVariable( &touch_emulate );
|
||||||
|
|
||||||
|
// TODO: touch platform
|
||||||
|
#if SDL_VERSION_ATLEAST( 2, 0, 10 )
|
||||||
|
SDL_SetHint( SDL_HINT_MOUSE_TOUCH_EVENTS, "0" );
|
||||||
|
SDL_SetHint( SDL_HINT_TOUCH_MOUSE_EVENTS, "0" );
|
||||||
|
#elif defined( SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH )
|
||||||
|
SDL_SetHint( SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, "1" );
|
||||||
|
#endif
|
||||||
|
|
||||||
touch.initialized = true;
|
touch.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -205,10 +205,9 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IN_SetRelativeMouseMode( qboolean set )
|
static void IN_SetRelativeMouseMode( qboolean set, qboolean verbose )
|
||||||
{
|
{
|
||||||
static qboolean s_bRawInput;
|
static qboolean s_bRawInput;
|
||||||
qboolean verbose = m_grab_debug.value ? true : false;
|
|
||||||
|
|
||||||
if( set && !s_bRawInput )
|
if( set && !s_bRawInput )
|
||||||
{
|
{
|
||||||
@@ -232,10 +231,9 @@ void IN_SetRelativeMouseMode( qboolean set )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IN_SetMouseGrab( qboolean set )
|
static void IN_SetMouseGrab( qboolean set, qboolean verbose )
|
||||||
{
|
{
|
||||||
static qboolean s_bMouseGrab;
|
static qboolean s_bMouseGrab;
|
||||||
qboolean verbose = m_grab_debug.value ? true : false;
|
|
||||||
|
|
||||||
if( set && !s_bMouseGrab )
|
if( set && !s_bMouseGrab )
|
||||||
{
|
{
|
||||||
@@ -260,7 +258,7 @@ void IN_SetMouseGrab( qboolean set )
|
|||||||
|
|
||||||
static void IN_CheckMouseState( qboolean active )
|
static void IN_CheckMouseState( qboolean active )
|
||||||
{
|
{
|
||||||
qboolean use_raw_input;
|
qboolean use_raw_input, verbose;
|
||||||
|
|
||||||
#if XASH_WIN32
|
#if XASH_WIN32
|
||||||
use_raw_input = ( m_rawinput.value && clgame.client_dll_uses_sdl ) || clgame.dllFuncs.pfnLookEvent != NULL;
|
use_raw_input = ( m_rawinput.value && clgame.client_dll_uses_sdl ) || clgame.dllFuncs.pfnLookEvent != NULL;
|
||||||
@@ -268,18 +266,20 @@ static void IN_CheckMouseState( qboolean active )
|
|||||||
use_raw_input = true; // always use SDL code
|
use_raw_input = true; // always use SDL code
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
verbose = m_grab_debug.value ? true : false;
|
||||||
|
|
||||||
if( m_ignore.value )
|
if( m_ignore.value )
|
||||||
active = false;
|
active = false;
|
||||||
|
|
||||||
if( active && use_raw_input && !host.mouse_visible && cls.state == ca_active )
|
if( active && use_raw_input && !host.mouse_visible && cls.state == ca_active )
|
||||||
IN_SetRelativeMouseMode( true );
|
IN_SetRelativeMouseMode( true, verbose );
|
||||||
else
|
else
|
||||||
IN_SetRelativeMouseMode( false );
|
IN_SetRelativeMouseMode( false, verbose );
|
||||||
|
|
||||||
if( active && !host.mouse_visible && cls.state == ca_active )
|
if( active && !host.mouse_visible && cls.state == ca_active )
|
||||||
IN_SetMouseGrab( true );
|
IN_SetMouseGrab( true, verbose );
|
||||||
else
|
else
|
||||||
IN_SetMouseGrab( false );
|
IN_SetMouseGrab( false, verbose );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ uint IN_CollectInputDevices( void );
|
|||||||
void IN_LockInputDevices( qboolean lock );
|
void IN_LockInputDevices( qboolean lock );
|
||||||
void IN_EngineAppendMove( float frametime, usercmd_t *cmd, qboolean active );
|
void IN_EngineAppendMove( float frametime, usercmd_t *cmd, qboolean active );
|
||||||
|
|
||||||
void IN_SetRelativeMouseMode( qboolean set );
|
|
||||||
void IN_SetMouseGrab( qboolean set );
|
|
||||||
|
|
||||||
extern convar_t m_yaw;
|
extern convar_t m_yaw;
|
||||||
extern convar_t m_pitch;
|
extern convar_t m_pitch;
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if XASH_SDL
|
|
||||||
#include <SDL.h> // SDL_GetBasePath
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
|
|||||||
@@ -2027,7 +2027,6 @@ void NET_Init( void )
|
|||||||
Cvar_RegisterVariable( &net_fakelag );
|
Cvar_RegisterVariable( &net_fakelag );
|
||||||
Cvar_RegisterVariable( &net_fakeloss );
|
Cvar_RegisterVariable( &net_fakeloss );
|
||||||
Cvar_RegisterVariable( &net_resolve_debug );
|
Cvar_RegisterVariable( &net_resolve_debug );
|
||||||
Cvar_RegisterVariable( &net_clockwindow );
|
|
||||||
|
|
||||||
Q_snprintf( cmd, sizeof( cmd ), "%i", PORT_SERVER );
|
Q_snprintf( cmd, sizeof( cmd ), "%i", PORT_SERVER );
|
||||||
Cvar_FullSet( "hostport", cmd, FCVAR_READ_ONLY );
|
Cvar_FullSet( "hostport", cmd, FCVAR_READ_ONLY );
|
||||||
|
|||||||
@@ -142,10 +142,17 @@ static qboolean vsync;
|
|||||||
|
|
||||||
void GL_UpdateSwapInterval( void )
|
void GL_UpdateSwapInterval( void )
|
||||||
{
|
{
|
||||||
if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))
|
// disable VSync while level is loading
|
||||||
|
if( cls.state < ca_active )
|
||||||
{
|
{
|
||||||
ClearBits( gl_vsync.flags, FCVAR_CHANGED );
|
// setup vsync here
|
||||||
vsync = gl_vsync.value;
|
vsync = false;
|
||||||
|
SetBits( gl_vsync->flags, FCVAR_CHANGED );
|
||||||
|
}
|
||||||
|
else if( FBitSet( gl_vsync->flags, FCVAR_CHANGED ))
|
||||||
|
{
|
||||||
|
ClearBits( gl_vsync->flags, FCVAR_CHANGED );
|
||||||
|
vsync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,10 +161,17 @@ void* GL_GetProcAddress( const char *name ) // RenderAPI requirement
|
|||||||
|
|
||||||
void GL_UpdateSwapInterval( void )
|
void GL_UpdateSwapInterval( void )
|
||||||
{
|
{
|
||||||
if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))
|
// disable VSync while level is loading
|
||||||
|
if( cls.state < ca_active )
|
||||||
|
{
|
||||||
|
// setup fb vsync here
|
||||||
|
fb.vsync = false;
|
||||||
|
SetBits( gl_vsync.flags, FCVAR_CHANGED );
|
||||||
|
}
|
||||||
|
else if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))
|
||||||
{
|
{
|
||||||
ClearBits( gl_vsync.flags, FCVAR_CHANGED );
|
ClearBits( gl_vsync.flags, FCVAR_CHANGED );
|
||||||
fb.vsync = gl_vsync.value;
|
fb.vsync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ GNU General Public License for more details.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
*/
|
*/
|
||||||
double Platform_DoubleTime( void );
|
double Platform_DoubleTime( void );
|
||||||
void Platform_Sleep( int msec );
|
|
||||||
void Platform_ShellExecute( const char *path, const char *parms );
|
void Platform_ShellExecute( const char *path, const char *parms );
|
||||||
void Platform_MessageBox( const char *title, const char *message, qboolean parentMainWindow );
|
void Platform_MessageBox( const char *title, const char *message, qboolean parentMainWindow );
|
||||||
void Platform_SetStatus( const char *status );
|
void Platform_SetStatus( const char *status );
|
||||||
@@ -169,6 +168,19 @@ static inline void Platform_SetupSigtermHandling( void )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void Platform_Sleep( int msec )
|
||||||
|
{
|
||||||
|
#if XASH_TIMER == TIMER_SDL
|
||||||
|
SDL_Delay( msec );
|
||||||
|
#elif XASH_TIMER == TIMER_POSIX
|
||||||
|
usleep( msec * 1000 );
|
||||||
|
#elif XASH_TIMER == TIMER_WIN32
|
||||||
|
Sleep( msec );
|
||||||
|
#else
|
||||||
|
// stub
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static inline qboolean Platform_NanoSleep( int nsec )
|
static inline qboolean Platform_NanoSleep( int nsec )
|
||||||
{
|
{
|
||||||
// SDL2 doesn't have nanosleep, so use low-level functions here
|
// SDL2 doesn't have nanosleep, so use low-level functions here
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ GNU General Public License for more details.
|
|||||||
// have backtrace() and backtrace_symbols() calls, which replace for us
|
// have backtrace() and backtrace_symbols() calls, which replace for us
|
||||||
// platform-specific code
|
// platform-specific code
|
||||||
#if HAVE_EXECINFO
|
#if HAVE_EXECINFO
|
||||||
|
#include "common.h"
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "common.h"
|
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
void Sys_Crash( int signal, siginfo_t *si, void *context )
|
void Sys_Crash( int signal, siginfo_t *si, void *context )
|
||||||
{
|
{
|
||||||
@@ -71,8 +70,8 @@ void Sys_Crash( int signal, siginfo_t *si, void *context )
|
|||||||
|
|
||||||
// put MessageBox as Sys_Error
|
// put MessageBox as Sys_Error
|
||||||
Msg( "%s\n", message );
|
Msg( "%s\n", message );
|
||||||
#if !XASH_DEDICATED
|
#ifdef XASH_SDL
|
||||||
IN_SetMouseGrab( false );
|
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||||
#endif
|
#endif
|
||||||
host.crashed = true;
|
host.crashed = true;
|
||||||
Platform_MessageBox( "Xash Error", message, false );
|
Platform_MessageBox( "Xash Error", message, false );
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ GNU General Public License for more details.
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "backtrace.h"
|
#include "backtrace.h"
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
static struct backtrace_state *g_bt_state;
|
static struct backtrace_state *g_bt_state;
|
||||||
static qboolean enable_libbacktrace;
|
static qboolean enable_libbacktrace;
|
||||||
@@ -111,10 +111,8 @@ static int Sys_BacktracePrintFull( void *data, uintptr_t pc, const char *filenam
|
|||||||
module_name = dlinfo.dli_fname;
|
module_name = dlinfo.dli_fname;
|
||||||
else module_name = NULL;
|
else module_name = NULL;
|
||||||
|
|
||||||
if( filename && lineno >= 0 && function )
|
if( filename && lineno && function )
|
||||||
{
|
{
|
||||||
filename = COM_FileWithoutPath( filename );
|
|
||||||
|
|
||||||
if( module_name )
|
if( module_name )
|
||||||
Sys_AppendPrint( pd, "%2d: %s (%s:%d) (%s)\n", pd->idx++, function, filename, lineno, module_name );
|
Sys_AppendPrint( pd, "%2d: %s (%s:%d) (%s)\n", pd->idx++, function, filename, lineno, module_name );
|
||||||
else
|
else
|
||||||
@@ -164,8 +162,8 @@ void Sys_CrashLibbacktrace( int signal, siginfo_t *si, void *context )
|
|||||||
|
|
||||||
// put MessageBox as Sys_Error
|
// put MessageBox as Sys_Error
|
||||||
Msg( "%s\n", message );
|
Msg( "%s\n", message );
|
||||||
#if !XASH_DEDICATED
|
#ifdef XASH_SDL
|
||||||
IN_SetMouseGrab( false );
|
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||||
#endif
|
#endif
|
||||||
host.crashed = true;
|
host.crashed = true;
|
||||||
Platform_MessageBox( "Xash Error", message, false );
|
Platform_MessageBox( "Xash Error", message, false );
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ GNU General Public License for more details.
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
void Sys_Crash( int signal, siginfo_t *si, void *context );
|
void Sys_Crash( int signal, siginfo_t *si, void *context );
|
||||||
void Sys_CrashLibbacktrace( int signal, siginfo_t *si, void *context );
|
void Sys_CrashLibbacktrace( int signal, siginfo_t *si, void *context );
|
||||||
@@ -193,8 +192,8 @@ void Sys_Crash( int signal, siginfo_t *si, void *context )
|
|||||||
|
|
||||||
// put MessageBox as Sys_Error
|
// put MessageBox as Sys_Error
|
||||||
Msg( "%s\n", message );
|
Msg( "%s\n", message );
|
||||||
#if !XASH_DEDICATED
|
#ifdef XASH_SDL
|
||||||
IN_SetMouseGrab( false );
|
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||||
#endif
|
#endif
|
||||||
host.crashed = true;
|
host.crashed = true;
|
||||||
Platform_MessageBox( "Xash Error", message, false );
|
Platform_MessageBox( "Xash Error", message, false );
|
||||||
|
|||||||
@@ -174,10 +174,5 @@ double Platform_DoubleTime( void )
|
|||||||
#endif
|
#endif
|
||||||
return (double) ts.tv_sec + (double) ts.tv_nsec/1000000000.0;
|
return (double) ts.tv_sec + (double) ts.tv_nsec/1000000000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform_Sleep( int msec )
|
|
||||||
{
|
|
||||||
usleep( msec * 1000 );
|
|
||||||
}
|
|
||||||
#endif // XASH_TIMER == TIMER_POSIX
|
#endif // XASH_TIMER == TIMER_POSIX
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,6 @@ double Platform_DoubleTime( void )
|
|||||||
CurrentTime = SDL_GetPerformanceCounter();
|
CurrentTime = SDL_GetPerformanceCounter();
|
||||||
return (double)( CurrentTime - g_ClockStart ) / (double)( g_PerformanceFrequency );
|
return (double)( CurrentTime - g_ClockStart ) / (double)( g_PerformanceFrequency );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform_Sleep( int msec )
|
|
||||||
{
|
|
||||||
SDL_Delay( msec );
|
|
||||||
}
|
|
||||||
#endif // XASH_TIMER == TIMER_SDL
|
#endif // XASH_TIMER == TIMER_SDL
|
||||||
|
|
||||||
#if XASH_MESSAGEBOX == MSGBOX_SDL
|
#if XASH_MESSAGEBOX == MSGBOX_SDL
|
||||||
@@ -114,11 +109,8 @@ void SDLash_Init( const char *basedir )
|
|||||||
host.type = HOST_DEDICATED;
|
host.type = HOST_DEDICATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SDL_MAJOR_VERSION >= 2
|
#if XASH_SDL == 2
|
||||||
SDL_SetHint( SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0" );
|
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
|
||||||
SDL_SetHint( SDL_HINT_MOUSE_TOUCH_EVENTS, "0" );
|
|
||||||
SDL_SetHint( SDL_HINT_TOUCH_MOUSE_EVENTS, "0" );
|
|
||||||
|
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
#endif // XASH_SDL == 2
|
#endif // XASH_SDL == 2
|
||||||
|
|
||||||
|
|||||||
@@ -488,7 +488,13 @@ GL_UpdateSwapInterval
|
|||||||
void GL_UpdateSwapInterval( void )
|
void GL_UpdateSwapInterval( void )
|
||||||
{
|
{
|
||||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||||
if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))
|
// disable VSync while level is loading
|
||||||
|
if( cls.state < ca_active )
|
||||||
|
{
|
||||||
|
SDL_GL_SetSwapInterval( 0 );
|
||||||
|
SetBits( gl_vsync.flags, FCVAR_CHANGED );
|
||||||
|
}
|
||||||
|
else if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))
|
||||||
{
|
{
|
||||||
ClearBits( gl_vsync.flags, FCVAR_CHANGED );
|
ClearBits( gl_vsync.flags, FCVAR_CHANGED );
|
||||||
|
|
||||||
|
|||||||
@@ -14,15 +14,11 @@ GNU General Public License for more details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
#define DBGHELP 1 // we always enable dbghelp.dll on Windows targets
|
#define DBGHELP 1 // we always enable dbghelp.dll on Windows targets
|
||||||
|
|
||||||
#if XASH_SDL
|
|
||||||
#include <SDL.h>
|
|
||||||
#endif // XASH_SDL
|
|
||||||
|
|
||||||
#if DBGHELP
|
#if DBGHELP
|
||||||
|
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
@@ -272,8 +268,8 @@ static long _stdcall Sys_Crash( PEXCEPTION_POINTERS pInfo )
|
|||||||
// check to avoid recursive call
|
// check to avoid recursive call
|
||||||
host.crashed = true;
|
host.crashed = true;
|
||||||
|
|
||||||
#if !XASH_DEDICATED
|
#ifdef XASH_SDL
|
||||||
IN_SetMouseGrab( false );
|
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||||
#endif // XASH_SDL
|
#endif // XASH_SDL
|
||||||
|
|
||||||
#if DBGHELP
|
#if DBGHELP
|
||||||
|
|||||||
@@ -36,11 +36,6 @@ double Platform_DoubleTime( void )
|
|||||||
|
|
||||||
return (double)( CurrentTime.QuadPart - g_ClockStart.QuadPart ) / (double)( g_PerformanceFrequency.QuadPart );
|
return (double)( CurrentTime.QuadPart - g_ClockStart.QuadPart ) / (double)( g_PerformanceFrequency.QuadPart );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform_Sleep( int msec )
|
|
||||||
{
|
|
||||||
Sleep( msec );
|
|
||||||
}
|
|
||||||
#endif // XASH_TIMER == TIMER_WIN32
|
#endif // XASH_TIMER == TIMER_WIN32
|
||||||
|
|
||||||
void Win32_Init( qboolean con_showalways )
|
void Win32_Init( qboolean con_showalways )
|
||||||
|
|||||||
@@ -205,62 +205,69 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct sv_client_s
|
typedef struct sv_client_s
|
||||||
{
|
{
|
||||||
cl_state_t state;
|
cl_state_t state;
|
||||||
cl_upload_t upstate; // uploading state
|
cl_upload_t upstate; // uploading state
|
||||||
char name[32]; // extracted from userinfo, color string allowed
|
char name[32]; // extracted from userinfo, color string allowed
|
||||||
uint flags; // client flags, some info
|
uint flags; // client flags, some info
|
||||||
uint extensions; // protocol extensions
|
CRC32_t crcValue;
|
||||||
|
|
||||||
char hashedcdkey[34]; // MD5 hash is 32 hex #'s, plus trailing 0
|
char userinfo[MAX_INFO_STRING]; // name, etc (received from client)
|
||||||
char userinfo[MAX_INFO_STRING]; // name, etc (received from client)
|
char physinfo[MAX_INFO_STRING]; // set on server (transmit to client)
|
||||||
char physinfo[MAX_INFO_STRING]; // set on server (transmit to client)
|
|
||||||
char useragent[MAX_INFO_STRING];
|
|
||||||
|
|
||||||
byte ignorecmdtime_warned; // did we warn our server operator in the log for this batch of commands?
|
netchan_t netchan;
|
||||||
byte m_bLoopback; // does this client want to hear his own voice?
|
int chokecount; // number of messages rate supressed
|
||||||
uint listeners; // which other clients does this guy's voice stream go to?
|
int delta_sequence; // -1 = no compression.
|
||||||
|
|
||||||
|
double next_messagetime; // time when we should send next world state update
|
||||||
|
double next_checkpingtime; // time to send all players pings to client
|
||||||
|
double next_sendinfotime; // time to send info about all players
|
||||||
|
double cl_updaterate; // client requested updaterate
|
||||||
|
double timebase; // client timebase
|
||||||
|
double connection_started;
|
||||||
|
|
||||||
|
char hashedcdkey[34]; // MD5 hash is 32 hex #'s, plus trailing 0
|
||||||
|
|
||||||
|
customization_t customdata; // player customization linked list
|
||||||
|
resource_t resourcesonhand;
|
||||||
|
resource_t resourcesneeded; // <mapname.res> from client (server downloading)
|
||||||
|
usercmd_t lastcmd; // for filling in big drops
|
||||||
|
|
||||||
|
double connecttime;
|
||||||
|
double cmdtime;
|
||||||
|
double ignorecmdtime;
|
||||||
|
|
||||||
|
int packet_loss;
|
||||||
|
float latency;
|
||||||
|
|
||||||
|
int ignored_ents; // if visibility list is full we should know how many entities will be ignored
|
||||||
|
edict_t *edict; // EDICT_NUM(clientnum+1)
|
||||||
|
edict_t *pViewEntity; // svc_setview member
|
||||||
|
edict_t *viewentity[MAX_VIEWENTS]; // list of portal cameras in player PVS
|
||||||
|
int num_viewents; // num of portal cameras that can merge PVS
|
||||||
|
|
||||||
|
qboolean m_bLoopback; // Does this client want to hear his own voice?
|
||||||
|
uint listeners; // which other clients does this guy's voice stream go to?
|
||||||
|
|
||||||
|
// the datagram is written to by sound calls, prints, temp ents, etc.
|
||||||
|
// it can be harmlessly overflowed.
|
||||||
|
sizebuf_t datagram;
|
||||||
|
byte datagram_buf[MAX_DATAGRAM];
|
||||||
|
|
||||||
|
client_frame_t *frames; // updates can be delta'd from here
|
||||||
|
event_state_t events; // delta-updated events cycle
|
||||||
|
|
||||||
|
int challenge; // challenge of this user, randomly generated
|
||||||
|
int userid; // identifying number on server
|
||||||
|
int extensions;
|
||||||
|
char useragent[MAX_INFO_STRING];
|
||||||
|
|
||||||
int ignorecmdtime_warns; // how many times client time was faster than server during this session
|
int ignorecmdtime_warns; // how many times client time was faster than server during this session
|
||||||
int userid; // identifying number on server
|
qboolean ignorecmdtime_warned; // did we warn our server operator in the log for this batch of commands?
|
||||||
|
|
||||||
netchan_t netchan;
|
|
||||||
sizebuf_t datagram; // the datagram is written to by sound calls, prints, temp ents, etc.
|
|
||||||
byte datagram_buf[MAX_DATAGRAM]; // it can be harmlessly overflowed.
|
|
||||||
|
|
||||||
int chokecount; // number of messages rate supressed
|
|
||||||
int delta_sequence; // -1 = no compression.
|
|
||||||
|
|
||||||
double next_messagetime; // time when we should send next world state update
|
|
||||||
double next_checkpingtime; // time to send all players pings to client
|
|
||||||
double next_sendinfotime; // time to send info about all players
|
|
||||||
double cl_updaterate; // client requested updaterate
|
|
||||||
double timebase; // client timebase
|
|
||||||
double connection_started;
|
|
||||||
|
|
||||||
customization_t customdata; // player customization linked list
|
|
||||||
resource_t resourcesonhand;
|
|
||||||
resource_t resourcesneeded; // <mapname.res> from client (server downloading)
|
|
||||||
usercmd_t lastcmd; // for filling in big drops
|
|
||||||
|
|
||||||
int packet_loss;
|
|
||||||
double connecttime;
|
|
||||||
double cmdtime;
|
|
||||||
double ignorecmdtime;
|
|
||||||
float latency;
|
|
||||||
|
|
||||||
int ignored_ents; // if visibility list is full we should know how many entities will be ignored
|
|
||||||
edict_t *edict; // EDICT_NUM(clientnum+1)
|
|
||||||
edict_t *pViewEntity; // svc_setview member
|
|
||||||
edict_t *viewentity[MAX_VIEWENTS]; // list of portal cameras in player PVS
|
|
||||||
int num_viewents; // num of portal cameras that can merge PVS
|
|
||||||
|
|
||||||
int userinfo_change_attempts;
|
|
||||||
double fullupdate_next_calltime;
|
double fullupdate_next_calltime;
|
||||||
double userinfo_next_changetime;
|
double userinfo_next_changetime;
|
||||||
double userinfo_penalty;
|
double userinfo_penalty;
|
||||||
|
int userinfo_change_attempts;
|
||||||
client_frame_t *frames; // updates can be delta'd from here
|
|
||||||
event_state_t events; // delta-updated events cycle
|
|
||||||
} sv_client_t;
|
} sv_client_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -277,25 +277,6 @@ static sv_client_t *SV_FindEmptySlot( void )
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SV_MaybeNotifyPlayerCountChange( const sv_client_t *cl, const char *address )
|
|
||||||
{
|
|
||||||
int i, count = 0;
|
|
||||||
|
|
||||||
// if this was the first client on the server, or the last client
|
|
||||||
// the server can hold, send a heartbeat to the master.
|
|
||||||
for( i = 0; i < svs.maxclients; i++ )
|
|
||||||
{
|
|
||||||
if( svs.clients[i].state >= cs_connected )
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( count == 1 || count == svs.maxclients )
|
|
||||||
NET_MasterClear();
|
|
||||||
|
|
||||||
Log_Printf( "\"%s<%i><%i><>\" connected, address \"%s\"\n",
|
|
||||||
cl->name, cl->userid, (int)( cl - svs.clients ), address );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
SV_ConnectClient
|
SV_ConnectClient
|
||||||
@@ -307,10 +288,9 @@ static void SV_ConnectClient( netadr_t from )
|
|||||||
{
|
{
|
||||||
char userinfo[MAX_INFO_STRING];
|
char userinfo[MAX_INFO_STRING];
|
||||||
char protinfo[MAX_INFO_STRING];
|
char protinfo[MAX_INFO_STRING];
|
||||||
client_frame_t *frames;
|
|
||||||
sv_client_t *newcl = NULL;
|
sv_client_t *newcl = NULL;
|
||||||
int qport, version;
|
int qport, version;
|
||||||
int i;
|
int i, count = 0;
|
||||||
int challenge;
|
int challenge;
|
||||||
const char *s;
|
const char *s;
|
||||||
int extensions;
|
int extensions;
|
||||||
@@ -355,6 +335,12 @@ static void SV_ConnectClient( netadr_t from )
|
|||||||
if( !SV_ProcessUserAgent( from, protinfo ))
|
if( !SV_ProcessUserAgent( from, protinfo ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if( Q_strlen( Info_ValueForKey( protinfo, "uuid" )) != 32 )
|
||||||
|
{
|
||||||
|
SV_RejectConnection( from, "invalid authentication certificate length\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// extract qport from protocol info
|
// extract qport from protocol info
|
||||||
qport = Q_atoi( Info_ValueForKey( protinfo, "qport" ));
|
qport = Q_atoi( Info_ValueForKey( protinfo, "qport" ));
|
||||||
extensions = Q_atoi( Info_ValueForKey( protinfo, "ext" ));
|
extensions = Q_atoi( Info_ValueForKey( protinfo, "ext" ));
|
||||||
@@ -411,20 +397,20 @@ static void SV_ConnectClient( netadr_t from )
|
|||||||
|
|
||||||
// build a new connection
|
// build a new connection
|
||||||
// accept the new client
|
// accept the new client
|
||||||
|
|
||||||
sv.current_client = newcl;
|
sv.current_client = newcl;
|
||||||
frames = Mem_Realloc( host.mempool, newcl->frames, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
|
||||||
memset( frames, 0, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
|
||||||
SV_ClearResourceLists( newcl );
|
|
||||||
|
|
||||||
memset( newcl, 0, sizeof( *newcl ));
|
|
||||||
|
|
||||||
newcl->edict = EDICT_NUM(( newcl - svs.clients ) + 1 );
|
newcl->edict = EDICT_NUM(( newcl - svs.clients ) + 1 );
|
||||||
newcl->frames = frames;
|
newcl->challenge = challenge; // save challenge for checksumming
|
||||||
|
newcl->frames = (client_frame_t *)Mem_Realloc( host.mempool, newcl->frames, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
||||||
|
memset( newcl->frames, 0, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
||||||
newcl->userid = g_userid++; // create unique userid
|
newcl->userid = g_userid++; // create unique userid
|
||||||
newcl->state = cs_connected;
|
newcl->state = cs_connected;
|
||||||
newcl->extensions = FBitSet( extensions, NET_EXT_SPLITSIZE );
|
newcl->extensions = extensions & (NET_EXT_SPLITSIZE);
|
||||||
Q_strncpy( newcl->useragent, protinfo, sizeof( newcl->useragent ));
|
Q_strncpy( newcl->useragent, protinfo, sizeof( newcl->useragent ));
|
||||||
|
|
||||||
|
// reset viewentities (from previous level)
|
||||||
|
memset( newcl->viewentity, 0, sizeof( newcl->viewentity ));
|
||||||
|
newcl->num_viewents = 0;
|
||||||
// HACKHACK: can hear all players by default to avoid issues
|
// HACKHACK: can hear all players by default to avoid issues
|
||||||
// with server.dll without voice game manager
|
// with server.dll without voice game manager
|
||||||
newcl->listeners = -1;
|
newcl->listeners = -1;
|
||||||
@@ -449,18 +435,47 @@ static void SV_ConnectClient( netadr_t from )
|
|||||||
newcl->connection_started = host.realtime;
|
newcl->connection_started = host.realtime;
|
||||||
newcl->cl_updaterate = 0.05; // 20 fps as default
|
newcl->cl_updaterate = 0.05; // 20 fps as default
|
||||||
newcl->delta_sequence = -1;
|
newcl->delta_sequence = -1;
|
||||||
|
newcl->flags = 0;
|
||||||
|
|
||||||
|
// reset any remaining events
|
||||||
|
memset( &newcl->events, 0, sizeof( newcl->events ));
|
||||||
|
|
||||||
// parse some info from the info strings (this can override cl_updaterate)
|
// parse some info from the info strings (this can override cl_updaterate)
|
||||||
Q_strncpy( newcl->userinfo, userinfo, sizeof( newcl->userinfo ));
|
Q_strncpy( newcl->userinfo, userinfo, sizeof( newcl->userinfo ));
|
||||||
|
newcl->fullupdate_next_calltime = 0;
|
||||||
|
newcl->userinfo_next_changetime = 0;
|
||||||
|
newcl->userinfo_penalty = 0;
|
||||||
|
newcl->userinfo_change_attempts = 0;
|
||||||
|
|
||||||
SV_UserinfoChanged( newcl );
|
SV_UserinfoChanged( newcl );
|
||||||
|
SV_ClearResourceLists( newcl );
|
||||||
|
#if 0
|
||||||
|
memset( &newcl->resourcesneeded, 0, sizeof( resource_t ));
|
||||||
|
memset( &newcl->resourcesonhand, 0, sizeof( resource_t ));
|
||||||
|
newcl->resourcesneeded.pNext = newcl->resourcesneeded.pPrev = &newcl->resourcesneeded;
|
||||||
|
newcl->resourcesonhand.pNext = newcl->resourcesonhand.pPrev = &newcl->resourcesonhand;
|
||||||
|
#endif
|
||||||
newcl->next_messagetime = host.realtime + newcl->cl_updaterate;
|
newcl->next_messagetime = host.realtime + newcl->cl_updaterate;
|
||||||
|
newcl->next_sendinfotime = 0.0;
|
||||||
|
newcl->ignored_ents = 0;
|
||||||
|
newcl->chokecount = 0;
|
||||||
|
|
||||||
// reset stats
|
// reset stats
|
||||||
newcl->next_checkpingtime = -1.0;
|
newcl->next_checkpingtime = -1.0;
|
||||||
|
newcl->packet_loss = 0;
|
||||||
|
|
||||||
SV_MaybeNotifyPlayerCountChange( newcl, NET_AdrToString( newcl->netchan.remote_address ));
|
// if this was the first client on the server, or the last client
|
||||||
|
// the server can hold, send a heartbeat to the master.
|
||||||
|
for( i = 0; i < svs.maxclients; i++ )
|
||||||
|
{
|
||||||
|
if( svs.clients[i].state >= cs_connected )
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
Log_Printf( "\"%s<%i><%i><>\" connected, address \"%s\"\n", newcl->name, newcl->userid, i, NET_AdrToString( newcl->netchan.remote_address ));
|
||||||
|
|
||||||
|
if( count == 1 || count == svs.maxclients )
|
||||||
|
NET_MasterClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -472,21 +487,25 @@ A connection request that came from the game module
|
|||||||
*/
|
*/
|
||||||
edict_t *GAME_EXPORT SV_FakeConnect( const char *netname )
|
edict_t *GAME_EXPORT SV_FakeConnect( const char *netname )
|
||||||
{
|
{
|
||||||
char userinfo[MAX_INFO_STRING];
|
char userinfo[MAX_INFO_STRING];
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
sv_client_t *cl;
|
sv_client_t *cl;
|
||||||
|
|
||||||
// find a client slot
|
|
||||||
cl = SV_FindEmptySlot();
|
|
||||||
|
|
||||||
if( !cl )
|
|
||||||
return NULL; // server is full
|
|
||||||
|
|
||||||
userinfo[0] = '\0';
|
|
||||||
|
|
||||||
if( !COM_CheckString( netname ))
|
if( !COM_CheckString( netname ))
|
||||||
netname = "Bot";
|
netname = "Bot";
|
||||||
|
|
||||||
|
// find a client slot
|
||||||
|
for( i = 0, cl = svs.clients; i < svs.maxclients; i++, cl++ )
|
||||||
|
{
|
||||||
|
if( cl->state == cs_free )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( i == svs.maxclients )
|
||||||
|
return NULL; // server is full
|
||||||
|
|
||||||
|
userinfo[0] = '\0';
|
||||||
|
|
||||||
// setup fake client params
|
// setup fake client params
|
||||||
Info_SetValueForKey( userinfo, "name", netname, sizeof( userinfo ));
|
Info_SetValueForKey( userinfo, "name", netname, sizeof( userinfo ));
|
||||||
Info_SetValueForKey( userinfo, "model", "gordon", sizeof( userinfo ));
|
Info_SetValueForKey( userinfo, "model", "gordon", sizeof( userinfo ));
|
||||||
@@ -496,26 +515,34 @@ edict_t *GAME_EXPORT SV_FakeConnect( const char *netname )
|
|||||||
// build a new connection
|
// build a new connection
|
||||||
// accept the new client
|
// accept the new client
|
||||||
sv.current_client = cl;
|
sv.current_client = cl;
|
||||||
if( cl->frames )
|
|
||||||
Mem_Free( cl->frames ); // fakeclients doesn't have frames
|
|
||||||
SV_ClearResourceLists( cl );
|
|
||||||
|
|
||||||
memset( cl, 0, sizeof( *cl ));
|
if( cl->frames ) Mem_Free( cl->frames ); // fakeclients doesn't have frames
|
||||||
|
memset( cl, 0, sizeof( sv_client_t ));
|
||||||
|
|
||||||
cl->state = cs_spawned;
|
cl->edict = EDICT_NUM( (cl - svs.clients) + 1 );
|
||||||
cl->edict = EDICT_NUM(( cl - svs.clients ) + 1 );
|
cl->userid = g_userid++; // create unique userid
|
||||||
cl->userid = g_userid++; // create unique userid
|
|
||||||
SetBits( cl->flags, FCL_FAKECLIENT );
|
SetBits( cl->flags, FCL_FAKECLIENT );
|
||||||
|
|
||||||
// parse some info from the info strings
|
// parse some info from the info strings
|
||||||
Q_strncpy( cl->userinfo, userinfo, sizeof( cl->userinfo ));
|
Q_strncpy( cl->userinfo, userinfo, sizeof( cl->userinfo ));
|
||||||
|
|
||||||
SV_UserinfoChanged( cl );
|
SV_UserinfoChanged( cl );
|
||||||
SetBits( cl->flags, FCL_RESEND_USERINFO );
|
SetBits( cl->flags, FCL_RESEND_USERINFO );
|
||||||
|
cl->next_sendinfotime = 0.0;
|
||||||
|
|
||||||
|
// if this was the first client on the server, or the last client
|
||||||
|
// the server can hold, send a heartbeat to the master.
|
||||||
|
for( i = 0, cl = svs.clients; i < svs.maxclients; i++, cl++ )
|
||||||
|
if( cl->state >= cs_connected ) count++;
|
||||||
|
cl = sv.current_client;
|
||||||
|
|
||||||
|
Log_Printf( "\"%s<%i><%i><>\" connected, address \"local\"\n", cl->name, cl->userid, i );
|
||||||
|
|
||||||
SetBits( cl->edict->v.flags, FL_CLIENT|FL_FAKECLIENT ); // mark it as fakeclient
|
SetBits( cl->edict->v.flags, FL_CLIENT|FL_FAKECLIENT ); // mark it as fakeclient
|
||||||
cl->connection_started = host.realtime;
|
cl->connection_started = host.realtime;
|
||||||
|
cl->state = cs_spawned;
|
||||||
|
|
||||||
SV_MaybeNotifyPlayerCountChange( cl, "local" );
|
if( count == 1 || count == svs.maxclients )
|
||||||
|
NET_MasterClear();
|
||||||
|
|
||||||
return cl->edict;
|
return cl->edict;
|
||||||
}
|
}
|
||||||
@@ -745,7 +772,7 @@ const char *SV_GetClientIDString( sv_client_t *cl )
|
|||||||
if( sv_lan.value )
|
if( sv_lan.value )
|
||||||
return "ID_LAN";
|
return "ID_LAN";
|
||||||
|
|
||||||
Q_snprintf( result, sizeof( result ), "ID_%s", cl->hashedcdkey );
|
Q_snprintf( result, sizeof( result ), "ID_%s", MD5_Print( (byte *)cl->hashedcdkey ));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3169,8 +3196,10 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
|
|||||||
if( len > 0 )
|
if( len > 0 )
|
||||||
Netchan_OutOfBand( NS_SERVER, from, len, (byte*)buf );
|
Netchan_OutOfBand( NS_SERVER, from, len, (byte*)buf );
|
||||||
}
|
}
|
||||||
else if( sv_log_outofband.value )
|
else
|
||||||
|
{
|
||||||
Con_DPrintf( S_ERROR "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), args );
|
Con_DPrintf( S_ERROR "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), args );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3301,10 +3330,6 @@ static void SV_ParseClientMove( sv_client_t *cl, sizebuf_t *msg )
|
|||||||
SV_RunCmd( cl, &cmds[i], cl->netchan.incoming_sequence - i );
|
SV_RunCmd( cl, &cmds[i], cl->netchan.incoming_sequence - i );
|
||||||
}
|
}
|
||||||
|
|
||||||
// was player kicked? stop here
|
|
||||||
if( cl->state <= cs_zombie )
|
|
||||||
return;
|
|
||||||
|
|
||||||
cl->lastcmd = cmds[0];
|
cl->lastcmd = cmds[0];
|
||||||
|
|
||||||
// adjust latency time by 1/2 last client frame since
|
// adjust latency time by 1/2 last client frame since
|
||||||
|
|||||||
@@ -763,31 +763,6 @@ qboolean SV_ProcessUserAgent( netadr_t from, const char *useragent )
|
|||||||
{
|
{
|
||||||
const char *input_devices_str = Info_ValueForKey( useragent, "d" );
|
const char *input_devices_str = Info_ValueForKey( useragent, "d" );
|
||||||
const char *id = Info_ValueForKey( useragent, "uuid" );
|
const char *id = Info_ValueForKey( useragent, "uuid" );
|
||||||
size_t len, i;
|
|
||||||
|
|
||||||
len = Q_strlen( id );
|
|
||||||
if( len != 32 )
|
|
||||||
{
|
|
||||||
SV_RejectConnection( from, "invalid authentication certificate\n" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i = 0; i < len; i++ )
|
|
||||||
{
|
|
||||||
char c = id[i];
|
|
||||||
|
|
||||||
if( !isdigit( id[i] ) && !( c >= 'a' && c <= 'f' ))
|
|
||||||
{
|
|
||||||
SV_RejectConnection( from, "invalid authentication certificate\n" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( SV_CheckID( id ))
|
|
||||||
{
|
|
||||||
SV_RejectConnection( from, "You are banned!\n" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !sv_allow_noinputdevices.value && ( !input_devices_str || !input_devices_str[0] ) )
|
if( !sv_allow_noinputdevices.value && ( !input_devices_str || !input_devices_str[0] ) )
|
||||||
{
|
{
|
||||||
@@ -821,6 +796,17 @@ qboolean SV_ProcessUserAgent( netadr_t from, const char *useragent )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( id )
|
||||||
|
{
|
||||||
|
qboolean banned = SV_CheckID( id );
|
||||||
|
|
||||||
|
if( banned )
|
||||||
|
{
|
||||||
|
SV_RejectConnection( from, "You are banned!\n" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -892,10 +892,6 @@ void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd, int random_seed )
|
|||||||
vec3_t oldvel;
|
vec3_t oldvel;
|
||||||
usercmd_t cmd;
|
usercmd_t cmd;
|
||||||
|
|
||||||
// if the player got kicked, do not process commands
|
|
||||||
if( cl->state <= cs_zombie )
|
|
||||||
return;
|
|
||||||
|
|
||||||
clent = cl->edict;
|
clent = cl->edict;
|
||||||
cmd = *ucmd;
|
cmd = *ucmd;
|
||||||
|
|
||||||
|
|||||||
@@ -907,7 +907,13 @@ static void GL_InitExtensionsBigGL( void )
|
|||||||
GL_CheckExtension( "GL_ARB_seamless_cube_map", NULL, 0, "gl_texture_cubemap_seamless", GL_ARB_SEAMLESS_CUBEMAP, 0 );
|
GL_CheckExtension( "GL_ARB_seamless_cube_map", NULL, 0, "gl_texture_cubemap_seamless", GL_ARB_SEAMLESS_CUBEMAP, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_CheckExtension( "GL_ARB_texture_non_power_of_two", NULL, 0, "gl_texture_npot", GL_ARB_TEXTURE_NPOT_EXT, 0 );
|
// NPOT textures support
|
||||||
|
if( !GL_CheckExtension( "GL_ARB_texture_non_power_of_two", NULL, 0, "gl_texture_npot", GL_ARB_TEXTURE_NPOT_EXT, 0 ))
|
||||||
|
{
|
||||||
|
// vitaGL exposes OES extension
|
||||||
|
GL_CheckExtension( "GL_OES_texture_npot", NULL, 0, "gl_texture_npot", GL_ARB_TEXTURE_NPOT_EXT, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
GL_CheckExtension( "GL_ARB_texture_compression", texturecompressionfuncs, ARRAYSIZE( texturecompressionfuncs ), "gl_texture_dxt_compression", GL_TEXTURE_COMPRESSION_EXT, 0 );
|
GL_CheckExtension( "GL_ARB_texture_compression", texturecompressionfuncs, ARRAYSIZE( texturecompressionfuncs ), "gl_texture_dxt_compression", GL_TEXTURE_COMPRESSION_EXT, 0 );
|
||||||
if( !GL_CheckExtension( "GL_EXT_texture_edge_clamp", NULL, 0, "gl_clamp_to_edge", GL_CLAMPTOEDGE_EXT, 2.0 )) // present in ES2
|
if( !GL_CheckExtension( "GL_EXT_texture_edge_clamp", NULL, 0, "gl_clamp_to_edge", GL_CLAMPTOEDGE_EXT, 2.0 )) // present in ES2
|
||||||
GL_CheckExtension( "GL_SGIS_texture_edge_clamp", NULL, 0, "gl_clamp_to_edge", GL_CLAMPTOEDGE_EXT, 0 );
|
GL_CheckExtension( "GL_SGIS_texture_edge_clamp", NULL, 0, "gl_clamp_to_edge", GL_CLAMPTOEDGE_EXT, 0 );
|
||||||
|
|||||||
@@ -1093,14 +1093,6 @@ static void R_RenderFullbrights( void )
|
|||||||
pglBlendFunc( GL_ONE, GL_ONE );
|
pglBlendFunc( GL_ONE, GL_ONE );
|
||||||
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||||
|
|
||||||
// if fullbright textures are drawn in separate pass from VBO they
|
|
||||||
// cause z-fighting, this is noticeable on `slide_waifufu.bsp` map
|
|
||||||
if( R_HasEnabledVBO() && gl_polyoffset.value )
|
|
||||||
{
|
|
||||||
pglEnable( GL_POLYGON_OFFSET_FILL );
|
|
||||||
pglPolygonOffset( -1.0f, -gl_polyoffset.value );
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i = draw_fullbrights.first; i <= draw_fullbrights.last; i++ )
|
for( i = draw_fullbrights.first; i <= draw_fullbrights.last; i++ )
|
||||||
{
|
{
|
||||||
es = fullbright_surfaces[i];
|
es = fullbright_surfaces[i];
|
||||||
@@ -1116,9 +1108,6 @@ static void R_RenderFullbrights( void )
|
|||||||
es->lumachain = NULL;
|
es->lumachain = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( R_HasEnabledVBO() && gl_polyoffset.value )
|
|
||||||
pglDisable( GL_POLYGON_OFFSET_FILL );
|
|
||||||
|
|
||||||
pglDisable( GL_BLEND );
|
pglDisable( GL_BLEND );
|
||||||
pglDepthMask( GL_TRUE );
|
pglDepthMask( GL_TRUE );
|
||||||
pglDisable( GL_ALPHA_TEST );
|
pglDisable( GL_ALPHA_TEST );
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ CFLAGS = {
|
|||||||
'common': {
|
'common': {
|
||||||
# disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP
|
# disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP
|
||||||
'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT', '/MP', '/Zc:__cplusplus'],
|
'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT', '/MP', '/Zc:__cplusplus'],
|
||||||
'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden', '-fno-threadsafe-statics', '-fasynchronous-unwind-tables'],
|
'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden', '-fno-threadsafe-statics'],
|
||||||
'gcc': ['-g', '-fvisibility=hidden', '-fasynchronous-unwind-tables'],
|
'gcc': ['-g', '-fvisibility=hidden'],
|
||||||
'owcc': ['-fno-short-enum', '-ffloat-store', '-g3']
|
'owcc': ['-fno-short-enum', '-ffloat-store', '-g3']
|
||||||
},
|
},
|
||||||
'fast': {
|
'fast': {
|
||||||
@@ -240,21 +240,16 @@ def get_optimization_flags(conf):
|
|||||||
linkflags+= [conf.get_flags_by_compiler(PROFILE_USE_LINKFLAGS, conf.env.COMPILER_CC)[0] % conf.options.PROFILE_USE]
|
linkflags+= [conf.get_flags_by_compiler(PROFILE_USE_LINKFLAGS, conf.env.COMPILER_CC)[0] % conf.options.PROFILE_USE]
|
||||||
cflags += [conf.get_flags_by_compiler(PROFILE_USE_CFLAGS, conf.env.COMPILER_CC)[0] % conf.options.PROFILE_USE]
|
cflags += [conf.get_flags_by_compiler(PROFILE_USE_CFLAGS, conf.env.COMPILER_CC)[0] % conf.options.PROFILE_USE]
|
||||||
|
|
||||||
if conf.env.DEST_OS == 'nswitch':
|
if conf.env.DEST_OS == 'nswitch' and conf.options.BUILD_TYPE == 'debug':
|
||||||
if conf.options.BUILD_TYPE == 'debug':
|
# enable remote debugger
|
||||||
# enable remote debugger
|
cflags.append('-DNSWITCH_DEBUG')
|
||||||
cflags.append('-DNSWITCH_DEBUG')
|
|
||||||
# this port don't have stack printing support
|
|
||||||
cflags.remove('-fasynchronous-unwind-tables')
|
|
||||||
elif conf.env.DEST_OS == 'psvita':
|
elif conf.env.DEST_OS == 'psvita':
|
||||||
# this optimization is broken in vitasdk
|
# this optimization is broken in vitasdk
|
||||||
cflags.append('-fno-optimize-sibling-calls')
|
cflags.append('-fno-optimize-sibling-calls')
|
||||||
# remove fvisibility to allow everything to be exported by default
|
# remove fvisibility to allow everything to be exported by default
|
||||||
cflags.remove('-fvisibility=hidden')
|
cflags.remove('-fvisibility=hidden')
|
||||||
# this port don't have stack printing support
|
|
||||||
cflags.remove('-fasynchronous-unwind-tables')
|
|
||||||
|
|
||||||
if conf.env.COMPILER_CC == 'gcc' or conf.env.COMPILER_CC == 'clang' and conf.env.DEST_OS not in ['android']:
|
if conf.env.COMPILER_CC != 'msvc' and conf.env.COMPILER_CC != 'owcc':
|
||||||
# HLSDK by default compiles with these options under Linux
|
# HLSDK by default compiles with these options under Linux
|
||||||
# no reason for us to not do the same
|
# no reason for us to not do the same
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user