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

Commit 1224fe9

Browse files
committed
Rolled back everything since 29f54f9 to get rid of the parser changes.
Brought back the logging changes but made it better. Logging now uses the "PluginLog" defined in the nlog.config in SESE. Fixes #6 Fixes #2 Releasing as version 1.7.0.2303
1 parent 29f54f9 commit 1224fe9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+522
-364
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ $RECYCLE.BIN/
125125
.DS_Store
126126
# My Stuff
127127
ClientEntityManagement.cs
128-
ProcessClientConceal.cs
128+
ProcessClientConceal.cs
129+
packages/*/*

.nuget/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>

.nuget/NuGet.exe

1.59 MB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36+
</PropertyGroup>
37+
38+
<PropertyGroup>
39+
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40+
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45+
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
46+
</PropertyGroup>
47+
48+
<PropertyGroup>
49+
<!-- NuGet command -->
50+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
51+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
52+
53+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
54+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
55+
56+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
57+
58+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
59+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
60+
61+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63+
64+
<!-- Commands -->
65+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
67+
68+
<!-- We need to ensure packages are restored prior to assembly resolve -->
69+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
70+
RestorePackages;
71+
$(BuildDependsOn);
72+
</BuildDependsOn>
73+
74+
<!-- Make the build depend on restore packages -->
75+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
76+
$(BuildDependsOn);
77+
BuildPackage;
78+
</BuildDependsOn>
79+
</PropertyGroup>
80+
81+
<Target Name="CheckPrerequisites">
82+
<!-- Raise an error if we're unable to locate nuget.exe -->
83+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
84+
<!--
85+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
86+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
87+
parallel builds will have to wait for it to complete.
88+
-->
89+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
90+
</Target>
91+
92+
<Target Name="_DownloadNuGet">
93+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
94+
</Target>
95+
96+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
97+
<Exec Command="$(RestoreCommand)"
98+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
99+
100+
<Exec Command="$(RestoreCommand)"
101+
LogStandardErrorAsError="true"
102+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
103+
</Target>
104+
105+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
106+
<Exec Command="$(BuildCommand)"
107+
Condition=" '$(OS)' != 'Windows_NT' " />
108+
109+
<Exec Command="$(BuildCommand)"
110+
LogStandardErrorAsError="true"
111+
Condition=" '$(OS)' == 'Windows_NT' " />
112+
</Target>
113+
114+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
115+
<ParameterGroup>
116+
<OutputFilename ParameterType="System.String" Required="true" />
117+
</ParameterGroup>
118+
<Task>
119+
<Reference Include="System.Core" />
120+
<Using Namespace="System" />
121+
<Using Namespace="System.IO" />
122+
<Using Namespace="System.Net" />
123+
<Using Namespace="Microsoft.Build.Framework" />
124+
<Using Namespace="Microsoft.Build.Utilities" />
125+
<Code Type="Fragment" Language="cs">
126+
<![CDATA[
127+
try {
128+
OutputFilename = Path.GetFullPath(OutputFilename);
129+
130+
Log.LogMessage("Downloading latest version of NuGet.exe...");
131+
WebClient webClient = new WebClient();
132+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
133+
134+
return true;
135+
}
136+
catch (Exception ex) {
137+
Log.LogErrorFromException(ex);
138+
return false;
139+
}
140+
]]>
141+
</Code>
142+
</Task>
143+
</UsingTask>
144+
</Project>

EssentialsPlugin.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ VisualStudioVersion = 12.0.31101.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EssentialsPlugin", "EssentialsPlugin\EssentialsPlugin.csproj", "{2F02801E-F501-4DF7-BBBF-212A65026680}"
77
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{41684A8F-9781-4808-B82B-66BE3B0D23D7}"
9+
ProjectSection(SolutionItems) = preProject
10+
.nuget\NuGet.Config = .nuget\NuGet.Config
11+
.nuget\NuGet.exe = .nuget\NuGet.exe
12+
.nuget\NuGet.targets = .nuget\NuGet.targets
13+
EndProjectSection
14+
EndProject
815
Global
916
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1017
Debug|Any CPU = Debug|Any CPU
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//2190
1+
//2304
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.1.0.2190")]
10-
[assembly: AssemblyVersion("1.1.0.2190")]
9+
[assembly: AssemblyFileVersion("1.7.0.2304")]
10+
[assembly: AssemblyVersion("1.7.0.2304")]

EssentialsPlugin/AssemblyFileVersion.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929

3030
using System.Reflection;
3131

32-
[assembly: AssemblyFileVersion("1.1.0.<#= revisionNumber #>")]
33-
[assembly: AssemblyVersion("1.1.0.<#= revisionNumber #>")]
32+
[assembly: AssemblyFileVersion("1.7.0.<#= revisionNumber #>")]
33+
[assembly: AssemblyVersion("1.7.0.<#= revisionNumber #>")]

EssentialsPlugin/ChatHandlers/Admin/HandleAdminStatistics.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
namespace EssentialsPlugin.ChatHandlers
2626
{
27+
using VRage.Utils;
28+
2729
public class HandleAdminStatistics : ChatHandlerBase
2830
{
2931
public override string GetHelp()
@@ -49,7 +51,7 @@ public override bool AllowedInConsole()
4951
public override bool HandleCommand(ulong userId, string[] words)
5052
{
5153
StringBuilder sb = new StringBuilder();
52-
Sandbox.Stats.Generic.WriteTo(sb);
54+
Stats.Generic.WriteTo(sb);
5355
Communication.SendPrivateInformation(userId, sb.ToString());
5456
return true;
5557
}

EssentialsPlugin/ChatHandlers/AdminConceal/HandleAdminReveal.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public override bool HandleCommand(ulong userId, string[] words)
7373
grid.CastShadows = true;
7474
builder.PersistentFlags = (MyPersistentEntityFlags2.InScene | MyPersistentEntityFlags2.CastShadows);
7575
MyAPIGateway.Entities.RemapObjectBuilder(builder);
76-
Logging.WriteLineAndConsole("Conceal", string.Format("Force Revealing - Id: {0} -> {4} Display: {1} OwnerId: {2} OwnerName: {3}", entity.EntityId, entity.DisplayName.Replace("\r", "").Replace("\n", ""), ownerId, ownerName, builder.EntityId));
76+
Log.Info("Conceal", string.Format("Force Revealing - Id: {0} -> {4} Display: {1} OwnerId: {2} OwnerName: {3}", entity.EntityId, entity.DisplayName.Replace("\r", "").Replace("\n", ""), ownerId, ownerName, builder.EntityId));
7777

7878
/*
7979
entity.InScene = true;
@@ -92,7 +92,7 @@ public override bool HandleCommand(ulong userId, string[] words)
9292
}
9393
});
9494

95-
Logging.WriteLineAndConsole( !force ? string.Format( "Command would Reveal {0} grids. Type /admin reveal force to reveal them.", count ) : string.Format( "Command Revealed {0} grids", count ) );
95+
Log.Info( !force ? string.Format( "Command would Reveal {0} grids. Type /admin reveal force to reveal them.", count ) : string.Format( "Command Revealed {0} grids", count ) );
9696

9797
return true;
9898
}

EssentialsPlugin/ChatHandlers/AdminDelete/HandleAdminDeleteCleanup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
public class HandleAdminDeleteCleanup : ChatHandlerBase
1212
{
13-
public override string GetHelp()
13+
public override string GetHelp( )
1414
{
1515
return "This command allows you to scan for grids that are considered trash and delete them. A trash item contains no function or terminal blocks. Adding function or terminal to the command allows you to omit those search parameters. Usage: /admin delete cleanup [functional] [terminal]";
1616
}
@@ -47,7 +47,7 @@ public override bool HandleCommand(ulong userId, string[] words)
4747
ownerName = PlayerMap.Instance.GetPlayerItemFromPlayerId(ownerId).Name;
4848
}
4949

50-
Logging.WriteLineAndConsole("Cleanup", string.Format("Cleanup Removed Grid - Id: {0} Display: {1} OwnerId: {2} OwnerName: {3}", entity.EntityId, entity.DisplayName, ownerId, ownerName));
50+
Log.Info("Cleanup", string.Format("Cleanup Removed Grid - Id: {0} Display: {1} OwnerId: {2} OwnerName: {3}", entity.EntityId, entity.DisplayName, ownerId, ownerName));
5151
}
5252
return true;
5353
}

0 commit comments

Comments
 (0)