Version 0.2

This commit is contained in:
recroom2016
2022-02-19 16:02:47 -05:00
parent bc27480295
commit b01c03d0b9
7 changed files with 62 additions and 36 deletions

View File

@@ -52,7 +52,7 @@ namespace api
return JsonConvert.SerializeObject(new Config2 return JsonConvert.SerializeObject(new Config2
{ {
MessageOfTheDay = "Default MOTD", MessageOfTheDay = "Default MOTD",
CdnBaseUri = "http://img.rec.net/", CdnBaseUri = "http://localhost:20182/",
LevelProgressionMaps = new List<LevelProgressionEntry> LevelProgressionMaps = new List<LevelProgressionEntry>
{ {
new LevelProgressionEntry new LevelProgressionEntry

View File

@@ -2,7 +2,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using api; using api;
using server; using server;
using System.IO;
namespace gamesessions2018 namespace gamesessions2018
{ {
// Token: 0x02000020 RID: 32 // Token: 0x02000020 RID: 32
@@ -11,14 +11,18 @@ namespace gamesessions2018
// Token: 0x060000BE RID: 190 RVA: 0x00004C08 File Offset: 0x00002E08 // Token: 0x060000BE RID: 190 RVA: 0x00004C08 File Offset: 0x00002E08
public static string JoinRandom(string jsonData) public static string JoinRandom(string jsonData)
{ {
bool sandboxmode = false;
GameSessions.JoinRandomRequest joinRandomRequest = JsonConvert.DeserializeObject<GameSessions.JoinRandomRequest>(jsonData); GameSessions.JoinRandomRequest joinRandomRequest = JsonConvert.DeserializeObject<GameSessions.JoinRandomRequest>(jsonData);
if (Config.localGameSession == null) if (File.ReadAllText("SaveData\\App\\sandbox.txt") == "Enabled")
{
sandboxmode = true;
}
{ {
Config.localGameSession = new GameSessions.SessionInstance Config.localGameSession = new GameSessions.SessionInstance
{ {
GameSessionId = 2842L, GameSessionId = 2018L,
RegionId = "au", RegionId = "us",
RoomId = joinRandomRequest.ActivityLevelIds[0], RoomId = joinRandomRequest.ActivityLevelIds[0],
RecRoomId = null, RecRoomId = null,
EventId = null, EventId = null,
@@ -26,7 +30,7 @@ namespace gamesessions2018
Name = "OpenRec", Name = "OpenRec",
ActivityLevelId = joinRandomRequest.ActivityLevelIds[0], ActivityLevelId = joinRandomRequest.ActivityLevelIds[0],
Private = false, Private = false,
Sandbox = false, Sandbox = sandboxmode,
SupportsScreens = true, SupportsScreens = true,
SupportsVR = true, SupportsVR = true,
GameInProgress = false, GameInProgress = false,
@@ -34,12 +38,7 @@ namespace gamesessions2018
IsFull = false IsFull = false
}; };
} }
else
{
Config.localGameSession.RoomId = joinRandomRequest.ActivityLevelIds[0];
Config.localGameSession.ActivityLevelId = joinRandomRequest.ActivityLevelIds[0];
Config.localGameSession.Sandbox = false;
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult return JsonConvert.SerializeObject(new GameSessions.JoinResult
{ {
Result = 0, Result = 0,
@@ -64,20 +63,20 @@ namespace gamesessions2018
{ {
Console.WriteLine("[API][GameSession] Creating Room..."); Console.WriteLine("[API][GameSession] Creating Room...");
GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData); GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData);
if (Config.localGameSession == null)
{ {
Config.localGameSession = new GameSessions.SessionInstance Config.localGameSession = new GameSessions.SessionInstance
{ {
GameSessionId = 2842L, GameSessionId = 2017L,
RegionId = "au", RegionId = "us",
RoomId = createRequest.ActivityLevelIds, RoomId = createRequest.ActivityLevelIds,
RecRoomId = null, RecRoomId = null,
EventId = null, EventId = null,
CreatorPlayerId = (long?)APIServer.CachedPlayerID, CreatorPlayerId = (long?)APIServer.CachedPlayerID,
Name = "Dorm Room", Name = "Custom Room",
ActivityLevelId = createRequest.ActivityLevelIds, ActivityLevelId = createRequest.ActivityLevelIds,
Private = true, Private = false,
Sandbox = true, Sandbox = createRequest.IsSandbox,
SupportsScreens = true, SupportsScreens = true,
SupportsVR = true, SupportsVR = true,
GameInProgress = false, GameInProgress = false,
@@ -85,12 +84,7 @@ namespace gamesessions2018
IsFull = false IsFull = false
}; };
} }
else
{
Config.localGameSession.RoomId = createRequest.ActivityLevelIds;
Config.localGameSession.ActivityLevelId = createRequest.ActivityLevelIds;
Config.localGameSession.Sandbox = createRequest.IsSandbox;
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult return JsonConvert.SerializeObject(new GameSessions.JoinResult
{ {
Result = 0, Result = 0,

View File

@@ -23,7 +23,7 @@ namespace api2018
XP = 9999, XP = 9999,
Level = 10, Level = 10,
RegistrationStatus = 2, RegistrationStatus = 2,
Developer = false, Developer = true,
CanReceiveInvites = false, CanReceiveInvites = false,
ProfileImageName = name, ProfileImageName = name,
JuniorProfile = false, JuniorProfile = false,

View File

@@ -53,7 +53,7 @@ namespace api2018
XP = 9999, XP = 9999,
Level = 10, Level = 10,
RegistrationStatus = 2, RegistrationStatus = 2,
Developer = false, Developer = true,
CanReceiveInvites = false, CanReceiveInvites = false,
ProfileImageName = name, ProfileImageName = name,
JuniorProfile = false, JuniorProfile = false,

View File

@@ -3,6 +3,7 @@ using server;
using System.IO; using System.IO;
using ws; using ws;
using api; using api;
using System.Net;
namespace start namespace start
{ {
@@ -14,17 +15,43 @@ namespace start
goto Start; goto Start;
Start: Start:
Console.WriteLine("OpenRec - Open source RecNet server software."); Console.WriteLine("OpenRec - Open source RecNet server software. (Version: " + version + ")");
Console.WriteLine("Made and provided by RecRoom 2016."); Console.WriteLine("Made and provided by RecRoom 2016.");
Console.WriteLine("Download source code here: https://github.com/recroom2016/OpenRec"); Console.WriteLine("Download source code here: https://github.com/recroom2016/OpenRec");
Console.WriteLine("Discord: https://discord.gg/daC8QUhnFP" + Environment.NewLine); Console.WriteLine("Discord: https://discord.gg/daC8QUhnFP" + Environment.NewLine);
Console.WriteLine("1) Modify Settings" + Environment.NewLine + "2) Modify Profile" + Environment.NewLine + "3) Start Server"); if (!(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt").Contains(version)))
{
Console.WriteLine("This version of OpenRec is outdated. We recommend you install the latest version, OpenRec " + new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt") + Environment.NewLine);
}
Console.WriteLine("1) Change Settings" + Environment.NewLine + "2) Modify Profile" + Environment.NewLine + "3) Start Server");
string readline = Console.ReadLine(); string readline = Console.ReadLine();
if (readline == "1") if (readline == "1")
{ {
Console.WriteLine("Not yet added in..."); goto TrueFalse;
TrueFalse:
Console.Clear();
Console.WriteLine("1) Sandbox Mode: " + File.ReadAllText("SaveData\\App\\sandbox.txt") + Environment.NewLine + "2) Go Back");
string readline4 = Console.ReadLine();
if (readline4 == "1")
{
if (File.ReadAllText("SaveData\\App\\sandbox.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
}
goto TrueFalse;
}
if (readline4 == "2")
{
Console.Clear();
goto Start; goto Start;
} }
}
if (readline == "2") if (readline == "2")
{ {
Console.Clear(); Console.Clear();
@@ -36,7 +63,7 @@ namespace start
Console.WriteLine("Current Username: " + File.ReadAllText("SaveData\\Profile\\username.txt")); Console.WriteLine("Current Username: " + File.ReadAllText("SaveData\\Profile\\username.txt"));
Console.WriteLine("New Username: "); Console.WriteLine("New Username: ");
string newusername = Console.ReadLine(); string newusername = Console.ReadLine();
File.WriteAllText("SaveData\\Profile\\username.txt)", newusername); File.WriteAllText("SaveData\\Profile\\username.txt", newusername);
Console.Clear(); Console.Clear();
goto Start; goto Start;
} }
@@ -48,7 +75,7 @@ namespace start
} }
if (readline == "3") if (readline == "3")
{ {
Console.WriteLine("Please select the version of RecRoom the server should host: (2016, 2017, 2018)"); Console.WriteLine("Please select the version of RecRoom the server should host: (2018)");
string readline2 = Console.ReadLine(); string readline2 = Console.ReadLine();
if (readline2 == "2016") if (readline2 == "2016")
{ {
@@ -79,7 +106,7 @@ namespace start
} }
} }
public static string version = "0.1"; public static string version = "0.2";
} }
} }

View File

@@ -11,6 +11,7 @@ namespace start
public static void setup() public static void setup()
{ {
Console.WriteLine("Setting up..."); Console.WriteLine("Setting up...");
Directory.CreateDirectory("SaveData\\App\\");
Directory.CreateDirectory("SaveData\\Profile\\"); Directory.CreateDirectory("SaveData\\Profile\\");
if (!(File.Exists("SaveData\\avatar.txt"))) if (!(File.Exists("SaveData\\avatar.txt")))
{ {
@@ -40,6 +41,10 @@ namespace start
{ {
File.WriteAllText("SaveData\\settings.txt", Newtonsoft.Json.JsonConvert.SerializeObject(api.Settings.CreateDefaultSettings())); File.WriteAllText("SaveData\\settings.txt", Newtonsoft.Json.JsonConvert.SerializeObject(api.Settings.CreateDefaultSettings()));
} }
if (!(File.Exists("SaveData\\App\\sandbox.txt")))
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
}
if (!(File.Exists("SaveData\\profileimage.png"))) if (!(File.Exists("SaveData\\profileimage.png")))
{ {
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png")); File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png"));