예제 #1
0
 public void ClearHeroes()
 {
     if (Singleton <GamePlayerCenter> .get_instance().HostPlayerId == this.PlayerId)
     {
         DebugHelper.CustomLog("Clear heros for playerid={0} camp={1}", new object[]
         {
             this.PlayerId,
             this.PlayerCamp
         });
     }
     this.IntimacyData = null;
     this._heroIds.Clear();
     this._heroes.Clear();
     this.CaptainId = 0u;
     this.Captain   = default(PoolObjHandle <ActorRoot>);
 }
예제 #2
0
        public Player AddPlayer(uint playerId, COM_PLAYERCAMP camp, int campPos = 0, uint level = 1u, bool isComputer = false, string name = null, int headIconId = 0, int logicWrold = 0, ulong uid = 0uL, uint vipLv = 0u, string openId = null, uint gradeOfRank = 0u, uint classOfRank = 0u, int honorId = 0, int honorLevel = 0, GameIntimacyData IntimacyData = null)
        {
            Player result = null;

            if (playerId == 0u)
            {
                DebugHelper.Assert(false, "Try to create player by Id 0");
            }
            else if (this._players.ContainsKey(playerId))
            {
                DebugHelper.Assert(false, "Try to create player which is already existed, ID is {0}", new object[]
                {
                    playerId
                });
                result = this.GetPlayer(playerId);
            }
            else
            {
                Player player = new Player();
                player.PlayerId     = playerId;
                player.LogicWrold   = logicWrold;
                player.PlayerUId    = uid;
                player.PlayerCamp   = camp;
                player.CampPos      = campPos;
                player.Level        = (int)level;
                player.HeadIconId   = headIconId;
                player.Computer     = isComputer;
                player.Name         = CUIUtility.RemoveEmoji(name);
                player.isGM         = false;
                player.VipLv        = vipLv;
                player.OpenId       = openId;
                player.GradeOfRank  = gradeOfRank;
                player.ClassOfRank  = classOfRank;
                player.HonorId      = honorId;
                player.HonorLevel   = honorLevel;
                player.IntimacyData = IntimacyData;
                this._players.Add(playerId, player);
                result = player;
            }
            DebugHelper.Assert((long)this._players.get_Count() <= 10L, "超出Player最大数量");
            return(result);
        }