示例#1
0
 public static bool Orb_Command_Information_Flight_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eFlight Commands:");
     NetObj.ClientObject.SendMessage("&a    /Smoke R G B&e:             Changes your smoke color.");
     NetObj.ClientObject.SendMessage("&a    /Rainbow&e:                 Makes your smoke cycle through the hue spectrum.");
     return(true);
 }
示例#2
0
 public static bool Orb_Command_Maintenence_User_Password_Enable_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("Password Authentication Enabled. You can now login with your password as a fallback if you need to authenticate yourself.");
     NetObj.UserObject.UsePassword = true;
     NetObj.UserObject.SaveAll();
     return(true);
 }
示例#3
0
        public static bool Orb_Command_Maintenence_Group_Ranks_List_Method(Server.NetObject NetObj, CommandReader Command)
        {
            Database.GroupDB.Group TargetGroup = Database.GroupDB.NoGroup;
            #region FindTargetGroup
            if (Command._CmdElements()[1] == "-")
            {
                if (NetObj.CommandHandling.PreviousGroup == Database.GroupDB.NoGroup)
                {
                    NetObj.ClientObject.SendMessage("No previous groups iterated over.");
                    return(false);
                }
                else
                {
                    TargetGroup = NetObj.CommandHandling.PreviousGroup;
                }
            }
            else
            {
                if (Database.GroupDB.FindGroup(Command._CmdElements()[1]) == Database.GroupDB.NoGroup)
                {
                    NetObj.ClientObject.SendMessage("Group not found: \"" + Command._CmdElements()[1] + "\".");
                    return(false);
                }
                TargetGroup = Database.GroupDB.FindGroup(Command._CmdElements()[1]);
            }
            #endregion
            #region ListRanks
            NetObj.ClientObject.SendMessage("Ranks in Group \"" + TargetGroup.Name + "\": " + TargetGroup.Ranks.Select(z => z.Name).ToList().ToStringList());
            return(true);

            #endregion
        }
示例#4
0
        public static bool Orb_Command_Flight_Form_Method(Server.NetObject NetObj, CommandReader Command)
        {
            if (Command._CmdArguments.Count() < 1)
            {
                NetObj.ClientObject.SendMessage("&eFormat incorrect: Use instead: \"/Form ID\"!");
                return(false);
            }

            uint ID = NetObj.Vehicle.ID;

            try
            {
                ID = UInt32.Parse(Command._CmdArguments[0]);
            }
            catch
            {
                NetObj.ClientObject.SendMessage("&eFormat incorrect: Be sure you are using an integer value!");
                return(false);
            }
            if (NetObj.Vehicle.ID == 0)
            {
                NetObj.ClientObject.SendMessage("&eYou need to be flying in order to choose a formation target!");
                return(false);
            }
            NetObj.Vehicle.FormTarget = ID;
            NetObj.ClientObject.SendMessage("&eSucessfully set Formation Target to \"" + NetObj.Vehicle.FormTarget.ToString() + "\".");
            return(true);
        }
示例#5
0
        public static bool Orb_Command_Server_Night_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region manageserver?
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            #endregion
            #region Night
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            uint apocolypse = 0;
            if (Server.Weather.Lighting >= 16777216)
            {
                apocolypse = 16777216;
            }
            Server.Weather.Lighting = apocolypse | 65536;
            Server.AllClients.Except(NetObj).SendMessage("User: \"" + NetObj.Username + "\" changed the time to NIGHT");
            NetObj.ClientObject.SendMessage("Changed the time to NIGHT.");
            Server.AllClients.Send(Server.Weather.Serialise());
            return(true);

            #endregion
        }
