Grand Theft Auto V
Участник
- Сообщения
- 62
- Реакции
- 0
Здрасте через некоторое время когда народу много на сервере потом при переподключении пишет Этот сеанс игры не доступен, и у друзей тоже, помогает только перезапуск серва, что делать?
После смены карты проходит или после перезапуска программы steam.
Я так понял что тут люди нашли временное решение,но по ссылке пускает только донатеров :( https://forums.alliedmods.net/showpost.php?p=2190564&postcount=24
#include <sourcemod>
new timeleft;
new String:logPath[PLATFORM_MAX_PATH];
new Handle:thetimer = INVALID_HANDLE;
new bool:mapchange;
new g_time;
new Handle:h_time;
new g_players;
new Handle:h_players;
new bool:g_enable;
new Handle:h_enable;
new bool:msgdone;
new bool:rdone;
public Plugin:myinfo =
{
name = "SM Session Bug Autorestart",
author = "Franc1sco franug",
description = "",
version = "1.4",
url = "http://www.zeuszombie.com/"
};
public OnPluginStart()
{
timeleft = g_time;
BuildPath(Path_SM, logPath, PLATFORM_MAX_PATH, "/logs/SessionBug_Restarts.log");
h_time = CreateConVar("sm_sessionbug_time", "1800", "time in seconds after kick all players from the server if no new player has connected");
h_players = CreateConVar("sm_sessionbug_players", "20", "Max Players ingame required for kick all players for a sessionbug problem");
h_enable = CreateConVar("sm_sessionbug_enable", "1", "Enable/disable plugin");
g_time = GetConVarInt(h_time);
g_players = GetConVarInt(h_players);
g_enable = GetConVarBool(h_enable);
HookConVarChange(h_time, OnConVarChanged);
HookConVarChange(h_players, OnConVarChanged);
HookConVarChange(h_enable, OnConVarChanged);
}
public OnConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
if (convar == h_time)
{
g_time = StringToInt(newValue);
}
else if (convar == h_players)
{
g_players = StringToInt(newValue);
}
else if (convar == h_enable)
{
g_enable = bool:StringToInt(newValue);
}
}
public OnMapStart()
{
mapchange = true;
CreateTimer(10.0, Pasado, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action:Pasado(Handle:timer)
{
mapchange = false;
}
public OnClientConnected(client)
{
if(!g_enable) return;
if(IsFakeClient(client)) return;
if(mapchange) return;
if(timeleft <= 30)
{
PrintToChatAll("[SessionBug] PLAYER KICK HAS BEEN ABORTED BECAUSE THE \"session is not available\" PROBLEM SEEMS FIXED");
}
if(thetimer == INVALID_HANDLE) thetimer = CreateTimer(1.0, Thetimer, _, TIMER_REPEAT);
timeleft = g_time;
msgdone = false;
rdone = false;
}
public Action:Thetimer(Handle:timer)
{
if(!g_enable) return;
--timeleft;
if(timeleft == 30)
{
Advert();
}
else if(timeleft == 20)
{
Advert();
}
else if(timeleft < 10 && timeleft >= 1)
{
Advert();
}
else if(timeleft < 1)
{
if(GetClientCount(false) > g_players)
{
if(msgdone) return;
PrintToChatAll("[SessionBug] ALL PLAYERS WILL BE KICKED WHEN THERE ARE %i PLAYERS OR LESS", g_players);
msgdone = true;
}
else
{
if(rdone) return;
ServerCommand("sm_kick @all You has been kicked for a problem in the session, please rejoin");
LogToFile(logPath, "Players kicked for a possible \"session is not available\" problem");
rdone = true;
}
}
}
Advert()
{
PrintToChatAll("[SessionBug] ALL PLAYERS WILL BE KICKED IN %i SECONDS FOR A \"session is not available\" PROBLEM", timeleft);
}
я проще сделал ... отключил лобби нафиг ... онлайн увеличился заметно
Да, есть такое. Как я понял, плагин рестартит сервер при таком зависании. Пробуйте:
PHP:#include <sourcemod> new timeleft; new String:logPath[PLATFORM_MAX_PATH]; new Handle:thetimer = INVALID_HANDLE; new bool:mapchange; new g_time; new Handle:h_time; new g_players; new Handle:h_players; new bool:g_enable; new Handle:h_enable; new bool:msgdone; new bool:rdone; public Plugin:myinfo = { name = "SM Session Bug Autorestart", author = "Franc1sco franug", description = "", version = "1.4", url = "http://www.zeuszombie.com/" }; public OnPluginStart() { timeleft = g_time; BuildPath(Path_SM, logPath, PLATFORM_MAX_PATH, "/logs/SessionBug_Restarts.log"); h_time = CreateConVar("sm_sessionbug_time", "1800", "time in seconds after kick all players from the server if no new player has connected"); h_players = CreateConVar("sm_sessionbug_players", "20", "Max Players ingame required for kick all players for a sessionbug problem"); h_enable = CreateConVar("sm_sessionbug_enable", "1", "Enable/disable plugin"); g_time = GetConVarInt(h_time); g_players = GetConVarInt(h_players); g_enable = GetConVarBool(h_enable); HookConVarChange(h_time, OnConVarChanged); HookConVarChange(h_players, OnConVarChanged); HookConVarChange(h_enable, OnConVarChanged); } public OnConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[]) { if (convar == h_time) { g_time = StringToInt(newValue); } else if (convar == h_players) { g_players = StringToInt(newValue); } else if (convar == h_enable) { g_enable = bool:StringToInt(newValue); } } public OnMapStart() { mapchange = true; CreateTimer(10.0, Pasado, _, TIMER_FLAG_NO_MAPCHANGE); } public Action:Pasado(Handle:timer) { mapchange = false; } public OnClientConnected(client) { if(!g_enable) return; if(IsFakeClient(client)) return; if(mapchange) return; if(timeleft <= 30) { PrintToChatAll("[SessionBug] PLAYER KICK HAS BEEN ABORTED BECAUSE THE \"session is not available\" PROBLEM SEEMS FIXED"); } if(thetimer == INVALID_HANDLE) thetimer = CreateTimer(1.0, Thetimer, _, TIMER_REPEAT); timeleft = g_time; msgdone = false; rdone = false; } public Action:Thetimer(Handle:timer) { if(!g_enable) return; --timeleft; if(timeleft == 30) { Advert(); } else if(timeleft == 20) { Advert(); } else if(timeleft < 10 && timeleft >= 1) { Advert(); } else if(timeleft < 1) { if(GetClientCount(false) > g_players) { if(msgdone) return; PrintToChatAll("[SessionBug] ALL PLAYERS WILL BE KICKED WHEN THERE ARE %i PLAYERS OR LESS", g_players); msgdone = true; } else { if(rdone) return; ServerCommand("sm_kick @all You has been kicked for a problem in the session, please rejoin"); LogToFile(logPath, "Players kicked for a possible \"session is not available\" problem"); rdone = true; } } } Advert() { PrintToChatAll("[SessionBug] ALL PLAYERS WILL BE KICKED IN %i SECONDS FOR A \"session is not available\" PROBLEM", timeleft); }
ОффтопP.S. Хоть бы не забанили на АМ за слив :)
Не подскажешь как? а то sv_allow_lobby_connect_only вроде как давно не работает?отключил лобби нафиг .
Нужно скомпилировать плагин ,вот инструкция http://hlmod.ru/forum/plaginy-dlya-sourcemod/30-ustanovka-i-kompilyatsiya-plaginov.htmlкак и куда это надо впихивать?
xados, Как и любой другой плагин.
P.S. Valve уже знают об этом баге, так что остаётся ждать.
xados, Как и любой другой плагин.
P.S. Valve уже знают об этом баге, так что остаётся ждать.
спасибо тебе за плагин! и можешь подсказать пожалуйста как именно он работает?
Тоже бы хотел узнать) если не сложно
CVARS:Please write a plugin that will reboot my server, but only when the player last entry was 30min if there are players on the server.
If the server have 10 players(example) for 30 min and no one will come to the server, the server will automatically restart. This is a solution for the problems with the session in CS GO, usually a problem occurs after 30 min from the last join player.
I prefer that the server rebooted itself and was immediately available rather than waiting until someone will reboot manually.
sm_sessionbug_time 1800 // time in seconds after kick all players from the server if no new player has connected
sm_sessionbug_players 20 // Max Players ingame required for kick all players for a sessionbug problem");
sm_sessionbug_enable 1 // Enable/disable plugin