예제 #1
0
        public static void RevertGame() //Reset game bools/stats and stop timers
        {
            world_.Hax = true;
            foreach (Player pl in world_.Players)
            {
                pl.JoinWorld(world_, WorldChangeReason.Rejoin);
            }
            //world_.Players.Send(PacketWriter.MakeHackControl(1, 1, 1, 1, 1, -1)); Commented out until classicube clients support hax packet

            foreach (Player p in world_.Players)
            {
                p.Info.isPlayingInfection = false;
                if (p.Info.isInfected)
                {
                    p.Info.isInfected        = false;
                    p.iName                  = null;
                    p.Info.tempDisplayedName = null;
                    p.entityChanged          = false;
                }
                p.Message("&aYour status has been reverted!");
                p.JoinWorld(world_, WorldChangeReason.Rejoin);
            }


            world_.gameMode = GameMode.NULL;
            task_.Stop();
            isOn     = false;
            instance = null;
            world_   = null;
        }
예제 #2
0
 public static Infection GetInstance(World world)
 {
     if (instance == null)
     {
         world_    = world;
         instance  = new Infection();
         startTime = DateTime.Now;
         task_     = new SchedulerTask(Interval, true).RunForever(TimeSpan.FromMilliseconds(250)); //run loop every quarter second
     }
     return(instance);
 }