示例#6
0
        private static void Orb_Command_Maintenence_Group_Users_Rank_Common_Method(Server.NetObject NetObj, Database.UserDB.User TargetUser, Database.GroupDB.Group TargetGroup, Database.GroupDB.Group.Rank TargetRank, string Reason)
        {
            if (TargetUser.Groups.First(x => x.Group == TargetGroup).Rank == TargetRank)
            {
                NetObj.ClientObject.SendMessage("User: \"" + TargetUser.Name + "\" is already Rank \"" + TargetRank.Name + "\" in Group: \"" + TargetGroup.Name + "\".");
                return;
            }
            TargetUser.Groups.First(x => x.Group == TargetGroup).PreviousRank = TargetUser.Groups.First(x => x.Group == TargetGroup).Rank;
            TargetUser.Groups.First(x => x.Group == TargetGroup).Rank         = TargetRank;
            TargetUser.Groups.First(x => x.Group == TargetGroup).RankDate     = DateTime.Now;
            TargetUser.Groups.First(x => x.Group == TargetGroup).RankedBy     = NetObj.UserObject;
            TargetUser.Groups.First(x => x.Group == TargetGroup).RankReason   = Reason;
            TargetUser.SaveAll();
            string RankType;

            if (TargetUser.Groups.First(x => x.Group == TargetGroup).Group.Ranks.IndexOf(TargetUser.Groups.First(y => y.Group == TargetGroup).PreviousRank) <
                TargetUser.Groups.First(a => a.Group == TargetGroup).Group.Ranks.IndexOf(TargetUser.Groups.First(y => y.Group == TargetGroup).Rank))
            {
                //Complex Lamba Much? This just menas if previous rank was lower then current rank...
                RankType = "Promoted";
            }
            else
            {
                RankType = "Demoted";
            }
            Server.EmptyClientList.Include(TargetUser).SendMessage("You were " + RankType + " from Rank: \"" + TargetUser.Groups.First(x => x.Group == TargetGroup).PreviousRank.Name + "\" to Rank: \"" + TargetUser.Groups.First(x => x.Group == TargetGroup).Rank.Name + "\" in Group: \"" + TargetGroup.Name + "\" by \"" + NetObj.UserObject.Name + "\".");
            Server.AllClients.Except(TargetUser).SendMessage("User: \"" + TargetUser.Name + "\" was " + RankType + " from Rank: \"" + TargetUser.Groups.First(x => x.Group == TargetGroup).PreviousRank.Name + "\" to Rank: \"" + TargetUser.Groups.First(x => x.Group == TargetGroup).Rank.Name + "\" in Group: \"" + TargetGroup.Name + "\" by \"" + NetObj.UserObject.Name + "\".");
            if (Reason.Length > 0)
            {
                Server.EmptyClientList.Include(TargetUser).SendMessage("Reason: \"" + Reason + "\".");
                Server.AllClients.Except(TargetUser).SendMessage("Reason: \"" + Reason + "\".");
            }
            return;
        }
示例#7
0
 public static bool Orb_Command_Chat_Spam_Method(Server.NetObject NetObj, CommandReader Command)
 {
     #region Spam
     if (NetObj.UserObject.Muted)
     {
         NetObj.UserObject.MuteNotifier();
         return(false);
     }
     if (NetObj.UserObject.Can(Database.PermissionDB.Strings.Say))
     {
         Network.Packets.Type32_ChatMessage SpamThis = new Network.Packets.Type32_ChatMessage();
         SpamThis.Message = Command._CmdRawArguments;
         Network.Packet ThisPacket = SpamThis.Serialise();
         Logger.Console.WriteLine(NetObj.UserObject.DisplayedName + "&b(Spam)&f: " + Command._CmdRawArguments);
         for (int i = 0; i < 10; i++)
         {
             Server.AllClients.Except(Server.OrbConsole).Send(ThisPacket);
         }
         return(true);
     }
     else
     {
         NetObj.ClientObject.SendMessage("You do not have enough permission to \"Spam\".");
         return(false);
     }
     #endregion
 }
