OpenRec 0.4.0

This commit is contained in:
recroom2016
2022-02-25 12:41:25 -05:00
parent 62e3fe47a6
commit 8c61c52edf
11 changed files with 2066 additions and 110 deletions

View File

@@ -28,6 +28,7 @@ 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 == "2017")
{
@@ -89,6 +90,64 @@ namespace server
if (Url.StartsWith("players/v1/"))
{
s = getorcreate.GetOrCreate(CachedPlayerID);
}
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 == "messages/v2/get")
{
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);
@@ -111,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);
@@ -132,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"))
@@ -160,6 +228,10 @@ namespace server
if (Url == "relationships/v1/bulkignoreplatformusers")
{
s = BlankResponse;
}
if (Url == "players/v1/list")
{
s = BracketResponse;
}
if (Url == "config/v1/amplitude")
{
@@ -172,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")
{
@@ -180,6 +256,21 @@ namespace server
if (Url == "relationships/v2/get")
{
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")
{
@@ -187,6 +278,12 @@ namespace server
}
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/")
@@ -198,9 +295,17 @@ namespace server
Settings.SetPlayerSettings(text);
}
if (Url == "avatar/v3/items")
{
if (CachedVersionMonth == 09)
{
s = BracketResponse;
}
else
{
s = File.ReadAllText("SaveData\\avataritems.txt");
}
}
if (Url == "equipment/v1/getUnlocked")
{
s = File.ReadAllText("SaveData\\equipment.txt");
@@ -210,20 +315,23 @@ namespace server
s = BracketResponse;
}
if (Url == "consumables/v1/getUnlocked")
{
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")
{
@@ -232,6 +340,10 @@ namespace server
if (Url == "rooms/v1/myrooms")
{
s = File.ReadAllText("SaveData\\myrooms.txt");
}
if (Url == "rooms/v2/myrooms")
{
s = BracketResponse;
}
if (Url == "rooms/v1/mybookmarkedrooms")
{
@@ -257,20 +369,33 @@ namespace server
{
s = gamesessions2018.GameSessions.Create(text);
}
if (rawUrl.Contains("images/v4/uploadtransient?gameSessionId=2018"))
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);
@@ -288,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

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenRec
{
class Class2
{
}
}

View File

@@ -12,13 +12,9 @@ namespace gamesessions2018
public static string JoinRandom(string jsonData)
{
long gamesessionid = 2018L;
bool sandboxmode = false;
Console.WriteLine("OpenRec GameSession Room");
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")
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Enabled")
{
gamesessionid = new Random().Next(0, 100);
}
@@ -30,11 +26,11 @@ namespace gamesessions2018
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,
@@ -64,19 +60,23 @@ namespace gamesessions2018
// Token: 0x060000C0 RID: 192 RVA: 0x00004D24 File Offset: 0x00002F24
public static string Create(string jsonData)
{
Console.WriteLine("Custom Room Test...");
GameSessions.JoinRandomRequest createRequest = JsonConvert.DeserializeObject<GameSessions.JoinRandomRequest>(jsonData);
long gamesessionid = 2016L;
Console.WriteLine("OpenRec GameSession Custom Room");
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Enabled")
{
gamesessionid = new Random().Next(0, 100);
}
GameSessions.CreateRequest createRequest = JsonConvert.DeserializeObject<GameSessions.CreateRequest>(jsonData);
Config.localGameSession = new GameSessions.SessionInstance
{
GameSessionId = 20181L,
GameSessionId = gamesessionid,
RegionId = "us",
RoomId = createRequest.ActivityLevelIds[0],
RoomId = createRequest.ActivityLevelId,
RecRoomId = null,
EventId = null,
CreatorPlayerId = (long?)APIServer.CachedPlayerID,
CreatorPlayerId = 1243409L,
Name = "Custom Room",
ActivityLevelId = createRequest.ActivityLevelIds[0],
ActivityLevelId = createRequest.ActivityLevelId,
Private = false,
Sandbox = true,
SupportsScreens = true,
@@ -85,7 +85,6 @@ namespace gamesessions2018
MaxCapacity = 20,
IsFull = false
};
}
return JsonConvert.SerializeObject(new GameSessions.JoinResult
{
Result = 0,
@@ -270,16 +269,67 @@ 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
{
public bool IsSandbox { get; set; }
public string[] ActivityLevelIds { get; set; }
// 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 ActivityLevelId { 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

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

@@ -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

@@ -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 (; ; )
{

View File

@@ -11,6 +11,7 @@ namespace start
{
}
//ignore this its a beta feature
public static void RecNet()
{
Console.ForegroundColor = ConsoleColor.Blue;
@@ -25,7 +26,7 @@ namespace start
}
ChatStart:
Console.WriteLine("Welcome to OpenRecNet!");
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?");

View File

@@ -12,6 +12,7 @@ namespace start
{
static void Main()
{
//startup for openrec
Setup.setup();
goto Start;
@@ -25,7 +26,7 @@ namespace start
{
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) Changelog" + Environment.NewLine +"2) Change Settings" + Environment.NewLine + "3) Modify Profile" + Environment.NewLine + "4) OpenRecNet" + Environment.NewLine + "5) 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")
{
@@ -42,37 +43,23 @@ namespace start
goto Settings;
Settings:
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) OpenRecNet Info Tab: " + File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") + Environment.NewLine + "4) Go Back");
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\\sandbox.txt") == "Disabled")
if (File.ReadAllText("SaveData\\App\\privaterooms.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Enabled");
File.WriteAllText("SaveData\\App\\privaterooms.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
File.WriteAllText("SaveData\\App\\privaterooms.txt", "Disabled");
}
Console.Clear();
Console.WriteLine("Success!");
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")
{
if (File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") == "Disabled")
{
@@ -86,6 +73,27 @@ namespace start
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();
@@ -175,31 +183,8 @@ namespace start
goto Start;
}
}
if (readline == "4")
{
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();
}
if (readline == "5")
{
Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)");
string readline2 = Console.ReadLine();
@@ -230,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.3.5";
public static string version = "0.4.0";
}
}

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

@@ -10,7 +10,8 @@ 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\\");
@@ -34,6 +35,14 @@ 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");
@@ -54,18 +63,18 @@ namespace start
{
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");
}
if (!(File.Exists("SaveData\\App\\privatedorm.txt")))
{
File.WriteAllText("SaveData\\App\\privatedorm.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");