Implement halloween check, like xmas
Update binary Add new "invasion" to GetDataHandlers.cs
This commit is contained in:
parent
0ade98dfab
commit
83a813e4f5
4 changed files with 20 additions and 0 deletions
|
|
@ -274,6 +274,8 @@ namespace TShockAPI
|
||||||
|
|
||||||
[Description("Number of bytes in the packet buffer before we disconnect the player.")] public int MaxBytesInBuffer = 5242880;
|
[Description("Number of bytes in the packet buffer before we disconnect the player.")] public int MaxBytesInBuffer = 5242880;
|
||||||
|
|
||||||
|
[Description("Forces your world to be in Halloween mode regardless of the data.")] public bool ForceHalloween = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads a configuration file from a given path
|
/// Reads a configuration file from a given path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -3204,6 +3204,7 @@ namespace TShockAPI
|
||||||
case -1:
|
case -1:
|
||||||
case -2:
|
case -2:
|
||||||
case -3:
|
case -3:
|
||||||
|
case -4:
|
||||||
invasion = true;
|
invasion = true;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -3242,6 +3243,9 @@ namespace TShockAPI
|
||||||
string boss;
|
string boss;
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
|
case -4:
|
||||||
|
boss = "a pumpkin invasion";
|
||||||
|
break;
|
||||||
case -3:
|
case -3:
|
||||||
boss = "the pirates";
|
boss = "the pirates";
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,7 @@ namespace TShockAPI
|
||||||
ServerApi.Hooks.WorldStartHardMode.Register(this, OnStartHardMode);
|
ServerApi.Hooks.WorldStartHardMode.Register(this, OnStartHardMode);
|
||||||
ServerApi.Hooks.WorldSave.Register(this, SaveManager.Instance.OnSaveWorld);
|
ServerApi.Hooks.WorldSave.Register(this, SaveManager.Instance.OnSaveWorld);
|
||||||
ServerApi.Hooks.WorldChristmasCheck.Register(this, OnXmasCheck);
|
ServerApi.Hooks.WorldChristmasCheck.Register(this, OnXmasCheck);
|
||||||
|
ServerApi.Hooks.WorldHalloweenCheck.Register(this, OnHalloweenCheck);
|
||||||
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
|
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
|
||||||
TShockAPI.Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
|
TShockAPI.Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
|
||||||
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
|
||||||
|
|
@ -328,6 +329,7 @@ namespace TShockAPI
|
||||||
ServerApi.Hooks.WorldStartHardMode.Deregister(this, OnStartHardMode);
|
ServerApi.Hooks.WorldStartHardMode.Deregister(this, OnStartHardMode);
|
||||||
ServerApi.Hooks.WorldSave.Deregister(this, SaveManager.Instance.OnSaveWorld);
|
ServerApi.Hooks.WorldSave.Deregister(this, SaveManager.Instance.OnSaveWorld);
|
||||||
ServerApi.Hooks.WorldChristmasCheck.Deregister(this, OnXmasCheck);
|
ServerApi.Hooks.WorldChristmasCheck.Deregister(this, OnXmasCheck);
|
||||||
|
ServerApi.Hooks.WorldHalloweenCheck.Deregister(this, OnHalloweenCheck);
|
||||||
ServerApi.Hooks.NetNameCollision.Deregister(this, NetHooks_NameCollision);
|
ServerApi.Hooks.NetNameCollision.Deregister(this, NetHooks_NameCollision);
|
||||||
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin;
|
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin;
|
||||||
|
|
||||||
|
|
@ -414,6 +416,18 @@ namespace TShockAPI
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnHalloweenCheck(HalloweenCheckEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Handled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Config.ForceHalloween)
|
||||||
|
{
|
||||||
|
args.Halloween = true;
|
||||||
|
args.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles exceptions that we didn't catch or that Red fucked up
|
/// Handles exceptions that we didn't catch or that Red fucked up
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue