Beispiel #1
0
        public void OnSendChatRsp(uint iMessageType, object kParam)
        {
            NetworkMessageParam param = kParam as NetworkMessageParam;
            SendChatRsp         rsp   = param.rsp as SendChatRsp;

            Log4U.LogDebug(rsp.resultCode);
            if (rsp.resultCode == SendChatRsp.ResultCode.SUCCESS)
            {
                if (_waitSendChatDict.ContainsKey(param.msgID))
                {
                    SendChatReq req = param.req as SendChatReq;
                    _waitSendChatDict[param.msgID].isSend = true;
                    _waitSendChatDict.Remove(param.msgID);
                }
                MessageDispatcher.GetInstance().DispatchMessage((uint)EUIMessage.UPDATE_SEND_CHAT);
            }
            else
            {
                if (_waitSendChatDict.ContainsKey(param.msgID))
                {
                    SendChatReq req = param.req as SendChatReq;
                    _waitSendChatDict[param.msgID].isSend = false;
                    _waitSendChatDict.Remove(param.msgID);
                }
                MessageDispatcher.GetInstance().DispatchMessage((uint)EUIMessage.UPDATE_SEND_CHAT);
            }
        }
Beispiel #2
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();
            }
        }
        public void OnChangeGroupSync(uint iMessageType, object kParam)
        {
            ChangeGroupSync sync = kParam as ChangeGroupSync;

            if (_groupDict.ContainsKey(sync.groupItem.groupId))
            {
                _groupDict[sync.groupItem.groupId] = sync.groupItem;
            }
            else
            {
                _groupDict.Add(sync.groupItem.groupId, sync.groupItem);
            }
            Log4U.LogDebug("Changing");
        }
Beispiel #4
0
        /// <summary>
        /// 对界面进行压栈
        /// </summary>
        /// <typeparam name="T">下一个界面的类型</typeparam>
        /// <param name="go">下一个界面对应的GameObject</param>
        /// <param name="param">需要传给下一个界面对应的压栈参数</param>
        private void PushState <T>(GameObject go, object param = null) where T : BaseState
        {
            T nextState = go.GetComponent <T>();

            nextState.OnEnter(param);

            if (_stateStack.Count != 0)
            {
                BaseState curState = _stateStack.Peek();
                curState.DisableTouch();
                Log4U.LogDebug("cur", curState.UIType);
                Tweener tweener = nextState.BeginEnterTween();
                tweener.OnComplete(delegate()
                {
                    curState.OnHide();
                    curState.EnabelTouch();
                });
            }
            _stateStack.Push(nextState);
        }
Beispiel #5
0
 public void RemoveChatLog(string chatID)
 {
     Log4U.LogDebug(_chatLogDict.Remove(chatID));
 }
 public void OnConfirmDeleteChatLog()
 {
     GlobalChat.GetInstance().RemoveChatLog(_chatLog.chatID);
     Destroy(gameObject);
     Log4U.LogDebug("chat count", GlobalChat.GetInstance().Count);
 }