Beispiel #1
0
    IEnumerator LoadSameIpView(LocalNotification args)
    {
        yield return(new WaitForSeconds(0.2f));

        ContextManager.Instance.Push(new SameIpViewContext());
        GameObject       gm  = UIManagers.Instance.GetSingleUI(UIType.SameIpView);
        ArgsSameIpPlayer msg = args.param as ArgsSameIpPlayer;

        Debug.Log("Texture---------");
        Debug.Log(leftHeadSpr.mainTexture);
        Debug.Log(rightHeadSpr.mainTexture);
        Debug.Log(topHeadSpr.mainTexture);
        Debug.Log(selfHeadSpr.mainTexture);
        gm.GetComponent <UISameIpView>().SetInfo(args, () => UpdateReadyGame(null), () =>
        {
            if (RoomInfo.Instance.IsCreater()) //房主,且不是aa的情况下,才凸显出房主的消息
            {
                TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_OUT_ROOM_BY_CREATER);
            }
            else
            {
                TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_OUT_ROOM_BY_PLAYER);
            }
        });
    }
Beispiel #2
0
 public void ClearInfo()
 {
     room        = null;
     mSameIpArgs = new ArgsSameIpPlayer();
     PlayerInfo.Instance.mTeamSelfIndex  = "2";
     PlayerInfo.Instance.mTeamEnemyIndex = "2";
     nextIndex = "2";
     PlayerInfo.Instance.mPlayerData.roomCode = 0;
     RoomInfo.Instance.mIsExistWaitGameView   = false;
     NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EUpdateCreateRoomSpr);
     ClearPlayersDic();
 }
Beispiel #3
0
 void CheckStartPlaying()
 {
     if (!GoldFiledManager.Instance.mIsGoldFiled)
     {
         ArgsSameIpPlayer args = RoomInfo.Instance.mSameIpArgs;
         if (args != null && args.list.Count == 4)
         {
             NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESameIpPlayer, args);
         }
         else if (RoomInfo.Instance.GetRealPlayerCount() == 3)
         {
             NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESendCanReadyGame);
         }
     }
 }
Beispiel #4
0
    void ResetRefreshView(LocalNotification e)
    {
        Debug.Log("ResetRefreshView");
        CheckGameType();
        RefreshRoomPlayer();
        RefreshSelfData();
        ContextManager.Instance.Pop(UIType.SameIpView.Name);
        if (GoldFiledManager.Instance.mIsGoldFiled)
        {
            return;
        }
        ArgsSameIpPlayer args = RoomInfo.Instance.mSameIpArgs;

        if (args != null && args.list.Count == 4)
        {
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESameIpPlayer, args);
        }
        else if (RoomInfo.Instance.GetRealPlayerCount() == 3)
        {
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESendCanReadyGame);
        }
    }
Beispiel #5
0
    void RoomJoinNewPlayer(MsgGlobal msg)
    {
        MsgGuandanRoom data = msg.guandan_room;

        //Test============================================
        string str = "=====";

        for (int i = 0; i < data.player_info.Count; i++)
        {
            str += data.player_info[i].name + "&&&";
        }
        Debug.Log(str);
        //Test============================================
        RoomInfo.Instance.UpdatePlayersDic(data.player_info);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ERoomJoin_other_join);


        if (GoldFiledManager.Instance.mIsGoldFiled) //金币场不作准备
        {
            return;
        }

        if (data.same_ip_player != null && data.same_ip_player.Count == 4)
        {
            ArgsSameIpPlayer args = new ArgsSameIpPlayer();
            for (int i = 0; i < data.same_ip_player.Count; i++)
            {
                args.list.Add(data.same_ip_player[i]);
            }
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESameIpPlayer, args);
        }
        else if (RoomInfo.Instance.GetRealPlayerCount() == 3)
        {
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESendCanReadyGame);
        }
    }