Skip to content

Commit

Permalink
Exclusion zones ready for beta
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxar-tc committed Jan 6, 2016
1 parent c59d0ce commit 1c20fe7
Show file tree
Hide file tree
Showing 9 changed files with 823 additions and 272 deletions.
6 changes: 3 additions & 3 deletions NoGrief/AssemblyFileVersion.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//9
//53
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyFileVersion("1.0.0.9")]
[assembly: AssemblyVersion("1.0.0.9")]
[assembly: AssemblyFileVersion("1.0.0.53")]
[assembly: AssemblyVersion("1.0.0.53")]
3 changes: 2 additions & 1 deletion NoGrief/ChatHandlers/ChatHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using NLog;
using SEModAPIInternal.API.Common;
using NoGriefPlugin.Utility;

public abstract class ChatHandlerBase
{
Expand Down Expand Up @@ -54,7 +55,7 @@ public virtual Boolean CanHandle( ulong steamId, String[ ] words, ref int comman

public abstract string GetHelp( );

public abstract string GetHelpDialog( );
public abstract Communication.ServerDialogItem GetHelpDialog( );

public virtual String GetCommandText( )
{
Expand Down
45 changes: 39 additions & 6 deletions NoGrief/NoGrief.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
using System.Runtime.InteropServices;
using SEModAPI.API.Utility;
using VRage.ModAPI;
using EssentialsPlugin.Utility;
using Utility;
public class NoGrief : IPlugin, IChatEventHandler, IPlayerEventHandler
{

Expand Down Expand Up @@ -75,6 +75,22 @@ public static string PluginPath
}
}

[Category( "Chat Settings" )]
[Description( "Chat messages sent from the server will show this name. \r\nNote: This is set separately from SESE and Essentials." )]
[Browsable( true )]
[ReadOnly( false )]
public string ServerChatName
{
get
{
return PluginSettings.Instance.ServerChatName;
}
set
{
PluginSettings.Instance.ServerChatName = value;
}
}

[Category( "Exclusion Zones" )]
[Description( "Turn exclusion zones on or off" )]
[Browsable( true )]
Expand Down Expand Up @@ -107,6 +123,23 @@ public MTObservableCollection<ExclusionItem> ExclusionItems
}
}

[Category( "Exclusion Zones" )]
[Description( "Turn logging on or off" )]
[Browsable( true )]
[ReadOnly( false )]
public bool ExclusionLogging
{
get
{
return PluginSettings.Instance.ExclusionLogging;
}
set
{
PluginSettings.Instance.ExclusionLogging = value;
}
}

/*
[Category( "Player Protection" )]
[Description( "Amount of time, in minutes, after a player logs off before their station is protected" )]
[Browsable( true )]
Expand Down Expand Up @@ -170,7 +203,7 @@ public int ProtectionRadius
PluginSettings.Instance.ProtectionRadius = value;
}
}

*/
#endregion

#region "Methods"
Expand Down Expand Up @@ -213,7 +246,7 @@ private void DoInit( string path )
// Setup process handlers
_processHandlers = new List<ProcessHandlerBase>
{

new ProcessExclusionZone( )
};

// Setup chat handlers
Expand Down Expand Up @@ -539,7 +572,7 @@ private void HandleHelpDialog( ulong remoteUserId, IReadOnlyCollection<string> c
commandList = commandList.Replace( ", ", "|" );
//take our list of commands, put line breaks between all the entries and stuff it into a dialog winow

Communication.SendClientMessage( remoteUserId, string.Format( "/dialog \"Help\" \"Available commands\" \"\" \"{0}||Type '/help dialog <command>' for more info.\" \"close\"", commandList ) );
Communication.DisplayDialog( remoteUserId, "Help", "Available commands", commandList + "||Type '/help dialog <command>' for more info.", "close" );
}
else
{
Expand All @@ -552,7 +585,7 @@ private void HandleHelpDialog( ulong remoteUserId, IReadOnlyCollection<string> c
{
if ( String.Equals( handler.GetCommandText( ), helpTarget, StringComparison.CurrentCultureIgnoreCase ) )
{
Communication.SendClientMessage( remoteUserId, handler.GetHelpDialog( ) );
Communication.DisplayDialog( remoteUserId, handler.GetHelpDialog( ) );
found = true;
}
}
Expand All @@ -562,7 +595,7 @@ private void HandleHelpDialog( ulong remoteUserId, IReadOnlyCollection<string> c
{
if ( String.Equals( cmd, helpTarget, StringComparison.CurrentCultureIgnoreCase ) )
{
Communication.SendClientMessage( remoteUserId, handler.GetHelpDialog( ) );
Communication.DisplayDialog( remoteUserId, handler.GetHelpDialog( ) );
found = true;
}
}
Expand Down
6 changes: 2 additions & 4 deletions NoGrief/NoGriefPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
</Compile>
<Compile Include="ChatHandlers\ChatHandlerBase.cs" />
<Compile Include="NoGrief.cs" />
<Compile Include="ProcessHandlers\ExclusionZoneHandler.cs" />
<Compile Include="ProcessHandlers\ProcessExclusionZone.cs" />
<Compile Include="Utility\Communication.cs" />
<Compile Include="Utility\DamageHandler.cs" />
<Compile Include="ProcessHandlers\ProcessHandlerBase.cs" />
<Compile Include="Settings\PluginSettings.cs" />
Expand All @@ -67,9 +68,6 @@
<Compile Include="Utility\MathUtility.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Essentials">
<HintPath>..\..\EssentialsPlugin\EssentialsPlugin\bin\x64\Debug\Essentials.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\SEServerExtender\SEServerExtender\bin\x64\Release\NLog.dll</HintPath>
Expand Down
Loading

0 comments on commit 1c20fe7

Please sign in to comment.