示例#8
0
        public static bool Orb_Command_Server_Strobe_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region manageserver?
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            #endregion
            #region Strobe
            uint apocolypse = 0;
            uint Weather    = Server.Weather.Lighting;
            if (Server.Weather.Lighting >= 16777216)
            {
                apocolypse = 16777216;
            }
            for (int i = 0; i < 16; i++)
            {
                Server.Weather.Lighting = apocolypse; //DAY
                Server.AllClients.Send(Server.Weather.Serialise());
                Thread.Sleep(25);
                Server.Weather.Lighting = apocolypse | 65536; //NIGHT
                Server.AllClients.Send(Server.Weather.Serialise());
                Thread.Sleep(25);
            }
            Server.Weather.Lighting = Weather;
            Server.AllClients.Send(Server.Weather.Serialise());
            return(true);

            #endregion
        }
                public void Process_Type05_EntityJoined(Network.Packet Packet)
                {
                    Network.Packets.Process_Type05_EntityJoined ThisPacket = new Network.Packets.Process_Type05_EntityJoined(Packet);
                    if (ThisPacket.OwnerName != "" && Parent.Username.StartsWith(ThisPacket.OwnerName))
                    {
                        //Parent.VehicleID = ThisPacket.ID;
                        Parent.Vehicle.ID   = ThisPacket.ID;
                        Parent.Vehicle.Name = ThisPacket.ObjectName;
                        Parent.Vehicle.IFF  = ThisPacket.IFF;
                        Parent.Vehicle.Type = ThisPacket.ObjectType;

                        Parent.Vehicle.PosX = ThisPacket.InitialPosX; //East/West
                        Parent.Vehicle.PosY = ThisPacket.InitialPosY; //Altitude
                        Parent.Vehicle.PosZ = ThisPacket.InitialPosZ; //North/South
                        Parent.Vehicle.HdgX = ThisPacket.InitialRotX; //Heading
                        Parent.Vehicle.HdgY = ThisPacket.InitialRotY; //Pitch
                        Parent.Vehicle.HdgZ = ThisPacket.InitialRotZ; //Roll

                        //ThisPacket.InitialRotZ = (float)(ThisPacket.InitialRotZ + (-90).ToRadians());
                        //ThisPacket.InitialPosY = 3000;

                        Parent.UserObject.FlightsFlown++;
                        Server.Vehicles.Add(Parent.Vehicle);
                        Parent.UserObject.Save(Database.UserDB.Strings.FlightsFlown);
                        Server.AllClients.SendMessage(Parent.Username + " took off (" + ThisPacket.ObjectName + ")");
                    }
                    else
                    {
                        Server.NetObject Owner = null;
                    }
                    Parent.ClientObject.Send(ThisPacket.Serialise());
                }
示例#10
0
 public static bool Orb_Command_Maintenence_Group_Represent_Method(Server.NetObject NetObj, CommandReader Command)
 {
     Database.GroupDB.Group TargetGroup = Database.GroupDB.NoGroup;
     #region FindTargetGroup
     if (Database.GroupDB.FindGroup(Command._CmdElements()[1]) == Database.GroupDB.NoGroup)
     {
         NetObj.ClientObject.SendMessage("Group not found: \"" + Command._CmdElements()[1] + "\".");
         return(false);
     }
     TargetGroup = Database.GroupDB.FindGroup(Command._CmdElements()[1]);
     #endregion
     #region Test Permissions
     if (NetObj.UserObject.Groups.Select(x => x.Group).Contains(TargetGroup))
     {
         //THIS User is a member of the group. (Required to be able to represent the group.
     }
     else
     {
         NetObj.ClientObject.SendMessage("You need to be a member of the group yourself in order to represent it.");
         return(false);
     }
     #endregion
     NetObj.UserObject.GroupRepresented = TargetGroup;
     NetObj.ClientObject.SendMessage("You are now representing Group: \"" + TargetGroup.Name + "\".");
     NetObj.UserObject.SaveAll();
     return(true);
 }
示例#11
0
        public static bool Orb_Command_Chat_ListGroups_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region ListGroup
            NetObj.ClientObject.SendMessage("&aList of Server Groups:    &e" + Database.GroupDB.ListToString(Database.GroupDB.List));
            return(true);

            #endregion
        }
示例#12
0
        public static bool Orb_Command_Chat_ListUser_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region ListUser
            NetObj.ClientObject.SendMessage("&aList of Users Online:    &e" + Server.ClientList.Select(x => x.Username).ToList().ToStringList());
            return(true);

            #endregion
        }
示例#13
0
 public static bool Orb_Command_Server_LandEverywhere_Method(Server.NetObject NetObj, CommandReader Command)
 {
     #region manageserver?
     if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
     {
         NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
         return(false);
     }
     #endregion
     #region LandEverywhere
     if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
     {
         NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
         return(false);
     }
     bool state = Server.Weather.LandEverywhere;
     if (Command._CmdArguments.Count() < 1)
     {
         state = !state; //inverse the state!
     }
     else
     {
         if (Command._CmdArguments[0].ToUpper() == "OFF" ||
             Command._CmdArguments[0].ToUpper() == "FALSE" ||
             Command._CmdArguments[0].ToUpper() == "0")
         {
             state = false;
         }
         else if (Command._CmdArguments[0].ToUpper() == "ON" ||
                  Command._CmdArguments[0].ToUpper() == "TRUE" ||
                  Command._CmdArguments[0].ToUpper() == "1")
         {
             state = true;
         }
         else
         {
             NetObj.ClientObject.SendMessage("Argument not Recognised: \"" + Command._CmdArguments[0] + "\". Try \"ON\" or \"OFF\" only.");
             return(false);
         }
     }
     if (!state)
     {
         Server.Weather.LandEverywhere = false;
         Server.AllClients.Except(NetObj).SendMessage("User: \"" + NetObj.Username + "\" turned Land Everywhere OFF");
         NetObj.ClientObject.SendMessage("Land Everywhere turned OFF.");
         Server.AllClients.Send(Server.Weather.Serialise());
         return(true);
     }
     else
     {
         Server.Weather.LandEverywhere = true;
         Server.AllClients.Except(NetObj).SendMessage("User: \"" + NetObj.Username + "\" turned Land Everywhere ON");
         NetObj.ClientObject.SendMessage("Land Everywhere turned ON.");
         Server.AllClients.Send(Server.Weather.Serialise());
         return(true);
     }
     #endregion
 }
示例#14
0
 public static bool Orb_Command_Information_Moderation_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eModeration Commands:");
     NetObj.ClientObject.SendMessage("&a    /User.<Username>.Ban (Reason)&e                Bans a user from the server permanently.");
     NetObj.ClientObject.SendMessage("&a    /User.<Username>.Ban (Duration) (Reason)&e     Bans a user from the server for a duration.");
     NetObj.ClientObject.SendMessage("&a    /User.<Username>.Mute (Reason)&e               Mutes a user on the server permanently.");
     NetObj.ClientObject.SendMessage("&a    /User.<Username>.Mute (Duration) (Reason)&e    Mutes a user on the server for a duration.");
     NetObj.ClientObject.SendMessage("&a    /User.<Username>.Kick (Reason)&e               Kicks a user from the server.");
     return(true);
 }
示例#15
0
 public static bool Orb_Command_Information_List_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eCommand Catagories:");
     NetObj.ClientObject.SendMessage("&a    /Commands.Chat");
     NetObj.ClientObject.SendMessage("&a    /Commands.Flight");
     NetObj.ClientObject.SendMessage("&a    /Commands.Moderation");
     NetObj.ClientObject.SendMessage("&a    /Commands.Maintenence");
     NetObj.ClientObject.SendMessage("&a    /Commands.Server");
     return(true);
 }
示例#16
0
 public static bool Orb_Command_Flight_VehicleID_Method(Server.NetObject NetObj, CommandReader Command)
 {
     if (NetObj.Vehicle.ID == 0)
     {
         NetObj.ClientObject.SendMessage("&eYou are not currently in a vehicle!");
         return(false);
     }
     NetObj.ClientObject.SendMessage("&eYour Vehicle ID is \"" + NetObj.Vehicle.ID.ToString() + "\".");
     return(true);
 }
示例#17
0
 public static bool Orb_Command_Information_Server_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eServer Commands:");
     NetObj.ClientObject.SendMessage("&a    /Wind (XXXYYKT)&e              Changes wind to new x y z values");
     NetObj.ClientObject.SendMessage("&a    /Fog (Range)&e                 Changes the fo visibility");
     NetObj.ClientObject.SendMessage("&a    /Apocolypse&e                  Severly Warps the ingame lighting (&cPHOTOSENSITIVE SHOCK WARNING!&e)");
     NetObj.ClientObject.SendMessage("&a    /BlackOut [ON|OFF]&e           Enables/Disables gForce Blackout");
     NetObj.ClientObject.SendMessage("&a    /LandEverywhere [ON|OFF]&e     Enables/Disables Land Everywhere");
     NetObj.ClientObject.SendMessage("&a    /Collisions [ON|OFF]&e         Enables/Disables aircraft collisions");
     return(true);
 }
示例#18
0
 public static bool Orb_Command_Information_Chat_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eChat Commands:");
     NetObj.ClientObject.SendMessage("&a    /Users&e:             Show who is online.");
     NetObj.ClientObject.SendMessage("&a    /Info (User)&e:       Show info for a user.");
     NetObj.ClientObject.SendMessage("&a    /Say&e:               Broadcast a message to the server.");
     NetObj.ClientObject.SendMessage("&a    /Password&e:          Changes your password.");
     NetObj.ClientObject.SendMessage("&a    /EnablePassword&e:    Enables your password.");
     NetObj.ClientObject.SendMessage("&a    /DisablePassword&e:   Disables your password.");
     NetObj.ClientObject.SendMessage("&b    @User&e:              Sends a Private Message to User");
     NetObj.ClientObject.SendMessage("&b    @User1,User2...&e:    Sends a Private Message to Multiple Users");
     NetObj.ClientObject.SendMessage("&b    @@Group&e:            Sends a Private Message to Group");
     NetObj.ClientObject.SendMessage("&b    @@Group1,Group2...&e: Sends a Private Message to Multiple Groups");
     return(true);
 }
示例#19
0
 public static void GroupChatMessage(Server.NetObject ThisNetObj, Commands.CommandReader Cmd)
 {
     foreach (string ThisCommandElement in Cmd._CmdElements())
     {
         if (Database.GroupDB.FindGroup(ThisCommandElement) != Database.GroupDB.NoGroup)
         {
             Server.EmptyClientList.Include(Database.GroupDB.FindGroup(ThisCommandElement)).Except(Database.UserDB.Find("PHP bot")).Except(ThisNetObj).SendMessage("(" + Database.GroupDB.FindGroup(ThisCommandElement).Name + ")" + ThisNetObj.UserObject.Name + ": " + Cmd._CmdRawArguments);
             ThisNetObj.ClientObject.SendMessage("(" + Database.GroupDB.FindGroup(ThisCommandElement).Name + ")" + ThisNetObj.UserObject.Name + ": " + Cmd._CmdRawArguments);
         }
         else
         {
             ThisNetObj.ClientObject.SendMessage("&eGroup not found: \"" + ThisCommandElement + "\".");
         }
     }
     return;
 }
示例#20
0
        public static bool Orb_Command_Maintenence_Group_Remove_Method(Server.NetObject NetObj, CommandReader Command)
        {
            Database.GroupDB.Group TargetGroup = Database.GroupDB.NoGroup;
            if (Command._CmdArguments.Count() < 1)
            {
                NetObj.ClientObject.SendMessage("Please specify a group name when adding a new group.");
                return(false);
            }
            string NewGroupName = Command._CmdArguments[0];

            #region FindTargetGroup
            TargetGroup = Database.GroupDB.FindGroup(Command._CmdArguments[0]);
            if (TargetGroup != Database.GroupDB.NoGroup)
            {
                NetObj.ClientObject.SendMessage("Group: \"" + TargetGroup + "\" already exists. You cannot make duplicate groups.");
                return(false);
            }
            #endregion
            #region Test Permissions
            if (NetObj.UserObject == Database.UserDB.SuperUser || NetObj.UserObject == TargetGroup.Founder)
            {
                //continue
            }
            else
            {
                NetObj.ClientObject.SendMessage("Unable to remove Group: \"" + TargetGroup.Name + "\" as you do not have permission to manage the server.");
                return(false);
            }
            #endregion

            #region Remove Group
            NetObj.ClientObject.SendMessage("You are about to remove Group: \"" + TargetGroup.Name + "\".");
            NetObj.ClientObject.SendMessage("THIS IS NOT REVERSABLE!");
            NetObj.ClientObject.SendMessage("Please confirm this action by typing \"/OK\".");
            if (!NetObj.GetCommandConfirmation(5000))
            {
                NetObj.ClientObject.SendMessage("No response, command cancelled.");
                return(false);
            }
            string GroupName = TargetGroup.Name;
            Database.GroupDB.Delete(TargetGroup);
            Server.EmptyClientList.Include(NetObj.UserObject).SendMessage("You successfully removed Group: \"" + GroupName + "\".");
            Server.AllClients.Except(NetObj.UserObject).SendMessage("User: \"" + NetObj.UserObject.Name + "\" removed Group: \"" + GroupName + "\".");
            return(true);

            #endregion
        }
