rewrite part 6: EVERYONE GETS A CLASS!

This commit is contained in:
Bitl 2020-07-06 09:59:10 -07:00
parent aa1ce3628f
commit 1149f55b63
15 changed files with 864 additions and 831 deletions

View File

@ -175,7 +175,7 @@ namespace NovetusCMD
if (!File.Exists(clientpath)) if (!File.Exists(clientpath))
{ {
ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2);
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
ReadClientValues(ClientName); ReadClientValues(ClientName);
} }
else else
@ -193,9 +193,9 @@ namespace NovetusCMD
public static void Main(string[] args) public static void Main(string[] args)
{ {
LauncherFuncs.ReadInfoFile(Directories.ConfigDir + "\\" + GlobalVars.InfoName, true); LauncherFuncs.ReadInfoFile(Directories.ConfigDir + "\\" + GlobalVars.InfoName, true);
Console.Title = "Novetus " + GlobalVars.Version + " CMD"; Console.Title = "Novetus " + GlobalVars.ProgramInformation.Version + " CMD";
ConsolePrint("NovetusCMD version " + GlobalVars.Version + " loaded.", 1); ConsolePrint("NovetusCMD version " + GlobalVars.ProgramInformation.Version + " loaded.", 1);
ConsolePrint("Novetus path: " + Directories.BasePath, 1); ConsolePrint("Novetus path: " + Directories.BasePath, 1);
if (args.Length == 0) if (args.Length == 0)
@ -437,7 +437,7 @@ namespace NovetusCMD
"Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(),
"Map: " + GlobalVars.UserConfiguration.Map, "Map: " + GlobalVars.UserConfiguration.Map,
"Players: " + GlobalVars.UserConfiguration.PlayerLimit, "Players: " + GlobalVars.UserConfiguration.PlayerLimit,
"Version: Novetus " + GlobalVars.Version, "Version: Novetus " + GlobalVars.ProgramInformation.Version,
"Online URI Link:", "Online URI Link:",
URI, URI,
"Local URI Link:", "Local URI Link:",

View File

@ -9,7 +9,6 @@
<Import_RootNamespace>NovetusFuncs</Import_RootNamespace> <Import_RootNamespace>NovetusFuncs</Import_RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)NovetusLoaderFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NovetusGlobalFuncs.cs" /> <Compile Include="$(MSBuildThisFileDirectory)NovetusGlobalFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NovetusScriptFuncs.cs" /> <Compile Include="$(MSBuildThisFileDirectory)NovetusScriptFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NovetusCodeExtensions.cs" /> <Compile Include="$(MSBuildThisFileDirectory)NovetusCodeExtensions.cs" />

View File

@ -17,16 +17,9 @@ using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
#endregion #endregion
/* /*
* Finish classes for:
*
* info
* reshade
*
* change field names for all forms * change field names for all forms
* Rewrite client launching into one function. * Rewrite client launching into one function.
* add regions to ALL classes. * add regions to ALL classes.
@ -79,10 +72,9 @@ public enum RobloxFileType
#region GlobalVars #region GlobalVars
public static class GlobalVars public static class GlobalVars
{ {
public static ProgramInfo ProgramInformation = new ProgramInfo();
public static Config UserConfiguration = new Config(); public static Config UserConfiguration = new Config();
public static string IP = "localhost"; public static string IP = "localhost";
public static string Version = "";
public static string Branch = "";
public static string SharedArgs = ""; public static string SharedArgs = "";
public static readonly string ScriptName = "CSMPFunctions"; public static readonly string ScriptName = "CSMPFunctions";
public static readonly string ScriptGenName = "CSMPBoot"; public static readonly string ScriptGenName = "CSMPBoot";
@ -98,15 +90,10 @@ public static class GlobalVars
//config name //config name
public static readonly string ConfigName = "config.ini"; public static readonly string ConfigName = "config.ini";
public static string ConfigNameCustomization = "config_customization.ini"; public static string ConfigNameCustomization = "config_customization.ini";
public static readonly string InfoName = "info.txt"; public static readonly string InfoName = "info.ini";
//client shit //client shit
public static ClientInfo SelectedClientInfo = new ClientInfo(); public static ClientInfo SelectedClientInfo = new ClientInfo();
public static string AddonScriptPath = ""; public static string AddonScriptPath = "";
//info shit
public static string DefaultClient = "";
public static string RegisterClient1 = "";
public static string RegisterClient2 = "";
public static string DefaultMap = "";
//charcustom //charcustom
public static CustomizationConfig UserCustomization = new CustomizationConfig(); public static CustomizationConfig UserCustomization = new CustomizationConfig();
public static string loadtext = ""; public static string loadtext = "";
@ -122,9 +109,6 @@ public static class GlobalVars
public static string image_inlauncher = "inlauncher_small"; public static string image_inlauncher = "inlauncher_small";
public static string image_instudio = "instudio_small"; public static string image_instudio = "instudio_small";
public static string image_incustomization = "incustomization_small"; public static string image_incustomization = "incustomization_small";
//reshade
public static bool ReShadeFPSDisplay = false;
public static bool ReShadePerformanceMode = false;
public static string MultiLine(params string[] args) public static string MultiLine(params string[] args)
{ {
@ -322,7 +306,9 @@ public class Config
GraphicsMode = GraphicsMode.OpenGL; GraphicsMode = GraphicsMode.OpenGL;
ReShade = false; ReShade = false;
QualityLevel = QualityLevel.Ultra; QualityLevel = QualityLevel.Ultra;
OldLayout = false; LauncherLayout = LauncherLayout.Extended;
ReShadeFPSDisplay = false;
ReShadePerformanceMode = false;
} }
public string SelectedClient { get; set; } public string SelectedClient { get; set; }
@ -341,7 +327,9 @@ public class Config
public GraphicsMode GraphicsMode { get; set; } public GraphicsMode GraphicsMode { get; set; }
public bool ReShade { get; set; } public bool ReShade { get; set; }
public QualityLevel QualityLevel { get; set; } public QualityLevel QualityLevel { get; set; }
public bool OldLayout { get; set; } public LauncherLayout LauncherLayout { get; set; }
public bool ReShadeFPSDisplay { get; set; }
public bool ReShadePerformanceMode { get; set; }
} }
#endregion #endregion
@ -405,23 +393,25 @@ public class CustomizationConfig
} }
#endregion #endregion
#region Program Information (WIP) #region Program Information
public class ProgramInfo public class ProgramInfo
{ {
public ProgramInfo() public ProgramInfo()
{ {
Version = "";
Branch = "";
DefaultClient = "";
RegisterClient1 = "";
RegisterClient2 = "";
DefaultMap = "";
} }
}
#endregion
#region ReShade Configuration (WIP) public string Version { get; set; }
public class ReShadeConfig public string Branch { get; set; }
{ public string DefaultClient { get; set; }
public ReShadeConfig() public string RegisterClient1 { get; set; }
{ public string RegisterClient2 { get; set; }
public string DefaultMap { get; set; }
}
} }
#endregion #endregion
@ -530,6 +520,99 @@ public class DiscordRpc
#region Function Classes #region Function Classes
#region Enum Parser
public static class EnumParser
{
public static QualityLevel GetQualityLevelForInt(int level)
{
switch (level)
{
case 1:
return QualityLevel.VeryLow;
case 2:
return QualityLevel.Low;
case 3:
return QualityLevel.Medium;
case 4:
return QualityLevel.High;
case 5:
default:
return QualityLevel.Ultra;
}
}
public static int GetIntForQualityLevel(QualityLevel level)
{
switch (level)
{
case QualityLevel.VeryLow:
return 1;
case QualityLevel.Low:
return 2;
case QualityLevel.Medium:
return 3;
case QualityLevel.High:
return 4;
case QualityLevel.Ultra:
default:
return 5;
}
}
public static GraphicsMode GetGraphicsModeForInt(int level)
{
switch (level)
{
case 1:
return GraphicsMode.OpenGL;
case 2:
return GraphicsMode.DirectX;
default:
return GraphicsMode.None;
}
}
public static int GetIntForGraphicsMode(GraphicsMode level)
{
switch (level)
{
case GraphicsMode.OpenGL:
return 1;
case GraphicsMode.DirectX:
return 2;
default:
return 0;
}
}
public static LauncherLayout GetLauncherLayoutForInt(int level)
{
switch (level)
{
case 1:
return LauncherLayout.Extended;
case 2:
return LauncherLayout.Compact;
default:
return LauncherLayout.None;
}
}
public static int GetIntForLauncherLayout(LauncherLayout level)
{
switch (level)
{
case LauncherLayout.Extended:
return 1;
case LauncherLayout.Compact:
return 2;
default:
return 0;
}
}
}
#endregion
#region UPNP #region UPNP
public static class UPnP public static class UPnP
{ {
@ -1230,149 +1313,6 @@ public class SimpleHTTPServer
} }
#endregion #endregion
#region Roblox XML Localizer
public static class RobloxXMLLocalizer
{
public static void DownloadFromNodes(string filepath, AssetCacheDef assetdef, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname);
}
public static void DownloadFromNodes(string filepath, AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname);
}
public static void DownloadFromNodes(string filepath, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "")
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
var v = from nodes in doc.Descendants("Item")
where nodes.Attribute("class").Value == itemClassValue
select nodes;
foreach (var item in v)
{
var v2 = from nodes in item.Descendants("Content")
where nodes.Attribute("name").Value == itemIdValue
select nodes;
foreach (var item2 in v2)
{
var v3 = from nodes in item2.Descendants("url")
select nodes;
foreach (var item3 in v3)
{
if (!item3.Value.Contains("rbxassetid"))
{
if (!item3.Value.Contains("rbxasset"))
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string urlFixed = url.Replace("&amp;", "&").Replace("amp;", "&");
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
else
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string rbxassetid = "rbxassetid://";
string urlFixed = "https://www.roblox.com/asset/?id=" + url.After(rbxassetid);
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
private static void DownloadFilesFromNode(string url, string path, string fileext, string id)
{
if (!string.IsNullOrWhiteSpace(id))
{
Downloader download = new Downloader(url, id);
try
{
download.InitDownload(path, fileext);
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
private static string RemoveInvalidXmlChars(string content)
{
return new string(content.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray());
}
private static string ReplaceHexadecimalSymbols(string txt)
{
string r = "[\x00-\x08\x0B\x0C\x0E-\x1F\x26]";
return Regex.Replace(txt, r, "", RegexOptions.Compiled);
}
}
#endregion
#endregion #endregion
#endregion #endregion

View File

@ -20,6 +20,15 @@ public enum LauncherState
} }
#endregion #endregion
#region Launcher Layout
public enum LauncherLayout
{
None = 0,
Extended = 1,
Compact = 2
}
#endregion
#region Launcher Functions #region Launcher Functions
public class LauncherFuncs public class LauncherFuncs
{ {
@ -27,117 +36,76 @@ public class LauncherFuncs
{ {
} }
public static void ReadInfoFile(string infopath, bool cmd = false, bool versiononly = false) public static void ReadInfoFile(string infopath, bool cmd = false)
{ {
string[] lines = File.ReadAllLines(infopath); //File is in System.IO //READ
GlobalVars.IsSnapshot = Convert.ToBoolean(lines[5]); string versionbranch, defaultclient, defaultmap, regclient1,
if (GlobalVars.IsSnapshot == true) regclient2, issnapshot, snapshottemplate, snapshotrevision;
IniFile ini = new IniFile(infopath);
string section = "ProgramInfo";
//not using the GlobalVars definitions as those are empty until we fill them in.
versionbranch = ini.IniReadValue(section, "Branch", "0.0");
defaultclient = ini.IniReadValue(section, "DefaultClient", "2009E");
defaultmap = ini.IniReadValue(section, "DefaultMap", "Dev - Baseplate2048.rbxl");
regclient1 = ini.IniReadValue(section, "UserAgentRegisterClient1", "2007M");
regclient2 = ini.IniReadValue(section, "UserAgentRegisterClient2", "2009L");
issnapshot = ini.IniReadValue(section, "IsSnapshot", "False");
snapshottemplate = ini.IniReadValue(section, "SnapshotTemplate", "%version% Snapshot (%build%.%revision%.%snapshot-revision%)");
snapshotrevision = ini.IniReadValue(section, "SnapshotRevision", "1");
try
{ {
if (cmd) GlobalVars.IsSnapshot = Convert.ToBoolean(issnapshot);
if (GlobalVars.IsSnapshot == true)
{ {
var versionInfo = FileVersionInfo.GetVersionInfo(Directories.RootPathLauncher + "\\Novetus.exe"); if (cmd)
GlobalVars.Version = lines[6].Replace("%version%", lines[0]) {
.Replace("%build%", versionInfo.ProductBuildPart.ToString()) var versionInfo = FileVersionInfo.GetVersionInfo(Directories.RootPathLauncher + "\\Novetus.exe");
.Replace("%revision%", versionInfo.FilePrivatePart.ToString()) GlobalVars.ProgramInformation.Version = snapshottemplate.Replace("%version%", versionbranch)
.Replace("%snapshot-revision%", lines[7]); .Replace("%build%", versionInfo.ProductBuildPart.ToString())
.Replace("%revision%", versionInfo.FilePrivatePart.ToString())
.Replace("%snapshot-revision%", snapshotrevision);
}
else
{
GlobalVars.ProgramInformation.Version = snapshottemplate.Replace("%version%", versionbranch)
.Replace("%build%", Assembly.GetExecutingAssembly().GetName().Version.Build.ToString())
.Replace("%revision%", Assembly.GetExecutingAssembly().GetName().Version.Revision.ToString())
.Replace("%snapshot-revision%", snapshotrevision);
}
string changelog = Directories.BasePath + "\\changelog.txt";
if (File.Exists(changelog))
{
string[] changelogedit = File.ReadAllLines(changelog);
if (!changelogedit[0].Equals(GlobalVars.ProgramInformation.Version))
{
changelogedit[0] = GlobalVars.ProgramInformation.Version;
File.WriteAllLines(changelog, changelogedit);
}
}
} }
else else
{ {
GlobalVars.Version = lines[6].Replace("%version%", lines[0]) GlobalVars.ProgramInformation.Version = versionbranch;
.Replace("%build%", Assembly.GetExecutingAssembly().GetName().Version.Build.ToString())
.Replace("%revision%", Assembly.GetExecutingAssembly().GetName().Version.Revision.ToString())
.Replace("%snapshot-revision%", lines[7]);
} }
string changelog = Directories.BasePath + "\\changelog.txt"; GlobalVars.ProgramInformation.Branch = versionbranch;
if (File.Exists(changelog)) GlobalVars.ProgramInformation.DefaultClient = defaultclient;
{ GlobalVars.ProgramInformation.DefaultMap = defaultmap;
string[] changelogedit = File.ReadAllLines(changelog); GlobalVars.ProgramInformation.RegisterClient1 = regclient1;
if (!changelogedit[0].Equals(GlobalVars.Version)) GlobalVars.ProgramInformation.RegisterClient2 = regclient2;
{ GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
changelogedit[0] = GlobalVars.Version; GlobalVars.UserConfiguration.Map = GlobalVars.ProgramInformation.DefaultMap;
File.WriteAllLines(changelog, changelogedit); GlobalVars.UserConfiguration.MapPath = Directories.MapsDir + @"\\" + GlobalVars.ProgramInformation.DefaultMap;
} GlobalVars.UserConfiguration.MapPathSnip = Directories.MapsDirBase + @"\\" + GlobalVars.ProgramInformation.DefaultMap;
}
} }
else catch (Exception)
{ {
GlobalVars.Version = lines[0]; ReadInfoFile(infopath, cmd);
}
GlobalVars.Branch = lines[0];
if (!versiononly)
{
GlobalVars.DefaultClient = lines[1];
GlobalVars.DefaultMap = lines[2];
GlobalVars.RegisterClient1 = lines[3];
GlobalVars.RegisterClient2 = lines[4];
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient;
GlobalVars.UserConfiguration.Map = GlobalVars.DefaultMap;
GlobalVars.UserConfiguration.MapPath = Directories.MapsDir + @"\\" + GlobalVars.DefaultMap;
GlobalVars.UserConfiguration.MapPathSnip = Directories.MapsDirBase + @"\\" + GlobalVars.DefaultMap;
}
}
public static QualityLevel GetQualityLevelForInt(int level)
{
switch (level)
{
case 1:
return QualityLevel.VeryLow;
case 2:
return QualityLevel.Low;
case 3:
return QualityLevel.Medium;
case 4:
return QualityLevel.High;
case 5:
default:
return QualityLevel.Ultra;
}
}
public static int GetIntForQualityLevel(QualityLevel level)
{
switch (level)
{
case QualityLevel.VeryLow:
return 1;
case QualityLevel.Low:
return 2;
case QualityLevel.Medium:
return 3;
case QualityLevel.High:
return 4;
case QualityLevel.Ultra:
default:
return 5;
}
}
public static GraphicsMode GetGraphicsModeForInt(int level)
{
switch (level)
{
case 1:
return GraphicsMode.OpenGL;
case 2:
return GraphicsMode.DirectX;
default:
return GraphicsMode.None;
}
}
public static int GetIntForGraphicsMode(GraphicsMode level)
{
switch (level)
{
case GraphicsMode.OpenGL:
return 1;
case GraphicsMode.DirectX:
return 2;
default:
return 0;
} }
} }
@ -163,10 +131,10 @@ public class LauncherFuncs
ini.IniWriteValue(section, "DiscordRichPresence", GlobalVars.UserConfiguration.DiscordPresence.ToString()); ini.IniWriteValue(section, "DiscordRichPresence", GlobalVars.UserConfiguration.DiscordPresence.ToString());
ini.IniWriteValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString()); ini.IniWriteValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString());
ini.IniWriteValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString()); ini.IniWriteValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString());
ini.IniWriteValue(section, "GraphicsMode", GetIntForGraphicsMode(GlobalVars.UserConfiguration.GraphicsMode).ToString()); ini.IniWriteValue(section, "GraphicsMode", GlobalVars.UserConfiguration.GraphicsMode.ToString());
ini.IniWriteValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString()); ini.IniWriteValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString());
ini.IniWriteValue(section, "QualityLevel", GetIntForQualityLevel(GlobalVars.UserConfiguration.QualityLevel).ToString()); ini.IniWriteValue(section, "QualityLevel", GlobalVars.UserConfiguration.QualityLevel.ToString());
ini.IniWriteValue(section, "OldLayout", GlobalVars.UserConfiguration.OldLayout.ToString()); ini.IniWriteValue(section, "Layout", GlobalVars.UserConfiguration.LauncherLayout.ToString());
} }
else else
{ {
@ -174,7 +142,7 @@ public class LauncherFuncs
string closeonlaunch, userid, name, selectedclient, string closeonlaunch, userid, name, selectedclient,
map, port, limit, upnp, map, port, limit, upnp,
disablehelpmessage, tripcode, discord, mappath, mapsnip, disablehelpmessage, tripcode, discord, mappath, mapsnip,
graphics, reshade, qualitylevel, oldlayout; graphics, reshade, qualitylevel, layout;
IniFile ini = new IniFile(cfgpath); IniFile ini = new IniFile(cfgpath);
@ -193,15 +161,14 @@ public class LauncherFuncs
discord = ini.IniReadValue(section, "DiscordRichPresence", GlobalVars.UserConfiguration.DiscordPresence.ToString()); discord = ini.IniReadValue(section, "DiscordRichPresence", GlobalVars.UserConfiguration.DiscordPresence.ToString());
mappath = ini.IniReadValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString()); mappath = ini.IniReadValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString());
mapsnip = ini.IniReadValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString()); mapsnip = ini.IniReadValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString());
graphics = ini.IniReadValue(section, "GraphicsMode", GetIntForGraphicsMode(GlobalVars.UserConfiguration.GraphicsMode).ToString()); graphics = ini.IniReadValue(section, "GraphicsMode", EnumParser.GetIntForGraphicsMode(GlobalVars.UserConfiguration.GraphicsMode).ToString());
reshade = ini.IniReadValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString()); reshade = ini.IniReadValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString());
qualitylevel = ini.IniReadValue(section, "QualityLevel", GetIntForQualityLevel(GlobalVars.UserConfiguration.QualityLevel).ToString()); qualitylevel = ini.IniReadValue(section, "QualityLevel", EnumParser.GetIntForQualityLevel(GlobalVars.UserConfiguration.QualityLevel).ToString());
oldlayout = ini.IniReadValue(section, "OldLayout", GlobalVars.UserConfiguration.OldLayout.ToString()); layout = ini.IniReadValue(section, "Layout", EnumParser.GetIntForLauncherLayout(GlobalVars.UserConfiguration.LauncherLayout).ToString());
try try
{ {
bool bline1 = Convert.ToBoolean(closeonlaunch); GlobalVars.UserConfiguration.CloseOnLaunch = Convert.ToBoolean(closeonlaunch);
GlobalVars.UserConfiguration.CloseOnLaunch = bline1;
if (userid.Equals("0")) if (userid.Equals("0"))
{ {
@ -210,8 +177,7 @@ public class LauncherFuncs
} }
else else
{ {
int iline2 = Convert.ToInt32(userid); GlobalVars.UserConfiguration.UserID = Convert.ToInt32(userid);
GlobalVars.UserConfiguration.UserID = iline2;
} }
GlobalVars.UserConfiguration.PlayerName = name; GlobalVars.UserConfiguration.PlayerName = name;
@ -220,17 +186,13 @@ public class LauncherFuncs
GlobalVars.UserConfiguration.Map = map; GlobalVars.UserConfiguration.Map = map;
int iline6 = Convert.ToInt32(port); GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(port);
GlobalVars.UserConfiguration.RobloxPort = iline6;
int iline7 = Convert.ToInt32(limit); GlobalVars.UserConfiguration.PlayerLimit = Convert.ToInt32(limit);
GlobalVars.UserConfiguration.PlayerLimit = iline7;
bool bline10 = Convert.ToBoolean(upnp); GlobalVars.UserConfiguration.UPnP = Convert.ToBoolean(upnp);
GlobalVars.UserConfiguration.UPnP = bline10;
bool bline11 = Convert.ToBoolean(disablehelpmessage); GlobalVars.UserConfiguration.DisabledItemMakerHelp = Convert.ToBoolean(disablehelpmessage);
GlobalVars.UserConfiguration.DisabledItemMakerHelp = bline11;
if (string.IsNullOrWhiteSpace(SecurityFuncs.Base64Decode(tripcode))) if (string.IsNullOrWhiteSpace(SecurityFuncs.Base64Decode(tripcode)))
{ {
@ -239,23 +201,18 @@ public class LauncherFuncs
} }
else else
{ {
string sdecrypt12 = SecurityFuncs.Base64Decode(tripcode); GlobalVars.UserConfiguration.PlayerTripcode = SecurityFuncs.Base64Decode(tripcode);
GlobalVars.UserConfiguration.PlayerTripcode = sdecrypt12;
} }
bool bline13 = Convert.ToBoolean(discord); GlobalVars.UserConfiguration.DiscordPresence = Convert.ToBoolean(discord);
GlobalVars.UserConfiguration.DiscordPresence = bline13;
GlobalVars.UserConfiguration.MapPath = mappath; GlobalVars.UserConfiguration.MapPath = mappath;
GlobalVars.UserConfiguration.MapPathSnip = mapsnip; GlobalVars.UserConfiguration.MapPathSnip = mapsnip;
int iline16 = Convert.ToInt32(graphics);
GlobalVars.UserConfiguration.GraphicsMode = GetGraphicsModeForInt(iline16); GlobalVars.UserConfiguration.GraphicsMode = EnumParser.GetGraphicsModeForInt(Convert.ToInt32(graphics));
bool bline17 = Convert.ToBoolean(reshade); GlobalVars.UserConfiguration.ReShade = Convert.ToBoolean(reshade);
GlobalVars.UserConfiguration.ReShade = bline17; GlobalVars.UserConfiguration.QualityLevel = EnumParser.GetQualityLevelForInt(Convert.ToInt32(qualitylevel));
int iline20 = Convert.ToInt32(qualitylevel); GlobalVars.UserConfiguration.LauncherLayout = EnumParser.GetLauncherLayoutForInt(Convert.ToInt32(layout));
GlobalVars.UserConfiguration.QualityLevel = GetQualityLevelForInt(iline20);
bool bline21 = Convert.ToBoolean(oldlayout);
GlobalVars.UserConfiguration.OldLayout = bline21;
} }
catch (Exception) catch (Exception)
{ {
@ -368,23 +325,12 @@ public class LauncherFuncs
GlobalVars.UserCustomization.Hat2 = hat2; GlobalVars.UserCustomization.Hat2 = hat2;
GlobalVars.UserCustomization.Hat3 = hat3; GlobalVars.UserCustomization.Hat3 = hat3;
int iline4 = Convert.ToInt32(headcolorid); GlobalVars.UserCustomization.HeadColorID = Convert.ToInt32(headcolorid);
GlobalVars.UserCustomization.HeadColorID = iline4; GlobalVars.UserCustomization.TorsoColorID = Convert.ToInt32(torsocolorid);
GlobalVars.UserCustomization.LeftArmColorID = Convert.ToInt32(larmid);
int iline5 = Convert.ToInt32(torsocolorid); GlobalVars.UserCustomization.RightArmColorID = Convert.ToInt32(rarmid);
GlobalVars.UserCustomization.TorsoColorID = iline5; GlobalVars.UserCustomization.LeftLegColorID = Convert.ToInt32(llegid);
GlobalVars.UserCustomization.RightLegColorID = Convert.ToInt32(rlegid);
int iline6 = Convert.ToInt32(larmid);
GlobalVars.UserCustomization.LeftArmColorID = iline6;
int iline7 = Convert.ToInt32(rarmid);
GlobalVars.UserCustomization.RightArmColorID = iline7;
int iline8 = Convert.ToInt32(llegid);
GlobalVars.UserCustomization.LeftLegColorID = iline8;
int iline9 = Convert.ToInt32(rlegid);
GlobalVars.UserCustomization.RightLegColorID = iline9;
GlobalVars.UserCustomization.HeadColorString = headcolorstring; GlobalVars.UserCustomization.HeadColorString = headcolorstring;
GlobalVars.UserCustomization.TorsoColorString = torsocolorstring; GlobalVars.UserCustomization.TorsoColorString = torsocolorstring;
@ -428,10 +374,10 @@ public class LauncherFuncs
string section = "GENERAL"; string section = "GENERAL";
int FPS = GlobalVars.ReShadeFPSDisplay ? 1 : 0; int FPS = GlobalVars.UserConfiguration.ReShadeFPSDisplay ? 1 : 0;
ini.IniWriteValue(section, "ShowFPS", FPS.ToString()); ini.IniWriteValue(section, "ShowFPS", FPS.ToString());
ini.IniWriteValue(section, "ShowFrameTime", FPS.ToString()); ini.IniWriteValue(section, "ShowFrameTime", FPS.ToString());
int PerformanceMode = GlobalVars.ReShadePerformanceMode ? 1 : 0; int PerformanceMode = GlobalVars.UserConfiguration.ReShadePerformanceMode ? 1 : 0;
ini.IniWriteValue(section, "PerformanceMode", PerformanceMode.ToString()); ini.IniWriteValue(section, "PerformanceMode", PerformanceMode.ToString());
} }
else else
@ -443,10 +389,10 @@ public class LauncherFuncs
string section = "GENERAL"; string section = "GENERAL";
int FPS = GlobalVars.ReShadeFPSDisplay ? 1 : 0; int FPS = GlobalVars.UserConfiguration.ReShadeFPSDisplay ? 1 : 0;
framerate = ini.IniReadValue(section, "ShowFPS", FPS.ToString()); framerate = ini.IniReadValue(section, "ShowFPS", FPS.ToString());
frametime = ini.IniReadValue(section, "ShowFrameTime", FPS.ToString()); frametime = ini.IniReadValue(section, "ShowFrameTime", FPS.ToString());
int PerformanceMode = GlobalVars.ReShadePerformanceMode ? 1 : 0; int PerformanceMode = GlobalVars.UserConfiguration.ReShadePerformanceMode ? 1 : 0;
performance = ini.IniReadValue(section, "PerformanceMode", PerformanceMode.ToString()); performance = ini.IniReadValue(section, "PerformanceMode", PerformanceMode.ToString());
if (setglobals) if (setglobals)
@ -456,20 +402,20 @@ public class LauncherFuncs
switch(Convert.ToInt32(framerate)) switch(Convert.ToInt32(framerate))
{ {
case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(frametime) == 1: case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(frametime) == 1:
GlobalVars.ReShadeFPSDisplay = true; GlobalVars.UserConfiguration.ReShadeFPSDisplay = true;
break; break;
default: default:
GlobalVars.ReShadeFPSDisplay = false; GlobalVars.UserConfiguration.ReShadeFPSDisplay = false;
break; break;
} }
switch (Convert.ToInt32(performance)) switch (Convert.ToInt32(performance))
{ {
case 1: case 1:
GlobalVars.ReShadePerformanceMode = true; GlobalVars.UserConfiguration.ReShadePerformanceMode = true;
break; break;
default: default:
GlobalVars.ReShadePerformanceMode = false; GlobalVars.UserConfiguration.ReShadePerformanceMode = false;
break; break;
} }
} }
@ -595,8 +541,8 @@ public class LauncherFuncs
public static void ResetConfigValues() public static void ResetConfigValues()
{ {
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
GlobalVars.UserConfiguration.Map = GlobalVars.DefaultMap; GlobalVars.UserConfiguration.Map = GlobalVars.ProgramInformation.DefaultMap;
GlobalVars.UserConfiguration.CloseOnLaunch = false; GlobalVars.UserConfiguration.CloseOnLaunch = false;
GeneratePlayerID(); GeneratePlayerID();
GlobalVars.UserConfiguration.PlayerName = "Player"; GlobalVars.UserConfiguration.PlayerName = "Player";
@ -605,12 +551,12 @@ public class LauncherFuncs
GlobalVars.UserConfiguration.UPnP = false; GlobalVars.UserConfiguration.UPnP = false;
GlobalVars.UserConfiguration.DisabledItemMakerHelp = false; GlobalVars.UserConfiguration.DisabledItemMakerHelp = false;
GlobalVars.UserConfiguration.DiscordPresence = true; GlobalVars.UserConfiguration.DiscordPresence = true;
GlobalVars.UserConfiguration.MapPath = Directories.MapsDir + @"\\" + GlobalVars.DefaultMap; GlobalVars.UserConfiguration.MapPath = Directories.MapsDir + @"\\" + GlobalVars.ProgramInformation.DefaultMap;
GlobalVars.UserConfiguration.MapPathSnip = Directories.MapsDirBase + @"\\" + GlobalVars.DefaultMap; GlobalVars.UserConfiguration.MapPathSnip = Directories.MapsDirBase + @"\\" + GlobalVars.ProgramInformation.DefaultMap;
GlobalVars.UserConfiguration.GraphicsMode = GraphicsMode.OpenGL; GlobalVars.UserConfiguration.GraphicsMode = GraphicsMode.OpenGL;
GlobalVars.UserConfiguration.ReShade = false; GlobalVars.UserConfiguration.ReShade = false;
GlobalVars.UserConfiguration.QualityLevel = QualityLevel.Ultra; GlobalVars.UserConfiguration.QualityLevel = QualityLevel.Ultra;
GlobalVars.UserConfiguration.OldLayout = false; GlobalVars.UserConfiguration.LauncherLayout = LauncherLayout.Extended;
ResetCustomizationValues(); ResetCustomizationValues();
} }
@ -785,49 +731,49 @@ public class LauncherFuncs
GlobalVars.presence.smallImageKey = GlobalVars.image_inlauncher; GlobalVars.presence.smallImageKey = GlobalVars.image_inlauncher;
GlobalVars.presence.state = "In Launcher"; GlobalVars.presence.state = "In Launcher";
GlobalVars.presence.details = "Selected " + GlobalVars.UserConfiguration.SelectedClient; GlobalVars.presence.details = "Selected " + GlobalVars.UserConfiguration.SelectedClient;
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "In Launcher"; GlobalVars.presence.smallImageText = "In Launcher";
break; break;
case LauncherState.InMPGame: case LauncherState.InMPGame:
GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.smallImageKey = GlobalVars.image_ingame;
GlobalVars.presence.details = ValidMapname; GlobalVars.presence.details = ValidMapname;
GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game";
break; break;
case LauncherState.InSoloGame: case LauncherState.InSoloGame:
GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.smallImageKey = GlobalVars.image_ingame;
GlobalVars.presence.details = ValidMapname; GlobalVars.presence.details = ValidMapname;
GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game"; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game"; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game";
break; break;
case LauncherState.InStudio: case LauncherState.InStudio:
GlobalVars.presence.smallImageKey = GlobalVars.image_instudio; GlobalVars.presence.smallImageKey = GlobalVars.image_instudio;
GlobalVars.presence.details = ValidMapname; GlobalVars.presence.details = ValidMapname;
GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio"; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio"; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio";
break; break;
case LauncherState.InCustomization: case LauncherState.InCustomization:
GlobalVars.presence.smallImageKey = GlobalVars.image_incustomization; GlobalVars.presence.smallImageKey = GlobalVars.image_incustomization;
GlobalVars.presence.details = "Customizing " + GlobalVars.UserConfiguration.PlayerName; GlobalVars.presence.details = "Customizing " + GlobalVars.UserConfiguration.PlayerName;
GlobalVars.presence.state = "In Character Customization"; GlobalVars.presence.state = "In Character Customization";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "In Character Customization"; GlobalVars.presence.smallImageText = "In Character Customization";
break; break;
case LauncherState.InEasterEggGame: case LauncherState.InEasterEggGame:
GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.smallImageKey = GlobalVars.image_ingame;
GlobalVars.presence.details = ValidMapname; GlobalVars.presence.details = ValidMapname;
GlobalVars.presence.state = "Reading a message."; GlobalVars.presence.state = "Reading a message.";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "Reading a message."; GlobalVars.presence.smallImageText = "Reading a message.";
break; break;
case LauncherState.LoadingURI: case LauncherState.LoadingURI:
GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.smallImageKey = GlobalVars.image_ingame;
GlobalVars.presence.details = ValidMapname; GlobalVars.presence.details = ValidMapname;
GlobalVars.presence.state = "Joining a " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; GlobalVars.presence.state = "Joining a " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game";
GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.Version; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version;
GlobalVars.presence.smallImageText = "Joining a " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; GlobalVars.presence.smallImageText = "Joining a " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game";
break; break;
default: default:
@ -984,92 +930,3 @@ public class LauncherFuncs
} }
} }
#endregion #endregion
#region Splash Reader
public static class SplashReader
{
private static string RandomSplash()
{
string[] splashes = File.ReadAllLines(Directories.ConfigDir + "\\splashes.txt");
string splash = "";
try
{
splash = splashes[new CryptoRandom().Next(0, splashes.Length - 1)];
}
catch (Exception)
{
try
{
splash = splashes[0];
}
catch (Exception)
{
splash = "missingno";
return splash;
}
}
CryptoRandom random = new CryptoRandom();
string formattedsplash = splash
.Replace("%name%", GlobalVars.UserConfiguration.PlayerName)
.Replace("%nextversion%", (Convert.ToDouble(GlobalVars.Branch) + 0.1).ToString())
.Replace("%randomtext%", SecurityFuncs.RandomString(random.Next(2, 32)));
return formattedsplash;
}
public static string GetSplash()
{
DateTime today = DateTime.Now;
string splash = "";
switch (today)
{
case DateTime christmaseve when christmaseve.Month.Equals(12) && christmaseve.Day.Equals(24):
case DateTime christmasday when christmasday.Month.Equals(12) && christmasday.Day.Equals(25):
splash = "Merry Christmas!";
break;
case DateTime newyearseve when newyearseve.Month.Equals(12) && newyearseve.Day.Equals(31):
case DateTime newyearsday when newyearsday.Month.Equals(1) && newyearsday.Day.Equals(1):
splash = "Happy New Year!";
break;
case DateTime halloween when halloween.Month.Equals(10) && halloween.Day.Equals(31):
splash = "Happy Halloween!";
break;
case DateTime bitlbirthday when bitlbirthday.Month.Equals(6) && bitlbirthday.Day.Equals(10):
splash = "Happy Birthday, Bitl!";
break;
case DateTime robloxbirthday when robloxbirthday.Month.Equals(8) && robloxbirthday.Day.Equals(27):
splash = "Happy Birthday, ROBLOX!";
break;
case DateTime novetusbirthday when novetusbirthday.Month.Equals(10) && novetusbirthday.Day.Equals(27):
splash = "Happy Birthday, Novetus!";
break;
case DateTime leiferikson when leiferikson.Month.Equals(10) && leiferikson.Day.Equals(9):
splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!";
break;
case DateTime smokeweedeveryday when smokeweedeveryday.Month.Equals(4) && smokeweedeveryday.Day.Equals(20):
CryptoRandom random = new CryptoRandom();
if (random.Next(0, 1) == 1)
{
splash = "smoke weed every day";
}
else
{
splash = "4/20 lol";
}
break;
case DateTime erikismyhero when erikismyhero.Month.Equals(2) && erikismyhero.Day.Equals(11):
splash = "RIP Erik Cassel";
break;
default:
splash = RandomSplash();
break;
}
return splash;
}
}
#endregion

View File

@ -1,305 +0,0 @@
#region Usings
using System;
using System.IO;
using System.Windows.Forms;
using System.Linq;
using System.Text;
using Ionic.Zip;
using System.Net;
#endregion
#region Downloader
class Downloader
{
private readonly string fileURL;
private readonly string fileName;
private readonly string fileFilter;
private string downloadOutcome;
private static string downloadOutcomeException;
public Downloader(string url, string name, string filter)
{
fileName = name;
fileURL = url;
fileFilter = filter;
}
public Downloader(string url, string name)
{
fileName = name;
fileURL = url;
fileFilter = "";
}
public void setDownloadOutcome(string text)
{
downloadOutcome = text;
}
public string getDownloadOutcome()
{
return downloadOutcome;
}
public void InitDownload(string path, string fileext, string additionalText = "")
{
string downloadOutcomeAddText = additionalText;
string outputfilename = fileName + fileext;
string fullpath = path + "\\" + outputfilename;
try
{
int read = DownloadFile(fileURL, fullpath);
downloadOutcome = "File " + outputfilename + " downloaded! " + read + " bytes written! " + downloadOutcomeAddText + downloadOutcomeException;
}
catch (Exception ex)
{
downloadOutcome = "Error when downloading file: " + ex.Message;
}
}
public void InitDownload(string additionalText = "")
{
string downloadOutcomeAddText = additionalText;
SaveFileDialog saveFileDialog1 = new SaveFileDialog
{
FileName = fileName,
//"Compressed zip files (*.zip)|*.zip|All files (*.*)|*.*"
Filter = fileFilter,
Title = "Save " + fileName
};
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
int read = DownloadFile(fileURL, saveFileDialog1.FileName);
downloadOutcome = "File " + Path.GetFileName(saveFileDialog1.FileName) + " downloaded! " + read + " bytes written! " + downloadOutcomeAddText + downloadOutcomeException;
}
catch (Exception ex)
{
downloadOutcome = "Error when downloading file: " + ex.Message;
}
}
}
private static int DownloadFile(string remoteFilename, string localFilename)
{
//credit to Tom Archer (https://www.codeguru.com/columns/dotnettips/article.php/c7005/Downloading-Files-with-the-WebRequest-and-WebResponse-Classes.htm)
//and Brokenglass (https://stackoverflow.com/questions/4567313/uncompressing-gzip-response-from-webclient/4567408#4567408)
// Function will return the number of bytes processed
// to the caller. Initialize to 0 here.
int bytesProcessed = 0;
// Assign values to these objects here so that they can
// be referenced in the finally block
Stream remoteStream = null;
Stream localStream = null;
WebResponse response = null;
// Use a try/catch/finally block as both the WebRequest and Stream
// classes throw exceptions upon error
//thanks to https://stackoverflow.com/questions/33761919/tls-1-2-in-net-framework-4-0 for the net 4.0 compatible TLS 1.1/1.2 code!
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| (SecurityProtocolType)3072
| (SecurityProtocolType)768
| SecurityProtocolType.Ssl3;
// Create a request for the specified remote file name
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteFilename);
request.UserAgent = "Roblox/WinINet";
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
if (request != null)
{
// Send the request to the server and retrieve the
// WebResponse object
response = request.GetResponse();
if (response != null)
{
// Once the WebResponse object has been retrieved,
// get the stream object associated with the response's data
remoteStream = response.GetResponseStream();
// Create the local file
localStream = File.Create(localFilename);
// Allocate a 1k buffer
byte[] buffer = new byte[1024];
int bytesRead;
// Simple do/while loop to read from stream until
// no bytes are returned
do
{
// Read data (up to 1k) from the stream
bytesRead = remoteStream.Read(buffer, 0, buffer.Length);
// Write the data to the local file
localStream.Write(buffer, 0, bytesRead);
// Increment total bytes processed
bytesProcessed += bytesRead;
} while (bytesRead > 0);
}
}
}
catch (Exception e)
{
downloadOutcomeException = " Exception detected: " + e.Message;
}
finally
{
// Close the response and streams objects here
// to make sure they're closed even if an exception
// is thrown at some point
if (response != null) response.Close();
if (remoteStream != null) remoteStream.Close();
if (localStream != null) localStream.Close();
}
// Return total bytes processed to caller.
return bytesProcessed;
}
}
#endregion
#region Addon Loader
public class AddonLoader
{
private readonly OpenFileDialog openFileDialog1;
private string installOutcome = "";
private int fileListDisplay = 0;
public AddonLoader()
{
openFileDialog1 = new OpenFileDialog()
{
FileName = "Select an addon .zip file",
Filter = "Compressed zip files (*.zip)|*.zip",
Title = "Open addon .zip"
};
}
public void setInstallOutcome(string text)
{
installOutcome = text;
}
public string getInstallOutcome()
{
return installOutcome;
}
public void setFileListDisplay(int number)
{
fileListDisplay = number;
}
public void LoadAddon()
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
int filecount = 0;
StringBuilder filelistbuilder = new StringBuilder();
using (Stream str = openFileDialog1.OpenFile())
{
using (var zipFile = ZipFile.Read(str))
{
ZipEntry[] entries = zipFile.Entries.ToArray();
foreach (ZipEntry entry in entries)
{
filelistbuilder.Append(entry.FileName + " ("+ entry.UncompressedSize +")");
filelistbuilder.Append(Environment.NewLine);
}
zipFile.ExtractAll(Directories.BasePath, ExtractExistingFileAction.OverwriteSilently);
}
}
string filelist = filelistbuilder.ToString();
if (filecount > fileListDisplay)
{
installOutcome = "Addon " + openFileDialog1.SafeFileName + " installed! " + filecount + " files copied!" + Environment.NewLine + "Files added/modified:" + Environment.NewLine + Environment.NewLine + filelist + Environment.NewLine + "and " + (filecount - fileListDisplay) + " more files!";
}
else
{
installOutcome = "Addon " + openFileDialog1.SafeFileName + " installed! " + filecount + " files copied!" + Environment.NewLine + "Files added/modified:" + Environment.NewLine + Environment.NewLine + filelist;
}
}
catch (Exception ex)
{
installOutcome = "Error when installing addon: " + ex.Message;
}
}
}
}
#endregion
#region Icon Loader
public class IconLoader
{
private OpenFileDialog openFileDialog1;
private string installOutcome = "";
public IconLoader()
{
openFileDialog1 = new OpenFileDialog()
{
FileName = "Select an icon .png file",
Filter = "Portable Network Graphics image (*.png)|*.png",
Title = "Open icon .png"
};
}
public void setInstallOutcome(string text)
{
installOutcome = text;
}
public string getInstallOutcome()
{
return installOutcome;
}
public void LoadImage()
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
using (Stream str = openFileDialog1.OpenFile())
{
using (Stream output = new FileStream(Directories.extradir + "\\icons\\" + GlobalVars.UserConfiguration.PlayerName + ".png", FileMode.Create))
{
byte[] buffer = new byte[32 * 1024];
int read;
while ((read = str.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, read);
}
}
str.Close();
}
installOutcome = "Icon " + openFileDialog1.SafeFileName + " installed!";
}
catch (Exception ex)
{
installOutcome = "Error when installing icon: " + ex.Message;
}
}
}
}
#endregion

View File

@ -184,7 +184,7 @@ public class SecurityFuncs
{ {
case ScriptType.Client: case ScriptType.Client:
SetWindowText(exe.MainWindowHandle, "Novetus " SetWindowText(exe.MainWindowHandle, "Novetus "
+ GlobalVars.Version + " - " + GlobalVars.ProgramInformation.Version + " - "
+ clientname + " " + clientname + " "
+ ScriptGenerator.GetNameForType(type) + ScriptGenerator.GetNameForType(type)
+ " [" + GlobalVars.IP + ":" + GlobalVars.UserConfiguration.RobloxPort + "]" + " [" + GlobalVars.IP + ":" + GlobalVars.UserConfiguration.RobloxPort + "]"
@ -193,7 +193,7 @@ public class SecurityFuncs
case ScriptType.Server: case ScriptType.Server:
case ScriptType.Solo: case ScriptType.Solo:
SetWindowText(exe.MainWindowHandle, "Novetus " SetWindowText(exe.MainWindowHandle, "Novetus "
+ GlobalVars.Version + " - " + GlobalVars.ProgramInformation.Version + " - "
+ clientname + " " + clientname + " "
+ ScriptGenerator.GetNameForType(type) + ScriptGenerator.GetNameForType(type)
+ (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]") + (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]")
@ -201,7 +201,7 @@ public class SecurityFuncs
break; break;
case ScriptType.Studio: case ScriptType.Studio:
SetWindowText(exe.MainWindowHandle, "Novetus Studio " SetWindowText(exe.MainWindowHandle, "Novetus Studio "
+ GlobalVars.Version + " - " + GlobalVars.ProgramInformation.Version + " - "
+ clientname + clientname
+ (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]") + (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]")
+ RandomStringTitle()); + RandomStringTitle());

View File

@ -1,4 +1,17 @@
namespace NovetusLauncher #region Usings
using Ionic.Zip;
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
#endregion
namespace NovetusLauncher
{ {
#region LocalVars #region LocalVars
class LocalVars class LocalVars
@ -10,8 +23,304 @@
} }
#endregion #endregion
#region Downloader
class Downloader
{
private readonly string fileURL;
private readonly string fileName;
private readonly string fileFilter;
private string downloadOutcome;
private static string downloadOutcomeException;
public Downloader(string url, string name, string filter)
{
fileName = name;
fileURL = url;
fileFilter = filter;
}
public Downloader(string url, string name)
{
fileName = name;
fileURL = url;
fileFilter = "";
}
public void setDownloadOutcome(string text)
{
downloadOutcome = text;
}
public string getDownloadOutcome()
{
return downloadOutcome;
}
public void InitDownload(string path, string fileext, string additionalText = "")
{
string downloadOutcomeAddText = additionalText;
string outputfilename = fileName + fileext;
string fullpath = path + "\\" + outputfilename;
try
{
int read = DownloadFile(fileURL, fullpath);
downloadOutcome = "File " + outputfilename + " downloaded! " + read + " bytes written! " + downloadOutcomeAddText + downloadOutcomeException;
}
catch (Exception ex)
{
downloadOutcome = "Error when downloading file: " + ex.Message;
}
}
public void InitDownload(string additionalText = "")
{
string downloadOutcomeAddText = additionalText;
SaveFileDialog saveFileDialog1 = new SaveFileDialog
{
FileName = fileName,
//"Compressed zip files (*.zip)|*.zip|All files (*.*)|*.*"
Filter = fileFilter,
Title = "Save " + fileName
};
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
int read = DownloadFile(fileURL, saveFileDialog1.FileName);
downloadOutcome = "File " + Path.GetFileName(saveFileDialog1.FileName) + " downloaded! " + read + " bytes written! " + downloadOutcomeAddText + downloadOutcomeException;
}
catch (Exception ex)
{
downloadOutcome = "Error when downloading file: " + ex.Message;
}
}
}
private static int DownloadFile(string remoteFilename, string localFilename)
{
//credit to Tom Archer (https://www.codeguru.com/columns/dotnettips/article.php/c7005/Downloading-Files-with-the-WebRequest-and-WebResponse-Classes.htm)
//and Brokenglass (https://stackoverflow.com/questions/4567313/uncompressing-gzip-response-from-webclient/4567408#4567408)
// Function will return the number of bytes processed
// to the caller. Initialize to 0 here.
int bytesProcessed = 0;
// Assign values to these objects here so that they can
// be referenced in the finally block
Stream remoteStream = null;
Stream localStream = null;
WebResponse response = null;
// Use a try/catch/finally block as both the WebRequest and Stream
// classes throw exceptions upon error
//thanks to https://stackoverflow.com/questions/33761919/tls-1-2-in-net-framework-4-0 for the net 4.0 compatible TLS 1.1/1.2 code!
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| (SecurityProtocolType)3072
| (SecurityProtocolType)768
| SecurityProtocolType.Ssl3;
// Create a request for the specified remote file name
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteFilename);
request.UserAgent = "Roblox/WinINet";
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
if (request != null)
{
// Send the request to the server and retrieve the
// WebResponse object
response = request.GetResponse();
if (response != null)
{
// Once the WebResponse object has been retrieved,
// get the stream object associated with the response's data
remoteStream = response.GetResponseStream();
// Create the local file
localStream = File.Create(localFilename);
// Allocate a 1k buffer
byte[] buffer = new byte[1024];
int bytesRead;
// Simple do/while loop to read from stream until
// no bytes are returned
do
{
// Read data (up to 1k) from the stream
bytesRead = remoteStream.Read(buffer, 0, buffer.Length);
// Write the data to the local file
localStream.Write(buffer, 0, bytesRead);
// Increment total bytes processed
bytesProcessed += bytesRead;
} while (bytesRead > 0);
}
}
}
catch (Exception e)
{
downloadOutcomeException = " Exception detected: " + e.Message;
}
finally
{
// Close the response and streams objects here
// to make sure they're closed even if an exception
// is thrown at some point
if (response != null) response.Close();
if (remoteStream != null) remoteStream.Close();
if (localStream != null) localStream.Close();
}
// Return total bytes processed to caller.
return bytesProcessed;
}
}
#endregion
#region Addon Loader
public class AddonLoader
{
private readonly OpenFileDialog openFileDialog1;
private string installOutcome = "";
private int fileListDisplay = 0;
public AddonLoader()
{
openFileDialog1 = new OpenFileDialog()
{
FileName = "Select an addon .zip file",
Filter = "Compressed zip files (*.zip)|*.zip",
Title = "Open addon .zip"
};
}
public void setInstallOutcome(string text)
{
installOutcome = text;
}
public string getInstallOutcome()
{
return installOutcome;
}
public void setFileListDisplay(int number)
{
fileListDisplay = number;
}
public void LoadAddon()
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
int filecount = 0;
StringBuilder filelistbuilder = new StringBuilder();
using (Stream str = openFileDialog1.OpenFile())
{
using (var zipFile = ZipFile.Read(str))
{
ZipEntry[] entries = zipFile.Entries.ToArray();
foreach (ZipEntry entry in entries)
{
filelistbuilder.Append(entry.FileName + " (" + entry.UncompressedSize + ")");
filelistbuilder.Append(Environment.NewLine);
}
zipFile.ExtractAll(Directories.BasePath, ExtractExistingFileAction.OverwriteSilently);
}
}
string filelist = filelistbuilder.ToString();
if (filecount > fileListDisplay)
{
installOutcome = "Addon " + openFileDialog1.SafeFileName + " installed! " + filecount + " files copied!" + Environment.NewLine + "Files added/modified:" + Environment.NewLine + Environment.NewLine + filelist + Environment.NewLine + "and " + (filecount - fileListDisplay) + " more files!";
}
else
{
installOutcome = "Addon " + openFileDialog1.SafeFileName + " installed! " + filecount + " files copied!" + Environment.NewLine + "Files added/modified:" + Environment.NewLine + Environment.NewLine + filelist;
}
}
catch (Exception ex)
{
installOutcome = "Error when installing addon: " + ex.Message;
}
}
}
}
#endregion
#region Icon Loader
public class IconLoader
{
private OpenFileDialog openFileDialog1;
private string installOutcome = "";
public IconLoader()
{
openFileDialog1 = new OpenFileDialog()
{
FileName = "Select an icon .png file",
Filter = "Portable Network Graphics image (*.png)|*.png",
Title = "Open icon .png"
};
}
public void setInstallOutcome(string text)
{
installOutcome = text;
}
public string getInstallOutcome()
{
return installOutcome;
}
public void LoadImage()
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
using (Stream str = openFileDialog1.OpenFile())
{
using (Stream output = new FileStream(Directories.extradir + "\\icons\\" + GlobalVars.UserConfiguration.PlayerName + ".png", FileMode.Create))
{
byte[] buffer = new byte[32 * 1024];
int read;
while ((read = str.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, read);
}
}
str.Close();
}
installOutcome = "Icon " + openFileDialog1.SafeFileName + " installed!";
}
catch (Exception ex)
{
installOutcome = "Error when installing icon: " + ex.Message;
}
}
}
}
#endregion
#region Roblox Type Definitions #region Roblox Type Definitions
public class RobloxTypeDefs public class RobloxDefs
{ {
public static AssetCacheDef Fonts { get { return new AssetCacheDef("SpecialMesh", new string[] { "MeshId", "TextureId" }, new string[] { ".mesh", ".png" }, new string[] { Directories.AssetCacheDirFonts, Directories.AssetCacheDirTextures }, new string[] { Directories.AssetCacheFontsGameDir, Directories.AssetCacheTexturesGameDir }); } } public static AssetCacheDef Fonts { get { return new AssetCacheDef("SpecialMesh", new string[] { "MeshId", "TextureId" }, new string[] { ".mesh", ".png" }, new string[] { Directories.AssetCacheDirFonts, Directories.AssetCacheDirTextures }, new string[] { Directories.AssetCacheFontsGameDir, Directories.AssetCacheTexturesGameDir }); } }
public static AssetCacheDef Sky { get { return new AssetCacheDef("Sky", new string[] { "SkyboxBk", "SkyboxDn", "SkyboxFt", "SkyboxLf", "SkyboxRt", "SkyboxUp" }, new string[] { ".png" }, new string[] { Directories.AssetCacheDirSky }, new string[] { Directories.AssetCacheSkyGameDir }); } } public static AssetCacheDef Sky { get { return new AssetCacheDef("Sky", new string[] { "SkyboxBk", "SkyboxDn", "SkyboxFt", "SkyboxLf", "SkyboxRt", "SkyboxUp" }, new string[] { ".png" }, new string[] { Directories.AssetCacheDirSky }, new string[] { Directories.AssetCacheSkyGameDir }); } }
@ -38,4 +347,236 @@
public static AssetCacheDef ItemPantsTexture { get { return new AssetCacheDef("Pants", new string[] { "PantsTemplate" }, new string[] { ".png" }, new string[] { Directories.pantsdirTextures }, new string[] { Directories.pantsGameDirTextures }); } } public static AssetCacheDef ItemPantsTexture { get { return new AssetCacheDef("Pants", new string[] { "PantsTemplate" }, new string[] { ".png" }, new string[] { Directories.pantsdirTextures }, new string[] { Directories.pantsGameDirTextures }); } }
} }
#endregion #endregion
#region Roblox XML Localizer
public static class RobloxXMLLocalizer
{
public static void DownloadFromNodes(string filepath, AssetCacheDef assetdef, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname);
}
public static void DownloadFromNodes(string filepath, AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname);
}
public static void DownloadFromNodes(string filepath, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "")
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
var v = from nodes in doc.Descendants("Item")
where nodes.Attribute("class").Value == itemClassValue
select nodes;
foreach (var item in v)
{
var v2 = from nodes in item.Descendants("Content")
where nodes.Attribute("name").Value == itemIdValue
select nodes;
foreach (var item2 in v2)
{
var v3 = from nodes in item2.Descendants("url")
select nodes;
foreach (var item3 in v3)
{
if (!item3.Value.Contains("rbxassetid"))
{
if (!item3.Value.Contains("rbxasset"))
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string urlFixed = url.Replace("&amp;", "&").Replace("amp;", "&");
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
else
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string rbxassetid = "rbxassetid://";
string urlFixed = "https://www.roblox.com/asset/?id=" + url.After(rbxassetid);
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
private static void DownloadFilesFromNode(string url, string path, string fileext, string id)
{
if (!string.IsNullOrWhiteSpace(id))
{
Downloader download = new Downloader(url, id);
try
{
download.InitDownload(path, fileext);
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
private static string RemoveInvalidXmlChars(string content)
{
return new string(content.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray());
}
private static string ReplaceHexadecimalSymbols(string txt)
{
string r = "[\x00-\x08\x0B\x0C\x0E-\x1F\x26]";
return Regex.Replace(txt, r, "", RegexOptions.Compiled);
}
}
#endregion
#region Splash Reader
public static class SplashReader
{
private static string RandomSplash()
{
string[] splashes = File.ReadAllLines(Directories.ConfigDir + "\\splashes.txt");
string splash = "";
try
{
splash = splashes[new CryptoRandom().Next(0, splashes.Length - 1)];
}
catch (Exception)
{
try
{
splash = splashes[0];
}
catch (Exception)
{
splash = "missingno";
return splash;
}
}
CryptoRandom random = new CryptoRandom();
string formattedsplash = splash
.Replace("%name%", GlobalVars.UserConfiguration.PlayerName)
.Replace("%nextversion%", (Convert.ToDouble(GlobalVars.ProgramInformation.Branch) + 0.1).ToString())
.Replace("%randomtext%", SecurityFuncs.RandomString(random.Next(2, 32)));
return formattedsplash;
}
public static string GetSplash()
{
DateTime today = DateTime.Now;
string splash = "";
switch (today)
{
case DateTime christmaseve when christmaseve.Month.Equals(12) && christmaseve.Day.Equals(24):
case DateTime christmasday when christmasday.Month.Equals(12) && christmasday.Day.Equals(25):
splash = "Merry Christmas!";
break;
case DateTime newyearseve when newyearseve.Month.Equals(12) && newyearseve.Day.Equals(31):
case DateTime newyearsday when newyearsday.Month.Equals(1) && newyearsday.Day.Equals(1):
splash = "Happy New Year!";
break;
case DateTime halloween when halloween.Month.Equals(10) && halloween.Day.Equals(31):
splash = "Happy Halloween!";
break;
case DateTime bitlbirthday when bitlbirthday.Month.Equals(6) && bitlbirthday.Day.Equals(10):
splash = "Happy Birthday, Bitl!";
break;
case DateTime robloxbirthday when robloxbirthday.Month.Equals(8) && robloxbirthday.Day.Equals(27):
splash = "Happy Birthday, ROBLOX!";
break;
case DateTime novetusbirthday when novetusbirthday.Month.Equals(10) && novetusbirthday.Day.Equals(27):
splash = "Happy Birthday, Novetus!";
break;
case DateTime leiferikson when leiferikson.Month.Equals(10) && leiferikson.Day.Equals(9):
splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!";
break;
case DateTime smokeweedeveryday when smokeweedeveryday.Month.Equals(4) && smokeweedeveryday.Day.Equals(20):
CryptoRandom random = new CryptoRandom();
if (random.Next(0, 1) == 1)
{
splash = "smoke weed every day";
}
else
{
splash = "4/20 lol";
}
break;
case DateTime erikismyhero when erikismyhero.Month.Equals(2) && erikismyhero.Day.Equals(11):
splash = "RIP Erik Cassel";
break;
default:
splash = RandomSplash();
break;
}
return splash;
}
}
#endregion
} }

View File

@ -250,7 +250,7 @@ namespace NovetusLauncher
"Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(),
"Map: " + GlobalVars.UserConfiguration.Map, "Map: " + GlobalVars.UserConfiguration.Map,
"Players: " + GlobalVars.UserConfiguration.PlayerLimit, "Players: " + GlobalVars.UserConfiguration.PlayerLimit,
"Version: Novetus " + GlobalVars.Version, "Version: Novetus " + GlobalVars.ProgramInformation.Version,
"Online URI Link:", "Online URI Link:",
URI, URI,
"Local URI Link:", "Local URI Link:",
@ -405,8 +405,8 @@ namespace NovetusLauncher
void MainFormLoad(object sender, EventArgs e) void MainFormLoad(object sender, EventArgs e)
{ {
Text = "Novetus " + GlobalVars.Version; Text = "Novetus " + GlobalVars.ProgramInformation.Version;
ConsolePrint("Novetus version " + GlobalVars.Version + " loaded. Initializing config.", 4); ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4);
ConsolePrint("Novetus path: " + Directories.BasePath, 4); ConsolePrint("Novetus path: " + Directories.BasePath, 4);
if (File.Exists(Directories.RootPath + "\\changelog.txt")) if (File.Exists(Directories.RootPath + "\\changelog.txt"))
{ {
@ -474,7 +474,7 @@ namespace NovetusLauncher
label8.Text = Application.ProductVersion; label8.Text = Application.ProductVersion;
GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
label11.Text = GlobalVars.Version; label11.Text = GlobalVars.ProgramInformation.Version;
label12.Text = SplashReader.GetSplash(); label12.Text = SplashReader.GetSplash();
LocalVars.prevsplash = label12.Text; LocalVars.prevsplash = label12.Text;
@ -520,8 +520,8 @@ namespace NovetusLauncher
label38.Text = GlobalVars.UserConfiguration.RobloxPort.ToString(); label38.Text = GlobalVars.UserConfiguration.RobloxPort.ToString();
checkBox2.Checked = GlobalVars.UserConfiguration.DiscordPresence; checkBox2.Checked = GlobalVars.UserConfiguration.DiscordPresence;
checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; checkBox5.Checked = GlobalVars.UserConfiguration.ReShade;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay; checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode; checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode;
switch (GlobalVars.UserConfiguration.GraphicsMode) switch (GlobalVars.UserConfiguration.GraphicsMode)
{ {
@ -578,7 +578,7 @@ namespace NovetusLauncher
{ {
ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2);
MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error);
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
ReadClientValues(ClientName); ReadClientValues(ClientName);
} }
else else
@ -1273,7 +1273,7 @@ namespace NovetusLauncher
{ {
Process process = new Process(); Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo(); ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = Directories.ClientDir + @"\\" + GlobalVars.RegisterClient1 + @"\\RobloxApp_studio.exe"; startInfo.FileName = Directories.ClientDir + @"\\" + GlobalVars.ProgramInformation.RegisterClient1 + @"\\RobloxApp_studio.exe";
startInfo.Arguments = "/regserver"; startInfo.Arguments = "/regserver";
startInfo.Verb = "runas"; startInfo.Verb = "runas";
process.StartInfo = startInfo; process.StartInfo = startInfo;
@ -1281,7 +1281,7 @@ namespace NovetusLauncher
Process process2 = new Process(); Process process2 = new Process();
ProcessStartInfo startInfo2 = new ProcessStartInfo(); ProcessStartInfo startInfo2 = new ProcessStartInfo();
startInfo2.FileName = Directories.ClientDir + @"\\" + GlobalVars.RegisterClient2 + @"\\RobloxApp_studio.exe"; startInfo2.FileName = Directories.ClientDir + @"\\" + GlobalVars.ProgramInformation.RegisterClient2 + @"\\RobloxApp_studio.exe";
startInfo2.Arguments = "/regserver"; startInfo2.Arguments = "/regserver";
startInfo2.Verb = "runas"; startInfo2.Verb = "runas";
process2.StartInfo = startInfo2; process2.StartInfo = startInfo2;
@ -1528,12 +1528,12 @@ namespace NovetusLauncher
private void checkBox6_CheckedChanged(object sender, EventArgs e) private void checkBox6_CheckedChanged(object sender, EventArgs e)
{ {
GlobalVars.ReShadeFPSDisplay = checkBox6.Checked; GlobalVars.UserConfiguration.ReShadeFPSDisplay = checkBox6.Checked;
} }
private void checkBox7_CheckedChanged(object sender, EventArgs e) private void checkBox7_CheckedChanged(object sender, EventArgs e)
{ {
GlobalVars.ReShadePerformanceMode = checkBox7.Checked; GlobalVars.UserConfiguration.ReShadePerformanceMode = checkBox7.Checked;
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
@ -1574,7 +1574,7 @@ namespace NovetusLauncher
private void button36_Click(object sender, EventArgs e) private void button36_Click(object sender, EventArgs e)
{ {
GlobalVars.UserConfiguration.OldLayout = true; GlobalVars.UserConfiguration.LauncherLayout = LauncherLayout.Compact;
WriteConfigValues(); WriteConfigValues();
Application.Restart(); Application.Restart();
} }

View File

@ -249,7 +249,7 @@ namespace NovetusLauncher
"Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(),
"Map: " + GlobalVars.UserConfiguration.Map, "Map: " + GlobalVars.UserConfiguration.Map,
"Players: " + GlobalVars.UserConfiguration.PlayerLimit, "Players: " + GlobalVars.UserConfiguration.PlayerLimit,
"Version: Novetus " + GlobalVars.Version, "Version: Novetus " + GlobalVars.ProgramInformation.Version,
"Online URI Link:", "Online URI Link:",
URI, URI,
"Local URI Link:", "Local URI Link:",
@ -404,8 +404,8 @@ namespace NovetusLauncher
void MainFormLoad(object sender, EventArgs e) void MainFormLoad(object sender, EventArgs e)
{ {
Text = "Novetus " + GlobalVars.Version; Text = "Novetus " + GlobalVars.ProgramInformation.Version;
ConsolePrint("Novetus version " + GlobalVars.Version + " loaded. Initializing config.", 4); ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4);
ConsolePrint("Novetus path: " + Directories.BasePath, 4); ConsolePrint("Novetus path: " + Directories.BasePath, 4);
if (File.Exists(Directories.RootPath + "\\changelog.txt")) if (File.Exists(Directories.RootPath + "\\changelog.txt"))
{ {
@ -473,7 +473,7 @@ namespace NovetusLauncher
label8.Text = Application.ProductVersion; label8.Text = Application.ProductVersion;
GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
label11.Text = GlobalVars.Version; label11.Text = GlobalVars.ProgramInformation.Version;
label12.Text = SplashReader.GetSplash(); label12.Text = SplashReader.GetSplash();
LocalVars.prevsplash = label12.Text; LocalVars.prevsplash = label12.Text;
@ -543,7 +543,7 @@ namespace NovetusLauncher
{ {
ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2);
MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error);
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
ReadClientValues(ClientName); ReadClientValues(ClientName);
} }
else else
@ -1238,7 +1238,7 @@ namespace NovetusLauncher
{ {
Process process = new Process(); Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo(); ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = Directories.ClientDir + @"\\" + GlobalVars.RegisterClient1 + @"\\RobloxApp_studio.exe"; startInfo.FileName = Directories.ClientDir + @"\\" + GlobalVars.ProgramInformation.RegisterClient1 + @"\\RobloxApp_studio.exe";
startInfo.Arguments = "/regserver"; startInfo.Arguments = "/regserver";
startInfo.Verb = "runas"; startInfo.Verb = "runas";
process.StartInfo = startInfo; process.StartInfo = startInfo;
@ -1246,7 +1246,7 @@ namespace NovetusLauncher
Process process2 = new Process(); Process process2 = new Process();
ProcessStartInfo startInfo2 = new ProcessStartInfo(); ProcessStartInfo startInfo2 = new ProcessStartInfo();
startInfo2.FileName = Directories.ClientDir + @"\\" + GlobalVars.RegisterClient2 + @"\\RobloxApp_studio.exe"; startInfo2.FileName = Directories.ClientDir + @"\\" + GlobalVars.ProgramInformation.RegisterClient2 + @"\\RobloxApp_studio.exe";
startInfo2.Arguments = "/regserver"; startInfo2.Arguments = "/regserver";
startInfo2.Verb = "runas"; startInfo2.Verb = "runas";
process2.StartInfo = startInfo2; process2.StartInfo = startInfo2;
@ -1516,7 +1516,7 @@ namespace NovetusLauncher
private void button36_Click(object sender, EventArgs e) private void button36_Click(object sender, EventArgs e)
{ {
GlobalVars.UserConfiguration.OldLayout = false; GlobalVars.UserConfiguration.LauncherLayout = LauncherLayout.Extended;
WriteConfigValues(); WriteConfigValues();
Application.Restart(); Application.Restart();
} }

View File

@ -20,8 +20,8 @@ namespace NovetusLauncher
{ {
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false); LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false);
checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; checkBox5.Checked = GlobalVars.UserConfiguration.ReShade;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay; checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode; checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode;
switch (GlobalVars.UserConfiguration.GraphicsMode) switch (GlobalVars.UserConfiguration.GraphicsMode)
{ {
@ -62,12 +62,12 @@ namespace NovetusLauncher
private void checkBox6_CheckedChanged(object sender, EventArgs e) private void checkBox6_CheckedChanged(object sender, EventArgs e)
{ {
GlobalVars.ReShadeFPSDisplay = checkBox6.Checked; GlobalVars.UserConfiguration.ReShadeFPSDisplay = checkBox6.Checked;
} }
private void checkBox7_CheckedChanged(object sender, EventArgs e) private void checkBox7_CheckedChanged(object sender, EventArgs e)
{ {
GlobalVars.ReShadePerformanceMode = checkBox7.Checked; GlobalVars.UserConfiguration.ReShadePerformanceMode = checkBox7.Checked;
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -34,13 +34,15 @@ namespace NovetusLauncher
{ {
//read from our config to determine which clients to load. //read from our config to determine which clients to load.
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false); LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false);
if (GlobalVars.UserConfiguration.OldLayout == false)
{ switch (GlobalVars.UserConfiguration.LauncherLayout)
Application.Run(new MainForm());
}
else
{ {
Application.Run(new MainForm_legacy()); case LauncherLayout.Compact:
Application.Run(new MainForm_legacy());
break;
default:
Application.Run(new MainForm());
break;
} }
} }
else else

View File

@ -299,132 +299,132 @@ namespace NovetusLauncher
} }
//meshes //meshes
worker.ReportProgress(5); worker.ReportProgress(5);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Fonts); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Fonts);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Fonts, 1, 1, 1, 1); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1);
//skybox //skybox
worker.ReportProgress(10); worker.ReportProgress(10);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 1, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 2, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 3, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 4, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 5, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0);
//decal //decal
worker.ReportProgress(15); worker.ReportProgress(15);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Decal); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Decal);
//texture //texture
worker.ReportProgress(20); worker.ReportProgress(20);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Texture); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Texture);
//tools and hopperbin //tools and hopperbin
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Tool); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Tool);
worker.ReportProgress(30); worker.ReportProgress(30);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.HopperBin); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.HopperBin);
//sound //sound
worker.ReportProgress(40); worker.ReportProgress(40);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sound); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sound);
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ImageLabel); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ImageLabel);
//clothing //clothing
worker.ReportProgress(60); worker.ReportProgress(60);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Shirt); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Shirt);
worker.ReportProgress(65); worker.ReportProgress(65);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ShirtGraphic); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ShirtGraphic);
worker.ReportProgress(70); worker.ReportProgress(70);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Pants); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Pants);
//scripts //scripts
worker.ReportProgress(80); worker.ReportProgress(80);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Script); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Script);
worker.ReportProgress(90); worker.ReportProgress(90);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.RBXM: case RobloxFileType.RBXM:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Fonts); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Fonts);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Fonts, 1, 1, 1, 1); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1);
//skybox //skybox
worker.ReportProgress(10); worker.ReportProgress(10);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 1, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 2, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 3, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 4, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sky, 5, 0, 0, 0); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0);
//decal //decal
worker.ReportProgress(15); worker.ReportProgress(15);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Decal); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Decal);
//texture //texture
worker.ReportProgress(20); worker.ReportProgress(20);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Texture); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Texture);
//tools and hopperbin //tools and hopperbin
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Tool); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Tool);
worker.ReportProgress(30); worker.ReportProgress(30);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.HopperBin); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.HopperBin);
//sound //sound
worker.ReportProgress(40); worker.ReportProgress(40);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Sound); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Sound);
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ImageLabel); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ImageLabel);
//clothing //clothing
worker.ReportProgress(60); worker.ReportProgress(60);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Shirt); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Shirt);
worker.ReportProgress(65); worker.ReportProgress(65);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ShirtGraphic); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ShirtGraphic);
worker.ReportProgress(70); worker.ReportProgress(70);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Pants); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Pants);
//scripts //scripts
worker.ReportProgress(80); worker.ReportProgress(80);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Script); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Script);
worker.ReportProgress(90); worker.ReportProgress(90);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Hat: case RobloxFileType.Hat:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemHatFonts, name, meshname); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHatFonts, name, meshname);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemHatFonts, 1, 1, 1, 1, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHatFonts, 1, 1, 1, 1, name);
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemHatSound); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHatSound);
//scripts //scripts
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.Script); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Script);
worker.ReportProgress(75); worker.ReportProgress(75);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.LocalScript); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.LocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Head: case RobloxFileType.Head:
//meshes //meshes
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemHeadFonts, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, name);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemHeadFonts, 1, 1, 1, 1, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, 1, 1, 1, 1, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Face: case RobloxFileType.Face:
//decal //decal
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemFaceTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemFaceTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.TShirt: case RobloxFileType.TShirt:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemTShirtTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemTShirtTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Shirt: case RobloxFileType.Shirt:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemShirtTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemShirtTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Pants: case RobloxFileType.Pants:
//texture //texture
worker.ReportProgress(0); worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxTypeDefs.ItemPantsTexture, name); RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemPantsTexture, name);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
default: default:

View File

@ -265,8 +265,7 @@ namespace NovetusLauncher
checkBox4.Checked = Locked; checkBox4.Checked = Locked;
} }
bool bline1 = Convert.ToBoolean(usesplayername); loadedClientInfo.UsesPlayerName = Convert.ToBoolean(usesplayername);
loadedClientInfo.UsesPlayerName = bline1;
bool bline2 = Convert.ToBoolean(usesid); bool bline2 = Convert.ToBoolean(usesid);
loadedClientInfo.UsesID = bline2; loadedClientInfo.UsesID = bline2;

View File

@ -34,8 +34,8 @@ namespace NovetusLauncher
private void NovetusSDK_Load(object sender, EventArgs e) private void NovetusSDK_Load(object sender, EventArgs e)
{ {
Text = "Novetus SDK " + GlobalVars.Version; Text = "Novetus SDK " + GlobalVars.ProgramInformation.Version;
label1.Text = GlobalVars.Version; label1.Text = GlobalVars.ProgramInformation.Version;
} }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) private void listBox1_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -214,7 +214,7 @@ namespace NovetusURI
if (!File.Exists(clientpath)) if (!File.Exists(clientpath))
{ {
MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus Launcher - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", "Novetus Launcher - Error while loading client", MessageBoxButtons.OK, MessageBoxIcon.Error);
GlobalVars.UserConfiguration.SelectedClient = GlobalVars.DefaultClient; GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient;
ReadClientValues(ClientName); ReadClientValues(ClientName);
} }
else else