return sprintf(_("%s Arena"), wpn_list);
}
+string GetVersionMessage(string hostversion, bool version_mismatch, bool version_check)
+{
+ string xonotic_hostversion = strcat("Xonotic ", hostversion);
+ if (version_mismatch)
+ {
+ if(!version_check)
+ return strcat(sprintf(_("This is %s"), xonotic_hostversion), "\n^3",
+ _("Your client version is outdated."), "\n\n\n",
+ _("### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###"), "\n\n\n",
+ _("Please update!"));
+ else
+ return strcat(sprintf(_("This is %s"), xonotic_hostversion), "\n^3",
+ _("This server is using an outdated Xonotic version."), "\n\n\n",
+ _("### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###"));
+ }
+ return sprintf(_("Welcome to %s"), xonotic_hostversion);
+}
+
NET_HANDLE(TE_CSQC_SERVERINFO, bool isNew)
{
bool force_centerprint = ReadByte();
string hostname = ReadString();
- string ver = ReadString();
+
+ string hostversion = ReadString();
+ bool version_mismatch = ReadByte();
+ bool version_check = ReadByte();
+ string ver = GetVersionMessage(hostversion, version_mismatch, version_check);
+
string modifications = translate_modifications(ReadString());
string weaponarena_list = translate_weaponarena(ReadString());
string cache_mutatormsg = ReadString();
}
#endif
-string GetClientVersionMessage(entity this)
-{
- if (CS(this).version_mismatch) {
- if(CS(this).version < autocvar_gameversion) {
- return strcat("This is Xonotic ", autocvar_g_xonoticversion,
- "\n^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8");
- } else {
- return strcat("This is Xonotic ", autocvar_g_xonoticversion,
- "\n^3This server is using an outdated Xonotic version.\n\n\n ### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###.^8");
- }
- } else {
- return strcat("Welcome to Xonotic ", autocvar_g_xonoticversion);
- }
-}
-
void SendWelcomemessage(entity this, bool force_centerprint)
{
msg_entity = this;
WriteHeader(MSG_ONE, TE_CSQC_SERVERINFO);
WriteByte(MSG_ONE, force_centerprint);
WriteString(MSG_ONE, autocvar_hostname);
- WriteString(MSG_ONE, GetClientVersionMessage(this));
+ WriteString(MSG_ONE, autocvar_g_xonoticversion);
+ WriteByte(MSG_ONE, CS(this).version_mismatch);
+ WriteByte(MSG_ONE, (CS(this).version < autocvar_gameversion));
MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
string modifications = M_ARGV(0, string);