示例#21
0
        public static bool Orb_Command_Maintenence_Group_Add_Method(Server.NetObject NetObj, CommandReader Command)
        {
            Database.GroupDB.Group TargetGroup = Database.GroupDB.NoGroup;
            if (Command._CmdArguments.Count() < 1)
            {
                NetObj.ClientObject.SendMessage("Please specify a group name when adding a new group.");
                return(false);
            }
            string NewGroupName = Command._CmdArguments[0];

            #region FindTargetGroup
            TargetGroup = Database.GroupDB.FindGroup(Command._CmdArguments[0]);
            if (TargetGroup != Database.GroupDB.NoGroup)
            {
                NetObj.ClientObject.SendMessage("Group: \"" + TargetGroup + "\" already exists. You cannot make duplicate groups.");
                return(false);
            }
            #endregion
            #region Test Permissions
            if (NetObj.UserObject == Database.UserDB.SuperUser || NetObj.UserObject.Can(Database.PermissionDB.Strings.ManageServer))
            {
                //Continue
            }
            else
            {
                NetObj.ClientObject.SendMessage("Unable to add new Group: \"" + NewGroupName + "\" as you do not have permission to manage the server.");
                return(false);
            }
            #endregion

            #region Add Group
            Database.GroupDB.Group NewGroup = Database.GroupDB.New(NewGroupName);
            NewGroup.DateCreated      = DateTime.Now;
            NewGroup.DateLastModified = DateTime.Now;
            NewGroup.DisplayedName    = NewGroupName;
            NewGroup.Founder          = NetObj.UserObject;
            NewGroup.Joinable         = true;
            NewGroup.Leavable         = true;
            NewGroup.Name             = NewGroupName;
            NewGroup.SaveAll();
            Server.EmptyClientList.Include(NetObj.UserObject).SendMessage("You created a new Group: \"" + NewGroup.Name + "\".");
            Server.AllClients.Except(NetObj.UserObject).SendMessage("User: \"" + NetObj.UserObject.Name + "\" created a new Group: \"" + NewGroup.Name + "\".");
            return(true);

            #endregion
        }
示例#22
0
        public static void StandardChatMessage(Server.NetObject ThisNetObj, Commands.CommandReader Cmd)
        {
            if (ThisNetObj.TextWaiters.Count > 0)
            {
                ThisNetObj.TextInput = Cmd._CmdComplete;
                foreach (AutoResetEvent ThisEvent in ThisNetObj.TextWaiters.ToArray())
                {
                    ThisEvent.Set();
                    ThisNetObj.TextWaiters.RemoveAll(x => x == ThisEvent);
                }
                return;
            }
            string output = FormatChatMessage(Cmd._CmdComplete, ThisNetObj);

            Server.AllClients.Except(Database.UserDB.Find("PHP bot")).SendMessage(output);
            //ThisNetObj.HostObject.SendMessage(output);
            Logger.Log.Chat(output);
            return;
        }
