Update version number and small plugin fix

This commit is contained in:
RaidMax 2019-01-27 18:54:18 -06:00
parent ca535019c6
commit 07df6dbf79
4 changed files with 23 additions and 16 deletions

View File

@ -6,7 +6,7 @@
<RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion> <RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PackageId>RaidMax.IW4MAdmin.Application</PackageId> <PackageId>RaidMax.IW4MAdmin.Application</PackageId>
<Version>2.2.3.3</Version> <Version>2.2.4.0</Version>
<Authors>RaidMax</Authors> <Authors>RaidMax</Authors>
<Company>Forever None</Company> <Company>Forever None</Company>
<Product>IW4MAdmin</Product> <Product>IW4MAdmin</Product>
@ -31,8 +31,8 @@
<PropertyGroup> <PropertyGroup>
<ServerGarbageCollection>true</ServerGarbageCollection> <ServerGarbageCollection>true</ServerGarbageCollection>
<TieredCompilation>true</TieredCompilation> <TieredCompilation>true</TieredCompilation>
<AssemblyVersion>2.2.3.3</AssemblyVersion> <AssemblyVersion>2.2.4.0</AssemblyVersion>
<FileVersion>2.2.3.3</FileVersion> <FileVersion>2.2.4.0</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -865,7 +865,7 @@ namespace IW4MAdmin
#if !DEBUG #if !DEBUG
else else
{ {
string formattedKick = String.Format(RconParser.GetCommandPrefixes().Kick, Target.ClientNumber, $"{loc["SERVER_KICK_TEXT"]} - ^5{Reason}^7"); string formattedKick = String.Format(RconParser.Configuration.CommandPrefixes.Kick, Target.ClientNumber, $"{loc["SERVER_KICK_TEXT"]} - ^5{Reason}^7");
await Target.CurrentServer.ExecuteCommandAsync(formattedKick); await Target.CurrentServer.ExecuteCommandAsync(formattedKick);
} }
#endif #endif
@ -904,7 +904,7 @@ namespace IW4MAdmin
#if !DEBUG #if !DEBUG
else else
{ {
string formattedKick = String.Format(RconParser.GetCommandPrefixes().Kick, Target.ClientNumber, $"^7{loc["SERVER_TB_TEXT"]}- ^5{Reason}"); string formattedKick = String.Format(RconParser.Configuration.CommandPrefixes.Kick, Target.ClientNumber, $"^7{loc["SERVER_TB_TEXT"]}- ^5{Reason}");
await Target.CurrentServer.ExecuteCommandAsync(formattedKick); await Target.CurrentServer.ExecuteCommandAsync(formattedKick);
} }
#else #else
@ -949,7 +949,7 @@ namespace IW4MAdmin
targetClient.Level = EFClient.Permission.Banned; targetClient.Level = EFClient.Permission.Banned;
#if !DEBUG #if !DEBUG
string formattedString = String.Format(RconParser.GetCommandPrefixes().Kick, targetClient.ClientNumber, $"{loc["SERVER_BAN_TEXT"]} - ^5{reason} ^7({loc["SERVER_BAN_APPEAL"]} {Website})^7"); string formattedString = String.Format(RconParser.Configuration.CommandPrefixes.Kick, targetClient.ClientNumber, $"{loc["SERVER_BAN_TEXT"]} - ^5{reason} ^7({loc["SERVER_BAN_APPEAL"]} {Website})^7");
await targetClient.CurrentServer.ExecuteCommandAsync(formattedString); await targetClient.CurrentServer.ExecuteCommandAsync(formattedString);
#else #else
await targetClient.CurrentServer.OnClientDisconnected(targetClient); await targetClient.CurrentServer.OnClientDisconnected(targetClient);

View File

@ -1,7 +1,6 @@
using SharedLibraryCore.Database.Models; using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces; using SharedLibraryCore.Interfaces;
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -85,14 +84,19 @@ namespace SharedLibraryCore
this.Version = (float)pluginObject.version; this.Version = (float)pluginObject.version;
if (pluginObject.isParser) try
{ {
await OnLoadAsync(mgr); if (pluginObject.isParser)
IEventParser eventParser = (IEventParser)ScriptEngine.GetValue("eventParser").ToObject(); {
IRConParser rconParser = (IRConParser)ScriptEngine.GetValue("rconParser").ToObject(); await OnLoadAsync(mgr);
Manager.AdditionalEventParsers.Add(eventParser); IEventParser eventParser = (IEventParser)ScriptEngine.GetValue("eventParser").ToObject();
Manager.AdditionalRConParsers.Add(rconParser); IRConParser rconParser = (IRConParser)ScriptEngine.GetValue("rconParser").ToObject();
Manager.AdditionalEventParsers.Add(eventParser);
Manager.AdditionalRConParsers.Add(rconParser);
}
} }
catch { }
if (!firstRun) if (!firstRun)
{ {
@ -123,6 +127,9 @@ namespace SharedLibraryCore
return Task.FromResult(ScriptEngine.Execute("plugin.onTickAsync(_server)").GetCompletionValue()); return Task.FromResult(ScriptEngine.Execute("plugin.onTickAsync(_server)").GetCompletionValue());
} }
public Task OnUnloadAsync() => Task.FromResult(ScriptEngine.Execute("plugin.onUnloadAsync()").GetCompletionValue()); public Task OnUnloadAsync()
{
return Task.FromResult(ScriptEngine.Execute("plugin.onUnloadAsync()").GetCompletionValue());
}
} }
} }

View File

@ -146,7 +146,7 @@ namespace SharedLibraryCore
protected async Task Tell(String Message, EFClient Target) protected async Task Tell(String Message, EFClient Target)
{ {
#if !DEBUG #if !DEBUG
string formattedMessage = String.Format(RconParser.GetCommandPrefixes().Tell, Target.ClientNumber, $"{(CustomSayEnabled ? $"{CustomSayName}: " : "")}{Message}"); string formattedMessage = String.Format(RconParser.Configuration.CommandPrefixes.Tell, Target.ClientNumber, $"{(CustomSayEnabled ? $"{CustomSayName}: " : "")}{Message}");
if (Target.ClientNumber > -1 && Message.Length > 0 && Target.Level != EFClient.Permission.Console) if (Target.ClientNumber > -1 && Message.Length > 0 && Target.Level != EFClient.Permission.Console)
await this.ExecuteCommandAsync(formattedMessage); await this.ExecuteCommandAsync(formattedMessage);
#else #else