mirror of
https://github.com/recroom2016/OpenRec-Launcher.git
synced 2026-04-22 13:55:53 +00:00
Add project files.
This commit is contained in:
222
Launcherapi/CustomRooms.cs
Normal file
222
Launcherapi/CustomRooms.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenRec2.Launcherapi
|
||||
{
|
||||
class CustomRooms
|
||||
{
|
||||
public static void RoomGet(string roomnames)
|
||||
{
|
||||
try
|
||||
{
|
||||
string webdata = new WebClient().DownloadString("https://rooms.rec.net/rooms?name=" + roomnames + "&include=297");
|
||||
ModernRooms.Root root2 = JsonConvert.DeserializeObject<ModernRooms.Root>(webdata);
|
||||
room = new Room
|
||||
{
|
||||
RoomId = 29,
|
||||
Name = root2.Name,
|
||||
Description = "OpenRec Downloaded Room",
|
||||
ImageName = root2.ImageName,
|
||||
CreatorPlayerId = Convert.ToUInt64(File.ReadAllText("SaveData\\Profile\\userid.txt")),
|
||||
State = 0,
|
||||
Accessibility = 1,
|
||||
SupportsLevelVoting = false,
|
||||
IsAGRoom = false,
|
||||
CloningAllowed = false,
|
||||
SupportsScreens = true,
|
||||
SupportsWalkVR = true,
|
||||
SupportsTeleportVR = true,
|
||||
ReplicationId = null,
|
||||
ReleaseStatus = 0
|
||||
|
||||
};
|
||||
scene = new List<Scene>
|
||||
{
|
||||
new Scene()
|
||||
{
|
||||
RoomSceneId = 1,
|
||||
RoomId = 29,
|
||||
RoomSceneLocationId = root2.SubRooms[0].UnitySceneId,
|
||||
Name = "Home",
|
||||
IsSandbox = true,
|
||||
DataBlobName = root2.SubRooms[0].DataBlob,
|
||||
MaxPlayers = 20,
|
||||
CanMatchmakeInto = true,
|
||||
DataModifiedAt = root2.SubRooms[0].DataSavedAt,
|
||||
ReplicationId = null,
|
||||
UseLevelBasedMatchmaking = false,
|
||||
UseAgeBasedMatchmaking = false,
|
||||
UseRecRoyaleMatchmaking = false,
|
||||
ReleaseStatus = 0,
|
||||
SupportsJoinInProgress = true
|
||||
}
|
||||
};
|
||||
root = new Root
|
||||
{
|
||||
Room = room,
|
||||
Scenes = scene,
|
||||
CoOwners = new List<ulong>(),
|
||||
InvitedCoOwners = new List<ulong>(),
|
||||
Hosts = new List<ulong>(),
|
||||
InvitedHosts = new List<ulong>(),
|
||||
CheerCount = root2.Stats.CheerCount,
|
||||
FavoriteCount = root2.Stats.FavoriteCount,
|
||||
VisitCount = root2.Stats.VisitCount,
|
||||
Tags = new List<aTag>
|
||||
{
|
||||
new aTag()
|
||||
{
|
||||
Tag = "rro",
|
||||
Type = 2
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\roomname.txt", root2.Name);
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\roomid.txt", Convert.ToString(root2.RoomId));
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\datablob.txt", root2.SubRooms[0].DataBlob);
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\roomsceneid.txt", root2.SubRooms[0].UnitySceneId);
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\imagename.txt", root2.ImageName);
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\cheercount.txt", Convert.ToString(root2.Stats.CheerCount));
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\favcount.txt", Convert.ToString(root2.Stats.FavoriteCount));
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\visitcount.txt", Convert.ToString(root2.Stats.VisitCount));
|
||||
File.WriteAllText("SaveData\\Rooms\\Downloaded\\RoomDetails.json", JsonConvert.SerializeObject(root));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Room room { get; set; }
|
||||
public static List<Scene> scene { get; set; }
|
||||
public static Root root { get; set; }
|
||||
//2018 rooms
|
||||
public class Room
|
||||
{
|
||||
public ulong RoomId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public ulong CreatorPlayerId { get; set; }
|
||||
public string ImageName { get; set; }
|
||||
public int State { get; set; }
|
||||
public int Accessibility { get; set; }
|
||||
public bool SupportsLevelVoting { get; set; }
|
||||
public bool IsAGRoom { get; set; }
|
||||
public bool CloningAllowed { get; set; }
|
||||
public bool SupportsScreens { get; set; }
|
||||
public bool SupportsWalkVR { get; set; }
|
||||
public bool SupportsTeleportVR { get; set; }
|
||||
public object ReplicationId { get; set; }
|
||||
public int ReleaseStatus { get; set; }
|
||||
}
|
||||
|
||||
public class Scene
|
||||
{
|
||||
public int RoomSceneId { get; set; }
|
||||
public ulong RoomId { get; set; }
|
||||
public string RoomSceneLocationId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool IsSandbox { get; set; }
|
||||
public string DataBlobName { get; set; }
|
||||
public int MaxPlayers { get; set; }
|
||||
public bool CanMatchmakeInto { get; set; }
|
||||
public DateTime DataModifiedAt { get; set; }
|
||||
public object ReplicationId { get; set; }
|
||||
public bool UseLevelBasedMatchmaking { get; set; }
|
||||
public bool UseAgeBasedMatchmaking { get; set; }
|
||||
public bool UseRecRoyaleMatchmaking { get; set; }
|
||||
public int ReleaseStatus { get; set; }
|
||||
public bool SupportsJoinInProgress { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
public Room Room { get; set; }
|
||||
public List<Scene> Scenes { get; set; }
|
||||
public List<ulong> CoOwners { get; set; }
|
||||
public List<ulong> InvitedCoOwners { get; set; }
|
||||
public List<ulong> Hosts { get; set; }
|
||||
public List<ulong> InvitedHosts { get; set; }
|
||||
public int CheerCount { get; set; }
|
||||
public int FavoriteCount { get; set; }
|
||||
public int VisitCount { get; set; }
|
||||
public List<aTag> Tags { get; set; }
|
||||
}
|
||||
public class aTag
|
||||
{
|
||||
public string Tag { get; set; }
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
||||
public class ModernRooms
|
||||
{
|
||||
public class Stats
|
||||
{
|
||||
public int CheerCount { get; set; }
|
||||
public int FavoriteCount { get; set; }
|
||||
public int VisitorCount { get; set; }
|
||||
public int VisitCount { get; set; }
|
||||
}
|
||||
|
||||
public class SubRoom
|
||||
{
|
||||
public int SubRoomId { get; set; }
|
||||
public ulong RoomId { get; set; }
|
||||
public string UnitySceneId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DataBlob { get; set; }
|
||||
public DateTime DataSavedAt { get; set; }
|
||||
public bool IsSandbox { get; set; }
|
||||
public int MaxPlayers { get; set; }
|
||||
public int Accessibility { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
public ulong RoomId { get; set; }
|
||||
public bool IsDorm { get; set; }
|
||||
public int MaxPlayerCalculationMode { get; set; }
|
||||
public int MaxPlayers { get; set; }
|
||||
public bool CloningAllowed { get; set; }
|
||||
public bool DisableMicAutoMute { get; set; }
|
||||
public bool DisableRoomComments { get; set; }
|
||||
public bool EncryptVoiceChat { get; set; }
|
||||
public bool LoadScreenLocked { get; set; }
|
||||
public int Version { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string ImageName { get; set; }
|
||||
public int WarningMask { get; set; }
|
||||
public object CustomWarning { get; set; }
|
||||
public int CreatorAccountId { get; set; }
|
||||
public int State { get; set; }
|
||||
public int Accessibility { get; set; }
|
||||
public bool SupportsLevelVoting { get; set; }
|
||||
public bool IsRRO { get; set; }
|
||||
public bool SupportsScreens { get; set; }
|
||||
public bool SupportsWalkVR { get; set; }
|
||||
public bool SupportsTeleportVR { get; set; }
|
||||
public bool SupportsVRLow { get; set; }
|
||||
public bool SupportsQuest2 { get; set; }
|
||||
public bool SupportsMobile { get; set; }
|
||||
public bool SupportsJuniors { get; set; }
|
||||
public int MinLevel { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Stats Stats { get; set; }
|
||||
public List<SubRoom> SubRooms { get; set; }
|
||||
public List<object> Tags { get; set; }
|
||||
public List<object> PromoImages { get; set; }
|
||||
public List<object> PromoExternalContent { get; set; }
|
||||
public List<object> LoadScreens { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
27
Launcherapi/Images.cs
Normal file
27
Launcherapi/Images.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenRec2.Launcherapi
|
||||
{
|
||||
internal class Images
|
||||
{
|
||||
|
||||
//to be able to read image files as images in gui
|
||||
public static Image bytearraytoimage(byte[] source)
|
||||
{
|
||||
try
|
||||
{
|
||||
MemoryStream ms = new MemoryStream(source);
|
||||
Image ret = Image.FromStream(ms);
|
||||
return ret;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Launcherapi/Setting.cs
Normal file
18
Launcherapi/Setting.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace OpenRec2.Launcherapi
|
||||
{
|
||||
// Token: 0x0200003D RID: 61
|
||||
internal class Setting
|
||||
{
|
||||
// Token: 0x170000AC RID: 172
|
||||
// (get) Token: 0x060001C8 RID: 456 RVA: 0x00002D5B File Offset: 0x00000F5B
|
||||
// (set) Token: 0x060001C9 RID: 457 RVA: 0x00002D63 File Offset: 0x00000F63
|
||||
public string Key { get; set; }
|
||||
|
||||
// Token: 0x170000AD RID: 173
|
||||
// (get) Token: 0x060001CA RID: 458 RVA: 0x00002D6C File Offset: 0x00000F6C
|
||||
// (set) Token: 0x060001CB RID: 459 RVA: 0x00002D74 File Offset: 0x00000F74
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
99
Launcherapi/Settings.cs
Normal file
99
Launcherapi/Settings.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OpenRec2.Launcherapi
|
||||
{
|
||||
internal class Settings
|
||||
{
|
||||
public static List<Setting> CreateDefaultSettings()
|
||||
{
|
||||
return new List<Setting>
|
||||
{
|
||||
new Setting
|
||||
{
|
||||
Key = "MOD_BLOCKED_TIME",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "MOD_BLOCKED_DURATION",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "PlayerSessionCount",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "ShowRoomCenter",
|
||||
Value = 1f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "QualitySettings",
|
||||
Value = 3.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "Recroom.OOBE",
|
||||
Value = 100.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "VoiceFilter",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "VIGNETTED_TELEPORT_ENABLED",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "CONTINUOUS_ROTATION_MODE",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "ROTATION_INCREMENT",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "ROTATE_IN_PLACE_ENABLED",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "TeleportBuffer",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "VoiceChat",
|
||||
Value = 1f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "PersonalBubble",
|
||||
Value = 0f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "ShowNames",
|
||||
Value = 1f.ToString()
|
||||
},
|
||||
new Setting
|
||||
{
|
||||
Key = "H.264 plugin",
|
||||
Value = 1f.ToString()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user