示例#23
0
 public static bool Orb_Command_Information_Maintenence_Method(Server.NetObject NetObj, CommandReader Command)
 {
     NetObj.ClientObject.SendMessage("&eMaintenence Commands:");
     NetObj.ClientObject.SendMessage("&a    /Groups&e                               Shows the Groups on the server.");
     NetObj.ClientObject.SendMessage("&a    /Groups.Add (Name)&e                    Adds a new group to the server.");
     NetObj.ClientObject.SendMessage("&a    /Groups.Remove (Name)&e                 Removes a group from the server.");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Add (Name)&e             Adds a user to a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Remove (Name)&e          Removes a user from a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Founder (Name)&e         Transfers Ownership of a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Ranks.List&e             Shows Ranks of a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Ranks.Add (Name)&e       Adds a new Rank to a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Ranks.Remove (Name)&e    Removes a Rank from a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Ranks.<Name>.MoveUp&e    Orders a Rank Higher in a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Ranks.<Name>.MoveDown&e  Orders a Rank Lower in a group");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Promote (Name)&e         Increases the rank of a user by one.");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Demote (Name)&e          Decreases the rank of a user by one.");
     NetObj.ClientObject.SendMessage("&a    /Groups.<NAME>.Rank (Name) (NewRank)&e  Shows the rank of, or re-ranks, a user.");
     return(true);
 }
示例#24
0
        public static bool Orb_Command_Server_Fog_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region manageserver?
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            #endregion
            #region Fog
            if (Command._CmdArguments.Count() >= 1)
            {
                if (Command._CmdArguments[0].ToUpper() == "OFF" ||
                    Command._CmdArguments[0].ToUpper() == "FALSE" ||
                    Command._CmdArguments[0].ToUpper() == "0")
                {
                    Server.Weather.Fog = 50000;
                    NetObj.ClientObject.SendMessage("Fog turned OFF.");
                }
                else
                {
                    try
                    {
                        Server.Weather.Fog = Single.Parse(Command._CmdArguments[0].ToUpper());
                        NetObj.ClientObject.SendMessage("Fog set to: " + Server.Weather.Fog.ToString());
                    }
                    catch
                    {
                        NetObj.ClientObject.SendMessage("Argument Invalid! Use a number only!");
                        return(false);
                    }
                }
                Server.AllClients.Send(Server.Weather.Serialise());
            }
            else
            {
                NetObj.ClientObject.SendMessage("Not Enough Arguments!");
                return(false);
            }
            return(true);

            #endregion
        }
        public static string FormatChatMessage(string Command, Server.NetObject ThisNetObj)
        {
            if (ThisNetObj.UserObject.GroupRepresented != Database.GroupDB.NoGroup)
            {
                string output = "";
                foreach (char ThisChar in ThisNetObj.UserObject.GroupRepresented.RepresentationFormat.ToUpperInvariant())
                {
                    switch (ThisChar)
                    {
                    case 'G':
                        output += "&5[" + ThisNetObj.UserObject.GroupRepresented.Name + "&5]";
                        break;

                    case 'U':
                        output += "&8" + ThisNetObj.UserObject.DisplayedName;
                        break;

                    case 'R':
                        try
                        {
                            if (ThisNetObj.UserObject.Groups.First(x => x.Group == ThisNetObj.UserObject.GroupRepresented).Rank == Database.GroupDB.NoRank)
                            {
                                continue;
                            }
                            output += "&9[" + ThisNetObj.UserObject.Groups.First(x => x.Group == ThisNetObj.UserObject.GroupRepresented).Rank.Name + "&9]";
                        }
                        catch
                        {
                        }
                        break;

                    default:
                        output += ThisChar;
                        break;
                    }
                }
                return(output + "&f: " + Command);
            }
            else
            {
                return(ThisNetObj.UserObject.DisplayedName + "&f: " + Command);
            }
        }
示例#26
0
 public static bool Orb_Command_Chat_Clear_Method(Server.NetObject NetObj, CommandReader Command)
 {
     #region Spam
     if (NetObj.UserObject.Muted)
     {
         NetObj.UserObject.MuteNotifier();
         return(false);
     }
     if (NetObj.UserObject.Can(Database.PermissionDB.Strings.Say))
     {
         System.Console.Clear();
         return(true);
     }
     else
     {
         NetObj.ClientObject.SendMessage("You do not have enough permission to \"Clear\".");
         return(false);
     }
     #endregion
 }
