using cmd to set mapname instead of performing mapswitch

This commit is contained in:
jenz 2024-06-29 23:51:23 +02:00
parent f0b3d7cb04
commit f4c8e1f61d

View File

@ -77,13 +77,20 @@ public Action read_info_over_txt(Handle timer, any data)
} }
if (count == 0) //mapname if (count == 0) //mapname
{ {
//its prefered instead to just fake the mapname since the fakeclients wont have to be kicked on mapchange then.
/*
char mapname[256]; char mapname[256];
GetCurrentMap(mapname, sizeof(mapname)); GetCurrentMap(mapname, sizeof(mapname));
if (!StrEqual(mapname, lineBuffer)) if (!StrEqual(mapname, lineBuffer))
{ {
ForceChangeLevel(lineBuffer, ""); //ForceChangeLevel(lineBuffer, "");
break; break;
} }
*/
char cmd[256];
Format(cmd, sizeof(cmd), "sv_mapname_override %s", lineBuffer);
ServerCommand(cmd);
ServerCommand("mp_timelimit 9000000"); //avoid map switches. also handled server hibernation with https://forums.alliedmods.net/showthread.php?t=331283
} }
else if (count == 1) //hostname else if (count == 1) //hostname
{ {
@ -162,6 +169,8 @@ public Action read_info_over_txt(Handle timer, any data)
CloseHandle(fileHandle); CloseHandle(fileHandle);
//kicking clients whos UserID is not connected on ze anymore. //kicking clients whos UserID is not connected on ze anymore.
for (int i = 0; i <= MaxClients; i++) for (int i = 0; i <= MaxClients; i++)
{ {
if (IsValidClient(i) && !IsClientSourceTV(i)) if (IsValidClient(i) && !IsClientSourceTV(i))