Exemplo n.º 1
0
        //更新状态
        public bool UpdateUserItemStatus(IClientUserItem pIClientUserItem, tagUserStatus pUserStatus)
        {
            //效验参数
            //ASSERT(pUserStatus != 0);
            Debug.Assert(pIClientUserItem != null);

            //获取用户
            tagUserInfo pUserInfo = pIClientUserItem.GetUserInfo();

            //以往数据
            tagUserStatus tUserStatus = new tagUserStatus();

            tUserStatus.wTableID     = pUserInfo.wTableID;
            tUserStatus.wChairID     = pUserInfo.wChairID;
            tUserStatus.cbUserStatus = pUserInfo.cbUserStatus;

            //设置数据
            pUserInfo.wTableID     = pUserStatus.wTableID;
            pUserInfo.wChairID     = pUserStatus.wChairID;
            pUserInfo.cbUserStatus = pUserStatus.cbUserStatus;
            pIClientUserItem.SetUserInfo(pUserInfo);
            //通知更新
            Debug.Assert(m_pIUserManagerSink != null);
            if (m_pIUserManagerSink != null)
            {
                m_pIUserManagerSink.OnUserItemUpdate(pIClientUserItem, ref tUserStatus);
            }


            return(true);
        }
Exemplo n.º 2
0
        public virtual void onGPAccountInfoHttpIP(uint dwUserID, string strIP, string strHttp)
        {
            GamePlayer pPlayer = getPlayerByUserID(dwUserID);

            if (pPlayer == null)
            {
                return;
            }
            IClientUserItem pIClientUserItem = pPlayer.getUserItem(false);

            if (pIClientUserItem == null)
            {
                return;
            }

            //获取用户
            tagUserInfo       pUserInfo       = pIClientUserItem.GetUserInfo();
            tagCustomFaceInfo pCustomFaceInfo = pIClientUserItem.GetCustomFaceInfo();
            var cbLogonIP = Encoding.Default.GetBytes(strIP);

            pUserInfo.dwClientAddr = (uint)(cbLogonIP[0] | cbLogonIP[1] << 8 | cbLogonIP[2] << 16 | cbLogonIP[3] << 24);
            ///pUserInfo.szLogonIP = Encoding.Default.GetBytes(strIP);
            pUserInfo.szHeadHttp = Encoding.Default.GetBytes(strHttp);
            //  strncpy(pUserInfo.szLogonIP, strIP.c_str(), countarray(pUserInfo.szLogonIP));
            //  strncpy(pUserInfo.szHeadHttp, strHttp.c_str(), countarray(pUserInfo.szHeadHttp));

            pPlayer.upPlayerInfo();
        }
Exemplo n.º 3
0
        //更新头像
        public bool UpdateUserCustomFace(IClientUserItem pIClientUserItem, uint dwCustomID,
                                         tagCustomFaceInfo CustomFaceInfo)
        {
            //获取用户
            tagUserInfo pUserInfo = pIClientUserItem.GetUserInfo();

            pIClientUserItem.SetCustomFaceInfo(CustomFaceInfo);

            //设置变量
            pUserInfo.dwCustomID = dwCustomID;
            pIClientUserItem.SetUserInfo(pUserInfo);
            //pCustomFaceInfo = CustomFaceInfo;

            //通知更新
            Debug.Assert(m_pIUserManagerSink != null);
            if (m_pIUserManagerSink != null)
            {
                m_pIUserManagerSink.OnUserFaceUpdate(pIClientUserItem);
            }

            return(true);
        }
Exemplo n.º 4
0
        //更新接口
        //更新积分
        public bool UpdateUserItemScore(IClientUserItem pIClientUserItem, tagUserScore pUserScore)
        {
            Debug.Log("更新积分");
            //效验参数
            //Debug.Assert(pUserScore != null);
            Debug.Assert(pIClientUserItem != null);

            //获取用户
            tagUserInfo pUserInfo = pIClientUserItem.GetUserInfo();

            //以往数据
            tagUserScore UserScore = new tagUserScore();

            UserScore.lScore       = pUserInfo.lScore;
            UserScore.lInsure      = pUserInfo.lInsureScore;
            UserScore.dwWinCount   = pUserInfo.lWinCount;
            UserScore.dwLostCount  = pUserInfo.lLostCount;
            UserScore.dwDrawCount  = pUserInfo.lDrawCount;
            UserScore.dwFleeCount  = pUserInfo.lFleeCount;
            UserScore.dwExperience = pUserInfo.lExperience;

            //设置数据
            pUserInfo.lScore       = pUserScore.lScore;
            pUserInfo.lInsureScore = pUserScore.lInsure;
            pUserInfo.lWinCount    = pUserScore.dwWinCount;
            pUserInfo.lLostCount   = pUserScore.dwLostCount;
            pUserInfo.lDrawCount   = pUserScore.dwDrawCount;
            pUserInfo.lFleeCount   = pUserScore.dwFleeCount;
            pUserInfo.lExperience  = pUserScore.dwExperience;
            pIClientUserItem.SetUserInfo(pUserInfo);
            //通知更新
            Debug.Assert(m_pIUserManagerSink != null);
            if (m_pIUserManagerSink != null)
            {
                m_pIUserManagerSink.OnUserItemUpdate(pIClientUserItem, ref UserScore);
            }

            return(true);
        }