Ejemplo n.º 1
1
        public void highlightStuff(string[] fileContent, Int64 seconds, Player p)
        {
            Player.UndoPos Pos;

            for (int i = fileContent.Length / 7; i >= 0; i--)
            {
                try
                {
                    if (Convert.ToDateTime(fileContent[(i * 7) + 4].Replace('&', ' ')).AddSeconds(seconds) >= DateTime.Now)
                    {
                        Level foundLevel = Level.Find(fileContent[i * 7]);
                        if (foundLevel != null && foundLevel == p.level)
                        {
                            Pos.mapName = foundLevel.name;
                            Pos.x = Convert.ToUInt16(fileContent[(i * 7) + 1]);
                            Pos.y = Convert.ToUInt16(fileContent[(i * 7) + 2]);
                            Pos.z = Convert.ToUInt16(fileContent[(i * 7) + 3]);

                            Pos.type = foundLevel.GetTile(Pos.x, Pos.y, Pos.z);

                            if (Pos.type == Convert.ToByte(fileContent[(i * 7) + 6]) || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
                            {
                                if (Pos.type == Block.air || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
                                    p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.red);
                                else p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.green);
                            }
                        }
                    }
                    else break;
                }
                catch { }
            }
        }
Ejemplo n.º 2
0
        public override void Use(Player p, string message)
        {
            Player who = Player.Find(message);
            Level whomap = who.level;
            if (who == null) { Player.SendMessage(p, "Player not found!"); }
            if (who == p) { Player.SendMessage(p, "Can't detain your self!"); }
            if (Server.devs.Contains(who.name) && !Server.devs.Contains(p.name))
            {
                Player.SendMessage(p, "You can't detain an MCDawn Developer!");
                return;
            }
            if (who.group.Permission >= p.group.Permission)
            {
                Player.SendMessage(p, "Can't detain someone with equal or higher rank!");
                return;
            }

            if (who.detained)
            {
                who.detained = false;
                Player.GlobalMessage(who.color + who.name + Server.DefaultColor + " is now freed from detention by " + p.color + p.name + Server.DefaultColor + ".");
                Command.all.Find("displayname").Use(who, who.name);
                return;
            }

            who.detained = true;
            Player.GlobalMessage(p.color + p.name + Server.DefaultColor + " detained " + who.color + who.name + Server.DefaultColor + " on map: &a" + whomap.name + Server.DefaultColor + ".");
            Command.all.Find("displayname").Use(who, who.name + " &c(detained)" + who.color + who.name);
        }
Ejemplo n.º 3
0
 public override void Help(Player p)
 {
     Player.SendMessage(p, "/setrank <player> <rank> [reason] - Sets or returns a players rank.");
     Player.SendMessage(p, "You may use /rank as a shortcut");
     Player.SendMessage(p, "Valid Ranks are: " + Group.concatList(true, true));
     Player.SendMessage(p, "Reason is optional.");
 }
Ejemplo n.º 4
0
 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     Player who = Player.Find(message);
     if (who != null)
     {
         if (who.voice)
         {
             who.voice = false;
             Player.SendMessage(p, "Removing voice status from " + who.name);
             who.SendMessage("Your voice status has been revoked.");
             who.voicestring = "";
         }
         else
         {
             who.voice = true;
             Player.SendMessage(p, "Giving voice status to " + who.name);
             who.SendMessage("You have received voice status.");
             who.voicestring = "&f+";
         }
     }
     else
     {
         Player.SendMessage(p, "There is no player online named \"" + message + "\"");
     }
 }
Ejemplo n.º 5
0
 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     try
     {
         if (message.ToLower() == "all")
         {
             for (int i = 0; i < PlayerBot.playerbots.Count; i++)
             {
                 if (PlayerBot.playerbots[i].level == p.level)
                 {
                     //   PlayerBot.playerbots.Remove(PlayerBot.playerbots[i]);
                     PlayerBot Pb = PlayerBot.playerbots[i];
                     Pb.removeBot();
                     i--;
                 }
             }
         }
         else
         {
             PlayerBot who = PlayerBot.Find(message);
             if (who == null) { Player.SendMessage(p, "There is no bot " + who + "!"); return; }
             if (p.level != who.level) { Player.SendMessage(p, who.name + " is in a different level."); return; }
             who.removeBot();
             Player.SendMessage(p, "Removed bot.");
         }
     }
     catch (Exception e) { Server.ErrorLog(e); Player.SendMessage(p, "Error caught"); }
 }
