Exemplo n.º 1
0
        static void Pardon(Client player, string[] cmd, int iarg)
        {
            if (cmd.Length != 2)
            {
                throw new ErrorException("Missing username");
            }

            if (player.Admin() || Donors.IsDonor(player))
            {
                Banned.Pardon(player, cmd [1]);
                return;
            }

            Banned.VotePardon(player, cmd [1]);
        }
Exemplo n.º 2
0
        void SetRegionStart(Client player, string[] cmd, int iarg)
        {
            if (Donors.IsDonor(player) == false && player.Uptime.TotalDays < 2 && (player.Admin() == false))
            {
                player.TellSystem(Chat.Red, "You must have been playing here at least 48 hours before you can create custom regions");
                player.TellSystem(Chat.Gray, "Use " + Chat.Yellow + "/ticket region" + Chat.Gray + " to create your first region");
                player.TellSystem(Chat.Gold, "See /donate, if you donate you can make one immediately.");
                return;
            }

            regionStart.Remove(player.MinecraftUsername);
            regionStart.Add(player.MinecraftUsername, player.Session.Position.Clone());
            player.TellSystem(Chat.Aqua, "Region start set at " + player.Session.Position.CloneInt());
            player.TellSystem(Chat.Aqua, "Go to other corner and type:");
            player.TellSystem("", "    /region set [ymin] [ymax]");
        }
Exemplo n.º 3
0
        public sealed override WorldSession Join(Client player)
        {
            //reset scoreboard
            player.Score = null;

            if (Suspended)
            {
                player.TellSystem(Chat.Purple, "Vanilla is suspended by admin, it will be right back");
                return(null);
            }

            StartBackend();

            lock (players)
            {
                int pc = 0;
                foreach (VanillaSession r in players)
                {
                    if (r.Player.Settings.Cloaked == null)
                    {
                        pc++;
                    }
                }

                if (pc >= MinecraftServer.MaxSlots && player.Settings.Cloaked == null)
                {
                    //Kick old player
                    //New visitors are given an advantage
                    if (player.Uptime.TotalMinutes < 15)
                    {
                        //Kick normal player
                        foreach (VanillaSession r in players)
                        {
                            if (r.Player.Settings.Cloaked != null)
                            {
                                continue;
                            }
                            if (Donors.IsDonor(r.Player))
                            {
                                continue;
                            }
                            if (r.Player.Uptime.TotalMinutes < 15)
                            {
                                continue;
                            }
                            KickSlot(r.Player);
                            World.Main.Say(Chat.Gray, r.Player.Name + " left its slot to " + player.Name + "(new)");
                            goto slotFree;
                        }
                    }

                    if (Donors.IsDonor(player.MinecraftUsername))
                    {
                        //Kick any non donor
                        foreach (VanillaSession r in players)
                        {
                            if (r.Player.Settings.Cloaked != null)
                            {
                                continue;
                            }
                            if (Donors.IsDonor(r.Player))
                            {
                                continue;
                            }
                            if (r.Player.Uptime.TotalMinutes < 15)
                            {
                                continue;
                            }
                            KickSlot(r.Player);
                            this.Say(Chat.Gray, r.Player.Name + " left its slot to donor " + player.Name);
                            goto slotFree;
                        }
                        foreach (VanillaSession r in players)
                        {
                            if (r.Player.Settings.Cloaked != null)
                            {
                                continue;
                            }
                            if (Donors.IsDonor(r.Player))
                            {
                                continue;
                            }
                            KickSlot(r.Player);
                            this.Say(Chat.Gray, r.Player.Name + " left its slot to donor " + player.Name);
                            goto slotFree;
                        }
                        goto slotFree;
                    }

                    //Block
                    Chat.ReadFile("full.txt", Chat.Aqua, player);
                    this.Say(Chat.DarkGreen, "No free slot for " + player.Name);
                    return(null);
                }

slotFree:

                var server = BackendManager.StartServer(ServerName);
                if (server.Running.WaitOne(10) == false)
                {
                    Log.WriteServer("Timeout waiting for server to start");
                }

                VanillaSession s = CreateSession(player);
                players.Add(s);
                base.Join(s);
#if DEBUG
                Console.WriteLine(s.Player.MinecraftUsername + " Joining Real: " + Players.Length);
#endif
                return(s);
            }
        }