diff --git a/EssentialsPlugin/ChatHandlers/Admin/HandleAdminVersion.cs b/EssentialsPlugin/ChatHandlers/Admin/HandleAdminVersion.cs index 9cf19fe..6c59e78 100644 --- a/EssentialsPlugin/ChatHandlers/Admin/HandleAdminVersion.cs +++ b/EssentialsPlugin/ChatHandlers/Admin/HandleAdminVersion.cs @@ -57,7 +57,7 @@ public override bool HandleCommand( ulong userId, string[] words ) //Version version = typeof( Essentials ).Assembly.GetName( ).Version; //Communication.SendPrivateInformation( userId, (String)version ); - Communication.SendPrivateInformation( userId, string.Format("Plugin '{0}' initialized. (Version: {1} ID: {2})", + Communication.SendPrivateInformation( userId, String.Format("Plugin '{0}' initialized. (Version: {1} ID: {2})", Essentials.Instance.Name, Essentials.Instance.Version, Essentials.Instance.Id) ); return true; diff --git a/EssentialsPlugin/ChatHandlers/ChatHandlerBase.cs b/EssentialsPlugin/ChatHandlers/ChatHandlerBase.cs index b00e989..f20c308 100644 --- a/EssentialsPlugin/ChatHandlers/ChatHandlerBase.cs +++ b/EssentialsPlugin/ChatHandlers/ChatHandlerBase.cs @@ -17,7 +17,7 @@ public ChatHandlerBase( ) Log.Debug( $"Added chat handler: {GetCommandText()}" ); } - public virtual bool CanHandle(ulong steamId, string[] words, ref int commandCount) + public virtual Boolean CanHandle(ulong steamId, String[] words, ref int commandCount) { // Administrator Command if (IsAdminCommand()) @@ -39,7 +39,7 @@ public virtual bool CanHandle(ulong steamId, string[] words, ref int commandCoun { commandCount = GetCommandText().Split(new char[] { ' ' }).Count(); if (words.Length > commandCount - 1) - return string.Join(" ", words).ToLower().StartsWith(GetCommandText()); + return String.Join(" ", words).ToLower().StartsWith(GetCommandText()); } else { @@ -49,7 +49,7 @@ public virtual bool CanHandle(ulong steamId, string[] words, ref int commandCoun commandCount = command.Split(new char[] { ' ' }).Count(); if (words.Length > commandCount - 1) { - found = string.Join(" ", words).ToLower().StartsWith(command); + found = String.Join(" ", words).ToLower().StartsWith(command); if (found) break; } @@ -65,16 +65,18 @@ public virtual bool CanHandle(ulong steamId, string[] words, ref int commandCoun public virtual Communication.ServerDialogItem GetHelpDialog( ) { - return new Communication.ServerDialogItem - { - title = "Help", - header = GetCommandText( ), - content = GetHelp( ), - buttonText = "close" - }; + Communication.ServerDialogItem DialogItem = new Communication.ServerDialogItem(); + DialogItem.title = "Help"; + DialogItem.header = GetCommandText(); + DialogItem.content = GetHelp(); + DialogItem.buttonText = "close"; + return DialogItem; } - public abstract string GetCommandText( ); + public virtual String GetCommandText() + { + return ""; + } public virtual string[] GetMultipleCommandText() { @@ -96,7 +98,7 @@ public virtual bool IsClientOnly() return false; } - public virtual bool HandleCommand(ulong userId, string[] words) + public virtual bool HandleCommand(ulong userId, String[] words) { return false; } diff --git a/EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs b/EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs index 5a15270..ca8c798 100644 --- a/EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs +++ b/EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs @@ -57,7 +57,7 @@ public override bool HandleCommand(ulong userId, string[] words) { foreach (DockingItem dockingItem in Docking.Instance.DockingItems) { - string dockedShipFileName = Essentials.PluginPath + string.Format("\\Docking\\docked_{0}_{1}_{2}.sbc", dockingItem.PlayerId, dockingItem.TargetEntityId, dockingItem.DockedEntityId); + string dockedShipFileName = Essentials.PluginPath + String.Format("\\Docking\\docked_{0}_{1}_{2}.sbc", dockingItem.PlayerId, dockingItem.TargetEntityId, dockingItem.DockedEntityId); DockingItem dockedShip = dockingItem; IMyEntity entity = MyAPIGateway.Entities.GetEntity(x => x.EntityId == dockedShip.TargetEntityId && x is IMyCubeGrid); diff --git a/EssentialsPlugin/ChatHandlers/Dock/HandleDockDock.cs b/EssentialsPlugin/ChatHandlers/Dock/HandleDockDock.cs index c2b1eeb..ff02376 100644 --- a/EssentialsPlugin/ChatHandlers/Dock/HandleDockDock.cs +++ b/EssentialsPlugin/ChatHandlers/Dock/HandleDockDock.cs @@ -73,7 +73,7 @@ public override bool HandleCommand(ulong userId, string[] words) m_docking = true; try { - string pylonName = string.Join(" ", words); + String pylonName = String.Join(" ", words); /* int timeLeft; @@ -92,7 +92,7 @@ public override bool HandleCommand(ulong userId, string[] words) long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First(); - Dictionary> testList; + Dictionary> testList; List beaconList; DockingZone.FindByName(pylonName, out testList, out beaconList, playerId); if (beaconList.Count == 4) diff --git a/EssentialsPlugin/ChatHandlers/Dock/HandleDockList.cs b/EssentialsPlugin/ChatHandlers/Dock/HandleDockList.cs index b9a13c4..c3989d2 100644 --- a/EssentialsPlugin/ChatHandlers/Dock/HandleDockList.cs +++ b/EssentialsPlugin/ChatHandlers/Dock/HandleDockList.cs @@ -51,7 +51,7 @@ public override bool HandleCommand(ulong userId, string[] words) return true; } - string pylonName = string.Join(" ", words); + String pylonName = String.Join(" ", words); if (PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).Count < 1) { Communication.SendPrivateInformation(userId, string.Format("Unable to find player Id: {0}", userId)); @@ -60,7 +60,7 @@ public override bool HandleCommand(ulong userId, string[] words) long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First(); - Dictionary> testList; + Dictionary> testList; List beaconList; DockingZone.FindByName(pylonName, out testList, out beaconList, playerId); diff --git a/EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs b/EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs index 4436374..e15a3cf 100644 --- a/EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs +++ b/EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs @@ -74,7 +74,7 @@ public override bool HandleCommand(ulong userId, string[] words) m_undocking = true; try { - string pylonName = string.Join( " ", words ); + String pylonName = String.Join( " ", words ); if ( PlayerMap.Instance.GetPlayerIdsFromSteamId( userId ).Count < 1 ) { Communication.SendPrivateInformation( userId, string.Format( "Unable to find player Id: {0}", userId ) ); @@ -83,7 +83,7 @@ public override bool HandleCommand(ulong userId, string[] words) long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId( userId ).First( ); - Dictionary> testList; + Dictionary> testList; List beaconList; DockingZone.FindByName( pylonName, out testList, out beaconList, playerId ); @@ -150,7 +150,7 @@ public override bool HandleCommand(ulong userId, string[] words) } } - string dockedShipFileName = Essentials.PluginPath + string.Format( "\\Docking\\docked_{0}_{1}_{2}.sbc", ownerId, dockingItem.TargetEntityId, dockingItem.DockedEntityId ); + String dockedShipFileName = Essentials.PluginPath + String.Format( "\\Docking\\docked_{0}_{1}_{2}.sbc", ownerId, dockingItem.TargetEntityId, dockingItem.DockedEntityId ); // Load Entity From File and add to game FileInfo fileInfo = new FileInfo( dockedShipFileName ); diff --git a/EssentialsPlugin/ChatHandlers/Dock/HandleDockValidate.cs b/EssentialsPlugin/ChatHandlers/Dock/HandleDockValidate.cs index 0af09b2..6dee860 100644 --- a/EssentialsPlugin/ChatHandlers/Dock/HandleDockValidate.cs +++ b/EssentialsPlugin/ChatHandlers/Dock/HandleDockValidate.cs @@ -52,7 +52,7 @@ public override bool HandleCommand(ulong userId, string[] words) } // Grab shared beacon name and playerId - string pylonName = string.Join(" ", words); + String pylonName = String.Join(" ", words); if (PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).Count < 1) { Communication.SendPrivateInformation(userId, "Failed to retrieve your playerId. Command failed."); @@ -62,7 +62,7 @@ public override bool HandleCommand(ulong userId, string[] words) long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First(); // Find shared beacon area - Dictionary> testList; + Dictionary> testList; List beaconList; DockingZone.FindByName(pylonName, out testList, out beaconList, playerId); if (beaconList.Count == 4) diff --git a/EssentialsPlugin/ChatHandlers/HandleInfo.cs b/EssentialsPlugin/ChatHandlers/HandleInfo.cs index f125420..ce49bdd 100644 --- a/EssentialsPlugin/ChatHandlers/HandleInfo.cs +++ b/EssentialsPlugin/ChatHandlers/HandleInfo.cs @@ -77,7 +77,7 @@ public override bool HandleCommand(ulong userId, string[] words) private static void ShowTopicList(ulong userId) { - string noticeList = ""; + String noticeList = ""; foreach (InformationItem item in PluginSettings.Instance.InformationItems) { if (!item.Enabled) diff --git a/EssentialsPlugin/Essentials.cs b/EssentialsPlugin/Essentials.cs index d7a998e..5748646 100644 --- a/EssentialsPlugin/Essentials.cs +++ b/EssentialsPlugin/Essentials.cs @@ -1428,7 +1428,7 @@ public void Init( ) DoInit( Path.GetDirectoryName( Assembly.GetExecutingAssembly( ).Location ) + "\\" ); } - public void InitWithPath( string modPath ) + public void InitWithPath( String modPath ) { //register object builder assembly string path = System.IO.Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "SpaceEngineers.ObjectBuilders.DLL" ); @@ -1613,7 +1613,7 @@ private void HandleHelpCommand( ulong remoteUserId, IReadOnlyCollection // Again, we should get handler to just return string[] of command Text if ( handler.GetMultipleCommandText( ).Length < 1 ) { - if ( string.Equals( handler.GetCommandText( ), helpTarget, StringComparison.CurrentCultureIgnoreCase ) ) + if ( String.Equals( handler.GetCommandText( ), helpTarget, StringComparison.CurrentCultureIgnoreCase ) ) { Communication.SendPrivateInformation( remoteUserId, handler.GetHelp( ) ); found = true; @@ -1623,7 +1623,7 @@ private void HandleHelpCommand( ulong remoteUserId, IReadOnlyCollection { foreach ( string cmd in handler.GetMultipleCommandText( ) ) { - if ( string.Equals( cmd, helpTarget, StringComparison.CurrentCultureIgnoreCase ) ) + if ( String.Equals( cmd, helpTarget, StringComparison.CurrentCultureIgnoreCase ) ) { Communication.SendPrivateInformation( remoteUserId, handler.GetHelp( ) ); found = true; @@ -1720,7 +1720,7 @@ private void HandleHelpDialog(ulong remoteUserId, IReadOnlyCollection co // Again, we should get handler to just return string[] of command Text if (handler.GetMultipleCommandText().Length < 1) { - if (string.Equals(handler.GetCommandText(), helpTarget, StringComparison.CurrentCultureIgnoreCase)) + if (String.Equals(handler.GetCommandText(), helpTarget, StringComparison.CurrentCultureIgnoreCase)) { Communication.DisplayDialog(remoteUserId, handler.GetHelpDialog()); found = true; @@ -1730,7 +1730,7 @@ private void HandleHelpDialog(ulong remoteUserId, IReadOnlyCollection co { foreach (string cmd in handler.GetMultipleCommandText()) { - if (string.Equals(cmd, helpTarget, StringComparison.CurrentCultureIgnoreCase)) + if (String.Equals(cmd, helpTarget, StringComparison.CurrentCultureIgnoreCase)) { Communication.DisplayDialog(remoteUserId, handler.GetHelpDialog()); found = true; diff --git a/EssentialsPlugin/GameModes/Conquest.cs b/EssentialsPlugin/GameModes/Conquest.cs index e09361f..e4d5503 100644 --- a/EssentialsPlugin/GameModes/Conquest.cs +++ b/EssentialsPlugin/GameModes/Conquest.cs @@ -161,7 +161,7 @@ private static void Load() { try { - string fileName = Essentials.PluginPath + "Essentials-Conquest.xml"; + String fileName = Essentials.PluginPath + "Essentials-Conquest.xml"; if (File.Exists(fileName)) { using (StreamReader reader = new StreamReader(fileName)) @@ -187,7 +187,7 @@ private static void Save() { lock (Instance) { - string fileName = Essentials.PluginPath + "Essentials-Conquest.xml"; + String fileName = Essentials.PluginPath + "Essentials-Conquest.xml"; using (StreamWriter writer = new StreamWriter(fileName)) { XmlSerializer x = new XmlSerializer(typeof(Conquest)); diff --git a/EssentialsPlugin/ProcessHandlers/ProcessDockingZone.cs b/EssentialsPlugin/ProcessHandlers/ProcessDockingZone.cs index 9aac12a..aeb1bae 100644 --- a/EssentialsPlugin/ProcessHandlers/ProcessDockingZone.cs +++ b/EssentialsPlugin/ProcessHandlers/ProcessDockingZone.cs @@ -119,7 +119,7 @@ private void CheckPlayerInDockingZone(IMyPlayer player) // Does this grid contain a docking zone? if (m_zoneCache.Contains(cubeGrid)) { - Dictionary> zoneList = DockingZone.GetZonesInGrid(cubeGrid); + Dictionary> zoneList = DockingZone.GetZonesInGrid(cubeGrid); if (zoneList == null) continue; diff --git a/EssentialsPlugin/ProcessHandlers/ProcessRestart.cs b/EssentialsPlugin/ProcessHandlers/ProcessRestart.cs index 7d3d8d2..7cacf9c 100644 --- a/EssentialsPlugin/ProcessHandlers/ProcessRestart.cs +++ b/EssentialsPlugin/ProcessHandlers/ProcessRestart.cs @@ -139,7 +139,7 @@ private void DoRestart() if (Environment.UserInteractive) { string restartText = "%windir%/system32/timeout /t 30\r\n"; - restartText += string.Format("cd /d \"{0}\"\r\n", Path.GetDirectoryName(Application.ExecutablePath)); + restartText += String.Format("cd /d \"{0}\"\r\n", Path.GetDirectoryName(Application.ExecutablePath)); restartText += PluginSettings.Instance.RestartAddedProcesses + "\r\n"; restartText += Path.GetFileName(Application.ExecutablePath) + " " + Server.Instance.CommandLineArgs.Args + "\r\n"; diff --git a/EssentialsPlugin/Settings/SettingsGreetingDialogItem.cs b/EssentialsPlugin/Settings/SettingsGreetingDialogItem.cs index 6e95a9d..16638d3 100644 --- a/EssentialsPlugin/Settings/SettingsGreetingDialogItem.cs +++ b/EssentialsPlugin/Settings/SettingsGreetingDialogItem.cs @@ -75,7 +75,7 @@ public override string ToString() public event PropertyChangedEventHandler PropertyChanged; - private void NotifyPropertyChanged(string propertyName = "") + private void NotifyPropertyChanged(String propertyName = "") { if (PropertyChanged != null) { diff --git a/EssentialsPlugin/Settings/SettingsProtectedItem.cs b/EssentialsPlugin/Settings/SettingsProtectedItem.cs index 718a6f8..d50a732 100644 --- a/EssentialsPlugin/Settings/SettingsProtectedItem.cs +++ b/EssentialsPlugin/Settings/SettingsProtectedItem.cs @@ -1,6 +1,9 @@ namespace EssentialsPlugin.Settings { using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.Windows.Forms; using System.Xml.Serialization; using VRage.Serialization; @@ -27,7 +30,6 @@ public enum ProtectionModeEnum GridSetStation, GridSetDynamic, GridDelete, - BlockSettings, } [Serializable] @@ -51,32 +53,33 @@ public class ProtectionSettings public SerializableDictionary ProtectionSettingsDict = new SerializableDictionary(); - private bool _enabled = true; + private bool enabled = true; public bool Enabled { - get { return _enabled; } - set { _enabled = value; } + get { return enabled; } + set { enabled = value; } } - private long _entityId; + private long entityId; public long EntityId { - get { return _entityId; } - set { _entityId = value; } + get { return entityId; } + set { entityId = value; } } - private bool _logOnly; + private bool logOnly; public bool LogOnly { - get { return _logOnly; } - set { _logOnly = value; } + get { return logOnly; } + set { logOnly = value; } } - private bool _protectDamage = true; + private bool protectDamage = true; public bool ProtectDamage { - get { return _protectDamage; } - set { _protectDamage = value; } + get { return protectDamage; } + set + {protectDamage = value;} } } } diff --git a/EssentialsPlugin/Utility/DockingItem.cs b/EssentialsPlugin/Utility/DockingItem.cs index 4e00b6b..75659e2 100644 --- a/EssentialsPlugin/Utility/DockingItem.cs +++ b/EssentialsPlugin/Utility/DockingItem.cs @@ -50,8 +50,8 @@ public Quaternion SaveQuat set { _saveQuat = value; } } - private string _dockedName; - public string DockedName + private String _dockedName; + public String DockedName { get { return _dockedName; } set { _dockedName = value; } diff --git a/EssentialsPlugin/Utility/DockingZone.cs b/EssentialsPlugin/Utility/DockingZone.cs index 220a30d..e188db2 100644 --- a/EssentialsPlugin/Utility/DockingZone.cs +++ b/EssentialsPlugin/Utility/DockingZone.cs @@ -41,7 +41,7 @@ public static bool IsGridInside(IMyCubeGrid dockingEntity, List be public static Dictionary> GetZonesInGrid(IMyCubeGrid cubeGrid) { - Dictionary> testList = new Dictionary>(); + Dictionary> testList = new Dictionary>(); List cubeBlocks = new List(); cubeGrid.GetBlocks(cubeBlocks); foreach (IMySlimBlock entityBlock in cubeBlocks) @@ -73,8 +73,8 @@ public static bool IsGridInside(IMyCubeGrid dockingEntity, List be } } - Dictionary> resultList = new Dictionary>(); - foreach (KeyValuePair> p in testList) + Dictionary> resultList = new Dictionary>(); + foreach (KeyValuePair> p in testList) { if (p.Value.Count == 4) { @@ -90,7 +90,7 @@ static public bool DoesGridContainZone(IMyCubeGrid cubeGrid) return GetZonesInGrid(cubeGrid).Count > 0; } - static public void FindByName(string pylonName, out Dictionary> testList, out List beaconList, long playerId) + static public void FindByName(String pylonName, out Dictionary> testList, out List beaconList, long playerId) { IMyCubeGrid beaconParent = null; testList = new Dictionary>(); diff --git a/EssentialsPlugin/Utility/Entity.cs b/EssentialsPlugin/Utility/Entity.cs index da81fce..96cbb6b 100644 --- a/EssentialsPlugin/Utility/Entity.cs +++ b/EssentialsPlugin/Utility/Entity.cs @@ -17,7 +17,7 @@ class Entity { private static readonly Logger Log = LogManager.GetLogger( "PluginLog" ); - static public bool GreaterThan( Vector3D v, Vector3D container ) + static public Boolean GreaterThan( Vector3D v, Vector3D container ) { if (v.X > container.X || v.Y > container.Y || v.Z > container.Z) return false; @@ -51,9 +51,9 @@ static public Boolean CheckCoolDown(String name, out int timeLeft) } */ - static public bool CheckForIntersection(Dictionary> testList, List beaconList, out int intersectElement) + static public bool CheckForIntersection(Dictionary> testList, List beaconList, out int intersectElement) { - bool intersects = false; + Boolean intersects = false; intersectElement = 0; OrientedBoundingBoxD targetTestBounding = GetBoundingBox(beaconList); if (testList.Count > 0) @@ -133,7 +133,7 @@ static public OrientedBoundingBoxD GetBoundingBox(List cubeList) return new OrientedBoundingBoxD(bb.Center, bb.HalfExtents, Quaternion.CreateFromRotationMatrix(parent.WorldMatrix.GetOrientation())); } - static public bool CheckOwnership(IMyCubeBlock entity, long playerId) + static public Boolean CheckOwnership(IMyCubeBlock entity, long playerId) { MyRelationsBetweenPlayerAndBlock relation = entity.GetUserRelationToOwner(playerId); diff --git a/EssentialsPlugin/Utility/Player.cs b/EssentialsPlugin/Utility/Player.cs index 0b80793..7670424 100644 --- a/EssentialsPlugin/Utility/Player.cs +++ b/EssentialsPlugin/Utility/Player.cs @@ -203,7 +203,7 @@ public static bool Move(string userName, Vector3D position) return true; } - public static bool CheckPlayerSameFaction(long playerId, long compareId) + public static Boolean CheckPlayerSameFaction(long playerId, long compareId) { if (compareId == playerId) return true; @@ -237,31 +237,31 @@ public static bool CheckPlayerSameFaction(long playerId, long compareId) return false; } - public static bool CheckPlayerSameFaction(ulong steamId, ulong steamCompareId) + public static Boolean CheckPlayerSameFaction(ulong steamId, ulong steamCompareId) { long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(steamId).FirstOrDefault(); long compareId = PlayerMap.Instance.GetPlayerIdsFromSteamId(steamCompareId).FirstOrDefault(); return CheckPlayerSameFaction(playerId, compareId); } - internal static object InvokeEntityMethod(object gameEntity, string methodName) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName) { return InvokeEntityMethod(gameEntity, methodName, new object[] { }); } - internal static object InvokeEntityMethod(object gameEntity, string methodName, object[] parameters) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName, Object[] parameters) { return InvokeEntityMethod(gameEntity, methodName, parameters, null); } - internal static object InvokeEntityMethod(object gameEntity, string methodName, object[] parameters, Type[] argTypes) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName, Object[] parameters, Type[] argTypes) { try { MethodInfo method = GetEntityMethod(gameEntity, methodName, argTypes); if (method == null) throw new Exception("Method is empty"); - object result = method.Invoke(gameEntity, parameters); + Object result = method.Invoke(gameEntity, parameters); return result; } @@ -272,7 +272,7 @@ internal static object InvokeEntityMethod(object gameEntity, string methodName, } } - internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) + internal static MethodInfo GetEntityMethod(Object gameEntity, string methodName) { try { @@ -285,7 +285,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) { //Recurse up through the class heirarchy to try to find the method Type type = gameEntity.GetType(); - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy); if (method != null) @@ -305,7 +305,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) } } - internal static MethodInfo GetEntityMethod(object gameEntity, string methodName, Type[] argTypes) + internal static MethodInfo GetEntityMethod(Object gameEntity, string methodName, Type[] argTypes) { try { @@ -321,7 +321,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName, { //Recurse up through the class heirarchy to try to find the method Type type = gameEntity.GetType(); - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy, Type.DefaultBinder, argTypes, null); if (method != null) @@ -412,7 +412,7 @@ private static void Load() { try { - string fileName = Essentials.PluginPath + "Essential-PlayerLogins.xml"; + String fileName = Essentials.PluginPath + "Essential-PlayerLogins.xml"; if (File.Exists(fileName)) { using (StreamReader reader = new StreamReader(fileName)) diff --git a/EssentialsPlugin/Utility/TimedEntityCleanup.cs b/EssentialsPlugin/Utility/TimedEntityCleanup.cs index ee0fdf6..e9500f3 100644 --- a/EssentialsPlugin/Utility/TimedEntityCleanup.cs +++ b/EssentialsPlugin/Utility/TimedEntityCleanup.cs @@ -16,7 +16,7 @@ public class TimedEntityCleanupItem { public long entityId; public DateTime addedTime; - public int secondsAfterAdding; + public Int32 secondsAfterAdding; } public class TimedEntityCleanup diff --git a/EssentialsPlugin/Utility/Utility.cs b/EssentialsPlugin/Utility/Utility.cs index 185de09..a9d8450 100644 --- a/EssentialsPlugin/Utility/Utility.cs +++ b/EssentialsPlugin/Utility/Utility.cs @@ -10,11 +10,11 @@ public static class General public static string TimeSpanToString(TimeSpan ts) { if (ts.Days > 0) - return string.Format("{0}d:{1:D2}h:{2:D2}m:{3:D2}s", ts.Days, ts.Hours, ts.Minutes, ts.Seconds); + return String.Format("{0}d:{1:D2}h:{2:D2}m:{3:D2}s", ts.Days, ts.Hours, ts.Minutes, ts.Seconds); else if (ts.Hours > 0) - return string.Format("{0:D2}h:{1:D2}m:{2:D2}s", ts.Hours, ts.Minutes, ts.Seconds); + return String.Format("{0:D2}h:{1:D2}m:{2:D2}s", ts.Hours, ts.Minutes, ts.Seconds); else - return string.Format("{0:D2}m:{1:D2}s", ts.Minutes, ts.Seconds); + return String.Format("{0:D2}m:{1:D2}s", ts.Minutes, ts.Seconds); } public static string Vector3DToString(Vector3D vector) diff --git a/EssentialsPlugin/Utility/Waypoints.cs b/EssentialsPlugin/Utility/Waypoints.cs index 2bf4c24..7be9f0f 100644 --- a/EssentialsPlugin/Utility/Waypoints.cs +++ b/EssentialsPlugin/Utility/Waypoints.cs @@ -40,7 +40,7 @@ private static void Load() { try { - string fileName = Essentials.PluginPath + "Essential-Waypoints.xml"; + String fileName = Essentials.PluginPath + "Essential-Waypoints.xml"; if (File.Exists(fileName)) { using (StreamReader reader = new StreamReader(fileName)) diff --git a/EssentialsPlugin/Utility/Wrapper.cs b/EssentialsPlugin/Utility/Wrapper.cs index 4808b0f..70c9629 100644 --- a/EssentialsPlugin/Utility/Wrapper.cs +++ b/EssentialsPlugin/Utility/Wrapper.cs @@ -13,7 +13,7 @@ public static void GameAction( Action action ) SandboxGameAssemblyWrapper.Instance.GameAction(action); } - public static void BeginGameAction(Action action, SandboxGameAssemblyWrapper.GameActionCallback callback, object state) + public static void BeginGameAction(Action action, SandboxGameAssemblyWrapper.GameActionCallback callback, Object state) { SandboxGameAssemblyWrapper.Instance.BeginGameAction(action, callback, state); } @@ -35,7 +35,7 @@ internal static FieldInfo GetStaticField(Type objectType, string fieldName) } } - internal static FieldInfo GetEntityField(object gameEntity, string fieldName) + internal static FieldInfo GetEntityField(Object gameEntity, string fieldName) { try { @@ -44,7 +44,7 @@ internal static FieldInfo GetEntityField(object gameEntity, string fieldName) { //Recurse up through the class heirarchy to try to find the field Type type = gameEntity.GetType(); - while (type != typeof(object)) + while (type != typeof(Object)) { field = type.GetField(fieldName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy); if (field != null) @@ -75,7 +75,7 @@ internal static MethodInfo GetStaticMethod(Type objectType, string methodName) { //Recurse up through the class heirarchy to try to find the method Type type = objectType; - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy); if (method != null) @@ -111,7 +111,7 @@ internal static MethodInfo GetStaticMethod(Type objectType, string methodName, T { //Recurse up through the class heirarchy to try to find the method Type type = objectType; - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy, Type.DefaultBinder, argTypes, null); if (method != null) @@ -133,7 +133,7 @@ internal static MethodInfo GetStaticMethod(Type objectType, string methodName, T } } - internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) + internal static MethodInfo GetEntityMethod(Object gameEntity, string methodName) { try { @@ -146,7 +146,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) { //Recurse up through the class heirarchy to try to find the method Type type = gameEntity.GetType(); - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy); if (method != null) @@ -168,7 +168,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName) } } - internal static MethodInfo GetEntityMethod(object gameEntity, string methodName, Type[] argTypes) + internal static MethodInfo GetEntityMethod(Object gameEntity, string methodName, Type[] argTypes) { try { @@ -184,7 +184,7 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName, { //Recurse up through the class heirarchy to try to find the method Type type = gameEntity.GetType(); - while (type != typeof(object)) + while (type != typeof(Object)) { method = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy, Type.DefaultBinder, argTypes, null); if (method != null) @@ -206,14 +206,14 @@ internal static MethodInfo GetEntityMethod(object gameEntity, string methodName, } } - internal static object GetStaticFieldValue(Type objectType, string fieldName) + internal static Object GetStaticFieldValue(Type objectType, string fieldName) { try { FieldInfo field = GetStaticField(objectType, fieldName); if (field == null) return null; - object value = field.GetValue(null); + Object value = field.GetValue(null); return value; } catch (Exception ex) @@ -223,7 +223,7 @@ internal static object GetStaticFieldValue(Type objectType, string fieldName) } } - internal static void SetStaticFieldValue(Type objectType, string fieldName, object value) + internal static void SetStaticFieldValue(Type objectType, string fieldName, Object value) { try { @@ -238,14 +238,14 @@ internal static void SetStaticFieldValue(Type objectType, string fieldName, obje } } - internal static object GetEntityFieldValue(object gameEntity, string fieldName) + internal static Object GetEntityFieldValue(Object gameEntity, string fieldName) { try { FieldInfo field = GetEntityField(gameEntity, fieldName); if (field == null) return null; - object value = field.GetValue(gameEntity); + Object value = field.GetValue(gameEntity); return value; } catch (Exception ex) @@ -255,7 +255,7 @@ internal static object GetEntityFieldValue(object gameEntity, string fieldName) } } - internal static void SetEntityFieldValue(object gameEntity, string fieldName, object value) + internal static void SetEntityFieldValue(Object gameEntity, string fieldName, Object value) { try { @@ -270,19 +270,19 @@ internal static void SetEntityFieldValue(object gameEntity, string fieldName, ob } } - internal static object InvokeStaticMethod(Type objectType, string methodName) + internal static Object InvokeStaticMethod(Type objectType, string methodName) { return InvokeStaticMethod(objectType, methodName, new object[] { }); } - internal static object InvokeStaticMethod(Type objectType, string methodName, object[] parameters) + internal static Object InvokeStaticMethod(Type objectType, string methodName, Object[] parameters) { try { MethodInfo method = GetStaticMethod(objectType, methodName); if (method == null) throw new Exception("Method is empty"); - object result = method.Invoke(null, parameters); + Object result = method.Invoke(null, parameters); return result; } @@ -295,24 +295,24 @@ internal static object InvokeStaticMethod(Type objectType, string methodName, ob } } - internal static object InvokeEntityMethod(object gameEntity, string methodName) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName) { return InvokeEntityMethod(gameEntity, methodName, new object[] { }); } - internal static object InvokeEntityMethod(object gameEntity, string methodName, object[] parameters) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName, Object[] parameters) { return InvokeEntityMethod(gameEntity, methodName, parameters, null); } - internal static object InvokeEntityMethod(object gameEntity, string methodName, object[] parameters, Type[] argTypes) + internal static Object InvokeEntityMethod(Object gameEntity, string methodName, Object[] parameters, Type[] argTypes) { try { MethodInfo method = GetEntityMethod(gameEntity, methodName, argTypes); if (method == null) throw new Exception("Method is empty"); - object result = method.Invoke(gameEntity, parameters); + Object result = method.Invoke(gameEntity, parameters); return result; } @@ -326,7 +326,7 @@ internal static object InvokeEntityMethod(object gameEntity, string methodName, } } - internal static PropertyInfo GetEntityProperty(object gameEntity, string propertyName) + internal static PropertyInfo GetEntityProperty(Object gameEntity, string propertyName) { try { @@ -344,7 +344,7 @@ internal static PropertyInfo GetEntityProperty(object gameEntity, string propert } } - internal static object GetEntityPropertyValue(object gameEntity, string propertyName) + internal static Object GetEntityPropertyValue(Object gameEntity, string propertyName) { try { @@ -352,7 +352,7 @@ internal static object GetEntityPropertyValue(object gameEntity, string property if (property == null) return null; - object result = property.GetValue(gameEntity, null); + Object result = property.GetValue(gameEntity, null); return result; } catch (Exception ex) @@ -364,7 +364,7 @@ internal static object GetEntityPropertyValue(object gameEntity, string property } } - internal static void SetEntityPropertyValue(object gameEntity, string propertyName, object value) + internal static void SetEntityPropertyValue(Object gameEntity, string propertyName, Object value) { try { diff --git a/EssentialsPlugin/UtilityClasses/OrientedBoundingBox.cs b/EssentialsPlugin/UtilityClasses/OrientedBoundingBox.cs index 42e5d1b..f9e7db1 100644 --- a/EssentialsPlugin/UtilityClasses/OrientedBoundingBox.cs +++ b/EssentialsPlugin/UtilityClasses/OrientedBoundingBox.cs @@ -63,7 +63,7 @@ public bool Equals(OrientedBoundingBox other) { return (Center == other.Center && HalfExtent == other.HalfExtent && Orientation == other.Orientation); } - public override bool Equals(object obj) + public override bool Equals(Object obj) { if (obj != null && obj is OrientedBoundingBox) { @@ -659,7 +659,7 @@ public bool Equals(OrientedBoundingBoxD other) { return (Center == other.Center && HalfExtent == other.HalfExtent && Orientation == other.Orientation); } - public override bool Equals(object obj) + public override bool Equals(Object obj) { if (obj != null && obj is OrientedBoundingBoxD) { diff --git a/EssentialsPlugin/UtilityClasses/SerializeableDictionary.cs b/EssentialsPlugin/UtilityClasses/SerializeableDictionary.cs index ac7a8aa..2eec596 100644 --- a/EssentialsPlugin/UtilityClasses/SerializeableDictionary.cs +++ b/EssentialsPlugin/UtilityClasses/SerializeableDictionary.cs @@ -56,7 +56,7 @@ protected SerializableDictionary(SerializationInfo info, StreamingContext contex int itemCount = info.GetInt32("ItemCount"); for (int i = 0; i < itemCount; i++) { - KeyValuePair kvp = (KeyValuePair)info.GetValue(string.Format("Item{0}", i), typeof(KeyValuePair)); + KeyValuePair kvp = (KeyValuePair)info.GetValue(String.Format("Item{0}", i), typeof(KeyValuePair)); Add(kvp.Key, kvp.Value); } } @@ -67,7 +67,7 @@ void ISerializable.GetObjectData(SerializationInfo info, StreamingContext contex int itemIdx = 0; foreach (KeyValuePair kvp in this) { - info.AddValue(string.Format("Item{0}", itemIdx), kvp, typeof(KeyValuePair)); + info.AddValue(String.Format("Item{0}", itemIdx), kvp, typeof(KeyValuePair)); itemIdx++; } }