Skip to content

Commit b8ef659

Browse files
committed
Double timeout length for WaitStart method. This should allow for proper ip assignment rather than returning with the "Error: No IP assigned." error.
1 parent 75867bc commit b8ef659

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎Torch.Server/Patches/SteamLoginPatch.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@ public static class SteamLoginPatch
1616
private static readonly MethodInfo LoginMethod;
1717
[ReflectedMethodInfo(typeof(SteamLoginPatch), nameof(Prefix))]
1818
private static readonly MethodInfo PrefixMethod;
19+
20+
[ReflectedMethodInfo(null, "WaitStart", TypeName = "VRage.Steam.MySteamGameServer, VRage.Steam")]
21+
private static readonly MethodInfo WaitStartMethod;
22+
[ReflectedMethodInfo(typeof(SteamLoginPatch), nameof(WaitStartLonger))]
23+
private static readonly MethodInfo WaitStartLongerMethod;
1924
#pragma warning restore CS0649
2025

2126
public static void Patch(PatchContext context)
2227
{
2328
context.GetPattern(LoginMethod).Prefixes.Add(PrefixMethod);
29+
context.GetPattern(WaitStartMethod).Prefixes.Add(WaitStartLongerMethod);
30+
Log.Info("Applied custom WaitStart timeout");
2431
}
2532

2633
private static bool Prefix()
@@ -36,5 +43,10 @@ private static bool Prefix()
3643
SteamGameServer.LogOn(token);
3744
return false;
3845
}
46+
47+
private static void WaitStartLonger(ref int timeOut)
48+
{
49+
timeOut = 20000;
50+
}
3951
}
4052
}

0 commit comments

Comments
 (0)