本文整理汇总了C#中Entry.Hook方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.Hook方法的具体用法?C# Entry.Hook怎么用?C# Entry.Hook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry.Hook方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public static void Init(Entry plugin)
{
// if (Storage.IsAvailable)
// {
// if (!Tables.CharacterTable.Exists())
// {
// ProgramLog.Admin.Log("SSC table does not exist and will now be created");
// Tables.CharacterTable.Create();
// }
// if (!Tables.ItemTable.Exists())
// {
// ProgramLog.Admin.Log("SSC item table does not exist and will now be created");
// Tables.ItemTable.Create();
// }
// if (!Tables.PlayerBuffTable.Exists())
// {
// ProgramLog.Admin.Log("SSC player buff table does not exist and will now be created");
// Tables.PlayerBuffTable.Create();
// }
// if (!Tables.DefaultLoadoutTable.Exists())
// {
// ProgramLog.Admin.Log("SSC loadout table does not exist and will now be created");
// Tables.DefaultLoadoutTable.Create();
// Tables.DefaultLoadoutTable.PopulateDefaults(StartingOutInfo);
// }
// }
//Player inventory,armor,dye common table
CharacterMode characterMode;
if (CharacterMode.TryParse(plugin.Config.SSC_CharacterMode, out characterMode))
{
Terraria.Main.ServerSideCharacter = characterMode != CharacterMode.NONE;
CharacterManager.Mode = characterMode;
ProgramLog.Admin.Log("SSC mode: " + characterMode);
plugin.Hook(HookPoints.ReceiveNetMessage, OnNetMessageReceived);
// Hook(HookPoints.PlayerDataReceived, OnPlayerDataReceived);
}
// else
// ProgramLog.Error.Log("Failed to parse line server-side-characters. No SSC will be used.");
AllowGuestInfo = plugin.Config.SSC_AllowGuestInfo;
SaveInterval = plugin.Config.SSC_SaveInterval;
//Default loadout table
LoadConfig();
}
示例2: Initialise
internal static void Initialise(Entry plugin)
{
plugin.Hook(HookPoints.ReceiveNetMessage, HandlePacket);
plugin.Hook(HookPoints.CheckBufferState, CheckState);
}