Exemplo n.º 1
0
        /// <summary>
        /// 类型:方法
        /// 名称:OnOperationRequest
        /// 作者:taixihuase
        /// 作用:响应并处理客户端发来的请求
        /// 编写日期:2015/7/14
        /// </summary>
        /// <param name="operationRequest"></param>
        /// <param name="sendParameters"></param>
        protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            switch (operationRequest.OperationCode)
            {
            // 账号注册
            case (byte)OperationCode.Regist:
                Regist.OnRequest(operationRequest, sendParameters, this);
                break;

            // 账号登陆
            case (byte)OperationCode.Login:
                Login.OnRequest(operationRequest, sendParameters, this);
                break;

            // 创建新角色
            case (byte)OperationCode.CreateCharacter:
                CreateCharacter.OnRequest(operationRequest, sendParameters, this);
                break;

            // 角色进入场景
            case (byte)OperationCode.WorldEnter:
                WorldEnter.OnRequest(operationRequest, sendParameters, this);
                break;
            }
        }