Esempio n. 1
0
 private void CheckPlayers()
 {
     lock (Players)
     {
         for (int i = 0; i < Players.Count; i++)
         {
             if (Players[i].IsDisposed)
             {
                 Players.RemoveAt(i);
                 InstanceService.SavePlayerIDs(ZoneID + ":" + ID, Players);
             }
         }
     }
 }
Esempio n. 2
0
        public void AddPlayer(Player player, Zone_jump jump)
        {
            lock (Players)
            {
                if (!Players.Contains(player))
                {
                    Players.Add(player);
                }

                player.InstanceID = ZoneID + ":" + ID;

                if (jump != null)
                {
                    player.Teleport(Region, jump.ZoneID, jump.WorldX, jump.WorldY, jump.WorldZ, jump.WorldO);
                }
                else
                {
                    player.Teleport(Region, player._Value.ZoneId, (uint)player._Value.WorldX, (uint)player._Value.WorldY, (ushort)player._Value.WorldZ, (ushort)player._Value.WorldO);
                }

                Region.CheckZone(player);

                InstanceService.SavePlayerIDs(ZoneID + ":" + ID, Players);

                player.SendClientMessage("Instance ID: " + ID, SystemData.ChatLogFilters.CHATLOGFILTERS_TELL_RECEIVE);

                string players = string.Empty;
                foreach (Player plr in Players)
                {
                    players += plr.Name + ",";
                }
                if (players.EndsWith(","))
                {
                    players = players.Substring(0, players.Length - 1);
                }

                player.SendClientMessage("Registered players: " + players, SystemData.ChatLogFilters.CHATLOGFILTERS_TELL_RECEIVE);
                player.SendClientMessage("Note: Wait for your party leader to get into the instance if you find yourself in another instance ID.", SystemData.ChatLogFilters.CHATLOGFILTERS_TELL_RECEIVE);
            }
        }