示例#27
0
 public static void PrivateChatMessage(Server.NetObject ThisNetObj, Commands.CommandReader Cmd)
 {
     foreach (string ThisCommandElement in Cmd._CmdElements())
     {
         if (Database.UserDB.Find(ThisCommandElement) != Database.UserDB.Nobody)
         {
             if (ThisNetObj.UserObject == Database.UserDB.Find(ThisCommandElement))
             {
                 ThisNetObj.ClientObject.SendMessage("&eYou can't PM yourself!");
                 continue;
             }
             Server.EmptyClientList.Include(Database.UserDB.Find(ThisCommandElement)).Except(Database.UserDB.Find("PHP bot")).Except(ThisNetObj).SendMessage("&bPM From " + ThisNetObj.UserObject.Name + ": " + Cmd._CmdRawArguments);
             ThisNetObj.ClientObject.SendMessage("&bPM To " + Database.UserDB.Find(ThisCommandElement).Name + ": " + Cmd._CmdRawArguments);
         }
         else
         {
             ThisNetObj.ClientObject.SendMessage("&eUser not found: \"" + ThisCommandElement + "\".");
         }
     }
     return;
 }
示例#28
0
        public static bool Orb_Command_Chat_Say_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region Say
            if (NetObj.UserObject.Muted)
            {
                NetObj.UserObject.MuteNotifier();
                return(false);
            }
            if (NetObj.UserObject.Can(Database.PermissionDB.Strings.Say))
            {
                Server.AllClients.Except(Server.OrbConsole).SendMessage(Command._CmdRawArguments);
                Logger.Console.WriteLine(NetObj.UserObject.DisplayedName + "&b(Say)&f: " + Command._CmdRawArguments);
            }
            else
            {
                NetObj.ClientObject.SendMessage("You do not have enough permission to \"Say\".");
            }
            return(true);

            #endregion
        }
示例#29
0
        public static bool Orb_Command_Flight_Smoke_Method(Server.NetObject NetObj, CommandReader Command)
        {
            if (Command._CmdArguments.Count() < 3)
            {
                NetObj.ClientObject.SendMessage("&eFormat incorrect: Use instead: \"/Smoke Red Green Blue\"!");
                return(false);
            }

            byte Alpha = 0;
            byte Red   = 255;
            byte Green = 255;
            byte Blue  = 255;

            try
            {
                Red   = Byte.Parse(Command._CmdArguments[0]);
                Green = Byte.Parse(Command._CmdArguments[1]);
                Blue  = Byte.Parse(Command._CmdArguments[2]);
            }
            catch
            {
                NetObj.ClientObject.SendMessage("&eFormat incorrect: Be sure you are using values between 0 and 255!");
                return(false);
            }
            if (NetObj.Vehicle.ID == 0)
            {
                NetObj.ClientObject.SendMessage("&eYou need to be flying in order to change your smoke color!");
                return(false);
            }
            Network.Packets.Type07_SmokeCol SmokePacket = new Network.Packets.Type07_SmokeCol();
            SmokePacket.ID    = NetObj.Vehicle.ID;
            SmokePacket.Alpha = Alpha;
            SmokePacket.Red   = Red;
            SmokePacket.Green = Green;
            SmokePacket.Blue  = Blue;
            NetObj.Smoke      = "";
            NetObj.HostObject.Send(SmokePacket.Serialise());
            NetObj.ClientObject.Send(SmokePacket.Serialise());
            return(true);
        }
示例#30
0
        public static bool Orb_Command_Server_Apocolypse_Method(Server.NetObject NetObj, CommandReader Command)
        {
            #region manageserver?
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            #endregion
            #region Apocolypse
            if (NetObj.UserObject.CanNot(Database.PermissionDB.Strings.ManageServer))
            {
                NetObj.ClientObject.SendMessage("You do not have permission to manage the server.");
                return(false);
            }
            uint apocolypse = 16777216;
            if (Server.Weather.Lighting >= 16777216)
            {
                Server.Weather.Lighting -= apocolypse;
            }
            else
            {
                Server.Weather.Lighting += apocolypse;
            }
            string state = "OFF";
            if (Server.Weather.Lighting >= 16777216)
            {
                state = "ON";
            }
            Server.AllClients.Except(NetObj).SendMessage("User: \"" + NetObj.Username + "\" changed the time to " + state);
            NetObj.ClientObject.SendMessage("Changed the time to " + state + ".");
            Server.AllClients.Send(Server.Weather.Serialise());
            return(true);

            #endregion
        }