Ejemplo n.º 6
0
 public override void Help(Player p)
 {
     Player.SendMessage(p, "/undo [player] [seconds] - Undoes the blockchanges made by [player] in the previous [seconds].");
     Player.SendMessage(p, "/undo [player] all - Will undo 138 hours for [player] &c<Operator+>");
     Player.SendMessage(p, "/undo [player] 0 - Will undo 30 minutes &c<Operator+>");
     Player.SendMessage(p, "/undo physics [seconds] - Undoes the physics for the current map");
 }
Ejemplo n.º 7
0
        public void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type)
        {
            p.ClearBlockchange();
            CatchPos cpos = (CatchPos)p.blockchangeObject;

            cpos.message = cpos.message.Replace("'", "\\'");

            DataTable Messages = MySQL.fillData("SELECT * FROM `Commandblocks" + p.level.name + "` WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
            Messages.Dispose();

            if (Messages.Rows.Count == 0)
            {
                MySQL.executeQuery("INSERT INTO `Commandblocks" + p.level.name + "` (X, Y, Z, Message) VALUES (" + (int)x + ", " + (int)y + ", " + (int)z + ", '" + cpos.message + "')");
            }
            else
            {
                MySQL.executeQuery("UPDATE `Commandblocks" + p.level.name + "` SET Message='" + cpos.message + "' WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
            }

            Player.SendMessage(p, "Message block placed.");
            p.level.Blockchange(p, x, y, z, cpos.type);
            p.SendBlockchange(x, y, z, cpos.type);

            if (p.staticCommands) p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
        }
Ejemplo n.º 8
0
 public override void Use(Player p, string message)
 {
     if (p == null) { Player.SendMessage(p, "Command not usable in Console."); return; }
     if (!p.group.CanExecute(Command.all.Find("static")) || !p.group.CanExecute(Command.all.Find("cuboid"))) { p.SendMessage("You must have access to both /static and /cuboid commands."); return; }
     if (p.staticCommands) { p.staticCommands = false; p.ClearBlockchange(); p.BlockAction = 0; p.SendMessage("/zz has finished."); }
     else { Command.all.Find("static").Use(p, "cuboid " + message); }
 }
Ejemplo n.º 9
0
        public override void Use(Player p, string message)
        {
            if (message == "" || message.IndexOf(' ') == -1) { Help(p); return; }

            string foundBlah = Command.all.FindShort(message.Split(' ')[0]);

            Command foundCmd;
            if (foundBlah == "") foundCmd = Command.all.Find(message.Split(' ')[0]);
            else foundCmd = Command.all.Find(foundBlah);

            if (foundCmd == null) { Player.SendMessage(p, "Could not find command entered"); return; }
            if (p != null && !p.group.CanExecute(foundCmd)) { Player.SendMessage(p, "This command is higher than your rank."); return; }

            LevelPermission newPerm = Level.PermissionFromName(message.Split(' ')[1]);
            if (newPerm == LevelPermission.Null) { Player.SendMessage(p, "Could not find rank specified"); return; }
            if (p != null && newPerm > p.group.Permission) { Player.SendMessage(p, "Cannot set to a rank higher than yourself."); return; }

            GrpCommands.rankAllowance newCmd = GrpCommands.allowedCommands.Find(rA => rA.commandName == foundCmd.name);
            newCmd.lowestRank = newPerm;
            GrpCommands.allowedCommands[GrpCommands.allowedCommands.FindIndex(rA => rA.commandName == foundCmd.name)] = newCmd;

            GrpCommands.Save(GrpCommands.allowedCommands);
            GrpCommands.fillRanks();
            Player.GlobalMessage("&d" + foundCmd.name + Server.DefaultColor + "'s permission was changed to " + Level.PermissionToName(newPerm));
            Server.s.Log(foundCmd.name + "'s permission was changed to " + Level.PermissionToName(newPerm));
        }
Ejemplo n.º 10
0
 public override void Help(Player p)
 {
     Player.SendMessage(p, "/infection - Play the Minecraft version of the popular zombie game, Infection!");
     Player.SendMessage(p, "/infection start - Start an Infection game on your level");
     Player.SendMessage(p, "/infection stop <all> - Stops an infection game on your level or stop all infection games.");
     Player.SendMessage(p, "/infection powerpill - Infection, but with a little bit of a twist. :D");
 }
Ejemplo n.º 11
0
 public override void Help(Player p)
 {
     Player.SendMessage(p, "/cmdbind [command] [num] - Binds [command] to [num]");
     Player.SendMessage(p, "[num] must be between 0 and 9");
     Player.SendMessage(p, "Use with \"/[num]\" &b(example: /2)");
     Player.SendMessage(p, "Use /cmdbind [num] to see stored commands.");
 }
Ejemplo n.º 12
0
        public override void Use(Player p, string message)
        {
            if (message == "" || message.Split(' ').Length < 2) { Help(p); return; }
            Player toSend = Player.Find(message.Split(' ')[0]);
            Player target = Player.Find(message.Split(' ')[1]);
            if (toSend == null || target == null) { Player.SendMessage(p, "Player could not be found."); return; }
            if (toSend == p)
            {
                if (target == p) { Player.SendMessage(p, "You can't teleport yourself to yourself."); return; }
                else { Player.SendMessage(p, "Use /tp <player> next time. Teleporting now..."); Command.all.Find("tp").Use(p, target.name); }
                return;
            }
            if (target == p) { Player.SendMessage(p, "Use /summon <player> next time. Summoning now..."); Command.all.Find("summon").Use(p, target.name); return; }
            if (p.group.Permission < toSend.group.Permission) { Player.SendMessage(p, "Cannot teleport a player of higher rank."); return; }
            if (target.level.name.Contains("cMuseum") || toSend.level.name.Contains("cMuseum")) { Player.SendMessage(p, "Player is in a museum!"); return; }

            if (toSend.level != target.level)
            {
                Command.all.Find("goto").Use(toSend, target.level.name);
                while (toSend.Loading) { }
            }
            if (toSend.level == target.level)
            {
                if (target.Loading)
                {
                    Player.SendMessage(p, "Waiting for " + target.color + target.name + "&g to spawn...");
                    while (target.Loading) { }
                }
                while (toSend.Loading) { }  //Wait for player to spawn in new map
                unchecked { toSend.SendPos((byte)-1, target.pos[0], target.pos[1], target.pos[2], target.rot[0], 0); }
            }
        }
Ejemplo n.º 13
0
 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     Level l; Group g;
     if (message.Split(' ').Length > 1)
     {
         if (message.Split(' ').Length > 2) { Help(p); return; }
         l = Level.Find(message.Split(' ')[0]);
         if (l == null) { Player.SendMessage(p, "Level could not be found."); return; }
         g = Group.Find(message.Split(' ')[1]);
         if (g == null) { Player.SendMessage(p, "Rank could not be found."); return; }
         if (p.group.Permission < g.Permission && p != null) { Player.SendMessage(p, "Cannot change SpeedHack rank to a higher rank."); return; }
         if (p.group.Permission < l.speedHackRank.Permission && p != null) { Player.SendMessage(p, "Cannot change SpeedHack rank of a higher rank."); return; }
         l.speedHackRank = g;
         l.Save();
         Player.GlobalMessage("SpeedHack rank on " + l.name + " changed to " + g.name);
     }
     else
     {
         if (p == null) { Player.SendMessage(p, "Please specify a level if you are using this from Console."); return; }
         l = p.level;
         g = Group.Find(message);
         if (g == null) { Player.SendMessage(p, "Rank could not be found."); return; }
         if (p.group.Permission < g.Permission) { Player.SendMessage(p, "Cannot change SpeedHack rank to a higher rank."); return; }
         if (p.group.Permission < l.speedHackRank.Permission) { Player.SendMessage(p, "Cannot change SpeedHack rank of a higher rank."); return; }
         l.speedHackRank = g;
         l.Save();
         Player.GlobalMessage("SpeedHack rank on " + l.name + " changed to " + g.name);
     }
 }
Ejemplo n.º 14
0
 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     if (!PlayerBot.ValidName(message)) { Player.SendMessage(p, "bot name " + message + " not valid!"); return; }
     PlayerBot.playerbots.Add(new PlayerBot(message, p.level, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0));
     //who.SendMessage("You were summoned by " + p.color + p.name + "&e.");
 }
