Exemplo n.º 1
0
        public Room(tagGameServer Server, tagGameKind Kind)
        {
            mGameServer = Server;
            mKind = Kind;
            mUserManager = new UserManager(this);
            mTableManager = new TableManager(this);
           // mFrameManger = new GameClientManager(this);

            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnRequestFailureEvent, (ushort)MAIN_CMD.MDM_GR_USER, (ushort)USER_SUB_CMD.SUB_GR_REQUEST_FAILURE, typeof(CMD_GR_RequestFailure));

            //游戏配置
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnCongigColumnEvent, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_COLUMN, typeof(CMD_GR_ConfigColumn));
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnCongigServerEvent, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_SERVER, typeof(CMD_GR_ConfigServer));
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnCongigPropertyEvent, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_PROPERTY, typeof(CMD_GR_ConfigProperty));
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnCongigFinishEvent, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_FINISH);
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            mSocketHander.RemoveListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, (ushort)MAIN_CMD.MDM_GR_USER, (ushort)USER_SUB_CMD.SUB_GR_REQUEST_FAILURE);

            mSocketHander.RemoveListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_COLUMN);
            mSocketHander.RemoveListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_SERVER);
            mSocketHander.RemoveListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_PROPERTY);
            mSocketHander.RemoveListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, (ushort)MAIN_CMD.MDM_GR_CONFIG, (ushort)CONFIG_SUB_CMD.SUB_GR_CONFIG_FINISH);

            mUserManager.Dispose();
            mTableManager.Dispose();
            if (mSocketHander.IsValid())
                mSocketHander.Shutdown();

            mTableManager = null;
            mSocketHander = null;
            mUserManager = null;
        }