fixed various bugs
This commit is contained in:
parent
7706658f9c
commit
cb60ed7773
|
|
@ -11,6 +11,7 @@ namespace Novetus.Bootstrapper
|
||||||
{
|
{
|
||||||
public static readonly string FixedBinDir = GlobalPaths.BasePathLauncher + @"\\bin";
|
public static readonly string FixedBinDir = GlobalPaths.BasePathLauncher + @"\\bin";
|
||||||
public static readonly string FixedConfigDir = GlobalPaths.BasePathLauncher + @"\\config";
|
public static readonly string FixedConfigDir = GlobalPaths.BasePathLauncher + @"\\config";
|
||||||
|
public static readonly string FixedDataDir = FixedBinDir + @"\\data";
|
||||||
|
|
||||||
#region File Names
|
#region File Names
|
||||||
public static readonly string LauncherName = "Novetus.exe";
|
public static readonly string LauncherName = "Novetus.exe";
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
<None Include="Resources\Montserrat-SemiBold.ttf" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="NovetusIcon.ico" />
|
<Content Include="NovetusIcon.ico" />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Text;
|
using System.Drawing.Text;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Novetus.Bootstrapper
|
namespace Novetus.Bootstrapper
|
||||||
|
|
@ -16,22 +15,26 @@ namespace Novetus.Bootstrapper
|
||||||
private void NovetusLaunchForm_Load(object sender, EventArgs e)
|
private void NovetusLaunchForm_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//use novetus font for label!!
|
//use novetus font for label!!
|
||||||
//https://stackoverflow.com/questions/1297264/using-custom-fonts-on-a-label-on-winforms
|
|
||||||
|
|
||||||
GlobalFuncs.ReadInfoFile(LocalPaths.InfoPath, true, LocalPaths.LauncherPath);
|
GlobalFuncs.ReadInfoFile(LocalPaths.InfoPath, true, LocalPaths.LauncherPath);
|
||||||
|
|
||||||
PrivateFontCollection pfc = new PrivateFontCollection();
|
try
|
||||||
int fontLength = Properties.Resources.Montserrat_SemiBold.Length;
|
{
|
||||||
byte[] fontdata = Properties.Resources.Montserrat_SemiBold;
|
PrivateFontCollection pfc = new PrivateFontCollection();
|
||||||
IntPtr data = Marshal.AllocCoTaskMem(fontLength);
|
string fontPath = LocalPaths.FixedDataDir + "\\BootstrapperFont.ttf";
|
||||||
Marshal.Copy(fontdata, 0, data, fontLength);
|
pfc.AddFontFile(fontPath);
|
||||||
pfc.AddMemoryFont(data, fontLength);
|
|
||||||
|
foreach (var fam in pfc.Families)
|
||||||
|
{
|
||||||
|
VersionLabel.Font = new Font(fam, VersionLabel.Font.Size);
|
||||||
|
LaunchNovetusButton.Font = new Font(fam, VersionLabel.Font.Size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
VersionLabel.Font = new Font(pfc.Families[0], VersionLabel.Font.Size);
|
|
||||||
VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper();
|
VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper();
|
||||||
|
|
||||||
LaunchNovetusButton.Font = new Font(pfc.Families[0], VersionLabel.Font.Size);
|
|
||||||
|
|
||||||
CenterToScreen();
|
CenterToScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,16 +60,6 @@ namespace Novetus.Bootstrapper.Properties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized resource of type System.Byte[].
|
|
||||||
/// </summary>
|
|
||||||
internal static byte[] Montserrat_SemiBold {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("Montserrat_SemiBold", resourceCulture);
|
|
||||||
return ((byte[])(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -118,9 +118,6 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="Montserrat_SemiBold" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\Montserrat-SemiBold.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name="NOVETUS_new_final_smol" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="NOVETUS_new_final_smol" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\NOVETUS_new_final_smol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\NOVETUS_new_final_smol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
namespace NovetusCMD
|
namespace NovetusCMD
|
||||||
|
|
@ -13,6 +14,24 @@ namespace NovetusCMD
|
||||||
#region Novetus CMD Main Class
|
#region Novetus CMD Main Class
|
||||||
public static class NovetusCMD
|
public static class NovetusCMD
|
||||||
{
|
{
|
||||||
|
//https://stackoverflow.com/questions/474679/capture-console-exit-c-sharp
|
||||||
|
#region Trap application termination
|
||||||
|
[DllImport("Kernel32")]
|
||||||
|
private static extern bool SetConsoleCtrlHandler(EventHandler handler, bool add);
|
||||||
|
|
||||||
|
private delegate bool EventHandler(CtrlType sig);
|
||||||
|
static EventHandler _handler;
|
||||||
|
|
||||||
|
enum CtrlType
|
||||||
|
{
|
||||||
|
CTRL_C_EVENT = 0,
|
||||||
|
CTRL_BREAK_EVENT = 1,
|
||||||
|
CTRL_CLOSE_EVENT = 2,
|
||||||
|
CTRL_LOGOFF_EVENT = 5,
|
||||||
|
CTRL_SHUTDOWN_EVENT = 6
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region UPnP
|
#region UPnP
|
||||||
public static void InitUPnP()
|
public static void InitUPnP()
|
||||||
{
|
{
|
||||||
|
|
@ -121,6 +140,9 @@ namespace NovetusCMD
|
||||||
#region Main Program Function
|
#region Main Program Function
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
_handler += new EventHandler(CloseHandler);
|
||||||
|
SetConsoleCtrlHandler(_handler, true);
|
||||||
|
|
||||||
var config = new NLog.Config.LoggingConfiguration();
|
var config = new NLog.Config.LoggingConfiguration();
|
||||||
var logfile = new NLog.Targets.FileTarget("logfile") { FileName = GlobalPaths.ConfigDir + "\\CMD-log-" + DateTime.Today.ToString("MM-dd-yyyy") + ".log" };
|
var logfile = new NLog.Targets.FileTarget("logfile") { FileName = GlobalPaths.ConfigDir + "\\CMD-log-" + DateTime.Today.ToString("MM-dd-yyyy") + ".log" };
|
||||||
config.AddRule(LogLevel.Info, LogLevel.Fatal, logfile);
|
config.AddRule(LogLevel.Info, LogLevel.Fatal, logfile);
|
||||||
|
|
@ -149,8 +171,6 @@ namespace NovetusCMD
|
||||||
LoadOverrideINIArgs(args);
|
LoadOverrideINIArgs(args);
|
||||||
InitUPnP();
|
InitUPnP();
|
||||||
|
|
||||||
AppDomain.CurrentDomain.ProcessExit += new EventHandler(ProgramClose);
|
|
||||||
|
|
||||||
GlobalFuncs.ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1);
|
GlobalFuncs.ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1);
|
||||||
|
|
||||||
switch (LocalVars.DebugMode)
|
switch (LocalVars.DebugMode)
|
||||||
|
|
@ -172,28 +192,37 @@ namespace NovetusCMD
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ProgramClose(object sender, EventArgs e)
|
private static bool CloseHandler(CtrlType sig)
|
||||||
{
|
{
|
||||||
if (GlobalVars.ProcessID != 0)
|
CloseHandlerInternal();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CloseHandlerInternal()
|
||||||
|
{
|
||||||
|
if (!LocalVars.PrintHelp)
|
||||||
{
|
{
|
||||||
if (LocalFuncs.ProcessExists(GlobalVars.ProcessID))
|
if (GlobalVars.ProcessID != 0)
|
||||||
{
|
{
|
||||||
Process proc = Process.GetProcessById(GlobalVars.ProcessID);
|
if (LocalFuncs.ProcessExists(GlobalVars.ProcessID))
|
||||||
proc.Kill();
|
{
|
||||||
|
Process proc = Process.GetProcessById(GlobalVars.ProcessID);
|
||||||
|
proc.Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!LocalVars.OverrideINI)
|
||||||
|
{
|
||||||
|
WriteConfigValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GlobalVars.RequestToOutputInfo)
|
||||||
|
{
|
||||||
|
GlobalFuncs.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LocalVars.OverrideINI)
|
Environment.Exit(-1);
|
||||||
{
|
|
||||||
WriteConfigValues();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GlobalVars.RequestToOutputInfo)
|
|
||||||
{
|
|
||||||
GlobalFuncs.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
Application.Exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadCMDArgs(string[] args)
|
static void LoadCMDArgs(string[] args)
|
||||||
|
|
@ -318,15 +347,16 @@ namespace NovetusCMD
|
||||||
#region Client Loading
|
#region Client Loading
|
||||||
static void StartServer(bool no3d)
|
static void StartServer(bool no3d)
|
||||||
{
|
{
|
||||||
GlobalFuncs.LaunchRBXClient(ScriptType.Server, no3d, false, new EventHandler(ServerExited));
|
GlobalFuncs.LaunchRBXClient(ScriptType.Server, no3d, false, new System.EventHandler(ServerExited));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ServerExited(object sender, EventArgs e)
|
static void ServerExited(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
GlobalVars.GameOpened = ScriptType.None;
|
GlobalVars.GameOpened = ScriptType.None;
|
||||||
GlobalFuncs.PingMasterServer(0, "The server has removed itself from the master server list.");
|
GlobalFuncs.PingMasterServer(0, "The server has removed itself from the master server list.");
|
||||||
Environment.Exit(0);
|
CloseHandlerInternal();
|
||||||
}
|
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,7 @@ public class GlobalFuncs
|
||||||
|
|
||||||
if (!File.Exists(fulldllpath))
|
if (!File.Exists(fulldllpath))
|
||||||
{
|
{
|
||||||
FixedFileCopy(GlobalPaths.ConfigDirData + "\\" + dllfilename, fulldllpath, false);
|
FixedFileCopy(GlobalPaths.DataDir + "\\" + dllfilename, fulldllpath, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -644,8 +644,16 @@ public class GlobalFuncs
|
||||||
string name = ClientName;
|
string name = ClientName;
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
{
|
{
|
||||||
name = GlobalVars.ProgramInformation.DefaultClient;
|
if (!string.IsNullOrWhiteSpace(GlobalVars.ProgramInformation.DefaultClient))
|
||||||
|
{
|
||||||
|
name = GlobalVars.ProgramInformation.DefaultClient;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string clientpath = GlobalPaths.ClientDir + @"\\" + name + @"\\clientinfo.nov";
|
string clientpath = GlobalPaths.ClientDir + @"\\" + name + @"\\clientinfo.nov";
|
||||||
|
|
||||||
if (!File.Exists(clientpath))
|
if (!File.Exists(clientpath))
|
||||||
|
|
@ -1893,7 +1901,7 @@ public class GlobalFuncs
|
||||||
|
|
||||||
string luafile = GetLuaFileName(ClientName, type);
|
string luafile = GetLuaFileName(ClientName, type);
|
||||||
string rbxexe = GetClientEXEDir(ClientName, type);
|
string rbxexe = GetClientEXEDir(ClientName, type);
|
||||||
string mapfile = type.Equals(ScriptType.EasterEgg) ? GlobalPaths.ConfigDirData + "\\Appreciation.rbxl" : (nomap ? "" : GlobalVars.UserConfiguration.MapPath);
|
string mapfile = type.Equals(ScriptType.EasterEgg) ? GlobalPaths.DataDir + "\\Appreciation.rbxl" : (nomap ? "" : GlobalVars.UserConfiguration.MapPath);
|
||||||
string mapname = type.Equals(ScriptType.EasterEgg) ? "" : (nomap ? "" : GlobalVars.UserConfiguration.Map);
|
string mapname = type.Equals(ScriptType.EasterEgg) ? "" : (nomap ? "" : GlobalVars.UserConfiguration.Map);
|
||||||
FileFormat.ClientInfo info = GetClientInfoValues(ClientName);
|
FileFormat.ClientInfo info = GetClientInfoValues(ClientName);
|
||||||
string quote = "\"";
|
string quote = "\"";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class GlobalPaths
|
||||||
public static readonly string ConfigDir = BasePath + @"\\config";
|
public static readonly string ConfigDir = BasePath + @"\\config";
|
||||||
public static readonly string ConfigDirClients = ConfigDir + @"\\clients";
|
public static readonly string ConfigDirClients = ConfigDir + @"\\clients";
|
||||||
public static readonly string ConfigDirTemplates = ConfigDir + @"\\itemtemplates";
|
public static readonly string ConfigDirTemplates = ConfigDir + @"\\itemtemplates";
|
||||||
public static readonly string ConfigDirData = BasePathLauncher + @"\\data";
|
public static readonly string DataDir = BinDir + @"\\data";
|
||||||
public static readonly string ClientDir = BasePath + @"\\clients";
|
public static readonly string ClientDir = BasePath + @"\\clients";
|
||||||
public static readonly string MapsDir = BasePath + @"\\maps";
|
public static readonly string MapsDir = BasePath + @"\\maps";
|
||||||
public static readonly string MapsDirCustom = MapsDir + @"\\Custom";
|
public static readonly string MapsDirCustom = MapsDir + @"\\Custom";
|
||||||
|
|
|
||||||
|
|
@ -1218,7 +1218,7 @@ public partial class AssetSDK : Form
|
||||||
{
|
{
|
||||||
if (MeshConverter_OpenOBJDialog.ShowDialog() == DialogResult.OK)
|
if (MeshConverter_OpenOBJDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
MeshConverter_ProcessOBJ(GlobalPaths.ConfigDirData + "\\ObjToRBXMesh.exe", MeshConverter_OpenOBJDialog.FileName);
|
MeshConverter_ProcessOBJ(GlobalPaths.DataDir + "\\ObjToRBXMesh.exe", MeshConverter_OpenOBJDialog.FileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,14 +88,14 @@ public partial class NovetusSDK : Form
|
||||||
break;
|
break;
|
||||||
case SDKApps.ScriptGenerator:
|
case SDKApps.ScriptGenerator:
|
||||||
Process proc = new Process();
|
Process proc = new Process();
|
||||||
proc.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\RSG.exe";
|
proc.StartInfo.FileName = GlobalPaths.DataDir + "\\RSG.exe";
|
||||||
proc.StartInfo.CreateNoWindow = false;
|
proc.StartInfo.CreateNoWindow = false;
|
||||||
proc.StartInfo.UseShellExecute = false;
|
proc.StartInfo.UseShellExecute = false;
|
||||||
proc.Start();
|
proc.Start();
|
||||||
break;
|
break;
|
||||||
case SDKApps.LegacyPlaceConverter:
|
case SDKApps.LegacyPlaceConverter:
|
||||||
Process proc2 = new Process();
|
Process proc2 = new Process();
|
||||||
proc2.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe";
|
proc2.StartInfo.FileName = GlobalPaths.DataDir + "\\Roblox_Legacy_Place_Converter.exe";
|
||||||
proc2.StartInfo.CreateNoWindow = false;
|
proc2.StartInfo.CreateNoWindow = false;
|
||||||
proc2.StartInfo.UseShellExecute = false;
|
proc2.StartInfo.UseShellExecute = false;
|
||||||
proc2.Start();
|
proc2.Start();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue