post rc2 launcher changes

This commit is contained in:
Bitl 2018-12-28 20:36:32 -07:00
parent 875efcf0ee
commit ea49872a1c
4 changed files with 236 additions and 79 deletions

View File

@ -1043,7 +1043,7 @@ namespace NovetusLauncher
string mapfile = GlobalVars.ConfigDir + "\\preview\\content\\fonts\\3DView.rbxl"; string mapfile = GlobalVars.ConfigDir + "\\preview\\content\\fonts\\3DView.rbxl";
string rbxexe = GlobalVars.ConfigDir + "\\preview\\3DView.exe"; string rbxexe = GlobalVars.ConfigDir + "\\preview\\3DView.exe";
string quote = "\""; string quote = "\"";
string args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CS3DView(0,'Player','" + GlobalVars.loadtext + ");" + quote; string args = quote + mapfile + "\" -script \"dofile('" + luafile + "'); _G.CS3DView(0,'Player'," + GlobalVars.loadtext + ");" + quote;
try try
{ {
Process client = new Process(); Process client = new Process();

View File

@ -280,41 +280,45 @@ namespace NovetusLauncher
public static void ReloadLoadtextValue() public static void ReloadLoadtextValue()
{ {
//todo: make sure webserver works after RC2, then use commented loadtext value and add charapp. if (GlobalVars.IsWebServerOn == true)
{
string extra = GlobalVars.Custom_Extra_SelectionIsHat == true ? GlobalVars.WebServer_HatDir + GlobalVars.Custom_Extra : GlobalVars.WebServer_ExtraDir + GlobalVars.Custom_Extra;
/* GlobalVars.loadtext = "'" + GlobalVars.WebServer_BodyColors + "','" +
string extra = GlobalVars.Custom_Extra_SelectionIsHat == true ? GlobalVars.WebServer_HatDir + GlobalVars.Custom_Extra : GlobalVars.WebServer_ExtraDir + GlobalVars.Custom_Extra; GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat1ID_Offline + "','" +
GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat2ID_Offline + "','" +
GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat3ID_Offline + "'," +
GlobalVars.WebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline + "','" +
GlobalVars.WebServer_ShirtDir + GlobalVars.Custom_Shirt_Offline + "','" +
GlobalVars.WebServer_PantsDir + GlobalVars.Custom_Pants_Offline + "','" +
GlobalVars.WebServer_FaceDir + GlobalVars.Custom_Face_Offline + "','" +
GlobalVars.WebServer_HeadDir + GlobalVars.Custom_Head_Offline + "','" +
GlobalVars.Custom_Icon_Offline + "','" +
extra + "', true";
GlobalVars.loadtext = GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat1ID_Offline + "','" + GlobalVars.sololoadtext = GlobalVars.loadtext.Replace(GlobalVars.WebServerURI,GlobalVars.LocalWebServerURI);
GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat2ID_Offline + "','" + }
GlobalVars.WebServer_HatDir + GlobalVars.Custom_Hat3ID_Offline + "'," + else
GlobalVars.WebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline + "','" + {
GlobalVars.WebServer_ShirtDir + GlobalVars.Custom_Shirt_Offline + "','" + GlobalVars.loadtext = "'" + GlobalVars.Custom_Hat1ID_Offline + "','" +
GlobalVars.WebServer_PantsDir + GlobalVars.Custom_Pants_Offline + "','" + GlobalVars.Custom_Hat2ID_Offline + "','" +
GlobalVars.WebServer_FaceDir + GlobalVars.Custom_Face_Offline + "','" + GlobalVars.Custom_Hat3ID_Offline + "'," +
GlobalVars.WebServer_HeadDir + GlobalVars.Custom_Head_Offline + "','" + GlobalVars.HeadColorID + "," +
GlobalVars.Custom_Icon_Offline + "','" + GlobalVars.TorsoColorID + "," +
extra + "'"; GlobalVars.LeftArmColorID + "," +
GlobalVars.RightArmColorID + "," +
GlobalVars.LeftLegColorID + "," +
GlobalVars.RightLegColorID + ",'" +
GlobalVars.Custom_T_Shirt_Offline + "','" +
GlobalVars.Custom_Shirt_Offline + "','" +
GlobalVars.Custom_Pants_Offline + "','" +
GlobalVars.Custom_Face_Offline + "','" +
GlobalVars.Custom_Head_Offline + "','" +
GlobalVars.Custom_Icon_Offline + "','" +
GlobalVars.Custom_Extra + "', false";
GlobalVars.sololoadtext = GlobalVars.loadtext.Replace(GlobalVars.WebServerURI,GlobalVars.LocalWebServerURI); GlobalVars.sololoadtext = GlobalVars.loadtext;
*/ }
GlobalVars.loadtext = GlobalVars.Custom_Hat1ID_Offline + "','" +
GlobalVars.Custom_Hat2ID_Offline + "','" +
GlobalVars.Custom_Hat3ID_Offline + "'," +
GlobalVars.HeadColorID + "," +
GlobalVars.TorsoColorID + "," +
GlobalVars.LeftArmColorID + "," +
GlobalVars.RightArmColorID + "," +
GlobalVars.LeftLegColorID + "," +
GlobalVars.RightLegColorID + ",'" +
GlobalVars.Custom_T_Shirt_Offline + "','" +
GlobalVars.Custom_Shirt_Offline + "','" +
GlobalVars.Custom_Pants_Offline + "','" +
GlobalVars.Custom_Face_Offline + "','" +
GlobalVars.Custom_Head_Offline + "','" +
GlobalVars.Custom_Icon_Offline + "','" +
GlobalVars.Custom_Extra + "'";
} }
public static void ReadClientValues(string clientpath) public static void ReadClientValues(string clientpath)
@ -987,23 +991,23 @@ namespace NovetusLauncher
{ {
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{ {
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{ {
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + "," + md5s + ")"; return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{ {
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false)
{ {
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + "," + md5s + ")"; return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else else
{ {
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
} }
else if (type == ScriptType.Server) else if (type == ScriptType.Server)
@ -1014,23 +1018,23 @@ namespace NovetusLauncher
{ {
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{ {
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{ {
return "_G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ")"; return "_G.CSSolo(" + GlobalVars.UserID + ",'Player'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{ {
return "_G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "_G.CSSolo(0,'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false ) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false )
{ {
return "_G.CSSolo(0,'Player','" + GlobalVars.loadtext + ")"; return "_G.CSSolo(0,'Player'," + GlobalVars.sololoadtext + ")";
} }
else else
{ {
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
} }
else if (type == ScriptType.Studio) else if (type == ScriptType.Studio)
@ -1261,23 +1265,23 @@ namespace NovetusLauncher
{ {
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{ {
return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{ {
return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + "," + md5s + ")"; return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{ {
return "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false)
{ {
return "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + "," + md5s + ")"; return "dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ")";
} }
else else
{ {
return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + "," + md5s + ")"; return "dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ")";
} }
} }
else if (type == ScriptGenerator.ScriptType.Server) else if (type == ScriptGenerator.ScriptType.Server)
@ -1288,23 +1292,23 @@ namespace NovetusLauncher
{ {
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true) if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{ {
return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{ {
return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ")"; return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false) else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{ {
return "dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false ) else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false )
{ {
return "dofile('" + luafile + "'); _G.CSSolo(0,'Player','" + GlobalVars.loadtext + ")"; return "dofile('" + luafile + "'); _G.CSSolo(0,'Player'," + GlobalVars.sololoadtext + ")";
} }
else else
{ {
return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")"; return "dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} }
} }
else if (type == ScriptGenerator.ScriptType.Studio) else if (type == ScriptGenerator.ScriptType.Studio)
@ -1738,6 +1742,7 @@ namespace NovetusLauncher
//made by aksakalli //made by aksakalli
public class SimpleHTTPServer public class SimpleHTTPServer
{ {
private readonly string[] _indexFiles = { private readonly string[] _indexFiles = {
"index.html", "index.html",
"index.htm", "index.htm",
@ -1856,6 +1861,7 @@ namespace NovetusLauncher
{ {
_serverThread.Abort(); _serverThread.Abort();
_listener.Stop(); _listener.Stop();
GlobalVars.IsWebServerOn = false;
} }
private void Listen() private void Listen()
@ -1985,6 +1991,7 @@ namespace NovetusLauncher
this._port = port; this._port = port;
_serverThread = new Thread(this.Listen); _serverThread = new Thread(this.Listen);
_serverThread.Start(); _serverThread.Start();
GlobalVars.IsWebServerOn = true;
} }
} }
@ -2084,6 +2091,7 @@ namespace NovetusLauncher
public static string ScriptName = "CSMPFunctions"; public static string ScriptName = "CSMPFunctions";
public static string ScriptGenName = "CSMPBoot"; public static string ScriptGenName = "CSMPBoot";
public static SimpleHTTPServer WebServer = null; public static SimpleHTTPServer WebServer = null;
public static bool IsWebServerOn = false;
//vars for loader //vars for loader
public static bool ReadyToLaunch = false; public static bool ReadyToLaunch = false;
//server settings. //server settings.

View File

@ -52,6 +52,7 @@ namespace NovetusLauncher
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.label17 = new System.Windows.Forms.Label();
this.checkBox4 = new System.Windows.Forms.CheckBox(); this.checkBox4 = new System.Windows.Forms.CheckBox();
this.button6 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button();
this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox3 = new System.Windows.Forms.TextBox();
@ -308,6 +309,7 @@ namespace NovetusLauncher
// //
// tabPage2 // tabPage2
// //
this.tabPage2.Controls.Add(this.label17);
this.tabPage2.Controls.Add(this.checkBox4); this.tabPage2.Controls.Add(this.checkBox4);
this.tabPage2.Controls.Add(this.button6); this.tabPage2.Controls.Add(this.button6);
this.tabPage2.Controls.Add(this.textBox3); this.tabPage2.Controls.Add(this.textBox3);
@ -331,6 +333,18 @@ namespace NovetusLauncher
this.tabPage2.ToolTipText = "Start a server for other players to play"; this.tabPage2.ToolTipText = "Start a server for other players to play";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
// label17
//
this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label17.ForeColor = System.Drawing.Color.Red;
this.label17.Location = new System.Drawing.Point(10, 124);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(382, 36);
this.label17.TabIndex = 58;
this.label17.Text = "NOTE: If you changed the server port, go to the CONSOLE and type \"webserver resta" +
"rt\" or \"restart\" to restart the web server or restart the launcher.";
this.label17.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// checkBox4 // checkBox4
// //
this.checkBox4.Location = new System.Drawing.Point(152, 198); this.checkBox4.Location = new System.Drawing.Point(152, 198);
@ -365,7 +379,7 @@ namespace NovetusLauncher
this.treeView1.HideSelection = false; this.treeView1.HideSelection = false;
this.treeView1.Location = new System.Drawing.Point(10, 30); this.treeView1.Location = new System.Drawing.Point(10, 30);
this.treeView1.Name = "treeView1"; this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(382, 127); this.treeView1.Size = new System.Drawing.Size(382, 91);
this.treeView1.TabIndex = 54; this.treeView1.TabIndex = 54;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TreeView1AfterSelect); this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TreeView1AfterSelect);
// //
@ -465,9 +479,9 @@ namespace NovetusLauncher
// //
// button20 // button20
// //
this.button20.Location = new System.Drawing.Point(292, 161); this.button20.Location = new System.Drawing.Point(292, 163);
this.button20.Name = "button20"; this.button20.Name = "button20";
this.button20.Size = new System.Drawing.Size(100, 48); this.button20.Size = new System.Drawing.Size(100, 46);
this.button20.TabIndex = 21; this.button20.TabIndex = 21;
this.button20.Text = "SERVER INFORMATION"; this.button20.Text = "SERVER INFORMATION";
this.button20.UseVisualStyleBackColor = true; this.button20.UseVisualStyleBackColor = true;
@ -1066,6 +1080,7 @@ namespace NovetusLauncher
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Button button24; private System.Windows.Forms.Button button24;
private System.Windows.Forms.CheckBox checkBox4; private System.Windows.Forms.CheckBox checkBox4;
private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button6;

View File

@ -173,33 +173,74 @@ namespace NovetusLauncher
void StartWebServer() void StartWebServer()
{ {
GlobalVars.WebServer = new SimpleHTTPServer(GlobalVars.DataPath, GlobalVars.WebServer_Port); if (SecurityFuncs.IsElevated)
ConsolePrint("WebServer: Server is running on port: " + GlobalVars.WebServer.Port.ToString(), 3); {
try
{
GlobalVars.WebServer = new SimpleHTTPServer(GlobalVars.DataPath, GlobalVars.WebServer_Port);
ConsolePrint("WebServer: Server is running on port: " + GlobalVars.WebServer.Port.ToString(), 3);
}
catch (Exception ex)
{
ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (" + ex.Message + ")", 2);
}
}
else
{
ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (Did not run as Administrator)", 2);
}
}
void StopWebServer()
{
if (SecurityFuncs.IsElevated)
{
try
{
ConsolePrint("WebServer: Server has stopped on port: " + GlobalVars.WebServer.Port.ToString(), 2);
GlobalVars.WebServer.Stop();
}
catch (Exception ex)
{
ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (" + ex.Message + ")", 2);
}
}
else
{
ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (Did not run as Administrator)", 2);
}
} }
void StartMusic() void StartMusic()
{ {
string file = GlobalVars.DataPath + "\\music\\music.mp3"; try
{
string file = GlobalVars.DataPath + "\\music\\music.mp3";
if (File.Exists(file)) if (File.Exists(file))
{ {
if (outputDevice == null) if (outputDevice == null)
{ {
outputDevice = new WaveOutEvent(); outputDevice = new WaveOutEvent();
} }
if (audioFile == null) if (audioFile == null)
{ {
audioFile = new AudioFileReader(file); audioFile = new AudioFileReader(file);
LoopStream loop = new LoopStream(audioFile); LoopStream loop = new LoopStream(audioFile);
outputDevice.Init(loop); outputDevice.Init(loop);
} }
outputDevice.Play(); outputDevice.Play();
} }
else else
{ {
button24.Visible = false; button24.Visible = false;
button24.Enabled = false; button24.Enabled = false;
} }
}
catch (Exception ex)
{
ConsolePrint("NAudio: Failed to play music. (" + ex.Message + ")", 2);
}
} }
void EndMusic() void EndMusic()
@ -356,7 +397,10 @@ namespace NovetusLauncher
{ {
WriteConfigValues(); WriteConfigValues();
DiscordRpc.Shutdown(); DiscordRpc.Shutdown();
GlobalVars.WebServer.Stop(); if (GlobalVars.IsWebServerOn == true)
{
StopWebServer();
}
} }
void ReadConfigValues() void ReadConfigValues()
@ -1163,6 +1207,80 @@ namespace NovetusLauncher
cc.Show(); cc.Show();
ConsolePrint("Avatar Customization Loaded.", 4); ConsolePrint("Avatar Customization Loaded.", 4);
} }
else if (string.Compare(command,"webserver",true) == 0)
{
ConsoleHelp(3);
}
else if (string.Compare(command,"webserver start",true) == 0)
{
if (GlobalVars.IsWebServerOn == false)
{
StartWebServer();
}
else
{
ConsolePrint("WebServer: There is already a web server open.", 2);
}
}
else if (string.Compare(command,"webserver stop",true) == 0)
{
if (GlobalVars.IsWebServerOn == true)
{
StopWebServer();
}
else
{
ConsolePrint("WebServer: There is no web server open.", 2);
}
}
else if (string.Compare(command,"webserver restart",true) == 0)
{
try
{
ConsolePrint("WebServer: Restarting...", 4);
StopWebServer();
StartWebServer();
}
catch(Exception ex)
{
ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2);
}
}
else if (string.Compare(command,"start",true) == 0)
{
if (GlobalVars.IsWebServerOn == false)
{
StartWebServer();
}
else
{
ConsolePrint("WebServer: There is already a web server open.", 2);
}
}
else if (string.Compare(command,"stop",true) == 0)
{
if (GlobalVars.IsWebServerOn == true)
{
StopWebServer();
}
else
{
ConsolePrint("WebServer: There is no web server open.", 2);
}
}
else if (string.Compare(command,"restart",true) == 0)
{
try
{
ConsolePrint("WebServer: Restarting...", 4);
StopWebServer();
StartWebServer();
}
catch(Exception ex)
{
ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2);
}
}
else if (string.Compare(command,GlobalVars.important,true) == 0) else if (string.Compare(command,GlobalVars.important,true) == 0)
{ {
GlobalVars.AdminMode = true; GlobalVars.AdminMode = true;
@ -1206,6 +1324,14 @@ namespace NovetusLauncher
ConsolePrint("= clientinfo | Launches the Novetus Client SDK", 4); ConsolePrint("= clientinfo | Launches the Novetus Client SDK", 4);
ConsolePrint("= itemmaker | Launches the Novetus Item SDK", 4); ConsolePrint("= itemmaker | Launches the Novetus Item SDK", 4);
} }
else if (page == 3)
{
ConsolePrint("Help: webserver", 3);
ConsolePrint("-------------------------", 1);
ConsolePrint("= restart | Restarts the web server", 4);
ConsolePrint("= stop | Stops a web server if there is one on.", 4);
ConsolePrint("= start | Starts a web server if there isn't one on yet.", 4);
}
else else
{ {
ConsolePrint("Help: all", 3); ConsolePrint("Help: all", 3);
@ -1225,6 +1351,11 @@ namespace NovetusLauncher
ConsolePrint("-- load | Reloads the config file", 4); ConsolePrint("-- load | Reloads the config file", 4);
ConsolePrint("-- reset | Resets the config file", 4); ConsolePrint("-- reset | Resets the config file", 4);
ConsolePrint("---------", 1); ConsolePrint("---------", 1);
ConsolePrint("= webserver", 3);
ConsolePrint("-- restart | Restarts the web server", 4);
ConsolePrint("-- stop | Stops a web server if there is one on.", 4);
ConsolePrint("-- start | Starts a web server if there isn't one on yet.", 4);
ConsolePrint("---------", 1);
} }
} }
@ -1257,12 +1388,15 @@ namespace NovetusLauncher
GlobalVars.RobloxPort = Convert.ToInt32(numericUpDown1.Value); GlobalVars.RobloxPort = Convert.ToInt32(numericUpDown1.Value);
numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label38.Text = GlobalVars.RobloxPort.ToString(); label38.Text = GlobalVars.RobloxPort.ToString();
GlobalVars.WebServer_Port = (GlobalVars.RobloxPort+1);
} }
void NumericUpDown2ValueChanged(object sender, EventArgs e) void NumericUpDown2ValueChanged(object sender, EventArgs e)
{ {
GlobalVars.RobloxPort = Convert.ToInt32(numericUpDown2.Value); GlobalVars.RobloxPort = Convert.ToInt32(numericUpDown2.Value);
numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label38.Text = GlobalVars.RobloxPort.ToString();
GlobalVars.WebServer_Port = (GlobalVars.RobloxPort+1);
} }
void NumericUpDown3ValueChanged(object sender, EventArgs e) void NumericUpDown3ValueChanged(object sender, EventArgs e)