Ejemplo n.º 15
0
        public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type)
        {
            p.ClearBlockchange();
            byte b = p.level.GetTile(x, y, z);
            p.SendBlockchange(x, y, z, b);
            CatchPos cpos = (CatchPos)p.blockchangeObject;

            ushort xx, yy, zz; int foundBlocks = 0;

            for (xx = Math.Min(cpos.x, x); xx <= Math.Max(cpos.x, x); ++xx)
                for (yy = Math.Min(cpos.y, y); yy <= Math.Max(cpos.y, y); ++yy)
                    for (zz = Math.Min(cpos.z, z); zz <= Math.Max(cpos.z, z); ++zz)
                    {
                        if (p.level.GetTile(xx, yy, zz) != cpos.toIgnore) foundBlocks++;
                    }

            Player.SendMessage(p, foundBlocks + " blocks are between (" + cpos.x + ", " + cpos.y + ", " + cpos.z + ") and (" + x + ", " + y + ", " + z + ")");

            ushort xdiff = (ushort)((Math.Max(cpos.x, x)) - Math.Min(cpos.x, x));
            ushort ydiff = (ushort)((Math.Max(cpos.y, y)) - Math.Min(cpos.y, y));
            ushort zdiff = (ushort)((Math.Max(cpos.z, z)) - Math.Min(cpos.z, z));

            Player.SendMessage(p, "The selected area was " + xdiff + " blocks wide, " + ydiff + " blocks high, " + zdiff + " blocks deep.");

            if (p.staticCommands) p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
        }
Ejemplo n.º 16
0
        public override void Use(Player p, string message)
        {
            if (message == "" || message.IndexOf(' ') == -1) { Help(p); return; }
            Level foundLevel = Level.Find(message.Split(' ')[0]);
            string newName = message.Split(' ')[1];

            if (File.Exists("levels/" + newName)) { Player.SendMessage(p, "Level already exists."); return; }
            if (foundLevel == Server.mainLevel) { Player.SendMessage(p, "Cannot rename the main level."); return; }
            if (foundLevel != null) foundLevel.Unload();

            try
            {
                File.Move("levels/" + foundLevel.name + ".lvl", "levels/" + newName + ".lvl");

                try
                {
                    File.Move("levels/level properties/" + foundLevel.name + ".properties", "levels/level properties/" + newName + ".properties");
                }
                catch { }
                try
                {
                    File.Move("levels/level properties/" + foundLevel.name, "levels/level properties/" + newName + ".properties");
                }
                catch { }

                MySQL.executeQuery("RENAME TABLE `Block" + foundLevel.name.ToLower() + "` TO `Block" + newName.ToLower() +
                    "`, `Portals" + foundLevel.name.ToLower() + "` TO `Portals" + newName.ToLower() +
                    "`, `Messages" + foundLevel.name.ToLower() + "` TO Messages" + newName.ToLower() +
                    "`, `Commandblocks" + foundLevel.name.ToLower() + "` TO Commandblocks" + newName.ToLower() +
                    ", `Zone" + foundLevel.name.ToLower() + "` TO `Zone" + newName.ToLower() + "`");

                Player.GlobalMessage("Renamed " + foundLevel.name + " to " + newName);
            }
            catch (Exception e) { Player.SendMessage(p, "Error when renaming."); Server.ErrorLog(e); }
        }
Ejemplo n.º 17
0
 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     p.painting = !p.painting; if (p.painting) { Player.SendMessage(p, "Painting mode: &aON" + Server.DefaultColor + "."); }
     else { Player.SendMessage(p, "Painting mode: &cOFF" + Server.DefaultColor + "."); }
     p.BlockAction = 0;
 }
