Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes a bunch of things and ticks Api version #5

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7003eeb
Offline usage of /whois
Nov 19, 2013
4da71db
Api tick and ref update
Mar 9, 2014
f3ed0c6
Null invSee after null checking it and doing things
Mar 9, 2014
88bb4e7
Update SignCommands.dll for ApiVersion 1,15
Mar 9, 2014
ca18299
Null check in OnChat
Mar 10, 2014
2f7dd6e
v1.5.4 - Fixed Nicknames and TShockIRC comp.
AxisKriel Apr 2, 2014
471d8b6
Merge pull request #1 from Enerdy/master
Apr 3, 2014
27e6d45
Rearrange derpy null check
Apr 4, 2014
419940a
Merge branch 'master' of https://github.com/WhiteXZ/Essentials-SignCo…
Apr 4, 2014
d928640
Refixed last commit + OnLeave
AxisKriel Apr 10, 2014
ce23ef6
Merge branch 'master' of https://github.com/Enerdy/Essentials-SignCom…
Apr 11, 2014
aee0a70
Remove borked merge stuff
May 17, 2014
c1989a3
Whoops. API tick for SignCommands
May 17, 2014
fe5dcc6
Update to 1.2.4 protocol
May 31, 2014
0c7b52c
Merge pull request #5 from ColinBohn/master
Jun 1, 2014
b59fd3f
Large refactoring and some potential fixes. Untested. Use at own risk.
Jun 4, 2014
225e930
Sign Commands Update
Jul 2, 2014
fd995f4
Fix major security issue
Jul 2, 2014
6c630f2
Merge pull request #7 from WhiteXZ/Update
Jul 2, 2014
af8a05b
Fix config definition error in SignCommands
Jul 3, 2014
c943a35
Fixes cooldowns
Jul 5, 2014
0c69fb6
-Starts implementing global cooldowns and player cooldowns
Jul 9, 2014
1c7b32d
Fix >sb
Jul 17, 2014
ad2377a
Sync Essentials with remote branch
Jul 17, 2014
fbd792f
Changed the way noEdit, noRead, requiredPermission etc work (they now…
Aug 16, 2014
a4b9eff
Fix problem with error message on 0 commands
Aug 16, 2014
b069014
Fixes some security issues
Aug 31, 2014
6bc71b5
1,17 api tick for sign commands.
Jun 10, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Build/Essentials.dll
Binary file not shown.
Binary file modified Build/SignCommands.dll
Binary file not shown.
8 changes: 5 additions & 3 deletions Essentials and Sign Commands.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials", "Essentials\Essentials.csproj", "{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignCommands", "SignCommands\SignCommands.csproj", "{AC6A21C4-6EFB-414B-BCE3-6B8F99F65165}"
Expand All @@ -11,8 +13,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Debug|Any CPU.Build.0 = Release|Any CPU
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85F20ADC-C2D1-416D-B7FF-9433C75A8F01}.Release|Any CPU.Build.0 = Release|Any CPU
{AC6A21C4-6EFB-414B-BCE3-6B8F99F65165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
4 changes: 2 additions & 2 deletions Essentials/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.3")]
[assembly: AssemblyFileVersion("1.5.3")]
[assembly: AssemblyVersion("1.6.0")]
[assembly: AssemblyFileVersion("1.6.0")]
83 changes: 12 additions & 71 deletions Essentials/esConfig.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using System.IO;
using System.IO;
using Newtonsoft.Json;
using System.Collections.Generic;
using TShockAPI;

namespace Essentials
{
public class esConfig
public class EsConfig
{
public bool ShowBackMessageOnDeath = true;
public string PrefixNicknamesWith = "~";
Expand All @@ -25,73 +23,16 @@ public class esConfig
public List<string> DisableSetHomeInRegions = new List<string>();
public int BackCooldown = 0;

public static string ConfigPath = string.Empty;
public esConfig Write(string path)
{
File.WriteAllText(path, JsonConvert.SerializeObject(this, Formatting.Indented));
return this;
}
public static esConfig Read(string path)
{
if (!File.Exists(path))
{
WriteExample(path);
}
return JsonConvert.DeserializeObject<esConfig>(File.ReadAllText(path));
}
public static void WriteExample(string path)
{
File.WriteAllText(path, @"{
""ShowBackMessageOnDeath"": true,
""PrefixNicknamesWith"": ""~"",
""LockRedTeam"": false,
""RedTeamPassword"": """",
""RedTeamPermission"": ""essentials.team.red"",
""LockGreenTeam"": false,
""GreenTeamPassword"": """",
""GreenTeamPermission"": ""essentials.team.green"",
""LockBlueTeam"": false,
""BlueTeamPassword"": """",
""BlueTeamPermission"": ""essentials.team.blue"",
""LockYellowTeam"": false,
""YellowTeamPassword"": """",
""YellowTeamPermission"": ""essentials.team.yellow"",
""DisableSetHomeInRegions"": [
""example""
],
""BackCooldown"": 0
}");
}
public void Write(string path)
{
File.WriteAllText(path, JsonConvert.SerializeObject(this, Formatting.Indented));
}

public static void LoadConfig()
{
try
{
ConfigPath = Path.Combine(Essentials.SavePath, "EssentialsConfig.json");
Essentials.Config = esConfig.Read(ConfigPath).Write(ConfigPath);
}
catch (Exception ex)
{
Log.ConsoleError("[Essentials] Config Exception. Check logs for more details.");
Log.Error(ex.ToString());
}
}
public static void ReloadConfig(CommandArgs args)
{
try
{
if (!Directory.Exists(Essentials.SavePath))
{
Directory.CreateDirectory(Essentials.SavePath);
}
Essentials.Config = esConfig.Read(ConfigPath).Write(ConfigPath);
args.Player.SendSuccessMessage("[Essentials] Config reloaded successfully.");
}
catch (Exception ex)
{
args.Player.SendSuccessMessage("[Essnetials] Reload failed. Check logs for more details.");
Log.Error(string.Concat("[Essentials] Config Exception:\n", ex.ToString()));
}
}
public static EsConfig Read(string path)
{
return !File.Exists(path)
? new EsConfig()
: JsonConvert.DeserializeObject<EsConfig>(File.ReadAllText(path));
}
}
}
Loading