update to latest snapshot
This commit is contained in:
parent
5b518175e9
commit
a10dcdcdfa
|
|
@ -0,0 +1,37 @@
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
//https://stackoverflow.com/questions/7612602/why-cant-i-use-the-await-operator-within-the-body-of-a-lock-statement/50139704#50139704
|
||||||
|
|
||||||
|
public class SemaphoreLocker
|
||||||
|
{
|
||||||
|
private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
|
||||||
|
|
||||||
|
public async Task LockAsync(Func<Task> worker)
|
||||||
|
{
|
||||||
|
await _semaphore.WaitAsync();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await worker();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_semaphore.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// overloading variant for non-void methods with return type (generic T)
|
||||||
|
public async Task<T> LockAsync<T>(Func<Task<T>> worker)
|
||||||
|
{
|
||||||
|
await _semaphore.WaitAsync();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return await worker();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_semaphore.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -30,14 +30,11 @@ namespace Novetus.Core
|
||||||
|
|
||||||
public class WebProxy
|
public class WebProxy
|
||||||
{
|
{
|
||||||
private ProxyServer Server = null;
|
private ProxyServer Server = new ProxyServer();
|
||||||
private ExplicitProxyEndPoint end;
|
private ExplicitProxyEndPoint end;
|
||||||
public ExtensionManager Manager = new ExtensionManager();
|
public ExtensionManager Manager = new ExtensionManager();
|
||||||
|
private static readonly SemaphoreLocker _locker = new SemaphoreLocker();
|
||||||
public bool HasStarted()
|
public bool Started { get { return Server.ProxyRunning; } }
|
||||||
{
|
|
||||||
return Server.ProxyRunning;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DoSetup()
|
public void DoSetup()
|
||||||
{
|
{
|
||||||
|
|
@ -77,8 +74,6 @@ namespace Novetus.Core
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
Server = new ProxyServer();
|
|
||||||
|
|
||||||
if (Server.ProxyRunning)
|
if (Server.ProxyRunning)
|
||||||
{
|
{
|
||||||
Util.ConsolePrint("The web proxy is already on and running.", 2);
|
Util.ConsolePrint("The web proxy is already on and running.", 2);
|
||||||
|
|
@ -208,9 +203,9 @@ namespace Novetus.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
|
|
||||||
private async Task OnRequest(object sender, SessionEventArgs e)
|
private async Task OnRequest(object sender, SessionEventArgs e)
|
||||||
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
|
{
|
||||||
|
await _locker.LockAsync(async () =>
|
||||||
{
|
{
|
||||||
if (!IsValidURL(e.HttpClient))
|
if (!IsValidURL(e.HttpClient))
|
||||||
{
|
{
|
||||||
|
|
@ -245,6 +240,7 @@ namespace Novetus.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
e.GenericResponse("", HttpStatusCode.NotFound);
|
e.GenericResponse("", HttpStatusCode.NotFound);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
|
|
@ -258,8 +254,6 @@ namespace Novetus.Core
|
||||||
Util.ConsolePrint("Web Proxy stopping on port " + GlobalVars.WebProxyPort, 3);
|
Util.ConsolePrint("Web Proxy stopping on port " + GlobalVars.WebProxyPort, 3);
|
||||||
Server.BeforeRequest -= new AsyncEventHandler<SessionEventArgs>(OnRequest);
|
Server.BeforeRequest -= new AsyncEventHandler<SessionEventArgs>(OnRequest);
|
||||||
Server.Stop();
|
Server.Stop();
|
||||||
Server.Dispose();
|
|
||||||
Server = null;
|
|
||||||
|
|
||||||
foreach (IExtension extension in Manager.GetExtensionList().ToArray())
|
foreach (IExtension extension in Manager.GetExtensionList().ToArray())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Classes\Script.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Classes\Script.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Classes\SemaphoreLocker.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Classes\WebProxy.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Classes\WebProxy.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\ClientManagement.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\ClientManagement.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Classes\Downloader.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Classes\Downloader.cs" />
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ namespace Novetus.Core
|
||||||
case ScriptType.Studio:
|
case ScriptType.Studio:
|
||||||
return GlobalVars.LauncherState.InStudio;
|
return GlobalVars.LauncherState.InStudio;
|
||||||
case ScriptType.EasterEgg:
|
case ScriptType.EasterEgg:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
return GlobalVars.LauncherState.InEasterEggGame;
|
return GlobalVars.LauncherState.InEasterEggGame;
|
||||||
default:
|
default:
|
||||||
return GlobalVars.LauncherState.InLauncher;
|
return GlobalVars.LauncherState.InLauncher;
|
||||||
|
|
@ -893,6 +894,7 @@ namespace Novetus.Core
|
||||||
rbxfolder = "client";
|
rbxfolder = "client";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
rbxfolder = "server";
|
rbxfolder = "server";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Studio:
|
case ScriptType.Studio:
|
||||||
|
|
@ -929,11 +931,14 @@ namespace Novetus.Core
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case ScriptType.Client:
|
case ScriptType.Client:
|
||||||
case ScriptType.Solo:
|
|
||||||
case ScriptType.EasterEgg:
|
case ScriptType.EasterEgg:
|
||||||
rbxexe = BasePath + @"\\" + GetClientSeperateFolderName(type) + @"\\RobloxApp_client.exe";
|
rbxexe = BasePath + @"\\" + GetClientSeperateFolderName(type) + @"\\RobloxApp_client.exe";
|
||||||
break;
|
break;
|
||||||
|
case ScriptType.Solo:
|
||||||
|
rbxexe = BasePath + @"\\" + GetClientSeperateFolderName(type) + @"\\RobloxApp_solo.exe";
|
||||||
|
break;
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
rbxexe = BasePath + @"\\" + GetClientSeperateFolderName(type) + @"\\RobloxApp_server.exe";
|
rbxexe = BasePath + @"\\" + GetClientSeperateFolderName(type) + @"\\RobloxApp_server.exe";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Studio:
|
case ScriptType.Studio:
|
||||||
|
|
@ -950,16 +955,17 @@ namespace Novetus.Core
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case ScriptType.Client:
|
case ScriptType.Client:
|
||||||
|
case ScriptType.EasterEgg:
|
||||||
rbxexe = BasePath + @"\\RobloxApp_client.exe";
|
rbxexe = BasePath + @"\\RobloxApp_client.exe";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
rbxexe = BasePath + @"\\RobloxApp_server.exe";
|
rbxexe = BasePath + @"\\RobloxApp_server.exe";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Studio:
|
case ScriptType.Studio:
|
||||||
rbxexe = BasePath + @"\\RobloxApp_studio.exe";
|
rbxexe = BasePath + @"\\RobloxApp_studio.exe";
|
||||||
break;
|
break;
|
||||||
case ScriptType.Solo:
|
case ScriptType.Solo:
|
||||||
case ScriptType.EasterEgg:
|
|
||||||
rbxexe = BasePath + @"\\RobloxApp_solo.exe";
|
rbxexe = BasePath + @"\\RobloxApp_solo.exe";
|
||||||
break;
|
break;
|
||||||
case ScriptType.None:
|
case ScriptType.None:
|
||||||
|
|
@ -1081,14 +1087,16 @@ namespace Novetus.Core
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case ScriptType.Client:
|
case ScriptType.Client:
|
||||||
|
case ScriptType.EasterEgg:
|
||||||
FileManagement.ReloadLoadoutValue(true);
|
FileManagement.ReloadLoadoutValue(true);
|
||||||
if (!GlobalVars.LocalPlayMode && GlobalVars.GameOpened != ScriptType.Server)
|
if (!GlobalVars.LocalPlayMode && GlobalVars.GameOpened != ScriptType.Server && GlobalVars.GameOpened != ScriptType.EasterEggServer)
|
||||||
{
|
{
|
||||||
goto default;
|
goto default;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
if (GlobalVars.GameOpened == ScriptType.Server)
|
case ScriptType.EasterEggServer:
|
||||||
|
if (GlobalVars.GameOpened == ScriptType.Server || GlobalVars.GameOpened == ScriptType.EasterEggServer)
|
||||||
{
|
{
|
||||||
Util.ConsolePrint("ERROR - Failed to launch Novetus. (A server is already running.)", 2);
|
Util.ConsolePrint("ERROR - Failed to launch Novetus. (A server is already running.)", 2);
|
||||||
|
|
||||||
|
|
@ -1100,7 +1108,7 @@ namespace Novetus.Core
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (GlobalVars.UserConfiguration.FirstServerLaunch)
|
else if (GlobalVars.UserConfiguration.FirstServerLaunch && GlobalVars.GameOpened == ScriptType.Server)
|
||||||
{
|
{
|
||||||
#if LAUNCHER
|
#if LAUNCHER
|
||||||
string hostingTips = "For your first time hosting a server, make sure your server's port forwarded (set up in your router), going through a tunnel server, or running from UPnP.\n" +
|
string hostingTips = "For your first time hosting a server, make sure your server's port forwarded (set up in your router), going through a tunnel server, or running from UPnP.\n" +
|
||||||
|
|
@ -1145,10 +1153,9 @@ namespace Novetus.Core
|
||||||
ReadClientValues(ClientName);
|
ReadClientValues(ClientName);
|
||||||
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) ?
|
bool isEasterEgg = (type.Equals(ScriptType.EasterEggServer));
|
||||||
GlobalPaths.DataDir + "\\Appreciation.rbxl" :
|
string mapfile = isEasterEgg ? GlobalPaths.DataDir + "\\Appreciation.rbxl" : (nomap ? (type.Equals(ScriptType.Studio) ? GlobalPaths.ConfigDir + "\\Place1.rbxl" : "") : GlobalVars.UserConfiguration.MapPath);
|
||||||
(nomap ? (type.Equals(ScriptType.Studio) ? GlobalPaths.ConfigDir + "\\Place1.rbxl" : "") : GlobalVars.UserConfiguration.MapPath);
|
string mapname = isEasterEgg ? "" : (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 = "\"";
|
||||||
string args = "";
|
string args = "";
|
||||||
|
|
@ -1488,6 +1495,7 @@ namespace Novetus.Core
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case ScriptType.Client:
|
case ScriptType.Client:
|
||||||
|
case ScriptType.EasterEgg:
|
||||||
return "_G.CSConnect("
|
return "_G.CSConnect("
|
||||||
+ (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'"
|
+ (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'"
|
||||||
+ GlobalVars.CurrentServer.ServerIP + "',"
|
+ GlobalVars.CurrentServer.ServerIP + "',"
|
||||||
|
|
@ -1499,6 +1507,7 @@ namespace Novetus.Core
|
||||||
+ ((GlobalVars.ValidatedExtraFiles > 0) ? "'," + GlobalVars.ValidatedExtraFiles.ToString() + "," : "',0,")
|
+ ((GlobalVars.ValidatedExtraFiles > 0) ? "'," + GlobalVars.ValidatedExtraFiles.ToString() + "," : "',0,")
|
||||||
+ GlobalVars.UserConfiguration.NewGUI.ToString().ToLower() + ");";
|
+ GlobalVars.UserConfiguration.NewGUI.ToString().ToLower() + ");";
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
return "_G.CSServer("
|
return "_G.CSServer("
|
||||||
+ GlobalVars.UserConfiguration.RobloxPort + ","
|
+ GlobalVars.UserConfiguration.RobloxPort + ","
|
||||||
+ GlobalVars.UserConfiguration.PlayerLimit + ","
|
+ GlobalVars.UserConfiguration.PlayerLimit + ","
|
||||||
|
|
@ -1507,7 +1516,6 @@ namespace Novetus.Core
|
||||||
+ ((GlobalVars.ValidatedExtraFiles > 0) ? "," + GlobalVars.ValidatedExtraFiles.ToString() + "," : ",0,")
|
+ ((GlobalVars.ValidatedExtraFiles > 0) ? "," + GlobalVars.ValidatedExtraFiles.ToString() + "," : ",0,")
|
||||||
+ GlobalVars.UserConfiguration.NewGUI.ToString().ToLower() + ");";
|
+ GlobalVars.UserConfiguration.NewGUI.ToString().ToLower() + ");";
|
||||||
case ScriptType.Solo:
|
case ScriptType.Solo:
|
||||||
case ScriptType.EasterEgg:
|
|
||||||
return "_G.CSSolo("
|
return "_G.CSSolo("
|
||||||
+ (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'"
|
+ (info.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'"
|
||||||
+ (info.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "',"
|
+ (info.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "',"
|
||||||
|
|
@ -1534,6 +1542,7 @@ namespace Novetus.Core
|
||||||
case ScriptType.Studio:
|
case ScriptType.Studio:
|
||||||
return "Studio";
|
return "Studio";
|
||||||
case ScriptType.EasterEgg:
|
case ScriptType.EasterEgg:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
return "A message from Bitl";
|
return "A message from Bitl";
|
||||||
default:
|
default:
|
||||||
return "N/A";
|
return "N/A";
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ namespace Novetus.Core
|
||||||
Solo = 2,
|
Solo = 2,
|
||||||
Studio = 3,
|
Studio = 3,
|
||||||
EasterEgg = 4,
|
EasterEgg = 4,
|
||||||
None = 5
|
EasterEggServer = 5,
|
||||||
|
None = 6
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,7 @@ namespace Novetus.Core
|
||||||
+ RandomStringTitle());
|
+ RandomStringTitle());
|
||||||
break;
|
break;
|
||||||
case ScriptType.EasterEgg:
|
case ScriptType.EasterEgg:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
default:
|
default:
|
||||||
SetWindowText(exe.MainWindowHandle, ScriptFuncs.Generator.GetNameForType(type)
|
SetWindowText(exe.MainWindowHandle, ScriptFuncs.Generator.GetNameForType(type)
|
||||||
+ RandomStringTitle());
|
+ RandomStringTitle());
|
||||||
|
|
|
||||||
|
|
@ -680,7 +680,7 @@ namespace Novetus.Core
|
||||||
return (p <= 0);
|
return (p <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ConsolePrint(string text, int type = 1, bool noLog = false)
|
public static void ConsolePrint(string text, int type = 1, bool noLog = false, bool scrollDown = true)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
@ -718,7 +718,7 @@ namespace Novetus.Core
|
||||||
#if LAUNCHER
|
#if LAUNCHER
|
||||||
if (GlobalVars.consoleForm != null)
|
if (GlobalVars.consoleForm != null)
|
||||||
{
|
{
|
||||||
FormPrint(text, type, GlobalVars.consoleForm.ConsoleBox);
|
FormPrint(text, type, GlobalVars.consoleForm.ConsoleBox, scrollDown);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -756,7 +756,7 @@ namespace Novetus.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void FormPrint(string text, int type, RichTextBox box)
|
private static void FormPrint(string text, int type, RichTextBox box, bool scrollDown = true)
|
||||||
{
|
{
|
||||||
if (box == null)
|
if (box == null)
|
||||||
return;
|
return;
|
||||||
|
|
@ -790,6 +790,12 @@ namespace Novetus.Core
|
||||||
box.AppendText(text, Color.Black);
|
box.AppendText(text, Color.Black);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scrollDown)
|
||||||
|
{
|
||||||
|
box.SelectionStart = box.Text.Length;
|
||||||
|
box.ScrollToCaret();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ConsoleText(string text, ConsoleColor color, bool newLine = false)
|
private static void ConsoleText(string text, ConsoleColor color, bool newLine = false)
|
||||||
|
|
@ -805,7 +811,7 @@ namespace Novetus.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ReadTextFileWithColor(string path)
|
public static void ReadTextFileWithColor(string path, bool scrollDown = true)
|
||||||
{
|
{
|
||||||
var lines = File.ReadLines(path);
|
var lines = File.ReadLines(path);
|
||||||
foreach (var line in lines)
|
foreach (var line in lines)
|
||||||
|
|
@ -813,11 +819,11 @@ namespace Novetus.Core
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] vals = line.Split('|');
|
string[] vals = line.Split('|');
|
||||||
ConsolePrint(vals[0], Convert.ToInt32(vals[1]), true);
|
ConsolePrint(vals[0], Convert.ToInt32(vals[1]), true, scrollDown);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
ConsolePrint(line, 1, true);
|
ConsolePrint(line, 1, true, scrollDown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ namespace NovetusLauncher
|
||||||
switch (GlobalVars.GameOpened)
|
switch (GlobalVars.GameOpened)
|
||||||
{
|
{
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
|
case ScriptType.EasterEggServer:
|
||||||
ShowCloseError("A server is open.", "Server", e);
|
ShowCloseError("A server is open.", "Server", e);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -190,9 +191,15 @@ namespace NovetusLauncher
|
||||||
DiscordRPC.Shutdown();
|
DiscordRPC.Shutdown();
|
||||||
}
|
}
|
||||||
if (GlobalVars.UserConfiguration.WebProxyEnabled)
|
if (GlobalVars.UserConfiguration.WebProxyEnabled)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
GlobalVars.Proxy.Stop();
|
GlobalVars.Proxy.Stop();
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!GlobalVars.AppClosed)
|
if (!GlobalVars.AppClosed)
|
||||||
{
|
{
|
||||||
|
|
@ -269,7 +276,7 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartGame(ScriptType gameType, bool no3d = false, bool nomap = false, bool console = false)
|
public async void StartGame(ScriptType gameType, bool no3d = false, bool nomap = false, bool console = false)
|
||||||
{
|
{
|
||||||
if (!console)
|
if (!console)
|
||||||
{
|
{
|
||||||
|
|
@ -355,7 +362,9 @@ namespace NovetusLauncher
|
||||||
ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase));
|
ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase));
|
||||||
break;
|
break;
|
||||||
case ScriptType.EasterEgg:
|
case ScriptType.EasterEgg:
|
||||||
ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, false, new EventHandler(EasterEggExited));
|
ClientManagement.LaunchRBXClient(ScriptType.EasterEggServer, false, false, new EventHandler(ServerExited));
|
||||||
|
await Util.Delay(1500);
|
||||||
|
ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, true, new EventHandler(EasterEggExited));
|
||||||
break;
|
break;
|
||||||
case ScriptType.None:
|
case ScriptType.None:
|
||||||
default:
|
default:
|
||||||
|
|
@ -370,6 +379,11 @@ namespace NovetusLauncher
|
||||||
|
|
||||||
public void EasterEggLogic()
|
public void EasterEggLogic()
|
||||||
{
|
{
|
||||||
|
if (LocalVars.Clicks <= 0)
|
||||||
|
{
|
||||||
|
LocalVars.prevsplash = SplashLabel.Text;
|
||||||
|
}
|
||||||
|
|
||||||
if (LocalVars.Clicks < 10)
|
if (LocalVars.Clicks < 10)
|
||||||
{
|
{
|
||||||
LocalVars.Clicks += 1;
|
LocalVars.Clicks += 1;
|
||||||
|
|
@ -431,6 +445,12 @@ namespace NovetusLauncher
|
||||||
{
|
{
|
||||||
LocalVars.Clicks = 0;
|
LocalVars.Clicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var processes = Process.GetProcessesByName("RobloxApp_server");
|
||||||
|
foreach (var process in processes)
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
}
|
||||||
ClientExitedBase(sender, e);
|
ClientExitedBase(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
else if (vals[1].Equals("off", StringComparison.InvariantCultureIgnoreCase))
|
else if (vals[1].Equals("off", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
if (!GlobalVars.Proxy.HasStarted() && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
if (!GlobalVars.Proxy.Started && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
||||||
{
|
{
|
||||||
Util.ConsolePrint("The web proxy is disabled. Please turn it on in order to use this command.", 2);
|
Util.ConsolePrint("The web proxy is disabled. Please turn it on in order to use this command.", 2);
|
||||||
return;
|
return;
|
||||||
|
|
@ -408,7 +408,7 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
else if (vals[1].Equals("disable", StringComparison.InvariantCultureIgnoreCase))
|
else if (vals[1].Equals("disable", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
if (!GlobalVars.Proxy.HasStarted() && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
if (!GlobalVars.Proxy.Started && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
||||||
{
|
{
|
||||||
Util.ConsolePrint("The web proxy is already disabled.", 2);
|
Util.ConsolePrint("The web proxy is already disabled.", 2);
|
||||||
return;
|
return;
|
||||||
|
|
@ -425,7 +425,7 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
else if (vals[1].Equals("extensions", StringComparison.InvariantCultureIgnoreCase))
|
else if (vals[1].Equals("extensions", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
if (!GlobalVars.Proxy.HasStarted() && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
if (!GlobalVars.Proxy.Started && !GlobalVars.UserConfiguration.WebProxyEnabled)
|
||||||
{
|
{
|
||||||
Util.ConsolePrint("The web proxy is disabled. Please turn it on in order to use this command.", 2);
|
Util.ConsolePrint("The web proxy is disabled. Please turn it on in order to use this command.", 2);
|
||||||
return;
|
return;
|
||||||
|
|
@ -468,9 +468,9 @@ namespace NovetusLauncher
|
||||||
public void ConsoleHelp()
|
public void ConsoleHelp()
|
||||||
{
|
{
|
||||||
ClearConsole();
|
ClearConsole();
|
||||||
Util.ConsolePrint("Help:", 3, true);
|
Util.ConsolePrint("Help:", 3, true, false);
|
||||||
Util.ReadTextFileWithColor(GlobalPaths.BasePath + "\\" + GlobalPaths.ConsoleHelpFileName);
|
Util.ReadTextFileWithColor(GlobalPaths.BasePath + "\\" + GlobalPaths.ConsoleHelpFileName, false);
|
||||||
Util.ConsolePrint(GlobalVars.Important2, 0, true);
|
Util.ConsolePrint(GlobalVars.Important2, 0, true, false);
|
||||||
ScrollToTop();
|
ScrollToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -478,7 +478,7 @@ namespace NovetusLauncher
|
||||||
{
|
{
|
||||||
ClearConsole();
|
ClearConsole();
|
||||||
Util.ConsolePrint("ClientScript Documentation:", 3, true);
|
Util.ConsolePrint("ClientScript Documentation:", 3, true);
|
||||||
Util.ReadTextFileWithColor(GlobalPaths.BasePath + "\\" + GlobalPaths.ClientScriptDocumentationFileName);
|
Util.ReadTextFileWithColor(GlobalPaths.BasePath + "\\" + GlobalPaths.ClientScriptDocumentationFileName, false);
|
||||||
ScrollToTop();
|
ScrollToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -537,7 +537,7 @@ namespace NovetusLauncher
|
||||||
{
|
{
|
||||||
GlobalVars.UserConfiguration = savedConfig;
|
GlobalVars.UserConfiguration = savedConfig;
|
||||||
}
|
}
|
||||||
ConsoleForm.CloseEventInternal();
|
ConsoleForm.CloseEvent(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,7 @@ public partial class ItemCreationSDKColorMenu : Form
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.partColorID = Convert.ToInt32(colorMenu.Items[selectedIndex].Tag);
|
parent.partColorID = Convert.ToInt32(colorMenu.Items[selectedIndex].Tag);
|
||||||
#pragma warning disable CS1690 // Accessing a member on a field of a marshal-by-reference class may cause a runtime exception
|
|
||||||
parent.partColorLabel.Text = parent.partColorID.ToString();
|
parent.partColorLabel.Text = parent.partColorID.ToString();
|
||||||
#pragma warning restore CS1690 // Accessing a member on a field of a marshal-by-reference class may cause a runtime exception
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,10 +306,10 @@ ROBLOX Script Generator was made by S. Costeira.
|
||||||
Thank you to NT_x86 for helping me with security fixes.
|
Thank you to NT_x86 for helping me with security fixes.
|
||||||
Thank you XlXi for the idea of the original logo. This logo was remade in newer verions in higher quality.
|
Thank you XlXi for the idea of the original logo. This logo was remade in newer verions in higher quality.
|
||||||
Thank you Nukley for the idea of the Splash Tester.
|
Thank you Nukley for the idea of the Splash Tester.
|
||||||
Credits go to Nostal-ia for getting 2011M corescripts working and helping me with 2011E corescripts.
|
Credits go to matboff for getting 2011M corescripts working and helping me with 2011E corescripts.
|
||||||
Credits to Hazelnut (creator of JRBX) for the buttons used in the Stylish style.
|
Credits to Hazelnut (creator of JRBX) for the buttons used in the Stylish style.
|
||||||
Credits go to davcs86 for the HWID generation code (https://github.com/davcs86/csharp-uhwid)
|
Credits go to davcs86 for the HWID generation code (https://github.com/davcs86/csharp-uhwid)
|
||||||
Credits go to BRAVONATCHO and Sodikm for parts of the web proxy code.
|
Credits go to matboff and Sodikm for parts of the web proxy code.
|
||||||
All credits for the used pieces of code go to the respective authors.
|
All credits for the used pieces of code go to the respective authors.
|
||||||
|
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,25 @@
|
||||||
|
1.3 Snapshot v22.8412.32591.1
|
||||||
|
Enhancements:
|
||||||
|
- Added badge support to the Web Proxy.
|
||||||
|
- The Easter Egg now loads up a server and a client, rather than loading a client in Play Solo mode.
|
||||||
|
- Further improved web proxy reliability.
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- Fixed the previous splash not showing up after closing the Easter Egg.
|
||||||
|
- Fixed a bug where the Console could close Novetus with a client open.
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
1.3 Snapshot v22.8411.39962.1
|
||||||
|
Enhancements:
|
||||||
|
- Web Proxy Extension API additions:
|
||||||
|
- Added Author().
|
||||||
|
- Improved Web Proxy Extension loading and management.
|
||||||
|
- Improved the Console user experience.
|
||||||
|
- Added proxy extensions reload - Reloads all Web Proxy extensions.
|
||||||
|
- Added proxy extensions list - Lists all Web Proxy extensions.
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- Fixed a bug that happens when the user manually stops the Web Proxy with the Console.
|
||||||
|
----------------------------------------------------------------------------
|
||||||
1.3 Snapshot v22.8408.16129.1
|
1.3 Snapshot v22.8408.16129.1
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- Changed the design of the Console to be more user friendly.
|
- Changed the design of the Console to be more user friendly.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ Commands:|3
|
||||||
+ config save - Saves the config file|4
|
+ config save - Saves the config file|4
|
||||||
+ config load - Reloads the config file|4
|
+ config load - Reloads the config file|4
|
||||||
+ config reset - Resets the config file|4
|
+ config reset - Resets the config file|4
|
||||||
+ proxy <off/on/disable> - Turns Novetus' web proxy on and off.
|
+ proxy <off/on/disable> - Turns Novetus' web proxy on and off. 'disable' disables the web proxy entirely.|4
|
||||||
|
+ proxy extensions reload - Reloads all Web Proxy extensions.|4
|
||||||
|
+ proxy extensions list - Lists all Web Proxy extensions.|4
|
||||||
---------|1
|
---------|1
|
||||||
Command-Line Parameters:|3
|
Command-Line Parameters:|3
|
||||||
---------|1
|
---------|1
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
local this = {}
|
||||||
|
|
||||||
|
function this:Name()
|
||||||
|
return "URL Setup Addon"
|
||||||
|
end
|
||||||
|
|
||||||
|
function this:IsEnabled(Script, Client)
|
||||||
|
if (Script ~= "Studio") then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function this:PreInit(Script, Client)
|
||||||
|
pcall(function() game:GetService("BadgeService"):SetPlaceId(game.PlaceId) end)
|
||||||
|
pcall(function() game:GetService("BadgeService"):SetAwardBadgeUrl("http://www.roblox.com/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d") end)
|
||||||
|
pcall(function() game:GetService("BadgeService"):SetHasBadgeUrl("http://www.roblox.com/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d") end)
|
||||||
|
pcall(function() game:GetService("BadgeService"):SetIsBadgeDisabledUrl("http://www.roblox.com/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d") end)
|
||||||
|
pcall(function() game:GetService("BadgeService"):SetIsBadgeLegalUrl("") end)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- DO NOT REMOVE THIS. this is required to load this addon into the game.
|
||||||
|
|
||||||
|
function AddModule(t)
|
||||||
|
print("AddonLoader: Adding " .. this:Name())
|
||||||
|
table.insert(t, this)
|
||||||
|
end
|
||||||
|
|
||||||
|
_G.CSScript_AddModule=AddModule
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
-- put script names here
|
-- put script names here
|
||||||
|
|
||||||
Addons = {"Utils", "ShadersCompatibility", "ServerWhitelist"}
|
Addons = {"Utils", "ShadersCompatibility", "ServerWhitelist", "URLSetup"}
|
||||||
|
|
||||||
-- DONT EDIT ANYTHING ELSE BELOW
|
-- DONT EDIT ANYTHING ELSE BELOW
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ public class Asset : IWebProxyExtension
|
||||||
return "Asset Redirection Extension";
|
return "Asset Redirection Extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string Author()
|
||||||
|
{
|
||||||
|
return "Bitl";
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsValidURL(string absolutePath, string host)
|
public override bool IsValidURL(string absolutePath, string host)
|
||||||
{
|
{
|
||||||
return (absolutePath.EndsWith("/asset") || absolutePath.EndsWith("/asset/"));
|
return (absolutePath.EndsWith("/asset") || absolutePath.EndsWith("/asset/"));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
using System.Net;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Titanium.Web.Proxy;
|
||||||
|
using Titanium.Web.Proxy.EventArguments;
|
||||||
|
using Titanium.Web.Proxy.Http;
|
||||||
|
using Titanium.Web.Proxy.Models;
|
||||||
|
using Novetus.Core;
|
||||||
|
|
||||||
|
public class AwardBadge : IWebProxyExtension
|
||||||
|
{
|
||||||
|
struct BadgeData
|
||||||
|
{
|
||||||
|
public long BadgeId;
|
||||||
|
public string BadgeName;
|
||||||
|
public string BadgeCreatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly string BadgeDatabasePath = GlobalPaths.ConfigDir + "\\BadgeDatabase.ini";
|
||||||
|
private string BadgeDatabaseSection = "BadgeDatabase";
|
||||||
|
private string MetadataFileExtension = "_meta.ini";
|
||||||
|
private INIFile ini = new INIFile(BadgeDatabasePath);
|
||||||
|
|
||||||
|
public override string Name()
|
||||||
|
{
|
||||||
|
return "Badge Award Extension";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string Author()
|
||||||
|
{
|
||||||
|
return "Bitl";
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddBadgeToDB(long BadgeID, bool Awarded = false)
|
||||||
|
{
|
||||||
|
CreateBadgeDatabaseIfNeeded();
|
||||||
|
ini.IniWriteValue(BadgeDatabaseSection, BadgeID.ToString(), Awarded.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlayerHasBadge(long BadgeID)
|
||||||
|
{
|
||||||
|
CreateBadgeDatabaseIfNeeded();
|
||||||
|
|
||||||
|
if (ini.IniValueExists(BadgeID.ToString()))
|
||||||
|
{
|
||||||
|
string awarded = ini.IniReadValue(BadgeDatabaseSection, BadgeID.ToString(), "False");
|
||||||
|
return Convert.ToBoolean(awarded);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateBadgeDatabaseIfNeeded()
|
||||||
|
{
|
||||||
|
if (!File.Exists(BadgeDatabasePath))
|
||||||
|
{
|
||||||
|
Util.ConsolePrint("WARNING - " + BadgeDatabasePath + " not found. Creating empty badge database.", 5);
|
||||||
|
File.Create(BadgeDatabasePath).Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnExtensionLoad()
|
||||||
|
{
|
||||||
|
CreateBadgeDatabaseIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
|
BadgeData LoadMetadata(long BadgeID)
|
||||||
|
{
|
||||||
|
BadgeData result;
|
||||||
|
result.BadgeId = BadgeID;
|
||||||
|
result.BadgeName = BadgeID.ToString();
|
||||||
|
result.BadgeCreatorName = "Unknown";
|
||||||
|
string metaFile = (GlobalVars.UserConfiguration.MapPath.Replace(".rbxl", "").Replace(".rbxlx", "").Replace(".bz2", "") + MetadataFileExtension);
|
||||||
|
|
||||||
|
if (GlobalVars.GameOpened == ScriptType.EasterEgg)
|
||||||
|
{
|
||||||
|
metaFile = ((GlobalPaths.DataDir + "\\Appreciation.rbxl").Replace(".rbxl", MetadataFileExtension));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (File.Exists(metaFile))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
INIFile metaIni = new INIFile(metaFile);
|
||||||
|
string section = BadgeID.ToString();
|
||||||
|
|
||||||
|
string name = metaIni.IniReadValue(section, "BadgeName", BadgeID.ToString());
|
||||||
|
string creator = metaIni.IniReadValue(section, "BadgeCreatorName", "Unknown");
|
||||||
|
result.BadgeName = name;
|
||||||
|
result.BadgeCreatorName = creator;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsValidURL(string absolutePath, string host)
|
||||||
|
{
|
||||||
|
return absolutePath.EndsWith("/game/badge/awardbadge.ashx");
|
||||||
|
}
|
||||||
|
|
||||||
|
string GenerateBadgeString(string creatorName, string badgeName, long id)
|
||||||
|
{
|
||||||
|
if (PlayerHasBadge(id))
|
||||||
|
{
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
return GlobalVars.UserConfiguration.PlayerName + " won " + creatorName + "'s \"" + badgeName + "\" award!";
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task OnRequest(object sender, SessionEventArgs e)
|
||||||
|
{
|
||||||
|
await Util.Delay(1000);
|
||||||
|
string query = e.HttpClient.Request.RequestUri.Query;
|
||||||
|
long badgeid = 0;
|
||||||
|
long userid = 0;
|
||||||
|
if (!long.TryParse(NetFuncs.FindQueryString(query, "badgeid"), out badgeid) &&
|
||||||
|
!long.TryParse(NetFuncs.FindQueryString(query, "userid"), out userid))
|
||||||
|
{
|
||||||
|
e.GenericResponse("", HttpStatusCode.BadRequest);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BadgeData meta = LoadMetadata(badgeid);
|
||||||
|
|
||||||
|
string badgeAwardString = GenerateBadgeString(meta.BadgeCreatorName, meta.BadgeName, badgeid);
|
||||||
|
AddBadgeToDB(badgeid, true);
|
||||||
|
e.Ok(badgeAwardString, NetFuncs.GenerateHeaders(badgeAwardString.Length.ToString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,11 @@ public class StudioLaunchPage : IWebProxyExtension
|
||||||
return "Studio Launch Page Extension";
|
return "Studio Launch Page Extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string Author()
|
||||||
|
{
|
||||||
|
return "Bitl";
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsValidURL(string absolutePath, string host)
|
public override bool IsValidURL(string absolutePath, string host)
|
||||||
{
|
{
|
||||||
return absolutePath.EndsWith("/ide/landing.aspx") || absolutePath.EndsWith("/my/places.aspx");
|
return absolutePath.EndsWith("/ide/landing.aspx") || absolutePath.EndsWith("/my/places.aspx");
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ public class UploadWarnings : IWebProxyExtension
|
||||||
return "Upload Dialog Warnings Extension";
|
return "Upload Dialog Warnings Extension";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string Author()
|
||||||
|
{
|
||||||
|
return "Bitl";
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsValidURL(string absolutePath, string host)
|
public override bool IsValidURL(string absolutePath, string host)
|
||||||
{
|
{
|
||||||
return absolutePath.EndsWith("/uploadmedia/postimage.aspx") || absolutePath.EndsWith("/uploadmedia/uploadvideo.aspx");
|
return absolutePath.EndsWith("/uploadmedia/postimage.aspx") || absolutePath.EndsWith("/uploadmedia/uploadvideo.aspx");
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ del /s /q Novetus\config\ReShade.ini
|
||||||
del /s /q Novetus\config\config.ini
|
del /s /q Novetus\config\config.ini
|
||||||
del /s /q Novetus\config\config_customization.ini
|
del /s /q Novetus\config\config_customization.ini
|
||||||
del /s /q Novetus\config\initialfilelist.txt
|
del /s /q Novetus\config\initialfilelist.txt
|
||||||
|
del /s /q Novetus\config\BadgeDatabase.ini
|
||||||
|
|
||||||
del /s /q Novetus\config\clients\GlobalSettings2_2007E.xml
|
del /s /q Novetus\config\clients\GlobalSettings2_2007E.xml
|
||||||
del /s /q Novetus\config\clients\GlobalSettings2_2007E-Shaders.xml
|
del /s /q Novetus\config\clients\GlobalSettings2_2007E-Shaders.xml
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue