}
#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;
SendWelcomemessage_msg_type(this, force_centerprint, MSG_ONE);
}
+// NOTE csqc uses the active mutators list sent by this function
+// to understand which mutators are enabled
+// also note that they aren't all registered mutators, e.g. jetpack, low gravity
void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type)
{
WriteByte(msg_type, boolean(autocvar_g_campaign));
}
WriteByte(msg_type, force_centerprint);
WriteString(msg_type, autocvar_hostname);
- WriteString(msg_type, GetClientVersionMessage(this));
+ WriteString(msg_type, autocvar_g_xonoticversion);
+ WriteByte(msg_type, CS(this).version_mismatch);
+ WriteByte(msg_type, (CS(this).version < autocvar_gameversion));
MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
string modifications = M_ARGV(0, string);
- if(g_weaponarena)
- {
- if(g_weaponarena_random)
- modifications = strcat(modifications, ", ", ftos(g_weaponarena_random), " of ", g_weaponarena_list, " Arena");
- else
- modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
- }
- else if(cvar("g_balance_blaster_weaponstartoverride") == 0)
+ if (!g_weaponarena && cvar("g_balance_blaster_weaponstartoverride") == 0)
modifications = strcat(modifications, ", No start weapons");
if(cvar("sv_gravity") < stof(cvar_defstring("sv_gravity")))
modifications = strcat(modifications, ", Low gravity");
if(g_weapon_stay && !g_cts)
modifications = strcat(modifications, ", Weapons stay");
if(autocvar_g_jetpack)
- modifications = strcat(modifications, ", Jet pack");
+ modifications = strcat(modifications, ", Jetpack");
modifications = substring(modifications, 2, strlen(modifications) - 2);
WriteString(msg_type, modifications);
+ WriteString(msg_type, g_weaponarena_list);
+
if(cache_lastmutatormsg != autocvar_g_mutatormsg)
{
strcpy(cache_lastmutatormsg, autocvar_g_mutatormsg);
WriteString(msg_type, cache_mutatormsg);
- string mutator_msg = "";
- MUTATOR_CALLHOOK(BuildGameplayTipsString, mutator_msg);
- mutator_msg = M_ARGV(0, string);
-
- WriteString(msg_type, mutator_msg); // trust that the mutator will do proper formatting
WriteString(msg_type, strreplace("\\n", "\n", autocvar_sv_motd));
}
MUTATOR_CALLHOOK(ClientConnect, this);
+ if (player_count == 1)
+ localcmd("\nsv_hook_firstjoin\n");
+
if (IS_REAL_CLIENT(this) && !IS_PLAYER(this) && !autocvar_g_campaign)
CS(this).motd_actived_time = -1; // the welcome message is shown by the client
}
player_powerups_remove_all(this); // stop powerup sound
ONREMOVE(this);
+
+ if (player_count == 0)
+ localcmd("\nsv_hook_lastleave\n");
}
void ChatBubbleThink(entity this)
}
void Join(entity this)
{
+ if (autocvar_g_campaign && !campaign_bots_may_start && !game_stopped && time >= game_starttime)
+ ReadyRestart(true);
+
TRANSMUTE(Player, this);
if(!this.team_selected)
|| (!(autocvar_sv_spectate || autocvar_g_campaign || (Player_GetForcedTeamIndex(this) == TEAM_FORCE_SPECTATOR))
&& (!teamplay || autocvar_g_balance_teams)))
{
- campaign_bots_may_start = true;
if(joinAllowed(this))
Join(this);
return;