Skip to content

Commit 252c32b

Browse files
committed
refactor: Clean up unused code (#8)
Closes UTY-27
1 parent f6307e7 commit 252c32b

26 files changed

Lines changed: 213 additions & 465 deletions

Assets/Rivet/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MARK: Runner
2-
FROM ubuntu:22.04
2+
FROM debian:12
33
WORKDIR /app
44

55
# Install necessary libraries for Unity
@@ -10,15 +10,13 @@ RUN apt-get update && apt-get install -y \
1010
&& useradd -ms /bin/bash rivet
1111

1212
# Copy the precompiled Unity server files
13-
COPY ./Builds/Game /app/Game
14-
# COPY ./Builds/Game_BurstDebugInformation_DoNotShip /app/Game_BurstDebugInformation_DoNotShip
15-
# COPY ./Builds/Game_Data /app/Game_Data
16-
# COPY ./Builds/UnityPlayer.so /app/UnityPlayer.so
13+
COPY builds/LinuxServer/ /app
14+
RUN ls /app && chmod +x /app/LinuxServer.x86_64
1715

1816
# Change to user rivet
1917
USER rivet
2018

2119
ENV UNITY_SERVER=1
2220

2321
# Run the server
24-
ENTRYPOINT ["./Game", "-batchmode", "-nographics"]
22+
ENTRYPOINT ["/app/LinuxServer.x86_64", "-batchmode", "-nographics"]

Assets/Rivet/Editor/CoroutineUtility.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

Assets/Rivet/Editor/CoroutineUtility.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Assets/Rivet/Editor/EditorCoroutine.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Assets/Rivet/Editor/EditorCoroutine.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Assets/Rivet/Editor/Images.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Rivet/Editor/Images/icon-text-black.svg.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Rivet/Editor/Images/icon-text-white.svg.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Rivet/Editor/RivetCLI.cs

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
4-
using System.Data.Common;
5-
using System.Diagnostics;
61
using System.IO;
7-
using System.Runtime.CompilerServices;
8-
using System.Threading.Tasks;
92
using Newtonsoft.Json.Linq;
10-
using UnityEngine;
113

124
public static class RivetCLI
135
{
@@ -38,10 +30,7 @@ public static bool CLIInstalled()
3830
return false;
3931
}
4032
return true;
41-
case ErrorResult<JObject> _:
42-
return false;
4333
default:
44-
UnityEngine.Debug.Log("Got different result type");
4534
return false;
4635
}
4736
}
@@ -53,33 +42,28 @@ public static Result<JObject> RunCommand(params string[] args)
5342

5443
public static string GetBinDir()
5544
{
56-
string homePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
45+
string homePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile);
5746
return Path.Combine(homePath, ".rivet", REQUIRED_RIVET_CLI_VERSION, "bin");
5847
}
5948

6049
public static string GetRivetCLIPath()
6150
{
62-
// // Assuming _RivetEditorSettings is a static class with a method GetSetting
63-
// string cliPath = _RivetEditorSettings.GetSetting(RIVET_CLI_PATH_SETTING);
64-
// if (!string.IsNullOrEmpty(cliPath))
65-
// {
66-
// return cliPath;
67-
// }
68-
6951
return Path.Combine(GetBinDir(), "rivet");
7052
}
7153

7254
public static Result<JObject> RunRivetCLI(params string[] args)
7355
{
74-
UnityEngine.Debug.Log($"Running Rivet CLI: {GetRivetCLIPath()} {string.Join(" ", args)}");
56+
// TODO: Turn this on if debug is enabled
57+
// UnityEngine.Debug.Log($"Running Rivet CLI: {GetRivetCLIPath()} {string.Join(" ", args)}");
7558

7659
if (!File.Exists(GetRivetCLIPath()))
7760
{
78-
UnityEngine.Debug.LogError("File does not exist: " + GetRivetCLIPath());
61+
// TODO: Turn this on if debug is enabled
62+
// UnityEngine.Debug.LogError("File does not exist: " + GetRivetCLIPath());
7963
return new ErrorResult<JObject>("File does not exist: " + GetRivetCLIPath());
8064
}
8165

82-
var startInfo = new ProcessStartInfo
66+
var startInfo = new System.Diagnostics.ProcessStartInfo
8367
{
8468
FileName = GetRivetCLIPath(),
8569
Arguments = string.Join(" ", args),
@@ -90,21 +74,19 @@ public static Result<JObject> RunRivetCLI(params string[] args)
9074

9175
try
9276
{
93-
using (var process = Process.Start(startInfo))
94-
{
95-
var output = process.StandardOutput.ReadToEnd();
96-
process.WaitForExit();
77+
using var process = System.Diagnostics.Process.Start(startInfo);
78+
var output = process.StandardOutput.ReadToEnd();
79+
process.WaitForExit();
9780

98-
return new SuccessResult<JObject>(JObject.Parse(output));
99-
}
81+
return new SuccessResult<JObject>(JObject.Parse(output));
10082
}
101-
catch (Exception ex)
83+
catch (System.Exception ex)
10284
{
10385
return new ErrorResult<JObject>("Failed to start process: " + ex.Message);
10486
}
10587
}
10688

107-
public static Result<string> _install()
89+
public static Result<string> Install()
10890
{
10991
string bin_dir = GetBinDir();
11092

Assets/Rivet/Editor/RivetPlugin.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
#define IN_EDITOR
2-
31
using UnityEngine;
42
using UnityEditor;
5-
using System.Diagnostics;
6-
using System.IO;
7-
using Newtonsoft.Json.Linq;
83

94
public static class ExtensionData
105
{
@@ -59,6 +54,15 @@ public void TransitionToState(IState newState)
5954

6055
void OnGUI()
6156
{
57+
// Draw the global Rivet buttons
58+
59+
// Links
60+
GUILayout.BeginHorizontal();
61+
if (GUILayout.Button("Hub")) Application.OpenURL("https://hub.rivet.gg/");
62+
if (GUILayout.Button("Docs")) Application.OpenURL("https://rivet.gg/docs");
63+
if (GUILayout.Button("Discord")) Application.OpenURL("https://rivet.gg/discord");
64+
GUILayout.EndHorizontal();
65+
6266
// Call the OnGUI method of the current state
6367
currentState.OnGUI();
6468
}

0 commit comments

Comments
 (0)