Ejemplo n.º 18
0
 public override void Use(Player p, string message)
 {
     if (p == null) { Player.SendMessage(p, "Command not usable in Console."); return; }
     if (p.hidden) { Player.SendMessage(p, "Unhide first to use /setskin."); return; }
     if (message.Split(' ').Length > 2) { Help(p); return; }
     if (message.Split(' ').Length == 2 && message.Split(' ')[1].ToLower().Trim() != "s") { Help(p); return; }
     if (message.Trim() == "")
     {
         Player.GlobalMessage(p.color + p.name + "&g's skin was reset to original skin.");
         Player.GlobalDie(p, false);
         //Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
         Player.SkinChange(p, p.color + p.name, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]);
     }
     else if (message.ToLower().Trim() == "s")
     {
         Player.GlobalMessageAdmins("To Admins: " + p.color + p.name + "&g's skin was reset to original skin.");
         Player.GlobalDie(p, false);
         //Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
         Player.SkinChange(p, p.color + p.name, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]);
     }
     else if (message.Split(' ').Length == 2 && message.Split(' ')[1].ToLower().Trim() == "s")
     {
         Player.GlobalMessageAdmins("To Admins: " + p.color + p.name + "&g's skin set to the skin of " + message.Split(' ')[0] + ".");
         Player.GlobalDie(p, false);
         Player.SkinChange(p, p.color + message.Split(' ')[0], p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]);
     }
     else
     {
         Player.GlobalMessage(p.color + p.name + "&g's skin set to the skin of " + message.Split(' ')[0] + ".");
         Player.GlobalDie(p, false);
         Player.SkinChange(p, p.color + message, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]); // Cannot use marker, that messes up the whole thing... Unless we have 2 GlobalSpawn type things, and on player's movement have those constantly stay together, but I'm way too lazy to do that lol. That would still cause a retarded half-steve, half-skin effect, so basically, spawning skinned players with uncorresponding names is not possible, unless client side hax.
     }
 }
Ejemplo n.º 19
0
 public void Clear(Player p)
 {
     byte[] buffer = new byte[65];
     Format(" ", 64).CopyTo(buffer, 1);
     p.SendRaw(13, buffer);
     buffer = null;
 }
Ejemplo n.º 20
0
        public override void Use(Player p, string message)
        {
            if (message != "")
            {
                Help(p);
            }
            else
            {
                Player.SendMessage(p, "This server runs on &9OpenNet" + Server.DefaultColor + ", which is based off MCDawn, and is being developed by sillyboyization for AsiaNet community.");
                Player.SendMessage(p, "This server's version: &eVanillaIceCream " + Server.DefaultColor + " - &a" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());

                TimeSpan up = DateTime.Now - Server.timeOnline;
                string upTime = "Time online: &b";
                if (up.Days == 1) upTime += up.Days + " day, ";
                else if (up.Days > 0) upTime += up.Days + " days, ";
                if (up.Hours == 1) upTime += up.Hours + " hour, ";
                else if (up.Days > 0 || up.Hours > 0) upTime += up.Hours + " hours, ";
                if (up.Minutes == 1) upTime += up.Minutes + " minute and ";
                else if (up.Hours > 0 || up.Days > 0 || up.Minutes > 0) upTime += up.Minutes + " minutes and ";
                if (up.Seconds == 1) upTime += up.Seconds + " second";
                else upTime += up.Seconds + " seconds";
                Player.SendMessage(p, upTime);

                if (Server.updateTimer.Interval > 100) Player.SendMessage(p, "Server is currently in &5Low Lag" + Server.DefaultColor + " mode.");
            }
        }
Ejemplo n.º 21
0
        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            string fileName;
            fileName = "extra/import/" + message + ".dat";

            if (!Directory.Exists("extra/import")) Directory.CreateDirectory("extra/import");
            if (!File.Exists(fileName))
            {
                Player.SendMessage(p, "Could not find .dat file");
                return;
            }

            FileStream fs = File.OpenRead(fileName);
            if (ConvertDat.Load(fs, message) != null)
            {
                Player.SendMessage(p, "Converted map!");
            }
            else
            {
                Player.SendMessage(p, "The map conversion failed.");
                return;
            }
            fs.Close();

            Command.all.Find("load").Use(p, message);
        }
Ejemplo n.º 22
0
 public override void Use(Player p, string message)
 {
     Player who = Player.Find(message);
     if (message == "") { who = p; }
     if (who == null) { p.SendMessage("Player could not be found."); return; }
     p.SendMessage(who.color + who.name + "&g currently has " + who.money + " " + Server.moneys);
 }
