Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Assets/Rivet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MARK: Runner
FROM ubuntu:22.04
FROM debian:12
WORKDIR /app

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

# Copy the precompiled Unity server files
COPY ./Builds/Game /app/Game
# COPY ./Builds/Game_BurstDebugInformation_DoNotShip /app/Game_BurstDebugInformation_DoNotShip
# COPY ./Builds/Game_Data /app/Game_Data
# COPY ./Builds/UnityPlayer.so /app/UnityPlayer.so
COPY builds/LinuxServer/ /app
RUN ls /app && chmod +x /app/LinuxServer.x86_64

# Change to user rivet
USER rivet

ENV UNITY_SERVER=1

# Run the server
ENTRYPOINT ["./Game", "-batchmode", "-nographics"]
ENTRYPOINT ["/app/LinuxServer.x86_64", "-batchmode", "-nographics"]
25 changes: 0 additions & 25 deletions Assets/Rivet/Editor/CoroutineUtility.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Rivet/Editor/CoroutineUtility.cs.meta

This file was deleted.

36 changes: 0 additions & 36 deletions Assets/Rivet/Editor/EditorCoroutine.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Rivet/Editor/EditorCoroutine.cs.meta

This file was deleted.

8 changes: 8 additions & 0 deletions Assets/Rivet/Editor/Images.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Assets/Rivet/Editor/Images/icon-text-black.svg.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Assets/Rivet/Editor/Images/icon-text-white.svg.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 12 additions & 30 deletions Assets/Rivet/Editor/RivetCLI.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Common;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using UnityEngine;

public static class RivetCLI
{
Expand Down Expand Up @@ -38,10 +30,7 @@ public static bool CLIInstalled()
return false;
}
return true;
case ErrorResult<JObject> _:
return false;
default:
UnityEngine.Debug.Log("Got different result type");
return false;
}
}
Expand All @@ -53,33 +42,28 @@ public static Result<JObject> RunCommand(params string[] args)

public static string GetBinDir()
{
string homePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string homePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile);
return Path.Combine(homePath, ".rivet", REQUIRED_RIVET_CLI_VERSION, "bin");
}

public static string GetRivetCLIPath()
{
// // Assuming _RivetEditorSettings is a static class with a method GetSetting
// string cliPath = _RivetEditorSettings.GetSetting(RIVET_CLI_PATH_SETTING);
// if (!string.IsNullOrEmpty(cliPath))
// {
// return cliPath;
// }

return Path.Combine(GetBinDir(), "rivet");
}

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

if (!File.Exists(GetRivetCLIPath()))
{
UnityEngine.Debug.LogError("File does not exist: " + GetRivetCLIPath());
// TODO: Turn this on if debug is enabled
// UnityEngine.Debug.LogError("File does not exist: " + GetRivetCLIPath());
return new ErrorResult<JObject>("File does not exist: " + GetRivetCLIPath());
}

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

try
{
using (var process = Process.Start(startInfo))
{
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
using var process = System.Diagnostics.Process.Start(startInfo);
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();

return new SuccessResult<JObject>(JObject.Parse(output));
}
return new SuccessResult<JObject>(JObject.Parse(output));
}
catch (Exception ex)
catch (System.Exception ex)
{
return new ErrorResult<JObject>("Failed to start process: " + ex.Message);
}
}

public static Result<string> _install()
public static Result<string> Install()
{
string bin_dir = GetBinDir();

Expand Down
14 changes: 9 additions & 5 deletions Assets/Rivet/Editor/RivetPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#define IN_EDITOR

using UnityEngine;
using UnityEditor;
using System.Diagnostics;
using System.IO;
using Newtonsoft.Json.Linq;

public static class ExtensionData
{
Expand Down Expand Up @@ -59,6 +54,15 @@ public void TransitionToState(IState newState)

void OnGUI()
{
// Draw the global Rivet buttons

// Links
GUILayout.BeginHorizontal();
if (GUILayout.Button("Hub")) Application.OpenURL("https://hub.rivet.gg/");
if (GUILayout.Button("Docs")) Application.OpenURL("https://rivet.gg/docs");
if (GUILayout.Button("Discord")) Application.OpenURL("https://rivet.gg/discord");
GUILayout.EndHorizontal();

// Call the OnGUI method of the current state
currentState.OnGUI();
}
Expand Down
42 changes: 0 additions & 42 deletions Assets/Rivet/Editor/RivetThread.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Rivet/Editor/RivetThread.cs.meta

This file was deleted.

37 changes: 1 addition & 36 deletions Assets/Rivet/Editor/Windows/Installer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using UnityEngine;
using UnityEditor;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Collections;
using Newtonsoft.Json.Linq;

namespace Rivet
{
Expand All @@ -20,36 +15,8 @@ public Installer()

public void OnEnter(RivetPluginWindow pluginWindow)
{
new System.Threading.Thread(() =>
{

// var api_address = apiEndpointLineEdit.Text; // replace with your actual control
var api_address = "https://api.rivet.gg";

var getLinkResult = RivetCLI.RunCommand(
"--api-endpoint",
api_address,
"sidekick",
"get-namespace-development-token",
"--namespace",
"staging"
);

switch (getLinkResult)
{
case SuccessResult<JObject> successResult:
var token = successResult.Data["Ok"]["token"].ToString();
break;
case ErrorResult<JObject> errorResult:
UnityEngine.Debug.LogError(errorResult.Message);
break;
}

}).Start();

this.window = pluginWindow;


// Prepare the installer
installLabelText = ReplacePlaceholders("%%version%% %%bin_dir%%");
installButtonEnabled = false;
Expand Down Expand Up @@ -79,9 +46,7 @@ public void OnGUI()
// Handle the Install button click
new System.Threading.Thread(() =>
{
// window.TransitionToState(new LoginState(window));
// return;
var result = RivetCLI._install();
var result = RivetCLI.Install();

switch (result)
{
Expand Down
Empty file.
11 changes: 0 additions & 11 deletions Assets/Rivet/Editor/Windows/Loading.cs.meta

This file was deleted.

1 change: 0 additions & 1 deletion Assets/Rivet/Editor/Windows/Login.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using UnityEngine;
using UnityEditor;
using System.Collections;
using Newtonsoft.Json.Linq;

namespace Rivet
Expand Down
Loading