move InstallClientSideLua Function
This commit is contained in:
@@ -1256,7 +1256,35 @@ namespace Barotrauma
|
||||
|
||||
commands.Add(new Command("install_cl_lua", "Installs client-side lua into your client.", (string[] args) =>
|
||||
{
|
||||
LuaSetup.InstallClientSideLua();
|
||||
if (!File.Exists("Mods/LuaForBarotrauma/clientside_files.zip"))
|
||||
{
|
||||
GameMain.Server.SendChatMessage("clientside_files.zip doesn't exist, Github version?", ChatMessageType.ServerMessageBox);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
System.IO.Compression.ZipFile.ExtractToDirectory("Mods/LuaForBarotrauma/clientside_files.zip", ".", true);
|
||||
|
||||
System.IO.File.Move("Barotrauma.dll", "Barotrauma.dll.temp", true);
|
||||
System.IO.File.Move("Barotrauma.deps.json", "Barotrauma.deps.json.temp", true);
|
||||
|
||||
System.IO.File.Move("Barotrauma.dll.original", "Barotrauma.dll");
|
||||
System.IO.File.Move("Barotrauma.deps.json.original", "Barotrauma.deps.json");
|
||||
|
||||
System.IO.File.Move("Barotrauma.dll.temp", "Barotrauma.dll.original", true);
|
||||
System.IO.File.Move("Barotrauma.deps.json.temp", "Barotrauma.deps.json.original", true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GameMain.Lua.HandleLuaException(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GameMain.Server.SendChatMessage("Client-Side Lua installed, restart your game to apply changes.", ChatMessageType.ServerMessageBox);
|
||||
}));
|
||||
|
||||
commands.Add(new Command("randomizeseed", "randomizeseed: Toggles level seed randomization on/off.", (string[] args) =>
|
||||
|
||||
@@ -222,43 +222,6 @@ namespace Barotrauma
|
||||
return value * 2;
|
||||
}
|
||||
|
||||
|
||||
#if SERVER
|
||||
public static void InstallClientSideLua()
|
||||
{
|
||||
if (!File.Exists("Mods/LuaForBarotrauma/clientside_files.zip"))
|
||||
{
|
||||
GameMain.Server.SendChatMessage("clientside_files.zip doesn't exist, Github version?", ChatMessageType.ServerMessageBox);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
ZipFile.ExtractToDirectory("Mods/LuaForBarotrauma/clientside_files.zip", ".", true);
|
||||
|
||||
File.Move("Barotrauma.dll", "Barotrauma.dll.temp", true);
|
||||
File.Move("Barotrauma.deps.json", "Barotrauma.deps.json.temp", true);
|
||||
|
||||
File.Move("Barotrauma.dll.original", "Barotrauma.dll");
|
||||
File.Move("Barotrauma.deps.json.original", "Barotrauma.deps.json");
|
||||
|
||||
File.Move("Barotrauma.dll.temp", "Barotrauma.dll.original", true);
|
||||
File.Move("Barotrauma.deps.json.temp", "Barotrauma.deps.json.original", true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LuaSetup.luaSetup.HandleLuaException(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GameMain.Server.SendChatMessage("Client-Side Lua installed, restart your game to apply changes.", ChatMessageType.ServerMessageBox);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (harmony != null)
|
||||
|
||||
Reference in New Issue
Block a user