New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[469c] Too many int files can blown game server #1218
Comments
Possible solution: function string GetRules()
{
local string ResultSet;
local Mutator M;
local string TestList, NextMutator, NextDesc;
local int Num, i;
ResultSet = "";
if (EnabledMutators == "")
{
TestList = " ";
for (M = BaseMutator.NextMutator; M != None; M = M.NextMutator)
{
NextMutator = Caps(string(M.Class)) $ " ";
if (InStr(TestList, " " $ NextMutator) == -1)
TestList = TestList $ NextMutator;
}
if (TestList != " ")
{
Num = 0;
NextMutator = "";
GetNextIntDesc("Engine.Mutator", 0, NextMutator, NextDesc);
while (NextMutator != "" && Num < 500)
{
i = InStr(TestList, " " $ Caps(NextMutator) $ " ");
if (i != -1)
{
TestList = Left(TestList, i) $ Mid(TestList, i + 1 + Len(NextMutator));
i = InStr(NextDesc, ",");
if (i != -1)
NextDesc = Left(NextDesc, i);
if (EnabledMutators != "")
EnabledMutators = EnabledMutators $ ", ";
EnabledMutators = EnabledMutators $ NextDesc;
if (TestList == " ")
break;
}
Num++;
GetNextIntDesc("Engine.Mutator", Num, NextMutator, NextDesc);
}
}
if (EnabledMutators == "")
EnabledMutators = " ";
}
// utpg: mutator/browser fix begin
if (EnabledMutators != " ")
ResultSet = ResultSet $ "\\mutators\\"$EnabledMutators;
// utpg: mutator/browser fix end
ResultSet = ResultSet $ "\\listenserver\\"$string(Level.NetMode==NM_ListenServer)
$ "\\password\\"$string(GamePassword!="");
return ResultSet;
} Known side effects: |
Why not cache the result and renew it on every game start? |
It is good to iterate through int files once only, can also add a simple sorter loop then to restore a proper order... Limit of 50 need to increase anyway, of course. |
It already do that. But coded badly. If it not able resolve anything, then it not change anything, and try it again, like nothing happen and it is clean start. In my change I set Space as result of empty work, so it ensure for call it once. |
Solution above, already fix all set of problems described here. I think order of mutator names not really matter, so no point waste time try use order from actors. But anyway mention this as possible side effect. |
Workaround: Used code: function PostBeginPlay() {
Level.Game.GetRules();
if (Level.Game.EnabledMutators == "") {
Log("Server not able make mutators list - fixed", Class.Name);
Level.Game.EnabledMutators = "-";
}
Destroy();
} |
In some cases it does matter... |
Depends how hard it implement. |
@SeriousBuggie lookup |
GameInfo.GetRules:
Imagine EnabledMutators is empty and in System directory exists 50 .int files which not correspond any of your mutators.
And Imagine you use 10 mutators.
Any UDP packet, which request rules force your server do 500 calls of GetNextIntDesc.
Which expensive as hell. Your tick rate start floating and game goes totally unplayable.
As solution:
The text was updated successfully, but these errors were encountered: