コード例 #1
0
        public void OnLoginRsp(uint iMessageType, object kParam)
        {
            LoginRsp rsp = kParam as LoginRsp;

            Log4U.LogDebug(rsp.resultCode);
            if (rsp.resultCode == LoginRsp.ResultCode.SUCCESS)
            {
                _isLogin = true;

                GetPersonalInfoReq req = new GetPersonalInfoReq
                {
                    friendInfo = true,
                    userInfo   = true,
                    groupInfo  = true,
                };
                NetworkManager.GetInstance().SendPacket <GetPersonalInfoReq>(ENetworkMessage.GET_PERSONALINFO_REQ, req);

                PlayerPrefs.SetString(GlobalVars.PREF_USER_ID, _userId);
                PlayerPrefs.SetString(GlobalVars.PREF_USER_PASSWORD, _userPassword);

                CreateDir();
            }
            else
            {
                DoLogOut();
            }
        }
コード例 #2
0
        public void OnGetPersonalInfoRsp(uint iMessageType, object kParam)
        {
            NetworkMessageParam param = kParam as NetworkMessageParam;
            GetPersonalInfoRsp  rsp   = param.rsp as GetPersonalInfoRsp;
            GetPersonalInfoReq  req   = param.req as GetPersonalInfoReq;

            if (rsp.resultCode == GetPersonalInfoRsp.ResultCode.SUCCESS &&
                req.userInfo)
            {
                _userName  = rsp.userInfo.userName;
                _headIndex = rsp.userInfo.headIndex;
                MessageDispatcher.GetInstance().DispatchMessage((uint)EUIMessage.UPDATE_PERSONAL_DETAIL, null);
            }
        }
コード例 #3
0
        public void OnPersonalSetRsp(uint iMessageType, object kParam)
        {
            PersonalSettingsRsp rsp = kParam as PersonalSettingsRsp;

            Log4U.LogInfo(rsp.resultCode);

            if (rsp.resultCode == PersonalSettingsRsp.ResultCode.SUCCESS)
            {
                GetPersonalInfoReq req = new GetPersonalInfoReq
                {
                    userInfo = true,
                };

                NetworkManager.GetInstance().SendPacket <GetPersonalInfoReq>(ENetworkMessage.GET_PERSONALINFO_REQ, req);
            }
        }
コード例 #4
0
        public void OnGetPersonalInfoRsp(uint iMessageType, object kParam)
        {
            NetworkMessageParam param = kParam as NetworkMessageParam;
            GetPersonalInfoRsp  rsp   = param.rsp as GetPersonalInfoRsp;
            GetPersonalInfoReq  req   = param.req as GetPersonalInfoReq;

            if (rsp.resultCode == GetPersonalInfoRsp.ResultCode.SUCCESS &&
                req.friendInfo)
            {
                _groupDict.Clear();
                foreach (GroupItem group in rsp.groups)
                {
                    _groupDict.Add(group.groupId, group);
                }
            }
        }
コード例 #5
0
        public void OnGetPersonalInfoRsp(uint iMessageType, object kParam)
        {
            NetworkMessageParam param = kParam as NetworkMessageParam;
            GetPersonalInfoRsp  rsp   = param.rsp as GetPersonalInfoRsp;
            GetPersonalInfoReq  req   = param.req as GetPersonalInfoReq;

            if (rsp.resultCode == GetPersonalInfoRsp.ResultCode.SUCCESS &&
                req.friendInfo)
            {
                _friendDict.Clear();
                foreach (UserItem friend in rsp.friends)
                {
                    _friendDict[friend.userId] = friend;
                }
                MessageDispatcher.GetInstance().DispatchMessageAsync((uint)EUIMessage.UPDATE_CHAT_LIST, null);
            }
        }