This commit is contained in:
recroom2016
2022-02-21 23:11:06 -05:00
parent b85ab57667
commit a8e081602a
7 changed files with 58 additions and 29 deletions

View File

@@ -192,7 +192,7 @@ namespace server
}
if (Url == "images/v2/named")
{
s = ImagesV2Named;
s = BracketResponse;
}
if (Url == "PlayerReporting/v1/moderationBlockDetails")
{
@@ -278,7 +278,11 @@ namespace server
{
s = gamesessions2018.GameSessions.JoinRandom(text);
}
if (rawUrl == "//api/images/v4/uploadtransient?gameSessionId=2018")
if (Url == "gamesessions/v2/create")
{
s = gamesessions2018.GameSessions.Create(text);
}
if (rawUrl.Contains("images/v4/uploadtransient?gameSessionId=2018"))
{
File.WriteAllBytes("SaveData\\Images\\image" + Convert.ToString(int.Parse(File.ReadAllText("SaveData\\Images\\count.txt") + 1)) + ".png", Encoding.UTF8.GetBytes(text.Remove(0, 50).Remove(text.Length - 48, 48)));
}

View File

@@ -11,17 +11,21 @@ namespace gamesessions2018
// Token: 0x060000BE RID: 190 RVA: 0x00004C08 File Offset: 0x00002E08
public static string JoinRandom(string jsonData)
{
long gamesessionid = 2018L;
bool sandboxmode = false;
GameSessions.JoinRandomRequest joinRandomRequest = JsonConvert.DeserializeObject<GameSessions.JoinRandomRequest>(jsonData);
if (File.ReadAllText("SaveData\\App\\sandbox.txt") == "Enabled")
{
sandboxmode = true;
}
if (File.ReadAllText("SaveData\\App\\privatedorm.txt") == "Enabled")
{
gamesessionid = new Random().Next(0, 100);
}
{
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = 2018L,
GameSessionId = gamesessionid,
RegionId = "us",
RoomId = joinRandomRequest.ActivityLevelIds[0],
RecRoomId = null,
@@ -38,7 +42,6 @@ namespace gamesessions2018
IsFull = false
};
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult
{
Result = 0,
@@ -61,13 +64,12 @@ namespace gamesessions2018
// Token: 0x060000C0 RID: 192 RVA: 0x00004D24 File Offset: 0x00002F24
public static string Create(string jsonData)
{
Console.WriteLine("[API][GameSession] Creating Room...");
Console.WriteLine("Custom Room Test...");
GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData);
{
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = 2017L,
GameSessionId = 1L,
RegionId = "us",
RoomId = createRequest.ActivityLevelIds,
RecRoomId = null,
@@ -84,7 +86,6 @@ namespace gamesessions2018
IsFull = false
};
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult
{
Result = 0,
@@ -272,25 +273,13 @@ namespace gamesessions2018
// Token: 0x02000025 RID: 37
public class CreateRequest
{
// Token: 0x17000055 RID: 85
// (get) Token: 0x060000F2 RID: 242 RVA: 0x0000271C File Offset: 0x0000091C
// (set) Token: 0x060000F3 RID: 243 RVA: 0x00002724 File Offset: 0x00000924
public bool IsSandbox { get; set; }
public string ActivityLevelIds { get; set; }
// Token: 0x17000056 RID: 86
// (get) Token: 0x060000F4 RID: 244 RVA: 0x0000272D File Offset: 0x0000092D
// (set) Token: 0x060000F5 RID: 245 RVA: 0x00002735 File Offset: 0x00000935
public ulong[] ExpectedPlayerIds { get; set; }
// Token: 0x17000057 RID: 87
// (get) Token: 0x060000F6 RID: 246 RVA: 0x0000273E File Offset: 0x0000093E
// (set) Token: 0x060000F7 RID: 247 RVA: 0x00002746 File Offset: 0x00000946
public GameSessions.RegionPing[] RegionPings { get; set; }
// Token: 0x17000058 RID: 88
// (get) Token: 0x060000F8 RID: 248 RVA: 0x0000274F File Offset: 0x0000094F
// (set) Token: 0x060000F9 RID: 249 RVA: 0x00002757 File Offset: 0x00000957
public bool IsSandbox { get; set; }
}
// Token: 0x02000026 RID: 38

View File

@@ -3,6 +3,16 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>icon2.ico</ApplicationIcon>
<AssemblyName>OpenRec</AssemblyName>
<RootNamespace>OpenRec</RootNamespace>
<Authors>recroom2016</Authors>
<PackageIcon>icon2.png</PackageIcon>
<PackageIconUrl />
<RepositoryUrl>https://github.com/recroom2016/OpenRec</RepositoryUrl>
<PackageProjectUrl>https://discord.gg/daC8QUhnFP</PackageProjectUrl>
<Company>OpenRec</Company>
<Version>0.4.0</Version>
</PropertyGroup>
<ItemGroup>
@@ -15,4 +25,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="C:\Users\Tucker\Downloads\icon2.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>

View File

@@ -16,6 +16,7 @@ namespace start
goto Start;
Start:
Console.ForegroundColor = ConsoleColor.Green;
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");
@@ -31,8 +32,8 @@ namespace start
Console.Clear();
goto Settings;
Settings:
Console.WriteLine("1) Sandbox Mode: " + File.ReadAllText("SaveData\\App\\sandbox.txt") + Environment.NewLine + "2) Go Back");
Settings: //SaveData\\App\\privatedorm.txt
Console.WriteLine("1) Sandbox Mode: " + File.ReadAllText("SaveData\\App\\sandbox.txt") + Environment.NewLine + "2) Private Dorm: " + File.ReadAllText("SaveData\\App\\privatedorm.txt") + Environment.NewLine + "3) Go Back");
string readline4 = Console.ReadLine();
if (readline4 == "1")
{
@@ -49,6 +50,20 @@ namespace start
goto Settings;
}
else if (readline4 == "2")
{
if (File.ReadAllText("SaveData\\App\\privatedorm.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\privatedorm.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\privatedorm.txt", "Disabled");
}
Console.Clear();
Console.WriteLine("Success!");
goto Settings;
}
else if (readline4 == "3")
{
Console.Clear();
goto Start;
@@ -139,7 +154,7 @@ namespace start
}
if (readline == "3")
{
Console.WriteLine("Please select the version of RecRoom the server should host: (2018)");
Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)");
string readline2 = Console.ReadLine();
if (readline2 == "2016")
{
@@ -170,7 +185,7 @@ namespace start
}
}
public static string version = "0.3";
public static string version = "0.3.5";
}
}

View File

@@ -54,6 +54,10 @@ namespace start
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
}
if (!(File.Exists("SaveData\\App\\privatedorm.txt")))
{
File.WriteAllText("SaveData\\App\\privatedorm.txt", "Disabled");
}
if (!(File.Exists("SaveData\\Images\\count.txt")))
{
File.WriteAllText("SaveData\\Images\\count.txt", "0");

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
icon2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB