Beispiel #1
0
 /// <summary>
 /// Special worlds where the entrance region matters
 /// such as banks and warpzones
 /// </summary>
 public void SetSession(WorldSession session)
 {
     lock (sessionLock)
     {
         WorldSession old = Session;
         Session = session;
         if (old != null)
         {
             old.Close("going to " + session);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Special worlds where the entrance region matters
        /// such as banks and warpzones
        /// </summary>
        public void SetWorld(World w)
        {
            lock (sessionLock)
            {
                if (Phase == Phases.FinalClose)
                {
                    w = World.Void;
                }
                WorldSession old = Session;
                Session            = World.Void.Join(this);
                clientThread.State = "Void";

                if (old != null)
                {
                    old.Close("going to " + w);
                }
                WorldSession n;

                //Banned players
                BadPlayer b = Banned.CheckBanned(this);
                if (b == null)
                {
                    n = w.Join(this);

                    AfkSession afk = n as AfkSession;
                    if (afk != null)
                    {
                        afk.OriginalWorld = old.World;
                    }
                }
                else
                {
                    n = World.HellBanned.Join(this);
                }

                //If we are denied
                if (n == null)
                {
                    Session = World.Wait.Join(this);
                }
                else
                {
                    Session = n;
                }

                clientThread.State = Session.ToString();
            }
        }