-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix when players cannot join the server.
- Loading branch information
Showing
5 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using HarmonyLib; | ||
using SDG.Unturned; | ||
using Steamworks; | ||
using System; | ||
|
||
namespace EvolutionPlugins.Dummy.Patches | ||
{ | ||
[HarmonyPatch(typeof(PlayerTool), "getSteamPlayer", new Type[] { typeof(CSteamID) })] | ||
public static class Patch_PlayerTool_getSteamPlayer | ||
{ | ||
internal static event NeedDummyProvider OnNeedDummyProvider; | ||
|
||
[HarmonyPostfix] | ||
public static void getSteamPlayer(CSteamID steamID, ref SteamPlayer __result) | ||
{ | ||
if (__result != null || OnNeedDummyProvider == null) return; | ||
|
||
if (OnNeedDummyProvider.Invoke().Dummies.TryGetValue(steamID, out var playerDummy)) | ||
{ | ||
__result = playerDummy.Data.UnturnedUser.Player.SteamPlayer; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters