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

@@ -264,9 +264,9 @@ namespace server
s = PlayerEventsResponse;
}
if (Url == "gamesessions/v2/joinrandom")
{
{
s = gamesessions2018.GameSessions.JoinRandom(text);
}
}
Console.WriteLine("API Response: " + s);
byte[] bytes = Encoding.UTF8.GetBytes(s);
response.ContentLength64 = (long)bytes.Length;

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,6 +3,7 @@ using server;
using System.IO;
using ws;
using api;
using System.Net;
namespace start
{
@@ -14,16 +15,42 @@ namespace start
goto 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("Download source code here: https://github.com/recroom2016/OpenRec");
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();
if (readline == "1")
{
Console.WriteLine("Not yet added in...");
goto Start;
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;
}
}
if (readline == "2")
{
@@ -36,7 +63,7 @@ namespace start
Console.WriteLine("Current Username: " + File.ReadAllText("SaveData\\Profile\\username.txt"));
Console.WriteLine("New Username: ");
string newusername = Console.ReadLine();
File.WriteAllText("SaveData\\Profile\\username.txt)", newusername);
File.WriteAllText("SaveData\\Profile\\username.txt", newusername);
Console.Clear();
goto Start;
}
@@ -48,7 +75,7 @@ namespace start
}
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();
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()
{
Console.WriteLine("Setting up...");
Directory.CreateDirectory("SaveData\\App\\");
Directory.CreateDirectory("SaveData\\Profile\\");
if (!(File.Exists("SaveData\\avatar.txt")))
{
@@ -40,6 +41,10 @@ namespace start
{
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")))
{
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png"));