mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-08 05:11:51 +08:00
Compare commits
3 Commits
continuous
...
continuous
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60c6767337 | ||
|
|
75451cc7fa | ||
|
|
db10035d9d |
@@ -50,7 +50,15 @@ const char *CL_MsgInfo( int cmd )
|
|||||||
if( cmd >= 0 && cmd <= svc_lastmsg )
|
if( cmd >= 0 && cmd <= svc_lastmsg )
|
||||||
{
|
{
|
||||||
// get engine message name
|
// get engine message name
|
||||||
Q_strncpy( sz, svc_strings[cmd], sizeof( sz ));
|
const char *svc_string = NULL;
|
||||||
|
|
||||||
|
if( cls.legacymode )
|
||||||
|
svc_string = svc_legacy_strings[cmd];
|
||||||
|
|
||||||
|
if( !svc_string )
|
||||||
|
svc_string = svc_strings[cmd];
|
||||||
|
|
||||||
|
Q_strncpy( sz, svc_string, sizeof( sz ));
|
||||||
}
|
}
|
||||||
else if( cmd > svc_lastmsg && cmd <= ( svc_lastmsg + MAX_USER_MESSAGES ))
|
else if( cmd > svc_lastmsg && cmd <= ( svc_lastmsg + MAX_USER_MESSAGES ))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -89,32 +89,32 @@ qboolean FS_LoadProgs( void )
|
|||||||
|
|
||||||
if( !fs_hInstance )
|
if( !fs_hInstance )
|
||||||
{
|
{
|
||||||
Host_Error( "FS_LoadProgs: can't load filesystem library %s: %s\n", name, COM_GetLibraryError() );
|
Host_Error( "%s: can't load filesystem library %s: %s\n", __func__, name, COM_GetLibraryError() );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !( GetFSAPI = (FSAPI)COM_GetProcAddress( fs_hInstance, GET_FS_API )))
|
if( !( GetFSAPI = (FSAPI)COM_GetProcAddress( fs_hInstance, GET_FS_API )))
|
||||||
{
|
{
|
||||||
FS_UnloadProgs();
|
FS_UnloadProgs();
|
||||||
Host_Error( "FS_LoadProgs: can't find GetFSAPI entry point in %s\n", name );
|
Host_Error( "%s: can't find GetFSAPI entry point in %s\n", __func__, name );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !GetFSAPI( FS_API_VERSION, &g_fsapi, &FI, &fs_memfuncs ))
|
if( GetFSAPI( FS_API_VERSION, &g_fsapi, &FI, &fs_memfuncs ) != FS_API_VERSION )
|
||||||
{
|
{
|
||||||
FS_UnloadProgs();
|
FS_UnloadProgs();
|
||||||
Host_Error( "FS_LoadProgs: can't initialize filesystem API: wrong version\n" );
|
Host_Error( "%s: can't initialize filesystem API: wrong version\n", __func__ );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !( fs_pfnCreateInterface = (pfnCreateInterface_t)COM_GetProcAddress( fs_hInstance, "CreateInterface" )))
|
if( !( fs_pfnCreateInterface = (pfnCreateInterface_t)COM_GetProcAddress( fs_hInstance, "CreateInterface" )))
|
||||||
{
|
{
|
||||||
FS_UnloadProgs();
|
FS_UnloadProgs();
|
||||||
Host_Error( "FS_LoadProgs: can't find CreateInterface entry point in %s\n", name );
|
Host_Error( "%s: can't find CreateInterface entry point in %s\n", __func__, name );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Con_DPrintf( "FS_LoadProgs: filesystem_stdio successfully loaded\n" );
|
Con_DPrintf( "%s: filesystem_stdio successfully loaded\n", __func__ );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ typedef struct dll_user_s
|
|||||||
qboolean custom_loader; // a bit who indicated loader type
|
qboolean custom_loader; // a bit who indicated loader type
|
||||||
qboolean encrypted; // dll is crypted (some client.dll in HL, CS etc)
|
qboolean encrypted; // dll is crypted (some client.dll in HL, CS etc)
|
||||||
char dllName[32]; // for debug messages
|
char dllName[32]; // for debug messages
|
||||||
string fullPath, shortPath; // actual dll paths
|
char fullPath[2048];
|
||||||
|
string shortPath; // actual dll paths
|
||||||
|
|
||||||
// ordinals stuff, valid only on Win32
|
// ordinals stuff, valid only on Win32
|
||||||
word *ordinals;
|
word *ordinals;
|
||||||
|
|||||||
@@ -89,6 +89,36 @@ const char *svc_strings[svc_lastmsg+1] =
|
|||||||
"svc_exec",
|
"svc_exec",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *svc_legacy_strings[svc_lastmsg+1] =
|
||||||
|
{
|
||||||
|
[svc_legacy_changing] = "svc_legacy_changing",
|
||||||
|
[svc_legacy_ambientsound] = "svc_legacy_ambientsound",
|
||||||
|
[svc_legacy_soundindex] = "svc_legacy_soundindex",
|
||||||
|
[svc_legacy_ambientsound] = "svc_legacy_ambientsound",
|
||||||
|
[svc_legacy_modelindex] = "svc_legacy_modelindex",
|
||||||
|
[svc_legacy_eventindex] = "svc_legacy_eventindex",
|
||||||
|
[svc_legacy_chokecount] = "svc_legacy_chokecount",
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *svc_goldsrc_strings[svc_lastmsg+1] =
|
||||||
|
{
|
||||||
|
[svc_goldsrc_version] = "svc_goldsrc_version",
|
||||||
|
[svc_goldsrc_serverinfo] = "svc_goldsrc_serverinfo",
|
||||||
|
[svc_goldsrc_deltadescription] = "svc_goldsrc_deltadescription",
|
||||||
|
[svc_goldsrc_stopsound] = "svc_goldsrc_stopsound",
|
||||||
|
[svc_goldsrc_damage] = "svc_goldsrc_damage",
|
||||||
|
[svc_goldsrc_killedmonster] = "svc_goldsrc_killedmonster",
|
||||||
|
[svc_goldsrc_foundsecret] = "svc_goldsrc_foundsecret",
|
||||||
|
[svc_goldsrc_spawnstaticsound] = "svc_goldsrc_spawnstaticsound",
|
||||||
|
[svc_goldsrc_decalname] = "svc_goldsrc_decalname",
|
||||||
|
[svc_goldsrc_newusermsg] = "svc_goldsrc_newusermsg",
|
||||||
|
[svc_goldsrc_newmovevars] = "svc_goldsrc_newmovevars",
|
||||||
|
[svc_goldsrc_sendextrainfo] = "svc_goldsrc_sendextrainfo",
|
||||||
|
[svc_goldsrc_timescale] = "svc_goldsrc_timescale",
|
||||||
|
[svc_goldsrc_sendcvarvalue] = "svc_goldsrc_sendcvarvalue",
|
||||||
|
[svc_goldsrc_sendcvarvalue2] = "svc_goldsrc_sendcvarvalue2",
|
||||||
|
};
|
||||||
|
|
||||||
void MSG_InitMasks( void )
|
void MSG_InitMasks( void )
|
||||||
{
|
{
|
||||||
uint startbit, endbit;
|
uint startbit, endbit;
|
||||||
|
|||||||
@@ -278,6 +278,8 @@ GNU General Public License for more details.
|
|||||||
#define SU_WEAPON (1<<14)
|
#define SU_WEAPON (1<<14)
|
||||||
|
|
||||||
extern const char *svc_strings[svc_lastmsg+1];
|
extern const char *svc_strings[svc_lastmsg+1];
|
||||||
|
extern const char *svc_legacy_strings[svc_lastmsg+1];
|
||||||
|
extern const char *svc_goldsrc_strings[svc_lastmsg+1];
|
||||||
extern const char *clc_strings[clc_lastmsg+1];
|
extern const char *clc_strings[clc_lastmsg+1];
|
||||||
|
|
||||||
// FWGS extensions
|
// FWGS extensions
|
||||||
@@ -316,4 +318,40 @@ extern const char *clc_strings[clc_lastmsg+1];
|
|||||||
// Master Server protocol
|
// Master Server protocol
|
||||||
#define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0" // TODO: implement IP filter
|
#define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0" // TODO: implement IP filter
|
||||||
|
|
||||||
|
// GoldSrc protocol definitions
|
||||||
|
#define PROTOCOL_GOLDSRC_VERSION_REAL 48
|
||||||
|
#define PROTOCOL_GOLDSRC_VERSION (PROTOCOL_GOLDSRC_VERSION_REAL | (BIT( 7 ))) // should be 48, only to differentiate it from PROTOCOL_LEGACY_VERSION
|
||||||
|
|
||||||
|
#define svc_goldsrc_version svc_changing
|
||||||
|
#define svc_goldsrc_serverinfo svc_serverdata
|
||||||
|
#define svc_goldsrc_deltadescription svc_deltatable
|
||||||
|
#define svc_goldsrc_stopsound svc_resource
|
||||||
|
#define svc_goldsrc_damage svc_restoresound
|
||||||
|
#define svc_goldsrc_killedmonster 27
|
||||||
|
#define svc_goldsrc_foundsecret 28
|
||||||
|
#define svc_goldsrc_spawnstaticsound 29
|
||||||
|
#define svc_goldsrc_decalname svc_bspdecal
|
||||||
|
#define svc_goldsrc_newusermsg svc_usermessage
|
||||||
|
#define svc_goldsrc_newmovevars svc_deltamovevars
|
||||||
|
#define svc_goldsrc_sendextrainfo 54
|
||||||
|
#define svc_goldsrc_timescale 55
|
||||||
|
#define svc_goldsrc_sendcvarvalue svc_querycvarvalue
|
||||||
|
#define svc_goldsrc_sendcvarvalue2 svc_querycvarvalue2
|
||||||
|
|
||||||
|
#define clc_goldsrc_hltv clc_requestcvarvalue // 9
|
||||||
|
#define clc_goldsrc_requestcvarvalue clc_requestcvarvalue2 // 10
|
||||||
|
#define clc_goldsrc_requestcvarvalue2 11
|
||||||
|
#define clc_goldsrc_lastmsg 12
|
||||||
|
|
||||||
|
#define S2C_REJECT_BADPASSWORD '8'
|
||||||
|
#define S2C_REJECT '9'
|
||||||
|
#define S2C_CHALLENGE "A00000000"
|
||||||
|
#define S2C_CONNECTION "B"
|
||||||
|
|
||||||
|
#define MAX_GOLDSRC_RESOURCE_BITS 12
|
||||||
|
#define MAX_GOLDSRC_ENTITY_BITS 11
|
||||||
|
// #define MAX_GOLDSRC_EDICTS BIT( MAX_ENTITY_BITS )
|
||||||
|
#define MAX_GOLDSRC_EDICTS ( BIT( MAX_ENTITY_BITS ) + ( MAX_CLIENTS * 15 ))
|
||||||
|
#define LAST_GOLDSRC_EDICT ( BIT( MAX_ENTITY_BITS ) - 1 )
|
||||||
|
|
||||||
#endif//NET_PROTOCOL_H
|
#endif//NET_PROTOCOL_H
|
||||||
|
|||||||
@@ -1363,8 +1363,13 @@ static qboolean FS_FindLibrary( const char *dllname, qboolean directpath, fs_dll
|
|||||||
|
|
||||||
if( index >= 0 && !dllInfo->encrypted && search )
|
if( index >= 0 && !dllInfo->encrypted && search )
|
||||||
{
|
{
|
||||||
Q_snprintf( dllInfo->fullPath, sizeof( dllInfo->fullPath ),
|
// gamedll might resolve it's own path using dladdr()
|
||||||
"%s%s", search->filename, dllInfo->shortPath );
|
// combine it with engine returned path to gamedir
|
||||||
|
// it might lead to double gamedir like this
|
||||||
|
// - valve/valve/dlls/hl.so
|
||||||
|
// instead of expected
|
||||||
|
// - valve/dlls/hl.so
|
||||||
|
Q_snprintf( dllInfo->fullPath, sizeof( dllInfo->fullPath ), "%s/%s%s", fs_rootdir, search->filename, dllInfo->shortPath );
|
||||||
dllInfo->custom_loader = false; // we can loading from disk and use normal debugging
|
dllInfo->custom_loader = false; // we can loading from disk and use normal debugging
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#define FS_API_VERSION 2 // not stable yet!
|
#define FS_API_VERSION 3 // not stable yet!
|
||||||
#define FS_API_CREATEINTERFACE_TAG "XashFileSystem002" // follow FS_API_VERSION!!!
|
#define FS_API_CREATEINTERFACE_TAG "XashFileSystem002" // follow FS_API_VERSION!!!
|
||||||
#define FILESYSTEM_INTERFACE_VERSION "VFileSystem009" // never change this!
|
#define FILESYSTEM_INTERFACE_VERSION "VFileSystem009" // never change this!
|
||||||
|
|
||||||
@@ -121,8 +121,8 @@ typedef enum
|
|||||||
|
|
||||||
typedef struct fs_dllinfo_t
|
typedef struct fs_dllinfo_t
|
||||||
{
|
{
|
||||||
string fullPath;
|
char fullPath[2048]; // absolute disk path
|
||||||
string shortPath;
|
string shortPath; // vfs path
|
||||||
qboolean encrypted;
|
qboolean encrypted;
|
||||||
qboolean custom_loader;
|
qboolean custom_loader;
|
||||||
} fs_dllinfo_t;
|
} fs_dllinfo_t;
|
||||||
|
|||||||
Reference in New Issue
Block a user