コード例 #1
0
        public void CreateAccountResult(bool success, int accountId, string accountName, string password, int peerConnectionId)
        {
            MyPeer peer = LBPeerManager.Instance.GetPeer(peerConnectionId);

            if (null != peer)
            {
                peer.SendCustomEvent(RpId.CreateAccountResult, RpCreateAccountResult.Serialization(success, RpCreateAccountResult.CreateAccountErrorCode.AccountExist));
            }
        }
コード例 #2
0
ファイル: LoginProxy.cs プロジェクト: yamido001/LegionBattle
    void OnCreateAccountResponse(ResponseBase response)
    {
        RpCreateAccountResult createAccountResult = response as RpCreateAccountResult;

        if (createAccountResult.Result)
        {
            GameMain.Instance.EventMgr.PostObjectEvent(EventId.CreateAccountSuccess, null);
        }
        else
        {
            GameMain.Instance.EventMgr.PostObjectEvent(EventId.CreateAccountError, createAccountResult.ErrorCode);
        }
    }
コード例 #3
0
        public void AccountCreate(string accountName, string password, int peerConnectionId)
        {
            LBLogger.Info(LogTag, "请求创建账号");
            LBAccount curAccount = GetAccountByName(accountName);

            if (null != curAccount)
            {
                MyPeer peer = LBPeerManager.Instance.GetPeer(peerConnectionId);
                if (null != peer)
                {
                    peer.SendCustomEvent(RpId.CreateAccountResult, RpCreateAccountResult.Serialization(false, RpCreateAccountResult.CreateAccountErrorCode.AccountExist));
                }
            }
            else
            {
                LBSqlManager.Instance.CreateAccount(accountName, password, peerConnectionId);
            }
        }
コード例 #4
0
        public static void OnOperateRequest(MyPeer peer, OperationRequest operationRequest)
        {
            LBLogger.Info(LogTag, "请求创建账号");
            RqCreateAccount rqCreateAccount = Deserialization(operationRequest.Parameters);

            if (null != rqCreateAccount)
            {
                LBAccountManager.Instance.AccountCreate(rqCreateAccount.AccountName, rqCreateAccount.Password, peer.ConnectionId);
            }
            else
            {
                if (ParseErrorCode == RqLoginErrorCode.Null)
                {
                    LBLogger.Error(LogTag, "登录游戏解析失败,但是没有错误码");
                    return;
                }
                peer.SendCustomEvent(RpId.CreateAccountResult, RpCreateAccountResult.Serialization(false, RpCreateAccountResult.CreateAccountErrorCode.ParseError));
            }
        }