added %mapfilec%. Changed ReadConfigValues

This commit is contained in:
Bitl 2020-07-12 08:49:48 -07:00
parent 3d69f9f1e9
commit 3de6a2a92d
8 changed files with 997 additions and 968 deletions

View File

@ -148,7 +148,7 @@ namespace NovetusCMD
{ {
GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false);
GlobalFuncs.ConsolePrint("Config loaded.", 3); GlobalFuncs.ConsolePrint("Config loaded.", 3);
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); GlobalFuncs.ReadClientValues();
} }
#endregion #endregion
@ -261,7 +261,7 @@ namespace NovetusCMD
} }
else else
{ {
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); GlobalFuncs.ReadClientValues();
} }
InitUPnP(); InitUPnP();

File diff suppressed because it is too large Load Diff

View File

@ -421,12 +421,12 @@ public class GlobalFuncs
} }
#if LAUNCHER #if LAUNCHER
public static void ReadClientValues(string ClientName, RichTextBox box) public static void ReadClientValues(RichTextBox box)
#else #else
public static void ReadClientValues(string ClientName) public static void ReadClientValues()
#endif #endif
{ {
string clientpath = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\clientinfo.nov"; string clientpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\clientinfo.nov";
if (!File.Exists(clientpath)) if (!File.Exists(clientpath))
{ {
@ -438,9 +438,9 @@ public class GlobalFuncs
#endif #endif
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
#if LAUNCHER #if LAUNCHER
ReadClientValues(ClientName, box); ReadClientValues(box);
#else #else
ReadClientValues(ClientName); ReadClientValues();
#endif #endif
} }
else else
@ -455,6 +455,24 @@ public class GlobalFuncs
} }
} }
public static bool CopyMapToRBXAsset()
{
bool success;
string clientcontentpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\temp.rbxl";
try
{
File.Copy(GlobalVars.UserConfiguration.MapPath, clientcontentpath, true);
success = true;
}
catch (Exception)
{
success = false;
}
return success;
}
public static void LoadClientValues(string clientpath) public static void LoadClientValues(string clientpath)
{ {
string file, usesplayername, usesid, warning, string file, usesplayername, usesid, warning,
@ -1081,9 +1099,9 @@ public class GlobalFuncs
client.StartInfo.Arguments = args; client.StartInfo.Arguments = args;
client.EnableRaisingEvents = true; client.EnableRaisingEvents = true;
#if LAUNCHER #if LAUNCHER
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, box); ReadClientValues(box);
#else #else
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); ReadClientValues();
#endif #endif
client.Exited += e; client.Exited += e;
client.Start(); client.Start();

View File

@ -20,6 +20,7 @@ public class GlobalPaths
public static readonly string MapsDir = BasePath + @"\\maps"; public static readonly string MapsDir = BasePath + @"\\maps";
public static readonly string MapsDirBase = "maps"; public static readonly string MapsDirBase = "maps";
public static readonly string BaseGameDir = "rbxasset://../../../"; public static readonly string BaseGameDir = "rbxasset://../../../";
public static readonly string AltBaseGameDir = "rbxasset://";
public static readonly string SharedDataGameDir = BaseGameDir + "shareddata/"; public static readonly string SharedDataGameDir = BaseGameDir + "shareddata/";
#endregion #endregion
@ -121,7 +122,6 @@ public class GlobalPaths
#endregion #endregion
#region Empty Paths (automatically changed) #region Empty Paths (automatically changed)
public static string FullMapPath = "";
public static string AddonScriptPath = ""; public static string AddonScriptPath = "";
#endregion #endregion
} }

View File

@ -322,6 +322,7 @@ public class ScriptFuncs
.Replace("%extraws%", GlobalPaths.WebServer_ExtraDir + GlobalVars.UserCustomization.Extra) .Replace("%extraws%", GlobalPaths.WebServer_ExtraDir + GlobalVars.UserCustomization.Extra)
.Replace("%hat4ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Extra) .Replace("%hat4ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Extra)
.Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\")) .Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\"))
.Replace("%mapfilec%", GlobalFuncs.CopyMapToRBXAsset() ? GlobalPaths.AltBaseGameDir + "temp.rbxl" : "")
.Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode) .Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode)
.Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath); .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath);
return compiled; return compiled;

View File

@ -524,7 +524,7 @@ namespace NovetusLauncher
void ReadClientValues() void ReadClientValues()
{ {
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, richTextBox1); GlobalFuncs.ReadClientValues(richTextBox1);
switch (GlobalVars.SelectedClientInfo.UsesPlayerName) switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{ {

View File

@ -561,7 +561,7 @@ namespace NovetusLauncher
void ReadClientValues() void ReadClientValues()
{ {
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, richTextBox1); GlobalFuncs.ReadClientValues(richTextBox1);
switch (GlobalVars.SelectedClientInfo.UsesPlayerName) switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{ {

View File

@ -44,7 +44,7 @@ namespace NovetusURI
GlobalVars.UserConfiguration.SelectedClient = client; GlobalVars.UserConfiguration.SelectedClient = client;
GlobalVars.IP = ip; GlobalVars.IP = ip;
GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(port); GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(port);
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); GlobalFuncs.ReadClientValues();
} }
} }
#endregion #endregion