Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Revert "Fix system type keyword use"
Browse files Browse the repository at this point in the history
This reverts commit 9b3bda6.
  • Loading branch information
rexxar-tc committed Nov 3, 2016
1 parent ba3b57d commit b3d6f19
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 103 deletions.
2 changes: 1 addition & 1 deletion EssentialsPlugin/ChatHandlers/Admin/HandleAdminVersion.cs
Expand Up @@ -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;
Expand Down
26 changes: 14 additions & 12 deletions EssentialsPlugin/ChatHandlers/ChatHandlerBase.cs
Expand Up @@ -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())
Expand All @@ -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
{
Expand All @@ -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;
}
Expand All @@ -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()
{
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions EssentialsPlugin/ChatHandlers/Dock/HandleDockDock.cs
Expand Up @@ -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;
Expand All @@ -92,7 +92,7 @@ public override bool HandleCommand(ulong userId, string[] words)

long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First();

Dictionary<string, List<IMyCubeBlock>> testList;
Dictionary<String, List<IMyCubeBlock>> testList;
List<IMyCubeBlock> beaconList;
DockingZone.FindByName(pylonName, out testList, out beaconList, playerId);
if (beaconList.Count == 4)
Expand Down
4 changes: 2 additions & 2 deletions EssentialsPlugin/ChatHandlers/Dock/HandleDockList.cs
Expand Up @@ -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));
Expand All @@ -60,7 +60,7 @@ public override bool HandleCommand(ulong userId, string[] words)

long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First();

Dictionary<string, List<IMyCubeBlock>> testList;
Dictionary<String, List<IMyCubeBlock>> testList;
List<IMyCubeBlock> beaconList;
DockingZone.FindByName(pylonName, out testList, out beaconList, playerId);

Expand Down
6 changes: 3 additions & 3 deletions EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs
Expand Up @@ -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 ) );
Expand All @@ -83,7 +83,7 @@ public override bool HandleCommand(ulong userId, string[] words)

long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId( userId ).First( );

Dictionary<string, List<IMyCubeBlock>> testList;
Dictionary<String, List<IMyCubeBlock>> testList;
List<IMyCubeBlock> beaconList;
DockingZone.FindByName( pylonName, out testList, out beaconList, playerId );

Expand Down Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions EssentialsPlugin/ChatHandlers/Dock/HandleDockValidate.cs
Expand Up @@ -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.");
Expand All @@ -62,7 +62,7 @@ public override bool HandleCommand(ulong userId, string[] words)
long playerId = PlayerMap.Instance.GetPlayerIdsFromSteamId(userId).First();

// Find shared beacon area
Dictionary<string, List<IMyCubeBlock>> testList;
Dictionary<String, List<IMyCubeBlock>> testList;
List<IMyCubeBlock> beaconList;
DockingZone.FindByName(pylonName, out testList, out beaconList, playerId);
if (beaconList.Count == 4)
Expand Down
2 changes: 1 addition & 1 deletion EssentialsPlugin/ChatHandlers/HandleInfo.cs
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions EssentialsPlugin/Essentials.cs
Expand Up @@ -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" );
Expand Down Expand Up @@ -1613,7 +1613,7 @@ private void HandleHelpCommand( ulong remoteUserId, IReadOnlyCollection<string>
// 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;
Expand All @@ -1623,7 +1623,7 @@ private void HandleHelpCommand( ulong remoteUserId, IReadOnlyCollection<string>
{
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;
Expand Down Expand Up @@ -1720,7 +1720,7 @@ private void HandleHelpDialog(ulong remoteUserId, IReadOnlyCollection<string> 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;
Expand All @@ -1730,7 +1730,7 @@ private void HandleHelpDialog(ulong remoteUserId, IReadOnlyCollection<string> 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;
Expand Down
4 changes: 2 additions & 2 deletions EssentialsPlugin/GameModes/Conquest.cs
Expand Up @@ -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))
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion EssentialsPlugin/ProcessHandlers/ProcessDockingZone.cs
Expand Up @@ -119,7 +119,7 @@ private void CheckPlayerInDockingZone(IMyPlayer player)
// Does this grid contain a docking zone?
if (m_zoneCache.Contains(cubeGrid))
{
Dictionary<string, List<IMyCubeBlock>> zoneList = DockingZone.GetZonesInGrid(cubeGrid);
Dictionary<String, List<IMyCubeBlock>> zoneList = DockingZone.GetZonesInGrid(cubeGrid);
if (zoneList == null)
continue;

Expand Down
2 changes: 1 addition & 1 deletion EssentialsPlugin/ProcessHandlers/ProcessRestart.cs
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion EssentialsPlugin/Settings/SettingsGreetingDialogItem.cs
Expand Up @@ -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)
{
Expand Down
29 changes: 16 additions & 13 deletions 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;

Expand All @@ -27,7 +30,6 @@ public enum ProtectionModeEnum
GridSetStation,
GridSetDynamic,
GridDelete,
BlockSettings,
}

[Serializable]
Expand All @@ -51,32 +53,33 @@ public class ProtectionSettings

public SerializableDictionary<ProtectionModeEnum,ProtectionSettings> ProtectionSettingsDict = new SerializableDictionary<ProtectionModeEnum, ProtectionSettings>();

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;}
}
}
}
4 changes: 2 additions & 2 deletions EssentialsPlugin/Utility/DockingItem.cs
Expand Up @@ -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; }
Expand Down
8 changes: 4 additions & 4 deletions EssentialsPlugin/Utility/DockingZone.cs
Expand Up @@ -41,7 +41,7 @@ public static bool IsGridInside(IMyCubeGrid dockingEntity, List<IMyCubeBlock> be

public static Dictionary<string, List<IMyCubeBlock>> GetZonesInGrid(IMyCubeGrid cubeGrid)
{
Dictionary<string, List<IMyCubeBlock>> testList = new Dictionary<string, List<IMyCubeBlock>>();
Dictionary<String, List<IMyCubeBlock>> testList = new Dictionary<string, List<IMyCubeBlock>>();
List<IMySlimBlock> cubeBlocks = new List<IMySlimBlock>();
cubeGrid.GetBlocks(cubeBlocks);
foreach (IMySlimBlock entityBlock in cubeBlocks)
Expand Down Expand Up @@ -73,8 +73,8 @@ public static bool IsGridInside(IMyCubeGrid dockingEntity, List<IMyCubeBlock> be
}
}

Dictionary<string, List<IMyCubeBlock>> resultList = new Dictionary<string, List<IMyCubeBlock>>();
foreach (KeyValuePair<string, List<IMyCubeBlock>> p in testList)
Dictionary<String, List<IMyCubeBlock>> resultList = new Dictionary<string, List<IMyCubeBlock>>();
foreach (KeyValuePair<String, List<IMyCubeBlock>> p in testList)
{
if (p.Value.Count == 4)
{
Expand All @@ -90,7 +90,7 @@ static public bool DoesGridContainZone(IMyCubeGrid cubeGrid)
return GetZonesInGrid(cubeGrid).Count > 0;
}

static public void FindByName(string pylonName, out Dictionary<string, List<IMyCubeBlock>> testList, out List<IMyCubeBlock> beaconList, long playerId)
static public void FindByName(String pylonName, out Dictionary<String, List<IMyCubeBlock>> testList, out List<IMyCubeBlock> beaconList, long playerId)
{
IMyCubeGrid beaconParent = null;
testList = new Dictionary<string, List<IMyCubeBlock>>();
Expand Down
8 changes: 4 additions & 4 deletions EssentialsPlugin/Utility/Entity.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -51,9 +51,9 @@ static public Boolean CheckCoolDown(String name, out int timeLeft)
}
*/

static public bool CheckForIntersection(Dictionary<string, List<IMyCubeBlock>> testList, List<IMyCubeBlock> beaconList, out int intersectElement)
static public bool CheckForIntersection(Dictionary<String, List<IMyCubeBlock>> testList, List<IMyCubeBlock> beaconList, out int intersectElement)
{
bool intersects = false;
Boolean intersects = false;
intersectElement = 0;
OrientedBoundingBoxD targetTestBounding = GetBoundingBox(beaconList);
if (testList.Count > 0)
Expand Down Expand Up @@ -133,7 +133,7 @@ static public OrientedBoundingBoxD GetBoundingBox(List<IMyCubeBlock> 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);

Expand Down

0 comments on commit b3d6f19

Please sign in to comment.