Merge branch 'general-devel' into feature/database
This commit is contained in:
commit
924fa983f6
20 changed files with 95 additions and 94 deletions
|
|
@ -400,8 +400,6 @@ namespace TShockAPI
|
|||
Hooks.AccountHooks.AccountDelete += OnAccountDelete;
|
||||
Hooks.AccountHooks.AccountCreate += OnAccountCreate;
|
||||
|
||||
On.Terraria.RemoteClient.Reset += RemoteClient_Reset;
|
||||
|
||||
GetDataHandlers.InitGetDataHandler();
|
||||
Commands.InitCommands();
|
||||
|
||||
|
|
@ -421,7 +419,7 @@ namespace TShockAPI
|
|||
// Initialize the AchievementManager, which is normally only done on clients.
|
||||
Game._achievements = new AchievementManager();
|
||||
|
||||
IL.Terraria.Initializers.AchievementInitializer.Load += OnAchievementInitializerLoad;
|
||||
OTAPI.Hooks.Initializers.AchievementInitializerLoad += OnAchievementInitializerLoad;
|
||||
|
||||
// Actually call AchievementInitializer.Load, which is also normally only done on clients.
|
||||
AchievementInitializer.Load();
|
||||
|
|
@ -470,17 +468,9 @@ namespace TShockAPI
|
|||
}
|
||||
}
|
||||
|
||||
private static void RemoteClient_Reset(On.Terraria.RemoteClient.orig_Reset orig, RemoteClient client)
|
||||
private static void OnAchievementInitializerLoad(object sender, OTAPI.Hooks.Initializers.AchievementInitializerLoadEventArgs args)
|
||||
{
|
||||
client.ClientUUID = null;
|
||||
orig(client);
|
||||
}
|
||||
|
||||
private static void OnAchievementInitializerLoad(ILContext il)
|
||||
{
|
||||
// Modify AchievementInitializer.Load to remove the Main.netMode == 2 check (occupies the first 4 IL instructions)
|
||||
for (var i = 0; i < 4; i++)
|
||||
il.Body.Instructions.RemoveAt(0);
|
||||
args.ShouldLoad = true;
|
||||
}
|
||||
|
||||
protected void CrashReporter_HeapshotRequesting(object sender, EventArgs e)
|
||||
|
|
@ -504,7 +494,7 @@ namespace TShockAPI
|
|||
}
|
||||
SaveManager.Instance.Dispose();
|
||||
|
||||
IL.Terraria.Initializers.AchievementInitializer.Load -= OnAchievementInitializerLoad;
|
||||
OTAPI.Hooks.Initializers.AchievementInitializerLoad -= OnAchievementInitializerLoad;
|
||||
|
||||
ModuleManager.Dispose();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue