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.ConsolePrint("Config loaded.", 3);
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient);
GlobalFuncs.ReadClientValues();
}
#endregion
@ -261,7 +261,7 @@ namespace NovetusCMD
}
else
{
GlobalFuncs.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient);
GlobalFuncs.ReadClientValues();
}
InitUPnP();

File diff suppressed because it is too large Load Diff

View File

@ -421,12 +421,12 @@ public class GlobalFuncs
}
#if LAUNCHER
public static void ReadClientValues(string ClientName, RichTextBox box)
public static void ReadClientValues(RichTextBox box)
#else
public static void ReadClientValues(string ClientName)
public static void ReadClientValues()
#endif
{
string clientpath = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\clientinfo.nov";
string clientpath = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\clientinfo.nov";
if (!File.Exists(clientpath))
{
@ -438,9 +438,9 @@ public class GlobalFuncs
#endif
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
#if LAUNCHER
ReadClientValues(ClientName, box);
ReadClientValues(box);
#else
ReadClientValues(ClientName);
ReadClientValues();
#endif
}
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)
{
string file, usesplayername, usesid, warning,
@ -1081,9 +1099,9 @@ public class GlobalFuncs
client.StartInfo.Arguments = args;
client.EnableRaisingEvents = true;
#if LAUNCHER
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, box);
ReadClientValues(box);
#else
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient);
ReadClientValues();
#endif
client.Exited += e;
client.Start();

View File

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

View File

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

View File

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

View File

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

View File

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