public void NewbieSetInfo(int inMyUserId, ReadyPlayerSampleInfo[] inPlayerInfos)
        {
            this.IsRoomReady = true;
            this.MyUserId    = inMyUserId;
            this._pvpPlayers.Clear();
            this._pvpPlayers.AddRange(inPlayerInfos);
            for (int i = 0; i < this._pvpPlayers.Count; i++)
            {
                ReadyPlayerSampleInfo readyPlayerSampleInfo = this._pvpPlayers[i];
                if (readyPlayerSampleInfo != null)
                {
                    readyPlayerSampleInfo.selfDefSkillId = "1";
                }
            }
            this.NewbieSetUserNameForRobot();
            ReadyPlayerSampleInfo readyPlayerSampleInfo2 = this._pvpPlayers.Find((ReadyPlayerSampleInfo x) => x.newUid == inMyUserId);

            if (readyPlayerSampleInfo2 != null)
            {
                this.SelfTeam = readyPlayerSampleInfo2.GetTeam();
            }
            else
            {
                ClientLogger.Error("NewbieSetInfo cannot found related playerinfo");
            }
        }
Exemple #2
0
        public TeamType GetTeam(int userId)
        {
            ReadyPlayerSampleInfo readyPlayerSampleInfo = this._roomInfo.PvpPlayers.FirstOrDefault((ReadyPlayerSampleInfo x) => x.newUid == userId);

            if (readyPlayerSampleInfo != null)
            {
                return(readyPlayerSampleInfo.GetTeam());
            }
            return(TeamType.None);
        }
Exemple #3
0
        public bool IsOurPlayer(int userId)
        {
            ReadyPlayerSampleInfo readyPlayerSampleInfo = this.TryFindPlayerInfo(userId, null);

            return(readyPlayerSampleInfo != null && readyPlayerSampleInfo.GetTeam() == this.SelfTeamType);
        }