diff --git a/APIServer.cs b/APIServer.cs index 968bffe..305c3bc 100644 --- a/APIServer.cs +++ b/APIServer.cs @@ -141,6 +141,10 @@ namespace server { s = PlayerEventsResponse; } + if (Url == "activities/charades/v1/words") + { + s = Activities.Charades.words(); + } if (Url == "gamesessions/v2/joinrandom") { s = gamesessions2018.GameSessions.JoinRandom(text); @@ -361,6 +365,10 @@ namespace server { s = PlayerEventsResponse; } + if (Url == "activities/charades/v1/words") + { + s = Activities.Charades.words(); + } if (Url == "gamesessions/v2/joinrandom") { s = gamesessions2018.GameSessions.JoinRandom(text); diff --git a/Activities.cs b/Activities.cs new file mode 100644 index 0000000..3cdb083 --- /dev/null +++ b/Activities.cs @@ -0,0 +1,197 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace api +{ + // Token: 0x0200000B RID: 11 + internal class Activities + { + // Token: 0x0200000C RID: 12 + public class Charades + { + // Token: 0x0600001D RID: 29 RVA: 0x0000410C File Offset: 0x0000230C + public static string words() + { + List value = new List + { + new Activities.Charades.word + { + EN_US = "talking ben", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "orange", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "grape", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "roblox", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "tree", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "cloud", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "iphone", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "your house", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "spaghetti", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "lean", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "bitcoin", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "nft", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "grass", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "recroom2016", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "joker", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "fortnite", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "woman", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "spiderman", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "vr", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "among us", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "coach", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "coach with a gun", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "funny fish", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "skinwalker", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "christmas tree", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "ur mom", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "stick of ram", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "big mac", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "ninetndo switch", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "crescendo", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "boxing", + Difficulty = 0 + }, + new Activities.Charades.word + { + EN_US = "angry birds", + Difficulty = 0 + } + }; + return JsonConvert.SerializeObject(value); + } + + // Token: 0x0200000D RID: 13 + public class word + { + // Token: 0x17000004 RID: 4 + // (get) Token: 0x0600001F RID: 31 RVA: 0x000020DC File Offset: 0x000002DC + // (set) Token: 0x06000020 RID: 32 RVA: 0x000020E4 File Offset: 0x000002E4 + public string EN_US { get; set; } + + // Token: 0x17000005 RID: 5 + // (get) Token: 0x06000021 RID: 33 RVA: 0x000020ED File Offset: 0x000002ED + // (set) Token: 0x06000022 RID: 34 RVA: 0x000020F5 File Offset: 0x000002F5 + public int Difficulty { get; set; } + } + } + } +} diff --git a/GameSessions.cs b/GameSessions.cs index 2538912..c909166 100644 --- a/GameSessions.cs +++ b/GameSessions.cs @@ -11,6 +11,7 @@ namespace gamesessions2018 // Token: 0x060000BE RID: 190 RVA: 0x00004C08 File Offset: 0x00002E08 public static string JoinRandom(string jsonData) { + long? creatorid = 1243409L; long gamesessionid = 2018L; Console.WriteLine("OpenRec GameSession Room"); GameSessions.JoinRandomRequest joinRandomRequest = JsonConvert.DeserializeObject(jsonData); @@ -18,26 +19,29 @@ namespace gamesessions2018 { gamesessionid = new Random().Next(0, 100); } - { - Config.localGameSession = new GameSessions.SessionInstance - { - GameSessionId = gamesessionid, - RegionId = "us", - RoomId = joinRandomRequest.ActivityLevelIds[0], - RecRoomId = null, - EventId = null, - CreatorPlayerId = 1243409L, - Name = "OpenRec Room", - ActivityLevelId = joinRandomRequest.ActivityLevelIds[0], - Private = false, - Sandbox = false, - SupportsScreens = true, - SupportsVR = true, - GameInProgress = false, - MaxCapacity = 20, - IsFull = false - }; + if (start.Program.version == "2017") + { + creatorid = (long?)APIServer.CachedPlayerID; } + Config.localGameSession = new GameSessions.SessionInstance + { + GameSessionId = gamesessionid, + RegionId = "us", + RoomId = joinRandomRequest.ActivityLevelIds[0], + RecRoomId = null, + EventId = null, + CreatorPlayerId = creatorid, + Name = "OpenRec Room", + ActivityLevelId = joinRandomRequest.ActivityLevelIds[0], + Private = false, + Sandbox = false, + SupportsScreens = true, + SupportsVR = true, + GameInProgress = false, + MaxCapacity = 20, + IsFull = false + }; + return JsonConvert.SerializeObject(new GameSessions.JoinResult { Result = 0, @@ -67,6 +71,7 @@ namespace gamesessions2018 gamesessionid = new Random().Next(0, 100); } GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject(jsonData); + Config.localGameSession = new GameSessions.SessionInstance { GameSessionId = gamesessionid, diff --git a/ImageServer.cs b/ImageServer.cs index 41cf1f2..7a882f5 100644 --- a/ImageServer.cs +++ b/ImageServer.cs @@ -55,14 +55,9 @@ namespace server this.listener.Stop(); } } - - public static string VersionCheckResponse = "{\"ValidVersion\":true}"; - public static string BlankResponse = ""; - - // Token: 0x04000192 RID: 402 private HttpListener listener = new HttpListener(); } } diff --git a/Program.cs b/Program.cs index daad21b..fbdb335 100644 --- a/Program.cs +++ b/Program.cs @@ -18,11 +18,11 @@ namespace start Start: Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine("OpenRec - Open source RecNet server software. (Version: " + version + ")"); + Console.WriteLine("OpenRec - Open source RecNet server software. (Version: " + appversion + ")"); 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); - if (!(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt").Contains(version))) + if (!(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt").Contains(appversion))) { 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")); } @@ -186,7 +186,7 @@ namespace start if (readline == "4") { - Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)"); + Console.WriteLine("Please select the version of RecRoom the server should host: (2017 (Beta), 2018)"); string readline2 = Console.ReadLine(); if (readline2 == "2016") { @@ -240,8 +240,8 @@ namespace start } } - - public static string version = "0.4.1"; + public static string version = ""; + public static string appversion = "0.4.2"; } }