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

Commit

Permalink
Merge pull request #10 from Jesus-QC/dev
Browse files Browse the repository at this point in the history
bump 0.0.0.3
  • Loading branch information
Jesus-QC authored Dec 8, 2021
2 parents 70810bf + b5f9ecb commit 7a561d4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions SecretAdmin/API/Features/Module.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using SecretAdmin.Features.Console;
using Spectre.Console;

namespace SecretAdmin.API.Features
{
Expand All @@ -23,12 +24,12 @@ protected Module()

public virtual void OnEnabled()
{
Log.SpectreRaw($"The module {Name} [{Version}] by {Author} has been enabled.", "lightcyan1");
Log.SpectreRaw($"The module {Name} [{Version}] by {Author} has been enabled.".EscapeMarkup(), "lightcyan1");
}

public virtual void OnDisabled()
{
Log.SpectreRaw($"The module {Name} [{Version}] by {Author} has been disabled.", "lightcyan1");
Log.SpectreRaw($"The module {Name} [{Version}] by {Author} has been disabled.".EscapeMarkup(), "lightcyan1");
}

public virtual void OnRegisteringCommands()
Expand Down
6 changes: 3 additions & 3 deletions SecretAdmin/API/ModuleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public static void LoadAll(uint port)
{
var assembly = Assembly.UnsafeLoadFrom(file);
count++;
Log.SpectreRaw($"Dependency {assembly.GetName().Name} ({assembly.GetName().Version}) has been loaded!", "lightcyan1");
Log.SpectreRaw($"Dependency {assembly.GetName().Name} ({assembly.GetName().Version}) has been loaded!".EscapeMarkup(), "lightcyan1");
}
catch (Exception e)
{
Log.SpectreRaw($"Couldn't load the dependency in the path {file}", "deeppink2");
Log.SpectreRaw($"Couldn't load the dependency in the path {file}".EscapeMarkup(), "deeppink2");
AnsiConsole.WriteException(e);
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ public static void LoadAll(uint port)
}
catch (Exception e)
{
Log.SpectreRaw($"Couldn't load the module in the path {file}", "deeppink2");
Log.SpectreRaw($"Couldn't load the module in the path {file}".EscapeMarkup(), "deeppink2");
AnsiConsole.WriteException(e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion SecretAdmin/Features/Server/SocketServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private async void ListenRequests()
Log.HandleMessage(message, codeType);
}
}
catch (OperationCanceledException)
catch (Exception)
{
Log.Alert("Socket cancelled.");
}
Expand Down
12 changes: 6 additions & 6 deletions SecretAdmin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ namespace SecretAdmin
{
class Program
{
public static Version Version { get; } = new (0, 0, 0,2);
public static Version Version { get; } = new (0, 0, 0,3);
public static ScpServer Server { get; private set; }
public static ConfigManager ConfigManager { get; private set; }
public static CommandHandler CommandHandler { get; private set; }

private static bool _exceptionalExit = true;

static void Main(string[] args)
{
Console.Title = $"SecretAdmin [v{Version}]";
Expand Down Expand Up @@ -57,14 +59,12 @@ private static void Start(string[] args)

private static void OnError(object obj, UnhandledExceptionEventArgs ev)
{
_exceptionalExit = false;
AnsiConsole.WriteException((Exception)ev.ExceptionObject);
File.WriteAllText(Path.Combine(Paths.ProgramLogsFolder, $"{DateTime.Now:MM.dd.yyyy-hh.mm.ss}-exception.log"), AnsiConsole.ExportText());
Exit(false);
}

private static void OnExit(object obj, EventArgs ev) => Exit();

private static void Exit(bool saveLogs = true)
private static void OnExit(object obj, EventArgs ev)
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("\nExit Detected. Killing game process.");
Expand All @@ -78,7 +78,7 @@ private static void Exit(bool saveLogs = true)
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Everything seems good to go! Bye :)");

if(saveLogs)
if(!_exceptionalExit)
File.WriteAllText(Path.Combine(Paths.ProgramLogsFolder, $"{DateTime.Now:MM.dd.yyyy-hh.mm.ss}.log"), AnsiConsole.ExportText());
}
}
Expand Down
6 changes: 3 additions & 3 deletions SecretAdmin/SecretAdmin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<TargetFramework>net5.0</TargetFramework>
<ApplicationIcon>SecretAdmin.ico</ApplicationIcon>
<Optimize>true</Optimize>
<AssemblyVersion>0.0.0.1</AssemblyVersion>
<AssemblyVersion>0.0.0.3</AssemblyVersion>
<Title>SecretAdmin</Title>
<Authors>Jesus-QC, SecretAdmin</Authors>
<Description>Server client for SCP:SL</Description>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/Jesus-QC/SecretAdmin</RepositoryUrl>
<FileVersion>0.0.0.3</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
Expand Down

0 comments on commit 7a561d4

Please sign in to comment.