mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Set a more explicit version number
Makes it easier to identify the currently running OPM version from the server list, useful for troubleshooting and checking if the server is up to date
This commit is contained in:
parent
5530d3051b
commit
64f62583ce
3 changed files with 13 additions and 12 deletions
|
@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#include "../qcommon/q_shared.h"
|
#include "../qcommon/q_shared.h"
|
||||||
#include "../server/server.h"
|
#include "../server/server.h"
|
||||||
|
#include "../qcommon/q_version.h"
|
||||||
#include "sv_gqueryreporting.h"
|
#include "sv_gqueryreporting.h"
|
||||||
#include "sv_gamespy.h"
|
#include "sv_gamespy.h"
|
||||||
|
|
||||||
|
@ -64,16 +65,16 @@ static const char *GS_GAME_NAME_DEMO[] =
|
||||||
|
|
||||||
static const char *GS_GAME_VERSION[] =
|
static const char *GS_GAME_VERSION[] =
|
||||||
{
|
{
|
||||||
TARGET_GAME_VERSION_MOH,
|
TARGET_GAME_VERSION_MOH "+" PRODUCT_VERSION,
|
||||||
TARGET_GAME_VERSION_MOHTA,
|
TARGET_GAME_VERSION_MOHTA "+" PRODUCT_VERSION,
|
||||||
TARGET_GAME_VERSION_MOHTT,
|
TARGET_GAME_VERSION_MOHTT "+" PRODUCT_VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* GS_GAME_VERSION_DEMO[] =
|
static const char* GS_GAME_VERSION_DEMO[] =
|
||||||
{
|
{
|
||||||
TARGET_GAME_VERSION_MOH,
|
TARGET_GAME_VERSION_MOH "+" PRODUCT_VERSION,
|
||||||
"d" TARGET_GAME_VERSION_MOHTA,
|
"d" TARGET_GAME_VERSION_MOHTA "+" PRODUCT_VERSION,
|
||||||
"d" TARGET_GAME_VERSION_MOHTT_DEMO,
|
"d" TARGET_GAME_VERSION_MOHTT_DEMO "+" PRODUCT_VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned int GAMESPY_DEFAULT_PORT = 12300;
|
static const unsigned int GAMESPY_DEFAULT_PORT = 12300;
|
||||||
|
|
|
@ -3128,7 +3128,7 @@ void Com_InitTargetGameWithType(target_game_e target_game, qboolean bIsDemo)
|
||||||
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOH_DEMO));
|
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOH_DEMO));
|
||||||
}
|
}
|
||||||
protocol_version_demo = protocol_version_full = PROTOCOL_MOH;
|
protocol_version_demo = protocol_version_full = PROTOCOL_MOH;
|
||||||
Cvar_Set("com_target_version", TARGET_GAME_VERSION_MOH);
|
Cvar_Set("com_target_version", va("%s+%s", TARGET_GAME_VERSION_MOH, PRODUCT_VERSION));
|
||||||
Cvar_Set("com_target_extension", PRODUCT_EXTENSION_MOH);
|
Cvar_Set("com_target_extension", PRODUCT_EXTENSION_MOH);
|
||||||
Cvar_Set("com_gamename", TARGET_GAME_NAME_MOH);
|
Cvar_Set("com_gamename", TARGET_GAME_NAME_MOH);
|
||||||
// "main" is already used as first argument of FS_Startup
|
// "main" is already used as first argument of FS_Startup
|
||||||
|
@ -3145,7 +3145,7 @@ void Com_InitTargetGameWithType(target_game_e target_game, qboolean bIsDemo)
|
||||||
}
|
}
|
||||||
protocol_version_demo = PROTOCOL_MOHTA_DEMO;
|
protocol_version_demo = PROTOCOL_MOHTA_DEMO;
|
||||||
protocol_version_full = PROTOCOL_MOHTA;
|
protocol_version_full = PROTOCOL_MOHTA;
|
||||||
Cvar_Set("com_target_version", TARGET_GAME_VERSION_MOHTA);
|
Cvar_Set("com_target_version", va("%s+%s", TARGET_GAME_VERSION_MOHTA, PRODUCT_VERSION));
|
||||||
Cvar_Set("com_target_extension", PRODUCT_EXTENSION_MOHTA);
|
Cvar_Set("com_target_extension", PRODUCT_EXTENSION_MOHTA);
|
||||||
Cvar_Set("com_gamename", TARGET_GAME_NAME_MOHTA);
|
Cvar_Set("com_gamename", TARGET_GAME_NAME_MOHTA);
|
||||||
if (!bIsDemo) {
|
if (!bIsDemo) {
|
||||||
|
@ -3162,12 +3162,12 @@ void Com_InitTargetGameWithType(target_game_e target_game, qboolean bIsDemo)
|
||||||
Cvar_Set("com_protocol", va("%i", PROTOCOL_MOHTA));
|
Cvar_Set("com_protocol", va("%i", PROTOCOL_MOHTA));
|
||||||
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOHTA));
|
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOHTA));
|
||||||
Cvar_Set("com_protocol_alt", va("%i", PROTOCOL_MOHTA_DEMO));
|
Cvar_Set("com_protocol_alt", va("%i", PROTOCOL_MOHTA_DEMO));
|
||||||
Cvar_Set("com_target_version", TARGET_GAME_VERSION_MOHTT);
|
Cvar_Set("com_target_version", va("%s+%s", TARGET_GAME_VERSION_MOHTT, PRODUCT_VERSION));
|
||||||
} else {
|
} else {
|
||||||
Cvar_Set("com_protocol", va("%i", PROTOCOL_MOHTA_DEMO));
|
Cvar_Set("com_protocol", va("%i", PROTOCOL_MOHTA_DEMO));
|
||||||
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOHTA_DEMO));
|
Cvar_Set("com_legacyprotocol", va("%i", PROTOCOL_MOHTA_DEMO));
|
||||||
Cvar_Set("com_protocol_alt", va("%i", PROTOCOL_MOHTA));
|
Cvar_Set("com_protocol_alt", va("%i", PROTOCOL_MOHTA));
|
||||||
Cvar_Set("com_target_version", TARGET_GAME_VERSION_MOHTT_DEMO);
|
Cvar_Set("com_target_version", va("%s+%s", TARGET_GAME_VERSION_MOHTT_DEMO, PRODUCT_VERSION));
|
||||||
}
|
}
|
||||||
protocol_version_demo = PROTOCOL_MOHTA_DEMO;
|
protocol_version_demo = PROTOCOL_MOHTA_DEMO;
|
||||||
protocol_version_full = PROTOCOL_MOHTA;
|
protocol_version_full = PROTOCOL_MOHTA;
|
||||||
|
|
|
@ -292,7 +292,7 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
||||||
if (bits&7) {
|
if (bits&7) {
|
||||||
int nbits;
|
int nbits;
|
||||||
nbits = bits&7;
|
nbits = bits&7;
|
||||||
if ( msg->bit + nbits > msg->maxsize << 3 ) {
|
if ( msg->bit + nbits >= msg->maxsize << 3 ) {
|
||||||
msg->overflowed = qtrue;
|
msg->overflowed = qtrue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ void MSG_WriteBits( msg_t *msg, int value, int bits ) {
|
||||||
Huff_offsetTransmit( &msgHuff.compressor, (value & 0xff), msg->data, &msg->bit, msg->maxsize << 3 );
|
Huff_offsetTransmit( &msgHuff.compressor, (value & 0xff), msg->data, &msg->bit, msg->maxsize << 3 );
|
||||||
value = (value>>8);
|
value = (value>>8);
|
||||||
|
|
||||||
if ( msg->bit > msg->maxsize << 3 ) {
|
if ( msg->bit >= msg->maxsize << 3 ) {
|
||||||
msg->overflowed = qtrue;
|
msg->overflowed = qtrue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue