26 Commits

Author SHA1 Message Date
recroom2016
dc949325a1 Update changelog.txt 2022-02-27 02:45:34 -05:00
recroom2016
88b37a9bbc Update changelog.txt 2022-02-27 02:06:09 -05:00
recroom2016
3a8c07098d Update changelog.txt 2022-02-25 20:55:19 -05:00
recroom2016
ada0777275 patch v0.4.1 2022-02-25 20:54:56 -05:00
recroom2016
21706a82fb Update version.txt 2022-02-25 20:53:01 -05:00
recroom2016
8024724946 Update changelog.txt 2022-02-25 20:05:53 -05:00
recroom2016
009a5d48e2 Update version.txt 2022-02-25 20:05:27 -05:00
recroom2016
060e2f27ed Merge branch 'master' of https://github.com/recroom2016/OpenRec 2022-02-25 12:41:33 -05:00
recroom2016
8c61c52edf OpenRec 0.4.0 2022-02-25 12:41:25 -05:00
recroom2016
6c4cfefce9 Update consumables.txt 2022-02-25 12:25:37 -05:00
recroom2016
62e3fe47a6 Create facefeaturesadd.txt 2022-02-24 15:09:54 -05:00
recroom2016
488f68d075 Update avatar.txt 2022-02-24 01:34:32 -05:00
recroom2016
8511d22c75 Create gameconfigs.txt 2022-02-24 01:19:33 -05:00
recroom2016
a9394b6c46 among us 2022-02-23 15:38:50 -05:00
recroom2016
93e74b51b4 Merge branch 'master' of https://github.com/recroom2016/OpenRec 2022-02-22 23:39:29 -05:00
recroom2016
c42d15d3aa working on chat features 2022-02-22 23:39:22 -05:00
recroom2016
5926b6c753 Update avatar.txt 2022-02-22 15:20:09 -05:00
recroom2016
3f8ff4a98b Merge branch 'master' of https://github.com/recroom2016/OpenRec 2022-02-22 00:30:58 -05:00
recroom2016
033634f104 2017 support in the works 2022-02-22 00:30:48 -05:00
recroom2016
41c720c948 Update changelog.txt 2022-02-21 23:37:00 -05:00
recroom2016
b7df2186b2 Create changelog.txt 2022-02-21 23:36:40 -05:00
recroom2016
a8e081602a 0.3.5 2022-02-21 23:11:06 -05:00
recroom2016
b85ab57667 August 3rd 3018 Support 2022-02-20 22:48:36 -05:00
recroom2016
358b654064 Update version.txt 2022-02-20 02:56:38 -05:00
recroom2016
8c8063a058 update 0.3 2022-02-20 02:42:04 -05:00
recroom2016
46ff9f37d3 Added profile image changing 2022-02-19 22:43:39 -05:00
26 changed files with 2511 additions and 216 deletions

View File

@@ -5,14 +5,13 @@ using System.Text;
using System.Threading;
using api;
using api2018;
using api2017;
using Newtonsoft.Json;
namespace server
{
internal class APIServer
{
public APIServer()
{
try
@@ -29,8 +28,9 @@ namespace server
{
try
{
//3 different servers for 3 different stages of the game, the apis change so much idk anymore
this.listener.Prefixes.Add("http://localhost:" + start.Program.version + "/");
if (start.Program.version == "2016")
if (start.Program.version == "2017")
{
for (; ; )
{
@@ -68,60 +68,93 @@ namespace server
{
s = Config2.GetDebugConfig();
}
Console.WriteLine("API Response: " + s);
byte[] bytes = Encoding.UTF8.GetBytes(s);
response.ContentLength64 = (long)bytes.Length;
Stream outputStream = response.OutputStream;
outputStream.Write(bytes, 0, bytes.Length);
Thread.Sleep(400);
outputStream.Close();
this.listener.Stop();
}
}
else if (start.Program.version == "2017")
{
for (; ; )
{
this.listener.Start();
Console.WriteLine("APIServer.cs is listening.");
HttpListenerContext context = this.listener.GetContext();
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
string rawUrl = request.RawUrl;
string Url = "";
if (rawUrl.StartsWith("/api/"))
{
Url = rawUrl.Remove(0, 5);
if (Url == "platformlogin/v1/profiles")
{
s = getorcreate.GetOrCreateArray((ulong.Parse(text.Remove(0, 32))));
CachedPlayerID = ulong.Parse(text.Remove(0, 32));
CachedPlatformID = ulong.Parse(text.Remove(0, 22));
File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID));
}
string text;
string s = "";
using (StreamReader streamReader = new StreamReader(request.InputStream, request.ContentEncoding))
if (Url == "platformlogin/v6")
{
s = PlatformLogin.v4(CachedPlayerID);
}
if (Url == "PlayerReporting/v1/moderationBlockDetails")
{
text = streamReader.ReadToEnd();
s = ModerationBlockDetails;
}
if (!(Url == ""))
if (Url == "config/v1/amplitude")
{
Console.WriteLine("API Requested: " + Url);
s = Amplitude.amplitude();
}
else
if (Url.StartsWith("players/v1/"))
{
s = getorcreate.GetOrCreate(CachedPlayerID);
}
if (Url == "avatar/v2")
{
Console.WriteLine("API Requested: " + rawUrl);
s = File.ReadAllText("SaveData\\avatar.txt");
}
Console.WriteLine("API Data: " + text);
if (Url.StartsWith("versioncheck"))
if (Url == "avatar/v2/set")
{
s = VersionCheckResponse;
//for later 2018 builds compatibility
if (!(text.Contains("FaceFeatures")))
{
string postdatacache = text;
text = postdatacache.Remove(postdatacache.Length - 1, 1) + File.ReadAllText("SaveData\\App\\facefeaturesadd.txt");
}
File.WriteAllText("SaveData\\avatar.txt", text);
}
if (Url == ("config/v2"))
if (Url == "messages/v2/get")
{
s = Config2.GetDebugConfig();
s = BracketResponse;
}
if (Url == "relationships/v2/get")
{
s = BracketResponse;
}
if (Url == "settings/v2/")
{
s = File.ReadAllText("SaveData\\settings.txt");
}
if (Url == "settings/v2/set")
{
Settings.SetPlayerSettings(text);
}
if (Url == "avatar/v3/items")
{
s = File.ReadAllText("SaveData\\avataritems.txt");
}
if (Url == "equipment/v1/getUnlocked")
{
s = File.ReadAllText("SaveData\\equipment.txt");
}
if (Url == "avatar/v2/gifts")
{
s = BracketResponse;
}
if (Url == "events/v3/list")
{
s = Events.list();
}
if (Url == "playerevents/v1/all")
{
s = PlayerEventsResponse;
}
if (Url == "gamesessions/v2/joinrandom")
{
s = gamesessions2018.GameSessions.JoinRandom(text);
}
if (Url == "gamesessions/v2/create")
{
s = gamesessions2018.GameSessions.Create(text);
}
Console.WriteLine("API Response: " + s);
byte[] bytes = Encoding.UTF8.GetBytes(s);
response.ContentLength64 = (long)bytes.Length;
Stream outputStream = response.OutputStream;
outputStream.Write(bytes, 0, bytes.Length);
Thread.Sleep(400);
Thread.Sleep(200);
outputStream.Close();
this.listener.Stop();
}
@@ -137,6 +170,7 @@ namespace server
HttpListenerResponse response = context.Response;
string rawUrl = request.RawUrl;
string Url = "";
byte[] bytes = null;
if (rawUrl.StartsWith("/api/"))
{
Url = rawUrl.Remove(0, 5);
@@ -158,6 +192,14 @@ namespace server
Console.WriteLine("API Data: " + text);
if (Url.StartsWith("versioncheck"))
{
if (Url.Contains("201809"))
{
CachedVersionMonth = 09;
}
else
{
CachedVersionMonth = 05;
}
s = VersionCheckResponse;
}
if (Url == ("config/v2"))
@@ -169,15 +211,28 @@ namespace server
s = getcachedlogins.GetDebugLogin(ulong.Parse(text.Remove(0, 32)), ulong.Parse(text.Remove(0, 22)));
CachedPlayerID = ulong.Parse(text.Remove(0, 32));
CachedPlatformID = ulong.Parse(text.Remove(0, 22));
File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID));
}
if (Url == "platformlogin/v1/logincached")
if (Url == "platformlogin/v1/loginaccount")
{
s = logincached.loginCache(CachedPlayerID, CachedPlatformID);
}
if (Url == "platformlogin/v1/createaccount")
{
s = logincached.loginCache(CachedPlayerID, CachedPlatformID);
}
if (Url == "platformlogin/v1/logincached")
{
s = logincached.loginCache(CachedPlayerID, CachedPlatformID);
}
if (Url == "relationships/v1/bulkignoreplatformusers")
{
s = BlankResponse;
}
if (Url == "players/v1/list")
{
s = BracketResponse;
}
if (Url == "config/v1/amplitude")
{
s = Amplitude.amplitude();
@@ -189,6 +244,10 @@ namespace server
if (Url == "PlayerReporting/v1/moderationBlockDetails")
{
s = ModerationBlockDetails;
}
if (Url == "//api/chat/v2/myChats?mode=0&count=50")
{
s = BracketResponse;
}
if (Url == "messages/v2/get")
{
@@ -198,21 +257,54 @@ namespace server
{
s = BracketResponse;
}
if (Url == "gameconfigs/v1/all")
{
s = File.ReadAllText("SaveData\\gameconfigs.txt");
}
if (Url.StartsWith("storefronts"))
{
if (CachedVersionMonth == 09)
{
s = File.ReadAllText("SaveData\\storefronts2.txt");
}
else
{
s = BracketResponse;
}
}
if (Url == "avatar/v2")
{
s = File.ReadAllText("SaveData\\avatar.txt");
}
if (Url == "avatar/v2/set")
{
//for later 2018 builds compatibility
if (!(text.Contains("FaceFeatures")))
{
string postdatacache = text;
text = postdatacache.Remove(postdatacache.Length - 1, 1) + File.ReadAllText("SaveData\\App\\facefeaturesadd.txt");
}
File.WriteAllText("SaveData\\avatar.txt", text);
}
if (Url == "settings/v2/")
{
s = File.ReadAllText("SaveData\\settings.txt");
}
if (Url == "settings/v2/set")
{
Settings.SetPlayerSettings(text);
}
if (Url == "avatar/v3/items")
{
s = File.ReadAllText("SaveData\\avataritems.txt");
if (CachedVersionMonth == 09)
{
s = BracketResponse;
}
else
{
s = File.ReadAllText("SaveData\\avataritems.txt");
}
}
if (Url == "equipment/v1/getUnlocked")
{
@@ -224,26 +316,32 @@ namespace server
}
if (Url == "consumables/v1/getUnlocked")
{
s = File.ReadAllText("SaveData\\consumables.txt");
if (CachedVersionMonth == 09)
{
s = BracketResponse;
}
else
{
s = File.ReadAllText("SaveData\\consumables.txt");
}
}
if (Url == "avatar/v2/gifts")
{
s = BracketResponse;
}
if (Url == "storefronts/v1/allGiftDrops/2")
{
s = BracketResponse;
}
if (Url == "storefronts/v2/2")
{
s = "";
s = BlankResponse;
}
if (Url == "objectives/v1/myprogress")
{
s = JsonConvert.SerializeObject(new Objective2018());
}
if (Url == "rooms/v1/myrooms")
{
s = File.ReadAllText("SaveData\\myrooms.txt");
}
if (Url == "rooms/v2/myrooms")
{
s = BracketResponse;
}
@@ -256,9 +354,9 @@ namespace server
s = BracketResponse;
}
if (Url == "events/v3/list")
{
{
s = Events.list();
}
}
if (Url == "playerevents/v1/all")
{
s = PlayerEventsResponse;
@@ -267,12 +365,41 @@ namespace server
{
s = gamesessions2018.GameSessions.JoinRandom(text);
}
if (Url == "gamesessions/v2/create")
{
s = gamesessions2018.GameSessions.Create(text);
}
if (Url == "gamesessions/v3/joinroom")
{
bytes = Encoding.UTF8.GetBytes((JsonConvert.SerializeObject(gamesessions2018.GameSessions2.JoinRoom(text))));
}
if (rawUrl.Contains("//api/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)));
int imagecount = int.Parse(File.ReadAllText("SaveData\\Images\\count.txt"));
File.WriteAllText("SaveData\\Images\\count.txt", Convert.ToString(imagecount + 1));
}
if (Url == "avatar/v3/saved")
{
s = BracketResponse;
}
if (Url == "checklist/v1/current")
{
s = BracketResponse;
}
if (Url == "presence/v1/setplayertype")
{
s = BracketResponse;
}
Console.WriteLine("API Response: " + s);
byte[] bytes = Encoding.UTF8.GetBytes(s);
if (!(Url == "gamesessions/v3/joinroom"))
{
bytes = Encoding.UTF8.GetBytes(s);
}
response.ContentLength64 = (long)bytes.Length;
Stream outputStream = response.OutputStream;
outputStream.Write(bytes, 0, bytes.Length);
Thread.Sleep(400);
Thread.Sleep(200);
outputStream.Close();
this.listener.Stop();
}
@@ -286,6 +413,7 @@ namespace server
}
public static ulong CachedPlayerID = 1;
public static ulong CachedPlatformID = 10000;
public static int CachedVersionMonth = 01;
public static string BlankResponse = "";
public static string BracketResponse = "[]";

View File

@@ -11,7 +11,7 @@ namespace api
{
return JsonConvert.SerializeObject(new Amplitude
{
AmplitudeKey = "e1693a1003671058b6abc356c8ba8d59"
AmplitudeKey = "NoKeyProvided"
});
}

View File

@@ -1 +1 @@
{"OutfitSelections":"b33dbeee-5bdd-443d-aa6a-761248054e08,,,,1;6d48c545-22bb-46c1-a29d-0a38af387143,,,,2;6d48c545-22bb-46c1-a29d-0a38af387143,,,,3;ecc1dbe6-ca06-4564-b2a6-30956194d1e9,51ef8d39-2b94-4f9e-9620-07b6b0a913a5,0b2395e1-ebcc-47e9-aaf1-faf9e9cec4cd,,2;ecc1dbe6-ca06-4564-b2a6-30956194d1e9,51ef8d39-2b94-4f9e-9620-07b6b0a913a5,0b2395e1-ebcc-47e9-aaf1-faf9e9cec4cd,,3;0753d7a4-8247-4fca-a6fc-359c26086140,,,,0;14ef6b00-debf-4a85-9755-b4d37df496d3,724c79a3-822c-422f-9462-a5374ee0211c,,,0;11e508a7-fe7d-470e-b270-2dba33e2f7a1,,,,0;d0a9262f-5504-46a7-bb10-7507503db58e,fe304452-b57b-45bc-9c1c-b85b70bcec12,,6a007c73-d930-408a-93df-041a715e0dd4,1","HairColor":"5ee30295-b05f-4e96-819e-5ac865b2c63d","SkinColor":"85343b16-d58a-4091-96d8-083a81fb03ae","FaceFeatures":""}
{"OutfitSelections":"b33dbeee-5bdd-443d-aa6a-761248054e08,,,,1;6d48c545-22bb-46c1-a29d-0a38af387143,,,,2;6d48c545-22bb-46c1-a29d-0a38af387143,,,,3;3757149b-f478-4975-81e5-d808a1bed8d5,,,,1;e15b13a7-9e9a-4b32-ba2c-0cb31ed55a8c,,,,1;3a790be3-2937-44d4-be01-b5d65353bd3d,,,,3;3a790be3-2937-44d4-be01-b5d65353bd3d,,,,2;b861e5f3-fc6d-43b3-9861-c1b45cb493a8,,,,0;61ba3c90-c81e-4deb-bc79-50c0f1fe3e83,,,,0","SkinColor":"2d398478-37c4-4c4a-a471-fbcbe3e5b1f5","HairColor":"5ee30295-b05f-4e96-819e-5ac865b2c63d","FaceFeatures":""}

22
Download/changelog.txt Normal file
View File

@@ -0,0 +1,22 @@
Patch v0.4.2:
-Fixed the issue with only hosts being able to start the games, now everyone is a host!
-Added basic charades cards, now charades is possible!
Patch v0.4.1:
-Fixed the room creation feature
Third public release of OpenRec, and probably the biggest update to date.
Supports:
-October 19th 2017
-May 30th 2018
-Sandbox mode now accessed through the room create button on the watch menu
-Creating custom rooms now works
-Reset Savedata Option
-Singleplayer (Private Rooms) Option
-Lots of backend and UI improvements
Credits:
@LucasOnDiscord#0210 - Adding potions
@GabeTheFirst#7335 - Tester when my game was broken

View File

@@ -1 +1 @@
[{"Id":1,"ConsumableItemDesc":"7OZ5AE3uuUyqa0P","CreatedAt":"2022-02-18T23:29:59.9035571-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":2,"ConsumableItemDesc":"_jnjYGBcyEWY5Ub4OezXcA","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":3,"ConsumableItemDesc":"5hIAZ9wg5EyG1cILf4FS2A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":4,"ConsumableItemDesc":"wUCIKdJSvEmiQHYMyx4X4w","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":5,"ConsumableItemDesc":"JfnVXFmilU6ysv-VbTAe3A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":6,"ConsumableItemDesc":"InQ25wQMGkG_bvuD5rf2Ag","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":7,"ConsumableItemDesc":"mMCGPgK3tki5S_15q2Z81A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":8,"ConsumableItemDesc":"ZuvkidodzkuOfGLDnTOFyg","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false}]
[{"Id":1,"ConsumableItemDesc":"7OZ5AE3uuUyqa0P","CreatedAt":"2022-02-18T23:29:59.9035571-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":2,"ConsumableItemDesc":"_jnjYGBcyEWY5Ub4OezXcA","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":3,"ConsumableItemDesc":"5hIAZ9wg5EyG1cILf4FS2A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":4,"ConsumableItemDesc":"wUCIKdJSvEmiQHYMyx4X4w","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":5,"ConsumableItemDesc":"JfnVXFmilU6ysv-VbTAe3A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":6,"ConsumableItemDesc":"InQ25wQMGkG_bvuD5rf2Ag","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":7,"ConsumableItemDesc":"mMCGPgK3tki5S_15q2Z81A","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":8,"ConsumableItemDesc":"ZuvkidodzkuOfGLDnTOFyg","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":9,"ConsumableItemDesc":"VQSgL2pTLkWx4B3kwYG7UA","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":10,"ConsumableItemDesc":"Tpxqe_lycUelySRHM8B0Vw","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false},{"Id":11,"ConsumableItemDesc":"-hy0qD-iUk-v4NHxNzanmg","CreatedAt":"2022-02-18T23:29:59.909138-05:00","Count":99,"UnlockedLevel":1,"IsActive":false}]

View File

@@ -0,0 +1 @@
,"FaceFeatures":""}

1
Download/gameconfigs.txt Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
0.2
0.4.1

View File

@@ -11,26 +11,26 @@ namespace gamesessions2018
// Token: 0x060000BE RID: 190 RVA: 0x00004C08 File Offset: 0x00002E08
public static string JoinRandom(string jsonData)
{
bool sandboxmode = false;
long gamesessionid = 2018L;
Console.WriteLine("OpenRec GameSession Room");
GameSessions.JoinRandomRequest joinRandomRequest = JsonConvert.DeserializeObject<GameSessions.JoinRandomRequest>(jsonData);
if (File.ReadAllText("SaveData\\App\\sandbox.txt") == "Enabled")
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Enabled")
{
sandboxmode = true;
gamesessionid = new Random().Next(0, 100);
}
{
{
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = 2018L,
GameSessionId = gamesessionid,
RegionId = "us",
RoomId = joinRandomRequest.ActivityLevelIds[0],
RecRoomId = null,
EventId = null,
CreatorPlayerId = (long?)APIServer.CachedPlayerID,
Name = "OpenRec",
CreatorPlayerId = 1243409L,
Name = "OpenRec Room",
ActivityLevelId = joinRandomRequest.ActivityLevelIds[0],
Private = false,
Sandbox = sandboxmode,
Sandbox = false,
SupportsScreens = true,
SupportsVR = true,
GameInProgress = false,
@@ -38,7 +38,6 @@ namespace gamesessions2018
IsFull = false
};
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult
{
Result = 0,
@@ -61,30 +60,31 @@ namespace gamesessions2018
// Token: 0x060000C0 RID: 192 RVA: 0x00004D24 File Offset: 0x00002F24
public static string Create(string jsonData)
{
Console.WriteLine("[API][GameSession] Creating Room...");
GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData);
long gamesessionid = 2016L;
Console.WriteLine("OpenRec GameSession Custom Room");
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Enabled")
{
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = 2017L,
RegionId = "us",
RoomId = createRequest.ActivityLevelIds,
RecRoomId = null,
EventId = null,
CreatorPlayerId = (long?)APIServer.CachedPlayerID,
Name = "Custom Room",
ActivityLevelId = createRequest.ActivityLevelIds,
Private = false,
Sandbox = createRequest.IsSandbox,
SupportsScreens = true,
SupportsVR = true,
GameInProgress = false,
MaxCapacity = 20,
IsFull = false
};
gamesessionid = new Random().Next(0, 100);
}
GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData);
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = gamesessionid,
RegionId = "us",
RoomId = createRequest.ActivityLevelId,
RecRoomId = null,
EventId = null,
CreatorPlayerId = (long?)APIServer.CachedPlayerID,
Name = "Custom Room",
ActivityLevelId = createRequest.ActivityLevelId,
Private = false,
Sandbox = true,
SupportsScreens = true,
SupportsVR = true,
GameInProgress = false,
MaxCapacity = 20,
IsFull = false
};
return JsonConvert.SerializeObject(new GameSessions.JoinResult
{
Result = 0,
@@ -269,13 +269,52 @@ namespace gamesessions2018
public GameSessions.RegionPing[] RegionPings { get; set; }
}
public class JoinRoomRequest2
{
// Token: 0x17000022 RID: 34
// (get) Token: 0x06000060 RID: 96 RVA: 0x00002345 File Offset: 0x00000545
// (set) Token: 0x06000061 RID: 97 RVA: 0x0000234D File Offset: 0x0000054D
public ulong[] ExpectedPlayerIds { get; set; }
// Token: 0x17000023 RID: 35
// (get) Token: 0x06000062 RID: 98 RVA: 0x00002356 File Offset: 0x00000556
// (set) Token: 0x06000063 RID: 99 RVA: 0x0000235E File Offset: 0x0000055E
public GameSessions.RegionPing[] RegionPings { get; set; }
// Token: 0x17000024 RID: 36
// (get) Token: 0x06000064 RID: 100 RVA: 0x00002367 File Offset: 0x00000567
// (set) Token: 0x06000065 RID: 101 RVA: 0x0000236F File Offset: 0x0000056F
public string[] RoomTags { get; set; }
// Token: 0x17000025 RID: 37
// (get) Token: 0x06000066 RID: 102 RVA: 0x00002378 File Offset: 0x00000578
// (set) Token: 0x06000067 RID: 103 RVA: 0x00002380 File Offset: 0x00000580
public string RoomName { get; set; }
// Token: 0x17000026 RID: 38
// (get) Token: 0x06000068 RID: 104 RVA: 0x00002389 File Offset: 0x00000589
// (set) Token: 0x06000069 RID: 105 RVA: 0x00002391 File Offset: 0x00000591
public string SceneName { get; set; }
// Token: 0x17000027 RID: 39
// (get) Token: 0x0600006A RID: 106 RVA: 0x0000239A File Offset: 0x0000059A
// (set) Token: 0x0600006B RID: 107 RVA: 0x000023A2 File Offset: 0x000005A2
public int AdditionalPlayerJoinMode { get; set; }
// Token: 0x17000028 RID: 40
// (get) Token: 0x0600006C RID: 108 RVA: 0x000023AB File Offset: 0x000005AB
// (set) Token: 0x0600006D RID: 109 RVA: 0x000023B3 File Offset: 0x000005B3
public bool Private { get; set; }
}
// Token: 0x02000025 RID: 37
// 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 string ActivityLevelIds { get; set; }
public string ActivityLevelId { get; set; }
// Token: 0x17000056 RID: 86
// (get) Token: 0x060000F4 RID: 244 RVA: 0x0000272D File Offset: 0x0000092D

231
GameSessions2.cs Normal file
View File

@@ -0,0 +1,231 @@
using System;
using System.Linq;
using Newtonsoft.Json;
using rooms2018;
using System.IO;
namespace gamesessions2018
{
// Token: 0x0200000F RID: 15
internal class GameSessions2
{
// Token: 0x06000033 RID: 51 RVA: 0x000048F0 File Offset: 0x00002AF0
public static GameSessions2.JoinResult JoinRoom(string postData)
{
GameSessions.JoinRoomRequest2 joinRoomRequest = JsonConvert.DeserializeObject<GameSessions.JoinRoomRequest2>(postData);
bool flag = Rooms.RecRoomOriginalRooms.ContainsKey(joinRoomRequest.RoomName);
if (flag)
{
GameSessions2.currentRoom = Rooms.RecRoomOriginalRooms[joinRoomRequest.RoomName];
}
else
{
GameSessions2.currentRoom = Rooms.RecRoomOriginalRooms["DormRoom"];
}
int num = 0;
for (int i = 0; i < GameSessions2.currentRoom.Scenes.Count<Rooms.Scene>(); i++)
{
bool flag2 = GameSessions2.currentRoom.Scenes[i].Name == joinRoomRequest.SceneName;
if (flag2)
{
num = i;
}
}
long gamesessionid = 2018L;
bool sandboxmode = false;
if (File.ReadAllText("SaveData\\App\\sandbox.txt") == "Enabled")
{
sandboxmode = true;
}
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Enabled")
{
gamesessionid = new Random().Next(0, 100);
}
GameSessions2.currentSession = new GameSessions2.SessionData
{
GameSessionId = gamesessionid,
PhotonRegionId = "us",
PhotonRoomId = GameSessions2.currentRoom.Room.RoomId.ToString(),
Name = GameSessions2.currentRoom.Room.Name,
RoomId = GameSessions2.currentRoom.Room.RoomId,
RoomSceneId = (long)(num + 1),
RoomSceneLocationId = GameSessions2.currentRoom.Scenes[num].RoomSceneLocationId,
IsSandbox = sandboxmode,
DataBlobName = "",
PlayerEventId = null,
Private = false,
GameInProgress = false,
MaxCapacity = 20,
IsFull = false
};
return new GameSessions2.JoinResult
{
Result = 0,
GameSession = GameSessions2.currentSession,
RoomDetails = GameSessions2.currentRoom
};
}
// Token: 0x04000019 RID: 25
public static Rooms.RoomDetail currentRoom;
// Token: 0x0400001A RID: 26
public static GameSessions2.SessionData placeholderSession = new GameSessions2.SessionData
{
GameSessionId = 1L,
PhotonRegionId = "us",
PhotonRoomId = "1",
Name = "Dorm Room",
RoomId = 1L,
RoomSceneId = 1L,
RoomSceneLocationId = "76d98498-60a1-430c-ab76-b54a29b7a163",
IsSandbox = false,
DataBlobName = "",
PlayerEventId = null,
Private = false,
GameInProgress = false,
MaxCapacity = 20,
IsFull = false
};
// Token: 0x0400001B RID: 27
public static GameSessions2.SessionData currentSession;
// Token: 0x02000010 RID: 16
public class JoinResult
{
// Token: 0x1700000F RID: 15
// (get) Token: 0x06000036 RID: 54 RVA: 0x00002202 File Offset: 0x00000402
// (set) Token: 0x06000037 RID: 55 RVA: 0x0000220A File Offset: 0x0000040A
public int Result { get; set; }
// Token: 0x17000010 RID: 16
// (get) Token: 0x06000038 RID: 56 RVA: 0x00002213 File Offset: 0x00000413
// (set) Token: 0x06000039 RID: 57 RVA: 0x0000221B File Offset: 0x0000041B
public GameSessions2.SessionData GameSession { get; set; }
// Token: 0x17000011 RID: 17
// (get) Token: 0x0600003A RID: 58 RVA: 0x00002224 File Offset: 0x00000424
// (set) Token: 0x0600003B RID: 59 RVA: 0x0000222C File Offset: 0x0000042C
public Rooms.RoomDetail RoomDetails { get; set; }
}
// Token: 0x02000011 RID: 17
public class SessionData
{
// Token: 0x17000012 RID: 18
// (get) Token: 0x0600003D RID: 61 RVA: 0x00002235 File Offset: 0x00000435
// (set) Token: 0x0600003E RID: 62 RVA: 0x0000223D File Offset: 0x0000043D
public long GameSessionId { get; set; }
// Token: 0x17000013 RID: 19
// (get) Token: 0x0600003F RID: 63 RVA: 0x00002246 File Offset: 0x00000446
// (set) Token: 0x06000040 RID: 64 RVA: 0x0000224E File Offset: 0x0000044E
public string PhotonRegionId { get; set; }
// Token: 0x17000014 RID: 20
// (get) Token: 0x06000041 RID: 65 RVA: 0x00002257 File Offset: 0x00000457
// (set) Token: 0x06000042 RID: 66 RVA: 0x0000225F File Offset: 0x0000045F
public string PhotonRoomId { get; set; }
// Token: 0x17000015 RID: 21
// (get) Token: 0x06000043 RID: 67 RVA: 0x00002268 File Offset: 0x00000468
// (set) Token: 0x06000044 RID: 68 RVA: 0x00002270 File Offset: 0x00000470
public string Name { get; set; }
// Token: 0x17000016 RID: 22
// (get) Token: 0x06000045 RID: 69 RVA: 0x00002279 File Offset: 0x00000479
// (set) Token: 0x06000046 RID: 70 RVA: 0x00002281 File Offset: 0x00000481
public long RoomId { get; set; }
// Token: 0x17000017 RID: 23
// (get) Token: 0x06000047 RID: 71 RVA: 0x0000228A File Offset: 0x0000048A
// (set) Token: 0x06000048 RID: 72 RVA: 0x00002292 File Offset: 0x00000492
public long RoomSceneId { get; set; }
// Token: 0x17000018 RID: 24
// (get) Token: 0x06000049 RID: 73 RVA: 0x0000229B File Offset: 0x0000049B
// (set) Token: 0x0600004A RID: 74 RVA: 0x000022A3 File Offset: 0x000004A3
public string RoomSceneLocationId { get; set; }
// Token: 0x17000019 RID: 25
// (get) Token: 0x0600004B RID: 75 RVA: 0x000022AC File Offset: 0x000004AC
// (set) Token: 0x0600004C RID: 76 RVA: 0x000022B4 File Offset: 0x000004B4
public bool IsSandbox { get; set; }
// Token: 0x1700001A RID: 26
// (get) Token: 0x0600004D RID: 77 RVA: 0x000022BD File Offset: 0x000004BD
// (set) Token: 0x0600004E RID: 78 RVA: 0x000022C5 File Offset: 0x000004C5
public string DataBlobName { get; set; }
// Token: 0x1700001B RID: 27
// (get) Token: 0x0600004F RID: 79 RVA: 0x000022CE File Offset: 0x000004CE
// (set) Token: 0x06000050 RID: 80 RVA: 0x000022D6 File Offset: 0x000004D6
public long? PlayerEventId { get; set; }
// Token: 0x1700001C RID: 28
// (get) Token: 0x06000051 RID: 81 RVA: 0x000022DF File Offset: 0x000004DF
// (set) Token: 0x06000052 RID: 82 RVA: 0x000022E7 File Offset: 0x000004E7
public bool Private { get; set; }
// Token: 0x1700001D RID: 29
// (get) Token: 0x06000053 RID: 83 RVA: 0x000022F0 File Offset: 0x000004F0
// (set) Token: 0x06000054 RID: 84 RVA: 0x000022F8 File Offset: 0x000004F8
public bool GameInProgress { get; set; }
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000055 RID: 85 RVA: 0x00002301 File Offset: 0x00000501
// (set) Token: 0x06000056 RID: 86 RVA: 0x00002309 File Offset: 0x00000509
public int MaxCapacity { get; set; }
// Token: 0x1700001F RID: 31
// (get) Token: 0x06000057 RID: 87 RVA: 0x00002312 File Offset: 0x00000512
// (set) Token: 0x06000058 RID: 88 RVA: 0x0000231A File Offset: 0x0000051A
public bool IsFull { get; set; }
}
// Token: 0x02000012 RID: 18
public enum JoinResultIDs
{
// Token: 0x0400002E RID: 46
Success,
// Token: 0x0400002F RID: 47
NoSuchGame,
// Token: 0x04000030 RID: 48
PlayerNotOnline,
// Token: 0x04000031 RID: 49
InsufficientSpace,
// Token: 0x04000032 RID: 50
EventNotStarted,
// Token: 0x04000033 RID: 51
EventAlreadyFinished,
// Token: 0x04000034 RID: 52
EventCreatorNotReady,
// Token: 0x04000035 RID: 53
BlockedFromRoom,
// Token: 0x04000036 RID: 54
ProfileLocked,
// Token: 0x04000037 RID: 55
NoBirthday,
// Token: 0x04000038 RID: 56
MarkedForDelete,
// Token: 0x04000039 RID: 57
JuniorNotAllowed,
// Token: 0x0400003A RID: 58
Banned,
// Token: 0x0400003B RID: 59
NoSuchRoom = 20,
// Token: 0x0400003C RID: 60
RoomCreatorNotReady,
// Token: 0x0400003D RID: 61
RoomIsNotActive,
// Token: 0x0400003E RID: 62
RoomBlockedByCreator,
// Token: 0x0400003F RID: 63
RoomBlockingCreator,
// Token: 0x04000040 RID: 64
RoomIsPrivate
}
}
}

View File

@@ -12,6 +12,7 @@ namespace api2018
// Token: 0x0600033C RID: 828 RVA: 0x00008F30 File Offset: 0x00007130
public static string GetDebugLogin(ulong userid, ulong platformid)
{
int level = int.Parse(File.ReadAllText("SaveData\\Profile\\level.txt"));
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
return JsonConvert.SerializeObject(new List<getcachedlogins>
{
@@ -21,7 +22,7 @@ namespace api2018
Username = name,
DisplayName = name,
XP = 9999,
Level = 10,
Level = level,
RegistrationStatus = 2,
Developer = true,
CanReceiveInvites = false,

63
GetOrCreates.cs Normal file
View File

@@ -0,0 +1,63 @@
using System;
using System.IO;
using Newtonsoft.Json;
namespace api2017
{
// Token: 0x0200003A RID: 58
internal class getorcreate
{
public static string GetOrCreate(ulong userid)
{
int level = int.Parse(File.ReadAllText("SaveData\\Profile\\level.txt"));
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
return JsonConvert.SerializeObject(new Profiles
{
Id = userid,
Username = name,
DisplayName = name,
XP = 48,
Level = level,
Reputation = 0,
Verified = true,
Developer = true,
HasEmail = true,
CanReceiveInvites = false,
ProfileImageName = name,
HasBirthday = true
});
}
// Token: 0x06000197 RID: 407 RVA: 0x0000550C File Offset: 0x0000370C
public static string GetOrCreateArray(ulong userid)
{
int level = int.Parse(File.ReadAllText("SaveData\\Profile\\level.txt"));
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
return JsonConvert.SerializeObject(new Profiles[]
{
new Profiles
{
Id = userid,
Username = name,
DisplayName = name,
XP = 48,
Level = level,
Reputation = 0,
Verified = true,
Developer = true,
HasEmail = true,
CanReceiveInvites = false,
ProfileImageName = name,
JuniorProfile = false,
ForceJuniorImages = false,
HasBirthday = true
}
});
}
// Token: 0x06000199 RID: 409 RVA: 0x00002BBE File Offset: 0x00000DBE
public static string playerName()
{
return File.ReadAllText("playerNameConfig.txt");
}
}
}

View File

@@ -30,6 +30,7 @@ namespace server
this.listener.Prefixes.Add("http://localhost:20182/");
for (; ; )
{
//image server always send out profile image for now, might cause issues later but ill fix it when I need too
this.listener.Start();
Console.WriteLine("ImageServer.cs is listening.");
HttpListenerContext context = this.listener.GetContext();

View File

@@ -41,6 +41,7 @@ namespace api2018
// Token: 0x0600036A RID: 874 RVA: 0x00009044 File Offset: 0x00007244
public static string loginCache(ulong userid, ulong platformid)
{
int level = int.Parse(File.ReadAllText("SaveData\\Profile\\level.txt"));
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
return JsonConvert.SerializeObject(new logincached
{
@@ -51,7 +52,7 @@ namespace api2018
Username = name,
DisplayName = name,
XP = 9999,
Level = 10,
Level = level,
RegistrationStatus = 2,
Developer = true,
CanReceiveInvites = false,

View File

@@ -9,6 +9,7 @@ namespace server
// Token: 0x02000050 RID: 80
internal class NameServer
{
// Token: 0x06000227 RID: 551 RVA: 0x00006D1C File Offset: 0x00004F1C
public NameServer()
{
@@ -26,6 +27,7 @@ namespace server
// Token: 0x06000228 RID: 552 RVA: 0x00006D84 File Offset: 0x00004F84
private void StartListen()
{
//nameserver is ONLY for 2018
this.listener.Prefixes.Add("http://localhost:20181/");
for (; ; )
{

106
OpenRecNet.cs Normal file
View File

@@ -0,0 +1,106 @@
using System;
using System.Net;
using System.IO;
using System.Threading;
namespace start
{
public class OpenRecNet
{
public OpenRecNet()
{
}
//ignore this its a beta feature
public static void RecNet()
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.Clear();
if ((File.ReadAllText("SaveData\\App\\showopenrecinfo.txt")) == "Enabled")
{
goto ChatStart;
}
else
{
goto SkipStart;
}
ChatStart:
Console.WriteLine("Welcome to OpenRecChat (Beta)!");
Console.WriteLine("You are logged in as " + File.ReadAllText("SaveData\\Profile\\username.txt" + "."));
Console.WriteLine("Your UserID is " + File.ReadAllText("SaveData\\Profile\\userid.txt" + "."));
Console.WriteLine("In the future, show this message?");
Console.WriteLine("1) Yes" + Environment.NewLine + "2) No");
string readline = Console.ReadLine();
if (readline == "1")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
justjoined = false;
goto SkipStart;
}
if (readline == "2")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Disabled");
justjoined = false;
goto SkipStart;
}
SkipStart:
for (; ; )
{
Console.Clear();
string refresh = new WebClient
{
Headers =
{
{
"username",
File.ReadAllText("SaveData\\Profile\\username.txt")
},
{
"justjoined",
Convert.ToString(justjoined)
}
}
}.DownloadString("https://openrecchat.loca.lt/refresh");
Console.WriteLine(refresh);
Console.WriteLine(Environment.NewLine + "Commands: /r -Refresh /e -Exit");
Console.WriteLine("Type your message below: ");
justjoined = false;
goto Send;
}
Send:
string send = Console.ReadLine();
if (send == "/r")
{
goto SkipStart;
}
else if (send == "/e")
{
Environment.Exit(0);
}
else if (send == "")
{
goto SkipStart;
}
new WebClient
{
Headers =
{
{
"userid",
File.ReadAllText("SaveData\\Profile\\userid.txt")
},
{
"username",
File.ReadAllText("SaveData\\Profile\\username.txt")
}
}
}.UploadString("https://openrecchat.loca.lt/sendmessage", send);
goto SkipStart;
}
public static bool justjoined = false;
}
}

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

@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31321.278
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRec_", "OpenRec_.csproj", "{C3C433FC-52FB-4472-81F7-B271A2CDABFE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B5E3DA5-F8EC-4767-9BC3-AE95E72631D0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

36
PlatformLogin.cs Normal file
View File

@@ -0,0 +1,36 @@
using System;
using Newtonsoft.Json;
namespace api2017
{
// Token: 0x02000032 RID: 50
internal class PlatformLogin
{
// Token: 0x17000070 RID: 112
// (get) Token: 0x06000137 RID: 311 RVA: 0x00002905 File Offset: 0x00000B05
// (set) Token: 0x06000138 RID: 312 RVA: 0x0000290D File Offset: 0x00000B0D
public string Token { get; set; }
// Token: 0x17000071 RID: 113
// (get) Token: 0x06000139 RID: 313 RVA: 0x00002916 File Offset: 0x00000B16
// (set) Token: 0x0600013A RID: 314 RVA: 0x0000291E File Offset: 0x00000B1E
public ulong PlayerId { get; set; }
// Token: 0x17000072 RID: 114
// (get) Token: 0x0600013B RID: 315 RVA: 0x00002927 File Offset: 0x00000B27
// (set) Token: 0x0600013C RID: 316 RVA: 0x0000292F File Offset: 0x00000B2F
public string Error { get; set; }
// Token: 0x0600013D RID: 317 RVA: 0x00005114 File Offset: 0x00003314
public static string v4(ulong userid)
{
PlatformLogin value = new PlatformLogin
{
Token = "j3923mHJG032jew",
PlayerId = userid,
Error = ""
};
return JsonConvert.SerializeObject(value);
}
}
}

View File

@@ -2,12 +2,10 @@
using System.Collections.Generic;
using System.Text;
namespace api2016
namespace api2017
{
class Profiles
{
public ulong Id { get; set; }
public string Username { get; set; }
public string DisplayName { get; set; }
@@ -15,27 +13,13 @@ namespace api2016
public int Level { get; set; }
public int Reputation { get; set; }
public bool Verified { get; set; }
public bool Developer { get; set; }
public bool HasEmail { get; set; }
public bool CanReceiveInvites { get; set; }
public string ProfileImageName { get; set; }
public bool JuniorProfile { get; set; }
public bool ForceJuniorImages { get; set; }
public bool PendingJunior { get; set; }
public bool HasBirthday { get; set; }
}
}

View File

@@ -4,70 +4,97 @@ using System.IO;
using ws;
using api;
using System.Net;
using System.Diagnostics;
namespace start
{
class Program
{
static void Main(string[] args)
static void Main()
{
//startup for openrec
Setup.setup();
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");
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)))
{
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("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"));
}
Console.WriteLine("1) Change Settings" + Environment.NewLine + "2) Modify Profile" + Environment.NewLine + "3) Start Server");
Console.WriteLine("1) Changelog" + Environment.NewLine +"2) Change Settings" + Environment.NewLine + "3) Modify Profile" + Environment.NewLine + "4) Start Server");
string readline = Console.ReadLine();
if (readline == "1")
{
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;
}
Console.WriteLine(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/changelog.txt"));
Console.WriteLine("Press any key to continue:");
Console.ReadKey();
Console.Clear();
goto Start;
}
if (readline == "2")
{
Console.Clear();
Console.WriteLine("1) Change Username" + Environment.NewLine + "2) Go Back");
string readline3 = Console.ReadLine();
if (readline3 == "1")
goto Settings;
Settings:
Console.WriteLine("1) Private Rooms: " + File.ReadAllText("SaveData\\App\\privaterooms.txt") + Environment.NewLine + "2) OpenRecNet Info Tab: " + File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") + Environment.NewLine + "3) Reset SaveData" + Environment.NewLine + "4) Go Back");
string readline4 = Console.ReadLine();
if (readline4 == "1")
{
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\privaterooms.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\privaterooms.txt", "Disabled");
}
Console.Clear();
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);
Console.Clear();
goto Start;
Console.WriteLine("Success!");
goto Settings;
}
if (readline3 == "2")
else if (readline4 == "2")
{
if (File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Disabled");
}
Console.Clear();
Console.WriteLine("Success!");
goto Settings;
}
else if (readline4 == "3")
{
File.Delete("SaveData\\avatar.txt");
File.Delete("SaveData\\avataritems.txt");
File.Delete("SaveData\\equipment.txt");
File.Delete("SaveData\\consumables.txt");
File.Delete("SaveData\\gameconfigs.txt");
File.Delete("SaveData\\storefronts2.txt");
File.Delete("SaveData\\Profile\\username.txt");
File.Delete("SaveData\\Profile\\level.txt");
File.Delete("SaveData\\Profile\\userid.txt");
File.Delete("SaveData\\myrooms.txt");
File.Delete("SaveData\\settings.txt");
File.Delete("SaveData\\App\\privaterooms.txt");
File.Delete("SaveData\\App\\showopenrecinfo.txt");
File.Delete("SaveData\\App\\facefeaturesadd.txt");
File.Delete("SaveData\\profileimage.png");
Console.WriteLine("Success!");
Setup.setup();
goto Settings;
}
else if (readline4 == "4")
{
Console.Clear();
goto Start;
@@ -75,7 +102,91 @@ namespace start
}
if (readline == "3")
{
Console.WriteLine("Please select the version of RecRoom the server should host: (2018)");
Console.Clear();
goto Profile;
Profile:
Console.WriteLine("1) Change Username" + Environment.NewLine + "2) Change Profile Image" + Environment.NewLine + "3) Change Level" + Environment.NewLine + "4) Go Back");
string readline3 = Console.ReadLine();
if (readline3 == "1")
{
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);
Console.Clear();
Console.WriteLine("Success!");
goto Start;
}
else if (readline3 == "2")
{
Console.Clear();
Console.WriteLine("1) Upload Media Link" + Environment.NewLine + "2) Drag Image onto this window" + Environment.NewLine + "3) Go Back");
string readline4 = Console.ReadLine();
if (readline4 == "1")
{
Console.WriteLine("Paste Media Link: ");
string medialink = Console.ReadLine();
try
{
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData(medialink));
}
catch (Exception ex4)
{
Console.Clear();
Console.WriteLine("Invalid Media Link");
goto Profile;
}
Console.Clear();
Console.WriteLine("Success!");
goto Start;
}
else if (readline4 == "2")
{
Console.WriteLine("Drag any image onto this window and press enter: ");
string imagedir = Console.ReadLine();
try
{
byte[] imagefile = File.ReadAllBytes(imagedir);
File.Replace(imagedir, "SaveData\\profileimage.png", "backupfilename.png");
File.WriteAllBytes(imagedir, imagefile);
}
catch (Exception ex4)
{
Console.Clear();
Console.WriteLine("Invalid Image (Make sure its on the same drive as OpenRec)");
goto Profile;
}
Console.Clear();
Console.WriteLine("Success!");
goto Start;
}
else if (readline4 == "3")
{
Console.Clear();
goto Start;
}
}
else if (readline3 == "3")
{
Console.WriteLine("Current Level: " + File.ReadAllText("SaveData\\Profile\\level.txt"));
Console.WriteLine("New Level: ");
string newlevel = Console.ReadLine();
File.WriteAllText("SaveData\\Profile\\level.txt", newlevel);
Console.Clear();
Console.WriteLine("Success!");
goto Start;
}
else if (readline3 == "4")
{
Console.Clear();
goto Start;
}
}
if (readline == "4")
{
Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)");
string readline2 = Console.ReadLine();
if (readline2 == "2016")
{
@@ -85,7 +196,7 @@ namespace start
new APIServer();
new WebSocket();
}
if (readline2 == "2017")
else if (readline2 == "2017")
{
version = "2017";
Console.Clear();
@@ -93,7 +204,7 @@ namespace start
new APIServer();
new WebSocket();
}
if (readline2 == "2018")
else if (readline2 == "2018")
{
version = "2018";
Console.Clear();
@@ -104,9 +215,33 @@ namespace start
new WebSocket();
}
}
if (readline == "5")
{
Console.Clear();
goto ChatStart;
ChatStart:
Console.WriteLine("Pinging the chat servers...");
try
{
string ping = new WebClient().DownloadString("https://openrecchat.loca.lt/ping");
}
catch (Exception ex4)
{
Console.WriteLine("Chat servers currently offline...");
Console.WriteLine("Press any key to continue:");
Console.ReadKey();
goto Start;
}
Console.WriteLine("Success!");
Console.WriteLine("Press any key to continue:");
Console.ReadKey();
OpenRecNet.RecNet();
}
}
public static string version = "0.2";
public static string version = "0.4.1";
}
}

63
Rooms.cs Normal file
View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
namespace rooms2018
{
// Token: 0x0200002B RID: 43
internal class RoomsList
{
// Token: 0x17000062 RID: 98
// (get) Token: 0x060000F8 RID: 248 RVA: 0x000053F8 File Offset: 0x000035F8
public static RoomsList.FeaturedRoomData getFeaturedRooms
{
get
{
List<Rooms.RoomPlayPage> list = new List<Rooms.RoomPlayPage>();
foreach (KeyValuePair<string, Rooms.RoomDetail> keyValuePair in Rooms.RecRoomOriginalRooms)
{
Rooms.RoomPlayPage item = new Rooms.RoomPlayPage
{
RoomName = keyValuePair.Value.Room.Name,
RoomId = keyValuePair.Value.Room.RoomId,
ImageName = "93a53ced93a04f658795a87f4a4aab85"
};
list.Add(item);
}
return new RoomsList.FeaturedRoomData
{
Name = "Rec Room Originals",
FeaturedRooms = list
};
}
}
// Token: 0x17000063 RID: 99
// (get) Token: 0x060000F9 RID: 249 RVA: 0x000054BC File Offset: 0x000036BC
public static List<Rooms.cRoom> HotRooms
{
get
{
List<Rooms.cRoom> list = new List<Rooms.cRoom>();
foreach (KeyValuePair<string, Rooms.RoomDetail> keyValuePair in Rooms.RecRoomOriginalRooms)
{
list.Add(keyValuePair.Value.Room);
}
return list;
}
}
// Token: 0x0200002C RID: 44
public class FeaturedRoomData
{
// Token: 0x17000064 RID: 100
// (get) Token: 0x060000FB RID: 251 RVA: 0x00002762 File Offset: 0x00000962
// (set) Token: 0x060000FC RID: 252 RVA: 0x0000276A File Offset: 0x0000096A
public string Name { get; set; }
// Token: 0x17000065 RID: 101
// (get) Token: 0x060000FD RID: 253 RVA: 0x00002773 File Offset: 0x00000973
// (set) Token: 0x060000FE RID: 254 RVA: 0x0000277B File Offset: 0x0000097B
public List<Rooms.RoomPlayPage> FeaturedRooms { get; set; }
}
}
}

1474
RoomsList.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,42 +5,22 @@ using Newtonsoft.Json;
namespace api
{
// Token: 0x0200003C RID: 60
internal class Settings
{
// Token: 0x060001C1 RID: 449 RVA: 0x00002D10 File Offset: 0x00000F10
public static string GetPlayerSettings()
{
if (Settings.playerSettings == null)
{
if (File.Exists(Settings.SettingsPath))
{
Settings.playerSettings = Settings.LoadSettings();
}
else
{
Settings.playerSettings = Settings.CreateDefaultSettings();
}
}
return JsonConvert.SerializeObject(Settings.playerSettings);
}
// Token: 0x060001C2 RID: 450 RVA: 0x000061FC File Offset: 0x000043FC
public static void SetPlayerSettings(string jsonData)
{
if (jsonData == "")
{
Console.WriteLine("[Settings][Set] Json Data is empty.");
{
return;
}
Setting setting = JsonConvert.DeserializeObject<Setting>(jsonData);
for (int i = 0; i < Settings.playerSettings.Count; i++)
Settings.playerSettings = Settings.LoadSettings();
foreach (Setting setting2 in Settings.playerSettings)
{
if (Settings.playerSettings[i].Key == setting.Key)
if (setting2.Key == setting.Key)
{
Settings.playerSettings[i].Value = setting.Value;
setting2.Value = setting.Value;
Settings.SaveSettings(Settings.playerSettings);
return;
}
}
Settings.playerSettings.Add(new Setting
@@ -50,8 +30,15 @@ namespace api
});
Settings.SaveSettings(Settings.playerSettings);
}
// Token: 0x060001C3 RID: 451 RVA: 0x000062AC File Offset: 0x000044AC
public static List<Setting> LoadSettings()
{
return JsonConvert.DeserializeObject<List<Setting>>(File.ReadAllText(Environment.CurrentDirectory + Settings.SettingsPath));
}
public static void SaveSettings(List<Setting> settings)
{
File.WriteAllText(Environment.CurrentDirectory + Settings.SettingsPath, JsonConvert.SerializeObject(settings));
}
public static List<Setting> CreateDefaultSettings()
{
return new List<Setting>
@@ -138,43 +125,10 @@ namespace api
}
};
}
// Token: 0x060001C4 RID: 452 RVA: 0x00006548 File Offset: 0x00004748
public static List<Setting> LoadSettings()
{
List<Setting> list = new List<Setting>();
using (BinaryReader binaryReader = new BinaryReader(File.Open(Settings.SettingsPath, FileMode.Open)))
{
while (binaryReader.BaseStream.Position != binaryReader.BaseStream.Length)
{
Setting item = new Setting
{
Key = binaryReader.ReadString(),
Value = binaryReader.ReadString()
};
list.Add(item);
}
}
return list;
}
// Token: 0x060001C5 RID: 453 RVA: 0x000065C8 File Offset: 0x000047C8
public static void SaveSettings(List<Setting> settings)
{
using (BinaryWriter binaryWriter = new BinaryWriter(File.Create("SaveData\\")))
{
foreach (Setting setting in settings)
{
binaryWriter.Write(setting.Key);
binaryWriter.Write(setting.Value);
}
}
}
// Token: 0x040000F0 RID: 240
private static List<Setting> playerSettings;
// Token: 0x040000F1 RID: 241
public static string SettingsPath = "SaveData\\settings.txt";
public static string SettingsPath = "\\SaveData\\settings.txt";
}
}

View File

@@ -10,7 +10,9 @@ namespace start
{
public static void setup()
{
Console.WriteLine("Setting up...");
//sets up all the important files so openrec doesnt crash like lame vaultserver xD
Console.WriteLine("Setting up... (May take a minute to download everything.)");
Directory.CreateDirectory("SaveData\\Images\\");
Directory.CreateDirectory("SaveData\\App\\");
Directory.CreateDirectory("SaveData\\Profile\\");
if (!(File.Exists("SaveData\\avatar.txt")))
@@ -33,17 +35,49 @@ namespace start
{
File.WriteAllText("SaveData\\consumables.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/consumables.txt"));
}
if (!(File.Exists("SaveData\\gameconfigs.txt")))
{
File.WriteAllText("SaveData\\gameconfigs.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/gameconfigs.txt"));
}
if (!(File.Exists("SaveData\\storefronts2.txt")))
{
File.WriteAllText("SaveData\\storefronts2.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/vaultButItsNewer/main/StoreFront2.json"));
}
if (!(File.Exists("SaveData\\Profile\\username.txt")))
{
File.WriteAllText("SaveData\\Profile\\username.txt", "DefaultUsername");
}
if (!(File.Exists("SaveData\\Profile\\level.txt")))
{
File.WriteAllText("SaveData\\Profile\\level.txt", "10");
}
if (!(File.Exists("SaveData\\Profile\\userid.txt")))
{
File.WriteAllText("SaveData\\Profile\\userid.txt", "2");
}
if (!(File.Exists("SaveData\\myrooms.txt")))
{
File.WriteAllText("SaveData\\myrooms.txt", "[]");
}
if (!(File.Exists("SaveData\\settings.txt")))
{
File.WriteAllText("SaveData\\settings.txt", Newtonsoft.Json.JsonConvert.SerializeObject(api.Settings.CreateDefaultSettings()));
}
if (!(File.Exists("SaveData\\App\\sandbox.txt")))
if (!(File.Exists("SaveData\\App\\privaterooms.txt")))
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
File.WriteAllText("SaveData\\App\\privaterooms.txt", "Disabled");
}
if (!(File.Exists("SaveData\\App\\showopenrecinfo.txt")))
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
}
if (!(File.Exists("SaveData\\App\\facefeaturesadd.txt")))
{
File.WriteAllText("SaveData\\App\\facefeaturesadd.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/facefeaturesadd.txt"));
}
if (!(File.Exists("SaveData\\Images\\count.txt")))
{
File.WriteAllText("SaveData\\Images\\count.txt", "0");
}
if (!(File.Exists("SaveData\\profileimage.png")))
{

BIN
icon2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB