Exemple #1
0
        /// <summary>
        /// Leaving the specified player and forAnotherRegion.
        /// </summary>
        /// <param name='player'>
        /// Player.
        /// </param>
        /// <param name='forAnotherRegion'>
        /// If going into another region dont tell the player, leaving
        /// </param>
        internal virtual void Leaving(Client player, WorldRegion nextRegion)
        {
            if (Type == SpawnRegion.Type)
            {
                SpawnRegion.Leaving(player);
            }

            if (Type == SpawnTimeRegion.Type)
            {
                SpawnTimeRegion.Leaving(player);
                return;
            }

            Log.WriteRegion(player, this, false);
            if (nextRegion == null || nextRegion.SubRegions != null && nextRegion.SubRegions.Contains(this))
            {
                player.TellAbove(Chat.Gray, "Leaving " + Name);
            }

            if (player.Settings.Cloaked != null)
            {
                return;
            }
            if (ReportVisits == false)
            {
                return;
            }

            TellResidentsSystem(player, Chat.Gray, player.Name + " left " + Name + " " + FromDirection(player.Session.Position));
        }
Exemple #2
0
 internal virtual bool FilterServer(WorldSession player, Packet packet)
 {
     if (player.Mode != GameMode.Creative)
     {
         if (Type == SpawnRegion.Type)
         {
             return(SpawnRegion.FilterServer(player, packet));
         }
         if (Type == SpawnTimeRegion.Type)
         {
             return(SpawnTimeRegion.FilterServer(player, packet));
         }
     }
     return(false);
 }
Exemple #3
0
        internal virtual void Entering(Client player)
        {
            if (Type == SpawnRegion.Type)
            {
                SpawnRegion.Entering(player);
            }

            if (Type == SpawnTimeRegion.Type)
            {
                SpawnTimeRegion.Entering(player);
                return;
            }

            Log.WriteRegion(player, this, true);

            Regions.WarpPortalVisuals.EnterRegion(player, this);

            //Region message
            if (Message != null)
            {
                player.TellAbove(Chat.DarkAqua + "[region] ", Message);
            }
            else
            {
                player.TellAbove(Chat.DarkAqua, "Entering " + Name);
            }

            if (player.Settings.Cloaked != null)
            {
                return;
            }

            if (ReportVisits == false)
            {
                return;
            }

            string message = player.Name + " entered " + ColorName + " " + FromDirection(player.Session.Position);

#if DEBUG
            player.TellSystem("DEBUG " + Chat.Blue, message);
#endif
            TellResidentsSystem(player, Chat.Blue, message);
        }