public CustomSystem() { if (_instance == null) { _instance = this; } }
public Engine(CustomSystem customSystem, ConsoleReaderWritter consoleReaderWriter, CommandExecuter commandExecuter) { this.CustomSystem = customSystem; this.ConsoleReaderWritter = consoleReaderWriter; this.CommandExecuter = commandExecuter; }
/* @brief: 注册表数据消息监听 * @param: iGameRecv 消息注册接口 * @return void */ public static void RegistCallback(bool bClear = true) { if (bClear) { Clear(); } //注册所有表 CreateTables(); //注册表自定义消息入口 CustomSystem.RegistCustomCallback(CallbackDefine.SERVER_CUSTOMMSG_VIRTUALREC_ADD, onTableAdd); CustomSystem.RegistCustomCallback(CallbackDefine.SERVER_CUSTOMMSG_VIRTUALREC_CLEAR, onTableClear); CustomSystem.RegistCustomCallback(CallbackDefine.SERVER_CUSTOMMSG_VIRTUALREC_UPDATE, onTableChangeSingle); CustomSystem.RegistCustomCallback(CallbackDefine.SERVER_CUSTOMMSG_VIRTUALREC_UPDATE_ROW, onTableChange); CustomSystem.RegistCustomCallback(CallbackDefine.SERVER_CUSTOMMSG_VIRTUALREC_REMOVE_ROW, onTableDelete); }
public static void Main() { try { CustomSystem customSystem = new CustomSystem(); ConsoleReaderWritter consoleReaderWriter = new ConsoleReaderWritter(); CommandExecuter commandExecuter = new CommandExecuter(customSystem, consoleReaderWriter); Engine engine = new Engine(customSystem, consoleReaderWriter, commandExecuter); engine.Run(); } catch (NullReferenceException nullRefEx) { Console.WriteLine(nullRefEx.Message); } }
/* @brief:系统启动注册事件 * @return void */ public static void RegistCallback(bool bClear = true) { IGameReceiver iGameRecv = Game.Instance.mGameRecv; if (iGameRecv == null) { LogSystem.Log("Error!! WorldStage::RegistCallback iGameRecv is null"); return; } GameSceneManager.RegistCallback(iGameRecv, bClear); ObjectManager.RegistCallback(iGameRecv, bClear); RecordSystem.RegistCallback(iGameRecv, bClear); CustomSystem.RegistCallback(iGameRecv, bClear); ViewSystem.RegistCallback(iGameRecv, bClear); TableSystem.RegistCallback(); ServerCustom.RegistCallBack(); iGameRecv.RegistCallBack("on_msg_tracert", on_msg_tracert); iGameRecv.RegistCallBack("on_terminate", on_terminate); }
/// <summary> /// 清除各个子面板 /// </summary> public void UnInitLobbyMainSystems() { WXLoginSystem.Destroy(); RealNameApproveSystem.Destroy(); LobbyMainSystem.Destroy(); ShareWxSystem.Destroy(); HolidayActivitySystem.Destroy(); GetGiftSpreadBagSystem.Destroy(); UserInfoSystem.Destroy(); GamePlayingMethodSystem.Destroy(); ProductAgencySystem.Destroy(); CustomSystem.Destroy(); PlayerMessageSystem.Destroy(); ActivitySystem.Destroy(); ActiveGiftSystem.Destroy(); CreatRoomMessageSystem.Destroy(); JoinRoomShowSystem.Destroy(); InsteadOpenRoomSystem.Destroy(); SelectAreaSystem.Destroy(); HistroyGradeSystem.Destroy(); ParlorShowSystem.Destroy(); RedPageShowSystem.Destroy(); }
/// <summary> /// 注册服务端消息 /// </summary> void RegisterCallback() { CustomSystem.RegistCustomCallback(0, OnMonsterKilled); }