Ejemplo n.º 23
0
        public override void Use(Player p, string message)
        {
            if (message.ToLower() == "empty")
            {
                Server.levels.ForEach(l =>
                {
                    if (l.players.Count <= 0 && l != Server.mainLevel)
                        l.Unload(true);
                });
                return;
            }

            Level level = Level.Find(message);
            if (level != null)
            {
                if (p != null && p.hidden)
                {
                    if (!level.Unload(true)) Player.SendMessage(p, "You cannot unload the main level.");
                    return;
                }
                else
                {
                    if (!level.Unload()) Player.SendMessage(p, "You cannot unload the main level.");
                    return;
                }
            }

            Player.SendMessage(p, "There is no level \"" + message + "\" loaded.");
        }
Ejemplo n.º 24
0
 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     Player who = Player.Find(message.Split(' ')[0]);
     if (who == null) { p.SendMessage("Player could not be found!"); return; }
     /*if (Server.devs.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Developer!"); return; }
     if (Server.staff.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Staff Member!"); return; }
     if (Server.administration.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Administrator!"); return; }*/
     if (who == p) { p.SendMessage("You can't revoke warnings on yourself!"); return; }
     if (p != null && (p.group.Permission <= who.group.Permission)) { p.SendMessage("You can't revoke warnings on a player of a same or higher rank!"); return; }
     else { reason = message.Substring(message.IndexOf(' ') + 1).Trim(); }
     if (who.warnings == 0) { Player.SendMessage(p, "That player has not been warned yet."); return; }
     if (p == null)
     {
         Player.GlobalMessage(who.color + who.name + "&g's warning was revoked by the Console!");
         if (message.Split(' ').Length > 1) { Player.GlobalMessage("Reason: " + reason); }
         Server.s.Log(who.name + "'s warning was revoked by " + p.name + "!");
         if (message.Split(' ').Length > 1) { Server.s.Log("Reason: " + reason); }
     }
     else
     {
         Player.GlobalMessage(who.color + who.name + "&g's warning was revoked by " + p.color + p.name + "&g!");
         if (message.Split(' ').Length > 1) { Player.GlobalMessage("Reason: " + reason); }
         Server.s.Log(who.name + "'s warning was revoked by the Console!");
         if (message.Split(' ').Length > 1) { Server.s.Log("Reason: " + reason); }
     }
     if (who.warnings >= 1) { who.warnings = 0; }
 }
Ejemplo n.º 25
0
        public override void Use(Player p, string message)
        {
            p.staticCommands = !p.staticCommands;
            p.ClearBlockchange();
            p.BlockAction = 0;

            Player.SendMessage(p, "Static mode: &a" + p.staticCommands.ToString());

            try
            {
                if (message != "")
                {
                    if (message.IndexOf(' ') == -1)
                    {
                        if (p.group.CanExecute(Command.all.Find(message)))
                            Command.all.Find(message).Use(p, "");
                        else
                            Player.SendMessage(p, "Cannot use that command.");
                    }
                    else
                    {
                        if (p.group.CanExecute(Command.all.Find(message.Split(' ')[0])))
                            Command.all.Find(message.Split(' ')[0]).Use(p, message.Substring(message.IndexOf(' ') + 1));
                        else
                            Player.SendMessage(p, "Cannot use that command.");
                    }
                }
            }
            catch { Player.SendMessage(p, "Could not find specified command"); }
        }
Ejemplo n.º 26
0
        public override void Use(Player p, string message)
        {
            if (message == "") { Help(p); return; }
            int number = message.Split(' ').Length;
            if (number > 2 || number < 1) { Help(p); return; }
            if (number == 1)
            {
                LevelPermission Perm = Level.PermissionFromName(message);
                if (Perm == LevelPermission.Null) { Player.SendMessage(p, "Not a valid rank"); return; }
                p.level.permissionbuild = Perm;
                Server.s.Log(p.level.name + " build permission changed to " + message + ".");
                Player.GlobalMessageLevel(p.level, "build permission changed to " + message + ".");
            }
            else
            {
                int pos = message.IndexOf(' ');
                string t = message.Substring(0, pos).ToLower();
                string s = message.Substring(pos + 1).ToLower();
                LevelPermission Perm = Level.PermissionFromName(s);
                if (Perm == LevelPermission.Null) { Player.SendMessage(p, "Not a valid rank"); return; }

                Level level = Level.Find(t);
                if (level != null)
                {
                    level.permissionbuild = Perm;
                    Server.s.Log(level.name + " build permission changed to " + s + ".");
                    Player.GlobalMessageLevel(level, "build permission changed to " + s + ".");
                    if (p != null)
                        if (p.level != level) { Player.SendMessage(p, "build permission changed to " + s + " on " + level.name + "."); }
                    return;
                }
                else
                    Player.SendMessage(p, "There is no level \"" + s + "\" loaded.");
            }
        }
Ejemplo n.º 27
0
        public override void Use(Player p, string message)
        {
            if (p == null) { p.SendMessage("Command not usable in Console."); return; }
            Player who = Player.Find(p.summonRequest);
            if (p.summonRequest == "") { Player.SendMessage(p, "No summon requests have been recieved."); return; }
            if (who == null) { Player.SendMessage(p, "Player is no longer online!"); p.tpRequest = ""; return; }
            if (who == p) { Player.SendMessage(p, "Cannot accept summon request from yourself."); p.summonRequest = ""; return; }
            if (who.level.zombiegame == true && p.level != who.level) { Player.SendMessage(p, "They can't leave an Infection game!"); return; }
            if (p.level.zombiegame == true && p.level != who.level) { Player.SendMessage(p, "Infection is active on this map, they can't come here!"); return; }
            if (who.level.spleefstarted == true && p.level != who.level) { Player.SendMessage(p, "They can't leave a Spleef game!"); return; }
            if (p.level.spleefstarted == true && p.level != who.level) { Player.SendMessage(p, "Spleef is active on this map, they can't come here!"); return; }

            if (p.level != who.level)
            {
                if (who.level.name.Contains("cMuseum")) { Player.SendMessage(p, "Player \"" + who.name + "\" is in a museum!"); return; }
                else
                {
                    Command.all.Find("goto").Use(p, who.level.name);
                    while (p.Loading) { }
                    unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
                    //Command.all.Find("summon").Use(who, p.name);
                }
            }
            if (p.level == who.level)
            {
                if (who.Loading)
                {
                    Player.SendMessage(p, "Waiting for " + who.color + who.name + Server.DefaultColor + " to spawn...");
                    while (who.Loading) { }
                }
                while (p.Loading) { }  //Wait for player to spawn in new map
                unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
            }
        }
Ejemplo n.º 28
0
        public override void Use(Player p, string message)
        {
            if (message != "") { Help(p); return; }

            p.deleteMode = !p.deleteMode;
            Player.SendMessage(p, "Delete mode: &a" + p.deleteMode);
        }
Ejemplo n.º 29
0
 public void AddGoalPos(Player p, ushort x, ushort y, ushort z, byte type)
 {
     p.ClearBlockchange();
     p.level.Blockchange(x, y, z, Block.air);
     if (type == Block.red && goalBuffer.Count > 0)
     {
         p.SendBlockchange(x, y, z, Block.air);
         foreach (PushBallTeam.Pos pp in goalBuffer)
         {
             p.level.pushBall.pushBallTeams.Find(team => team.color == goalPosColor[1]).goalPositions.Add(pp);
             p.SendBlockchange(pp.x, pp.y, pp.z, Block.air);
         }
         Player.SendMessage(p, "Goal positions selected for " + p.level.pushBall.pushBallTeams.Find(team => team.color == goalPosColor[1]).teamstring);
         goalBuffer.Clear();
         goalPosColor = "";
     }
     else
     {
         p.SendBlockchange(x, y, z, Block.green);
         PushBallTeam.Pos gp = new PushBallTeam.Pos();
         gp.x = x; gp.y = y; gp.z = z;
         goalBuffer.Add(gp);
         Player.SendMessage(p, "&aGoal position added. &cPlace a red block to finish.");
         p.Blockchange += new Player.BlockchangeEventHandler(AddGoalPos);
     }
 }
Ejemplo n.º 30
0
 public override void Help(Player p)
 {
     Player.SendMessage(p, "/hportal [orange/blue/air/water/lava/home] [multi] - Activates Portal mode.");
     Player.SendMessage(p, "/hportal [type] multi - Place Entry blocks until exit is wanted.");
     Player.SendMessage(p, "/hportal show - Shows portals, green = in, red = out.");
     Player.SendMessage(p, "Using /hportal home [multi] creates a portal that brings players to their player home.");
 }