removed REALLY bad code. What the FUCK?!?
This commit is contained in:
parent
5e38a35d5a
commit
7706658f9c
|
|
@ -187,6 +187,12 @@ namespace NovetusCMD
|
|||
{
|
||||
WriteConfigValues();
|
||||
}
|
||||
|
||||
if (GlobalVars.RequestToOutputInfo)
|
||||
{
|
||||
GlobalFuncs.FixedFileDelete(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName);
|
||||
}
|
||||
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
|
|
@ -269,7 +275,7 @@ namespace NovetusCMD
|
|||
}
|
||||
else
|
||||
{
|
||||
GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the default map.", 4);
|
||||
GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the map defined in the INI file.", 4);
|
||||
}
|
||||
|
||||
if (CommandLine["client"] != null)
|
||||
|
|
@ -279,7 +285,7 @@ namespace NovetusCMD
|
|||
}
|
||||
else
|
||||
{
|
||||
GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the default client.", 4);
|
||||
GlobalFuncs.ConsolePrint("NovetusCMD will launch the server with the client defined in the INI file.", 4);
|
||||
}
|
||||
|
||||
if (CommandLine["port"] != null)
|
||||
|
|
|
|||
|
|
@ -2261,19 +2261,19 @@ public class GlobalFuncs
|
|||
if (GlobalVars.RequestToOutputInfo)
|
||||
{
|
||||
string[] lines1 = {
|
||||
SecurityFuncs.Base64Encode((!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP)),
|
||||
SecurityFuncs.Base64Encode(!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient)
|
||||
};
|
||||
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1, true));
|
||||
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
|
||||
string[] lines2 = {
|
||||
SecurityFuncs.Base64Encode("localhost"),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()),
|
||||
SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient)
|
||||
};
|
||||
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2, true));
|
||||
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
|
||||
|
||||
string text = MultiLine(
|
||||
string[] text = {
|
||||
"Process ID: " + (GlobalVars.ProcessID == 0 ? "N/A" : GlobalVars.ProcessID.ToString()),
|
||||
"Don't copy the Process ID when sharing the server.",
|
||||
"--------------------",
|
||||
|
|
@ -2288,10 +2288,11 @@ public class GlobalFuncs
|
|||
URI,
|
||||
"Local URI Link:",
|
||||
URI2
|
||||
);
|
||||
};
|
||||
|
||||
File.WriteAllText(GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName, GlobalFuncs.RemoveEmptyLines(text));
|
||||
GlobalFuncs.ConsolePrint("Server Information sent to file " + GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName, 4);
|
||||
string txt = GlobalPaths.BasePath + "\\" + GlobalVars.ServerInfoFileName;
|
||||
File.WriteAllLines(txt, text);
|
||||
ConsolePrint("Server Information sent to file " + txt, 4);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -2330,16 +2331,6 @@ public class GlobalFuncs
|
|||
}*/
|
||||
}
|
||||
|
||||
public static string MultiLine(params string[] args)
|
||||
{
|
||||
return string.Join(Environment.NewLine, args);
|
||||
}
|
||||
|
||||
public static string RemoveEmptyLines(string lines)
|
||||
{
|
||||
return Regex.Replace(lines, @"^\s*$\n|\r", string.Empty, RegexOptions.Multiline).TrimEnd();
|
||||
}
|
||||
|
||||
// Credit to Carrot for the original code. Rewote it to be smaller.
|
||||
public static string CryptStringWithByte(string word)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,18 +103,15 @@ public class ScriptFuncs
|
|||
|
||||
public static void GenerateScriptForClient(string ClientName, ScriptType type)
|
||||
{
|
||||
string code = GlobalFuncs.MultiLine(
|
||||
string[] code = {
|
||||
"--Load Script",
|
||||
//scriptcontents,
|
||||
(GlobalVars.SelectedClientInfo.SeperateFolders ?
|
||||
"dofile('rbxasset://../../content/scripts/" + GlobalPaths.ScriptName + ".lua')" :
|
||||
(GlobalVars.SelectedClientInfo.SeperateFolders ? "" +
|
||||
"dofile('rbxasset://../../content/scripts/" + GlobalPaths.ScriptName + ".lua')" :
|
||||
"dofile('rbxasset://scripts/" + GlobalPaths.ScriptName + ".lua')"),
|
||||
GetScriptFuncForType(type),
|
||||
!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? "dofile('" + GlobalPaths.AddonScriptPath + "')" : ""
|
||||
);
|
||||
|
||||
List<string> list = new List<string>(Regex.Split(code, Environment.NewLine));
|
||||
string[] convertedList = list.ToArray();
|
||||
};
|
||||
|
||||
if (GlobalVars.SelectedClientInfo.SeperateFolders)
|
||||
{
|
||||
|
|
@ -129,7 +126,7 @@ public class ScriptFuncs
|
|||
(GlobalVars.SelectedClientInfo.SeperateFolders ?
|
||||
GlobalPaths.ClientDir + @"\\" + ClientName + @"\\" + GlobalFuncs.GetClientSeperateFolderName(type) + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua":
|
||||
GlobalPaths.ClientDir + @"\\" + ClientName + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua"),
|
||||
convertedList);
|
||||
code);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in New Issue