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();

View File

@ -123,6 +123,7 @@ partial class ClientinfoEditor
this.extraToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.extradToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extrawsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.hat4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.hat4dToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.hat4wsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.charappToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -143,7 +144,7 @@ partial class ClientinfoEditor
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.checkBox5 = new System.Windows.Forms.CheckBox();
this.hat4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mapfilecToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@ -405,6 +406,7 @@ partial class ClientinfoEditor
this.generalToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mapfileToolStripMenuItem,
this.mapfiledToolStripMenuItem,
this.mapfilecToolStripMenuItem,
this.luafileToolStripMenuItem,
this.ipToolStripMenuItem,
this.portToolStripMenuItem,
@ -543,7 +545,7 @@ partial class ClientinfoEditor
this.extraToolStripMenuItem,
this.charappToolStripMenuItem});
this.customizationToolStripMenuItem.Name = "customizationToolStripMenuItem";
this.customizationToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.customizationToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.customizationToolStripMenuItem.Text = "Customization";
//
// bodyColorsToolStripMenuItem
@ -556,7 +558,7 @@ partial class ClientinfoEditor
this.rarmcolorToolStripMenuItem,
this.rlegcolorToolStripMenuItem});
this.bodyColorsToolStripMenuItem.Name = "bodyColorsToolStripMenuItem";
this.bodyColorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.bodyColorsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.bodyColorsToolStripMenuItem.Text = "Body Colors";
//
// headcolorToolStripMenuItem
@ -614,69 +616,69 @@ partial class ClientinfoEditor
this.hat2wsToolStripMenuItem,
this.hat3wsToolStripMenuItem});
this.hatsToolStripMenuItem.Name = "hatsToolStripMenuItem";
this.hatsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hatsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.hatsToolStripMenuItem.Text = "Hats";
//
// hat1ToolStripMenuItem
//
this.hat1ToolStripMenuItem.Name = "hat1ToolStripMenuItem";
this.hat1ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat1ToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat1ToolStripMenuItem.Text = "%hat1%";
this.hat1ToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat2ToolStripMenuItem
//
this.hat2ToolStripMenuItem.Name = "hat2ToolStripMenuItem";
this.hat2ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat2ToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat2ToolStripMenuItem.Text = "%hat2%";
this.hat2ToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat3ToolStripMenuItem
//
this.hat3ToolStripMenuItem.Name = "hat3ToolStripMenuItem";
this.hat3ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat3ToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat3ToolStripMenuItem.Text = "%hat3%";
this.hat3ToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat1dToolStripMenuItem
//
this.hat1dToolStripMenuItem.Name = "hat1dToolStripMenuItem";
this.hat1dToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat1dToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat1dToolStripMenuItem.Text = "%hat1d%";
this.hat1dToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat2dToolStripMenuItem
//
this.hat2dToolStripMenuItem.Name = "hat2dToolStripMenuItem";
this.hat2dToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat2dToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat2dToolStripMenuItem.Text = "%hat2d%";
this.hat2dToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat3dToolStripMenuItem
//
this.hat3dToolStripMenuItem.Name = "hat3dToolStripMenuItem";
this.hat3dToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat3dToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat3dToolStripMenuItem.Text = "%hat3d%";
this.hat3dToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat1wsToolStripMenuItem
//
this.hat1wsToolStripMenuItem.Name = "hat1wsToolStripMenuItem";
this.hat1wsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat1wsToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat1wsToolStripMenuItem.Text = "%hat1ws%";
this.hat1wsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat2wsToolStripMenuItem
//
this.hat2wsToolStripMenuItem.Name = "hat2wsToolStripMenuItem";
this.hat2wsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat2wsToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat2wsToolStripMenuItem.Text = "%hat2ws%";
this.hat2wsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat3wsToolStripMenuItem
//
this.hat3wsToolStripMenuItem.Name = "hat3wsToolStripMenuItem";
this.hat3wsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat3wsToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.hat3wsToolStripMenuItem.Text = "%hat3ws%";
this.hat3wsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
@ -687,7 +689,7 @@ partial class ClientinfoEditor
this.facedToolStripMenuItem,
this.facewsToolStripMenuItem});
this.facesToolStripMenuItem.Name = "facesToolStripMenuItem";
this.facesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.facesToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.facesToolStripMenuItem.Text = "Faces";
//
// faceToolStripMenuItem
@ -718,7 +720,7 @@ partial class ClientinfoEditor
this.headdToolStripMenuItem,
this.headwsToolStripMenuItem});
this.headsToolStripMenuItem.Name = "headsToolStripMenuItem";
this.headsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.headsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.headsToolStripMenuItem.Text = "Heads";
//
// headToolStripMenuItem
@ -749,7 +751,7 @@ partial class ClientinfoEditor
this.tshirtdToolStripMenuItem,
this.tshirtwsToolStripMenuItem});
this.tShirtsToolStripMenuItem.Name = "tShirtsToolStripMenuItem";
this.tShirtsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.tShirtsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.tShirtsToolStripMenuItem.Text = "T-Shirts";
//
// tshirtToolStripMenuItem
@ -780,7 +782,7 @@ partial class ClientinfoEditor
this.shirtdToolStripMenuItem,
this.shirtwsToolStripMenuItem});
this.shirtsToolStripMenuItem.Name = "shirtsToolStripMenuItem";
this.shirtsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.shirtsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.shirtsToolStripMenuItem.Text = "Shirts";
//
// shirtToolStripMenuItem
@ -811,7 +813,7 @@ partial class ClientinfoEditor
this.pantsdToolStripMenuItem,
this.pantswsToolStripMenuItem});
this.pantsToolStripMenuItem.Name = "pantsToolStripMenuItem";
this.pantsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.pantsToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.pantsToolStripMenuItem.Text = "Pants";
//
// pantsToolStripMenuItem1
@ -845,83 +847,90 @@ partial class ClientinfoEditor
this.hat4dToolStripMenuItem,
this.hat4wsToolStripMenuItem});
this.extraToolStripMenuItem.Name = "extraToolStripMenuItem";
this.extraToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.extraToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.extraToolStripMenuItem.Text = "Extra";
//
// extraToolStripMenuItem1
//
this.extraToolStripMenuItem1.Name = "extraToolStripMenuItem1";
this.extraToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.extraToolStripMenuItem1.Size = new System.Drawing.Size(134, 22);
this.extraToolStripMenuItem1.Text = "%extra%";
this.extraToolStripMenuItem1.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// extradToolStripMenuItem
//
this.extradToolStripMenuItem.Name = "extradToolStripMenuItem";
this.extradToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.extradToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.extradToolStripMenuItem.Text = "%extrad%";
this.extradToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// extrawsToolStripMenuItem
//
this.extrawsToolStripMenuItem.Name = "extrawsToolStripMenuItem";
this.extrawsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.extrawsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.extrawsToolStripMenuItem.Text = "%extraws%";
this.extrawsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat4ToolStripMenuItem
//
this.hat4ToolStripMenuItem.Name = "hat4ToolStripMenuItem";
this.hat4ToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.hat4ToolStripMenuItem.Text = "%hat4%";
this.hat4ToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat4dToolStripMenuItem
//
this.hat4dToolStripMenuItem.Name = "hat4dToolStripMenuItem";
this.hat4dToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat4dToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.hat4dToolStripMenuItem.Text = "%hat4d%";
this.hat4dToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// hat4wsToolStripMenuItem
//
this.hat4wsToolStripMenuItem.Name = "hat4wsToolStripMenuItem";
this.hat4wsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat4wsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
this.hat4wsToolStripMenuItem.Text = "%hat4ws%";
this.hat4wsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// charappToolStripMenuItem
//
this.charappToolStripMenuItem.Name = "charappToolStripMenuItem";
this.charappToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.charappToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.charappToolStripMenuItem.Text = "%charapp%";
this.charappToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// nameToolStripMenuItem
//
this.nameToolStripMenuItem.Name = "nameToolStripMenuItem";
this.nameToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.nameToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.nameToolStripMenuItem.Text = "%name%";
this.nameToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// idToolStripMenuItem
//
this.idToolStripMenuItem.Name = "idToolStripMenuItem";
this.idToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.idToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.idToolStripMenuItem.Text = "%id%";
this.idToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// tripcodeToolStripMenuItem
//
this.tripcodeToolStripMenuItem.Name = "tripcodeToolStripMenuItem";
this.tripcodeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.tripcodeToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.tripcodeToolStripMenuItem.Text = "%tripcode%";
this.tripcodeToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// iconeToolStripMenuItem
//
this.iconeToolStripMenuItem.Name = "iconeToolStripMenuItem";
this.iconeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.iconeToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.iconeToolStripMenuItem.Text = "%icone%";
this.iconeToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// iconToolStripMenuItem
//
this.iconToolStripMenuItem.Name = "iconToolStripMenuItem";
this.iconToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.iconToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.iconToolStripMenuItem.Text = "%icon%";
this.iconToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
@ -1028,12 +1037,12 @@ partial class ClientinfoEditor
this.checkBox5.UseVisualStyleBackColor = true;
this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
//
// hat4ToolStripMenuItem
// mapfilecToolStripMenuItem
//
this.hat4ToolStripMenuItem.Name = "hat4ToolStripMenuItem";
this.hat4ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.hat4ToolStripMenuItem.Text = "%hat4%";
this.hat4ToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
this.mapfilecToolStripMenuItem.Name = "mapfilecToolStripMenuItem";
this.mapfilecToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
this.mapfilecToolStripMenuItem.Text = "%mapfilec%";
this.mapfilecToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click);
//
// ClientinfoEditor
//
@ -1184,4 +1193,5 @@ partial class ClientinfoEditor
private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox checkBox5;
private System.Windows.Forms.ToolStripMenuItem hat4ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mapfilecToolStripMenuItem;
}

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