コード例 #1
0
        public void UnRegister([FromBody] ProtocolMapping protocolMapping)
        {
            var config = Configuration.GetConfiguration();

            foreach (var one in config.Protocols)
            {
                if (one.Protocol.Equals(protocolMapping.Protocol) &&
                    Registration.IsRegistered(one.Protocol))
                {
                    var protocols = new List <string> {
                        one.Protocol
                    };
                    Registration.UnRegister(protocols);
                }
            }
        }
コード例 #2
0
    /// <summary>
    /// 初始化
    /// </summary>
    public void Initialize()
    {
        m_SocketClient = new SocketClient();

        m_SendWriter = new BinaryWriter(new MemoryStream(DEFAULT_SEND_BUFFER_SIZE));

        m_NetControllers = new BetterList <BaseNetController>();

        m_GatewayProtocolMapping    = new ProtocolMapping();
        m_GameServerProtocolMapping = new ProtocolMapping();

        m_SendToGameServerWriter = new BinaryWriter(new MemoryStream(DEFAULT_SEND_BUFFER_SIZE));
        m_PlayerToGSProto        = SingleInstanceCache.GetInstanceByType <KC2G_PlayerToGS>();

        m_Handshake        = false;
        m_MessageToken     = "";
        m_MessageTokenHash = 0;
        m_MessageIndex     = 0;

        ListenGateway(KG2C_Protocol.g2c_gs_to_player, OnReceivedGameServerMessage, typeof(KG2C_GSToPlayer));

        #region NetController
        m_LoginController         = new LoginController();
        m_CharacterListController = new CharacterListController();
        m_SceneController         = new SceneController();
        m_PlayerController        = new PlayerController();
        m_MailController          = new MailController();
        m_LogController           = new LogController();
        m_FriendController        = new FriendController();
        m_TeamController          = new TeamController();
        m_PackageController       = new PackageController();
        m_ShopController          = new ShopController();
        m_FoundryController       = new FoundryController();
        m_InstanceController      = new InstanceController();
        m_MissionController       = new MissionController();
        m_ChatContoller           = new Game.Frame.Net.ChatController();
        m_SkillController         = new SkillController();
        m_DropItemController      = new DropItemController();
        m_reliveController        = new ReliveController();
        m_MSAIBossController      = new MSAIBossController();
        #endregion
    }