Initial upload

This commit is contained in:
myawired
2026-05-03 14:53:43 -04:00
commit 7a46a17131
819 changed files with 607914 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
using Newtonsoft.Json;
using LiteDB;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class ActionLink
{
[BsonId]
[JsonIgnore]
public string LinkId { get; set; } = Utils.GenerateShortCode(6);
public ulong creatorPlayerId { get; set; }
public string? data { get; set; }
public bool isValid { get; set; }
[JsonIgnore]
public LinkType CodeType { get; set; }
[JsonIgnore]
public int ValidHours { get; set; }
[JsonIgnore]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
[JsonIgnore]
public DateTime ExpiresAt => CreatedAt.AddHours(ValidHours);
[JsonIgnore]
public int ExtraDataId { get; set; }
}
public enum LinkType
{
Unknown = -1,
Friend, // 0
Referral, // 1
Meetup, // 2
Club, // 3
PlayerEvent, // 4
Room, // 5
Influencer, // 6
Photo // 7
}
}
+12
View File
@@ -0,0 +1,12 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Amplitude2023
{
public string? AmplitudeKey { get; set; }
public bool? UseRudderStack { get; set; }
public string? RudderStackKey { get; set; }
public bool? UseStatSig { get; set; }
public string? StatSigKey { get; set; }
public int? StatSigEnvironment { get; set; }
}
}
+86
View File
@@ -0,0 +1,86 @@
using System.Collections.Generic;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Config
{
public string MessageOfTheDay { get; set; }
public string CdnBaseUri { get; set; }
public string ShareBaseUrl { get; set; }
public List<LevelProgressionMap> LevelProgressionMaps { get; set; }
public MatchmakingParams MatchmakingParams { get; set; }
public List<List<DailyObjective>> DailyObjectives { get; set; }
public ServerMaintenance ServerMaintainence { get; set; }
public AutoMicMutingConfig AutoMicMutingConfig { get; set; }
public StorefrontConfig StorefrontConfig { get; set; }
public RoomKeyConfig RoomKeyConfig { get; set; }
public RoomCurrencyConfig RoomCurrencyConfig { get; set; }
public List<ConfigTableEntry> ConfigTable { get; set; }
public PhotonConfig PhotonConfig { get; set; }
}
public class LevelProgressionMap
{
public int Level { get; set; }
public int RequiredXp { get; set; }
public int? GiftDropId { get; set; }
}
public class MatchmakingParams
{
public double PreferFullRoomsFrequency { get; set; }
public double PreferEmptyRoomsFrequency { get; set; }
}
public class DailyObjective
{
public int Type { get; set; }
public int Score { get; set; }
public int Xp { get; set; }
}
public class ServerMaintenance
{
public int StartsInMinutes { get; set; }
}
public class AutoMicMutingConfig
{
public double MicSpamVolumeThreshold { get; set; }
public double MicVolumeSampleInterval { get; set; }
public double MicVolumeSampleRollingWindowLength { get; set; }
public double MicSpamSamplePercentageForWarning { get; set; }
public double MicSpamSamplePercentageForWarningToEnd { get; set; }
public double MicSpamSamplePercentageForForceMute { get; set; }
public double MicSpamSamplePercentageForForceMuteToEnd { get; set; }
public double MicSpamWarningStateVolumeMultiplier { get; set; }
}
public class StorefrontConfig
{
public int MinPlayerLevelForGifting { get; set; }
}
public class RoomKeyConfig
{
public int MaxKeysPerRoom { get; set; }
}
public class RoomCurrencyConfig
{
public double AwardCurrencyCooldownSeconds { get; set; }
}
public class ConfigTableEntry
{
public string Key { get; set; }
public string Value { get; set; }
}
public class PhotonConfig
{
public string CloudRegion { get; set; }
public bool CrcCheckEnabled { get; set; }
public bool EnableServerTracingAfterDisconnect { get; set; }
}
}
+21
View File
@@ -0,0 +1,21 @@
using System.Runtime.CompilerServices;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class CustomAvatarItems
{
public List<object>? Results { get; set; }
public int TotalResults { get; set; }
}
public class CreateCustomAvatarItemResponse
{
// {"name":"eeeeeeeeeeeeeeeeeeeee","Description":"eawwwwwwwwwwweweawewaewa","Price":1000,"BaseAvatarItemId":2184,"BaseAvatarItemColor":"#F55C1A","Accessibility":1}
public string? Name { get; set; } // Custom shirt name
public string? Description { get; set; } // Custom shirt description
public int Price { get; set; } // This range from 1000 to 10,000
public int BaseAvatarItemId { get; set; } // the avatar id from the avatar db
public string? BaseAvatarItemColor { get; set; } // Hex color code default is #F55C1A
public int Accessibility { get; set; } // enum 0 for me only, 1 for everyone
}
}
+46
View File
@@ -0,0 +1,46 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Hile
{
public enum HileTypes
{
Obscured = 0,
Time = 1,
Inject = 2,
GiftCount = 3,
Engine = 4,
UnknownDll = 5,
ImageSignature = 6,
AvatarHack = 7,
NetworkCertificatePublicKey = 100,
NetworkCertificateIssuer = 101,
NetworkCertificateMissing = 102,
NetworkCertificateMismatch = 103,
AutosaveChecksumMismatch = 150,
AutosaveSubRoomIdMismatch = 151,
AutosaveChecksumException = 152,
Photon_MissingHash = 200,
Photon_CorruptHash = 201,
Photon_DifferentHash = 203,
AppData_Runtime_LengthMismatch = 300,
AppData_Runtime_LastWriteTimeMismatch = 301,
AppData_Runtime_FileModified = 302,
AppData_Boot_InvalidSignature = 310,
AppData_Boot_UnableToVerifySignatures = 311,
Config_MissingHash = 320,
Config_DifferentHash = 321,
Photon_InstantiateTool = 400,
Memory_Hash_Mismatch = 500,
Driver_Invalid_Signature = 600
}
}
}
+7
View File
@@ -0,0 +1,7 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class LockedItems
{
public List<string> AvatarItemDescriptions { get; set; } = new List<string>();
}
}
+8
View File
@@ -0,0 +1,8 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class MyObjectives
{
public List<object> Objectives { get; set; } = new List<object>();
public List<object> ObjectiveGroups { get; set; } = new List<object>();
}
}
+42
View File
@@ -0,0 +1,42 @@
using Microsoft.Extensions.Diagnostics.HealthChecks;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class NS
{
public string Accounts { get; set; } = "";
public string API { get; set; } = "";
public string Auth { get; set; } = "";
public string BugReporting { get; set; } = "";
public string Cards { get; set; } = "";
public string CDN { get; set; } = "";
public string Chat { get; set; } = "";
public string Clubs { get; set; } = "";
public string CMS { get; set; } = "";
public string Commerce { get; set; } = "";
public string Data { get; set; } = "";
public string DataCollection { get; set; } = "";
public string Discovery { get; set; } = "";
public string Econ { get; set; } = "";
public string GameLogs { get; set; } = "";
public string Geo { get; set; } = "";
public string Images { get; set; } = "";
public string Leaderboard { get; set; } = "";
public string Link { get; set; } = "";
public string Lists { get; set; } = "";
public string Matchmaking { get; set; } = "";
public string Moderation { get; set; } = "";
public string Notifications { get; set; } = "";
public string PlatformNotifications { get; set; } = "";
public string PlayerSettings { get; set; } = "";
public string RoomComments { get; set; } = "";
public string Rooms { get; set; } = "";
public string Storage { get; set; } = "";
public string Strings { get; set; } = "";
public string StringsCDN { get; set; } = "";
public string Studio { get; set; } = "";
public string Thorn { get; set; } = "";
public string Videos { get; set; } = "";
public string WWW { get; set; } = "";
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using Rec_rewild_live_rewrite.api.dbs;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Progress
{
public int Level { get; set; }
public ulong PlayerId { get; set; }
public int XP { get; set; }
public static Progress GetPlayerLevel(ulong player_id)
{
var account = PlayerDB.GetFullAccount(player_id);
if (account == null || account.player == null)
{
return new Progress
{
Level = 0,
PlayerId = player_id,
XP = 0
};
}
return new Progress
{
Level = account.player.Level,
PlayerId = account.player.Id,
XP = account.player.XP
};
}
}
}
+45
View File
@@ -0,0 +1,45 @@
using System.Text.Json.Serialization;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class RRPlus
{
public class SubscriptionResponse
{
[JsonPropertyOrder(1)]
public Subscription subscription { get; set; }
[JsonPropertyOrder(2)]
public ulong? platformAccountSubscribedPlayerId { get; set; }
}
public class Subscription
{
[JsonPropertyOrder(1)] public int subscriptionId { get; set; }
[JsonPropertyOrder(2)] public ulong recNetPlayerId { get; set; }
[JsonPropertyOrder(3)] public int platformType { get; set; }
[JsonPropertyOrder(4)] public string platformId { get; set; }
[JsonPropertyOrder(5)] public string platformPurchaseId { get; set; }
[JsonPropertyOrder(6)] public object? @event { get; set; }
[JsonPropertyOrder(7)] public int type { get; set; }
[JsonPropertyOrder(8)] public int level { get; set; }
[JsonPropertyOrder(9)] public int period { get; set; }
[JsonPropertyOrder(10)] public DateTime expirationDate { get; set; }
[JsonPropertyOrder(11)] public bool isAutoRenewing { get; set; }
[JsonPropertyOrder(12)] public DateTime createdAt { get; set; }
[JsonPropertyOrder(13)] public DateTime modifiedAt { get; set; }
}
public enum SubscriptionLevel
{
Gold,
Platinum,
}
public enum SubscriptionPeriod
{
Month,
Year,
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using Rec_rewild_live_rewrite.api.server.Classes.db_class;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Rep
{
public ulong AccountId { get; set; }
public bool IsCheerful { get; set; }
public int Noteriety { get; set; }
public CheerCategoryEnum SelectedCheer { get; set; }
public int CheerCredit { get; set; }
public int CheerGeneral { get; set; }
public int CheerHelpful { get; set; }
public int CheerCreative { get; set; }
public int CheerGreatHost { get; set; }
public int CheerSportsman { get; set; }
}
}
+154
View File
@@ -0,0 +1,154 @@
using System.Text;
using System.Text.RegularExpressions;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Sanitize
{
public string Context { get; set; } = "RoomChat";
public int Intent { get; set; } = 1;
public bool PreRemoveBlockedCharacters { get; set; } = true;
public string ReplacementChar { get; set; } = "*";
public string Value { get; set; } = "";
public int ruleset { get; set; } = 0;
private const char MaskChar = '*';
// Words that should never be censored
private static readonly HashSet<string> Whitelist = new(StringComparer.OrdinalIgnoreCase)
{
"password",
"pass",
"class",
"assistant",
"account"
};
// Compiled swear patterns
private static readonly List<(string Word, Regex Pattern)> SwearPatterns;
static Sanitize()
{
var swears = File.ReadAllLines("Data/badwords.txt")
.Select(x => x.Trim().ToLowerInvariant())
.Where(x => !string.IsNullOrWhiteSpace(x))
.Distinct()
.ToList();
SwearPatterns = swears
.Select(word => (word, BuildFuzzyRegex(word)))
.ToList();
}
/* ----------------------------------------------------
* PUBLIC API
* --------------------------------------------------*/
public static bool ContainsSwears(string message)
{
if (string.IsNullOrWhiteSpace(message))
return false;
if (ConfigRewild.AllowSwears)
return false;
var normalized = Normalize(message);
return SwearPatterns.Any(p => p.Pattern.IsMatch(normalized));
}
public static string SanitizeMessage(string message)
{
if (string.IsNullOrWhiteSpace(message))
return message;
var tokens = Regex.Split(message, @"(\W+)");
var sb = new StringBuilder(message.Length);
foreach (var token in tokens)
{
// Not a word (punctuation, spaces, etc.)
if (!IsWord(token))
{
sb.Append(token);
continue;
}
var normalized = Normalize(token);
// Ignore very short words
if (normalized.Length < 3)
{
sb.Append(token);
continue;
}
// Whitelist check (normalized!)
if (Whitelist.Contains(normalized))
{
sb.Append(token);
continue;
}
bool replaced = false;
foreach (var (_, pattern) in SwearPatterns)
{
// IMPORTANT: whole-word match only
if (pattern.IsMatch(normalized))
{
sb.Append(new string(MaskChar, token.Length));
Console.WriteLine($"[Sanitize] Censored word in message: '{token}'");
replaced = true;
break;
}
}
if (!replaced)
sb.Append(token);
}
return sb.ToString();
}
/* ----------------------------------------------------
* INTERNAL HELPERS
* --------------------------------------------------*/
private static bool IsWord(string input) =>
input.Any(char.IsLetterOrDigit);
private static Regex BuildFuzzyRegex(string word)
{
// Example: f.{0,1}u.{0,1}c.{0,1}k
var pattern = string.Join(".{0,1}",
word.Select(c => Regex.Escape(c.ToString())));
// Force FULL match only
return new Regex(
$"^{pattern}$",
RegexOptions.IgnoreCase | RegexOptions.Compiled
);
}
private static string Normalize(string input)
{
input = input.ToLowerInvariant();
input = Regex.Replace(input, @"[0@]", "o");
input = Regex.Replace(input, @"[1!|]", "i");
input = Regex.Replace(input, @"[$5]", "s");
input = Regex.Replace(input, @"3", "e");
input = Regex.Replace(input, @"7", "t");
// Remove non letters
input = Regex.Replace(input, @"[^a-z]", "");
// Collapse repeats (fuuuuuck → fuuck)
input = Regex.Replace(input, @"(.)\1{2,}", "$1$1");
return input;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
using Newtonsoft.Json;
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class SteamAuthResponse
{
public SteamResponse? response { get; set; }
}
public class SteamResponse
{
[JsonProperty("params")]
public SteamParams? paramsData { get; set; }
}
public class SteamParams
{
public string? result { get; set; }
public string? steamid { get; set; }
public string? ownersteamid { get; set; }
public bool vacbanned { get; set; }
public bool publisherbanned { get; set; }
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class Sub
{
public ulong creatorAccountId { get; set; }
public ulong clubId { get; set; }
public int membershipType { get; set; }
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class SuccessResponse
{
public bool success { get; set; }
public object? value { get; set; }
}
}
+26
View File
@@ -0,0 +1,26 @@
namespace Rec_rewild_live_rewrite.api.server.Classes
{
public class VersionCheck
{
public VersionStatus ValidVersion { get; set; }
public VersionStatus VersionStatus { get; set; }
public UpdateNoti UpdateNotificationStage { get; set; }
public bool IsVersionIslanded { get; set; }
public bool IsCrossPlayDisabled { get; set; }
}
public enum VersionStatus
{
ValidForPlay,
UpdateRequired
}
public enum UpdateNoti
{
None,
Silent,
Warn,
Prompt,
Require
}
}
@@ -0,0 +1,90 @@
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class ChatDBClasses
{
public class ChatThread
{
public List<ChatMessage> Messages { get; set; }
public long ChatThreadId { get; set; }
public List<ulong> PlayerIds { get; set; }
public long LastReadMessageId { get; set; }
public string ChatThreadName { get; set; }
public DateTime? SnoozedUntil { get; set; }
public bool IsFavorited { get; set; }
}
public class ChatMessage
{
public long ChatMessageId { get; set; }
public long ChatThreadId { get; set; }
public int SenderPlayerId { get; set; }
public DateTime TimeSent { get; set; }
public string Contents { get; set; }
public int ModerationState { get; set; } // todo find the enum
}
public class MessageJson
{
public MessageContentType Type { get; set; }
public int Version { get; set; } // default ver is 2
public string Data { get; set; }
}
public struct SendMessageResponse
{
public ChatResults ChatResult { get; set; }
public ChatThread ChatThread { get; set; }
}
public class ChatPrivacySettings
{
public ulong playerId { get; set; }
public ChatPrivacy directMessagePrivacySetting { get; set; } = ChatPrivacy.Friends;
public ChatPrivacy groupChatPrivacySetting { get; set; } = ChatPrivacy.Friends;
}
public enum ChatResults
{
Success,
InvalidArguments,
ThreadNotFound,
MembershipNotFound,
PlayerAlreadyOnThread,
CannotMessagePlayer,
InvalidCharacters,
RecentlyLeftThread,
ThreadTooLarge
}
public enum ModerationState : byte
{
Active,
Junior_Pending = 11,
Moderation_Pending = 100,
Moderation_Closed,
Moderation_Banned,
MarkedForDelete = 255
}
public enum QueryMode
{
Latest,
NewerThan,
OlderThan
}
public enum MessageContentType
{
Text,
PartyInvite,
Photo
}
public enum ChatPrivacy
{
Friends,
Favorites,
NoOne
}
}
}
@@ -0,0 +1,6 @@
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class ClubDBClasses
{
}
}
@@ -0,0 +1,134 @@
using LiteDB;
using Microsoft.AspNetCore.Http.HttpResults;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class EventDBClasses
{
public class CreateEventRequest
{
// {"RoomId":708,"SubRoomId":1444,"ClubId":null,"name":"awdadwdawdadwdawdadwd","Description":"awdadwdawdadwdawdadwdawdadwdawdadwdawdadwdawdadwdawdadwdawdadwdawdadwd","Tags":["grandopening"],"ImageName":"J9W8A0FUGWXG4CMBKFDJ46CUZHJOHP.png","StartTime":"2025-12-13T14:20:41.6244242Z","EndTime":"2025-12-13T14:50:41.6244242Z","Accessibility":1,"IsMultiInstance":false,"SupportMultiInstanceRoomChat":false,"DefaultBroadcastPermissions":0,"CanRequestBroadcastPermissions":0}
public ulong RoomId { get; set; }
public ulong? SubRoomId { get; set; }
public ulong? ClubId { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public List<string>? Tags { get; set; }
public string? ImageName { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public PlayerEventAccessibility Accessibility { get; set; }
public bool IsMultiInstance { get; set; } // this is just multi instance room
public bool SupportMultiInstanceRoomChat { get; set; } // this let player talk betweeen room instance using room chat
public int DefaultBroadcastPermissions { get; set; } // idk what this is used for
public int CanRequestBroadcastPermissions { get; set; } // idk what this is used for
}
public class FullPlayerEvent
{
public List<FullTag>? Tags { get; set; }
public List<FullEventResponses>? Responses { get; set; }
[BsonId]
public ulong PlayerEventId { get; set; }
public ulong? CreatorPlayerId { get; set; }
public string? ImageName { get; set; }
public ulong RoomId { get; set; }
public ulong? SubRoomId { get; set; }
public ulong? ClubId { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public int AttendeeCount { get; set; }
public int State { get; set; }
public PlayerEventAccessibility Accessibility { get; set; }
public bool IsMultiInstance { get; set; } // this is just multi instance room
public bool SupportMultiInstanceRoomChat { get; set; } // this let player talk betweeen room instance using room chat
public BroadcastPermissionsEnum DefaultBroadcastPermissions { get; set; } // idk what this is used for
public BroadcastPermissionsEnum CanRequestBroadcastPermissions { get; set; } // idk what this is used for
public ulong BroadcastingRoomInstanceId { get; set; }
public DateTime? RecurrenceSchedule { get; set; }
}
public class FullTag
{
public string? Tag { get; set; }
public TagType Type { get; set; }
}
public class FullEventResponses
{
public ulong PlayerEventResponseId { get; set; }
public ulong PlayerEventId { get; set; }
public ulong PlayerId { get; set; }
public DateTime CreatedAt { get; set; }
public PlayerEventResponseType Type { get; set; } = PlayerEventResponseType.None;
}
public enum PlayerEventResponseType
{
None = -1,
Yes,
Interested,
No,
Pending
}
public enum BroadcastPermissionsEnum
{
None,
RoomOwners = 256,
All = 2147483647
}
public enum PlayerEventAccessibility
{
Private,
Public,
Unlisted
}
public enum TagType
{
Unknown1 = 0,
Unknown2 = 1,
Unknown3 = 2
}
public enum EventResults
{
Success,
HasModeratorClosedEvent,
DoesNotExist,
PlayerDoesNotExist,
RoomDoesNotExist,
StatusUnchanged,
PrivateEvent,
SomethingWentWrong,
DoesNotOwnRoom,
ResponseDoesNotExist,
PlayerAlreadyInvited,
EventDatesInvalid,
EventTooLong,
EventTooShort,
InappropriateName,
InappropriateDescription,
SomeInvitesFailed,
CannotInviteJunior,
EventCountLimitReached,
DoesNotOwnEvent,
UnregisteredOrJuniorNotAllowed,
InvalidClubPermissions,
ImageDoesNotExist,
SubRoomDoesNotExist,
DoesNotOwnSubRoom,
ModifyTagsFailed,
RoomCapacityTooLow,
BroadcastEventNotMultiInstance,
PlayerNotAllowedToCreateMultiInstanceEvents,
PlayerBannedFromEventCreation,
EventIsModerationClosed,
EventIsModerationPendingReview
}
}
}
@@ -0,0 +1,61 @@
using System;
using LiteDB;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class YourFriendData
{
[BsonId]
public ObjectId? Id { get; set; }
public ulong PlayerID { get; set; }
public RelationshipDetail Relationship { get; set; }
}
public class FriendData
{
[BsonId]
public ObjectId? Id { get; set; }
public string? FriendId { get; set; }
public RelationshipType Relationship { get; set; }
public FriendInfo FriendFlags { get; set; }
public ReciprocalStatus Status { get; set; }
}
public class RelationshipDetail
{
public ulong Id { get; set; }
public ulong PlayerID { get; set; }
public ulong OtherPlayerID { get; set; }
public RelationshipType RelationshipType { get; set; }
public ReciprocalStatus Muted { get; set; }
public ReciprocalStatus Ignored { get; set; }
public ReciprocalStatus Favorited { get; set; }
public int VoiceVolume { get; set; } = 100;
}
public enum RelationshipType
{
None,
FriendRequestSent,
FriendRequestReceived,
Friend,
}
[Flags]
public enum FriendInfo
{
None = 0,
Favorited = 1,
Muted = 2,
Ignored = 4,
Blocked = 5
}
public enum ReciprocalStatus
{
None,
Local,
Remote,
Mutual
}
}
@@ -0,0 +1,96 @@
using System.Text.Json.Serialization;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class LeaderboardDBClasses
{
public class GetNearbyScoresRequest
{
// {"PlayerId":2,"StatChannel":2,"RoomId":29,"FilterType":1,"SortAscending":false,"WindowSize":10}
public ulong PlayerId { get; set; }
public int StatChannel { get; set; }
public ulong RoomId { get; set; }
public FilterTypeEnum FilterType { get; set; }
public bool SortAscending { get; set; }
public int WindowSize { get; set; }
}
public class GetRanksRequest
{
// {"PlayerId":2,"StatChannel":2,"RoomId":29,"FilterType":0,"SortAscending":false,"RankStart":0,"RankEnd":9}
public ulong PlayerId { get; set; }
public int StatChannel { get; set; }
public ulong RoomId { get; set; }
public FilterTypeEnum FilterType { get; set; }
public bool SortAscending { get; set; }
public int RankStart { get; set; } // skip
public int RankEnd { get; set; } // take
}
public class CheckAndSetStatRequest
{
// {"StatChannel":2,"RoomId":29,"StatValue":1,"CurrentStatValue":null}
public int StatChannel { get; set; }
public ulong RoomId { get; set; }
public int StatValue { get; set; }
public int? CurrentStatValue { get; set; }
}
public class Entry
{
[JsonIgnore]
public int Id { get; set; } // LiteDB PK
public int PlayerId { get; set; }
[JsonIgnore]
public int StatChannel { get; set; }
[JsonIgnore]
public long RoomId { get; set; }
public int Score { get; set; }
public int Rank { get; set; }
}
public class SingleLeaderboard
{
public List<Entry> Rows { get; set; }
}
public class FullLeaderboard
{
public List<Entry> GlobalOverall { get; set; }
public List<Entry> GlobalPeriodic { get; set; }
public List<Entry> FriendsOverall { get; set; }
public List<Entry> FriendsPeriodic { get; set; }
public DateTime NextResetUTC { get; set; }
}
public enum RequestResult
{
Success,
InvalidStat,
RedisConnectionError
}
public enum FilterType
{
Global,
Friends
}
public enum Timeframe
{
AllTime,
TwoWeeks
}
public enum FilterTypeEnum
{
NearbyScoresGlobal,
NearbyScoresFriends,
Champions,
NUM_VALUES // wat
}
}
}
@@ -0,0 +1,341 @@
using System;
using System.Text.Json.Serialization;
using LiteDB;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class account_data
{
[JsonPropertyOrder(1)]
public ulong accountId { get; set; }
[JsonPropertyOrder(2)]
public string? username { get; set; }
[JsonPropertyOrder(3)]
public string? displayName { get; set; }
[JsonPropertyOrder(4)]
public string? profileImage { get; set; }
[JsonPropertyOrder(5)]
public bool? isJunior { get; set; }
[JsonPropertyOrder(6)]
public long platforms { get; set; }
[JsonPropertyOrder(7)]
public long personalPronouns { get; set; }
[JsonPropertyOrder(8)]
public long identityFlags { get; set; }
[JsonPropertyOrder(9)]
public DateTime createdAt { get; set; }
[JsonPropertyOrder(10)]
public bool isMetaPlatformBlocked { get; set; } = false;
}
public class setting_data
{
public ulong accountId { get; set; }
public string Key { get; set; }
public string Val { get; set; }
}
public class player_data
{
public ulong id { get; set; }
public ulong playerid { get; set; }
public Platforms platform { get; set; }
public List<string>? deviceId { get; set; }
public string? authtoken { get; set; }
public string? password { get; set; }
public player_info? player { get; set; }
public player_extra? player_Extra { get; set; }
public DevFlag dev_Flag { get; set; }
}
public enum Platforms
{
All = -1,
Steam,
Oculus,
PlayStation,
Xbox,
RecNet,
IOS,
GooglePlay,
Standalone
}
public class player_extra
{
public ulong? DormRoomID { get; set; }
public List<string>? IpAddresses { get; set; }
public ulong DiscordId { get; set; }
public string? Bio { get; set; }
public string? avatar { get; set; }
public List<avatar_data_saved>? SavedOutfits { get; set; }
public Moderation_Detail.ModerationBlockDetails? ModerationBlockDetails { get; set; }
public List<ulong>? CheeredRooms { get; set; }
public List<ulong>? FavoritedRooms { get; set; }
public int sub_count { get; set; } = 0;
public List<ulong> SubbedTo { get; set; } = new();
public bool IsRecentRoomHistoryVisible { get; set; } = true;
public Influencer? Influencer { get; set; }
public CustomAvatarItems CustomAvatarItems { get; set; } = new CustomAvatarItems();
public MyRoomData MyRoomData { get; set; } = new MyRoomData();
public List<MessageData>? Messages { get; set; }
public PlayerPhotoTaggingSetting PlayerPhotoTaggingSetting { get; set; } = PlayerPhotoTaggingSetting.Anyone;
}
public enum PlayerPhotoTaggingSetting
{
Anyone,
Friends,
NoOne
}
public class SetPlayerPhotoTaggingSettingRequest
{
public PlayerPhotoTaggingSetting Setting { get; set; }
}
public class MyRoomData
{
public List<string> owned_room_keys { get; set; } = new List<string>();
public List<PlayerData> PlayerData { get; set; } = new List<PlayerData>();
public List<My_Room_currencies> Roomcurrencies { get; set; } = new List<My_Room_currencies>();
}
public class PlayerData
{
public ulong RoomId { get; set; }
public string Data { get; set; }
}
public class My_Room_currencies
{
public long RoomId { get; set; }
public string Id { get; set; }
public long Value { get; set; }
}
public class SubscribedToEntry
{
public ulong PlayerId { get; set; }
}
public class avatar_data_saved
{
public ulong Slot { get; set; }
public string? Avatar { get; set; }
public string? ImageName { get; set; }
public List<CustomAvatarItemEntry>? CustomAvatarItems { get; set; }
public string? FaceFeatures { get; set; }
public string? HairColor { get; set; }
public string? Name { get; set; }
public string? SkinColor { get; set; }
public string? OutfitSelections { get; set; }
public string? OutfitSelectionsV2 { get; set; }
public string? PreviewImageName { get; set; }
}
public class CustomAvatarItemEntry
{
public string? CustomAvatarItemId { get; set; }
public int BodyPart { get; set; }
}
public class avatar_data
{
public string? OutfitSelections { get; set; }
public string? FaceFeatures { get; set; }
public string? SkinColor { get; set; }
public string? HairColor { get; set; }
}
public class player_info
{
public ulong Id { get; set; }
public string? Username { get; set; }
public string? DisplayName { get; set; }
public string? DisplayEmoji { get; set; }
public string? Email { get; set; }
public int XP { get; set; }
public int Level { get; set; }
public int pronounFlags { get; set; }
public int identityFlags { get; set; }
public bool IsJunior { get; set; }
public bool AvoidJuniors { get; set; }
public mPlayerReputation? PlayerReputation { get; set; }
public List<mPlatformID>? PlatformIds { get; set; }
public DateTime created_at { get; set; }
public DateTime last_login_time { get; set; }
public List<ulong> recent_rooms { get; set; } = new List<ulong>();
public string? bannerImage { get; set; }
public string? profileImage { get; set; }
}
public class AccountLogin
{
public DateTime createdAt { get; set; }
public DateTime lastLoginTime { get; set; }
public ulong accountId { get; set; }
public Platforms platform { get; set; }
public string? platformId { get; set; }
}
public class mPlatformID
{
public Platforms Platform { get; set; }
public ulong PlatformId { get; set; }
}
public class mPlayerReputation
{
public bool IsCheerful { get; set; }
public int Noteriety { get; set; }
public int CheerGeneral { get; set; }
public int CheerHelpful { get; set; }
public int CheerGreatHost { get; set; }
public int CheerSportsman { get; set; }
public int CheerCreative { get; set; }
public int CheerCredit { get; set; }
public int SubscriberCount { get; set; }
public int SubscribedCount { get; set; }
public CheerCategoryEnum SelectedCheer { get; set; }
}
public class DeleteMessagesRequest
{
public List<ulong> MessageIds { get; set; }
}
public enum CheerCategoryEnum
{
None = -1,
General = 0,
Helpful = 10,
Sportmanship = 20,
GreatHost = 30,
Creative = 40
}
public class account_data_web
{
public ulong accountId { get; set; }
public DateTime createdAt { get; set; }
public string? displayName { get; set; }
public string? displayEmoji { get; set; }
public long identityFlags { get; set; }
public bool? isJunior { get; set; }
public long personalPronouns { get; set; }
public long platforms { get; set; }
public string? profileImage { get; set; }
public string? bannerImage { get; set; }
public string? username { get; set; }
}
public class account_data_me
{
public ulong accountId { get; set; }
public int availableusernameChanges { get; set; } = 3;
public string? bannerImage { get; set; }
public DateTime createdAt { get; set; }
public string? email { get; set; }
public string? displayName { get; set; }
public string? displayEmoji { get; set; }
public long identityFlags { get; set; }
public bool hasBirthday { get; set; } = true;
public string? Phone { get; set; }
public bool? isJunior { get; set; }
public long personalPronouns { get; set; }
public long platforms { get; set; }
public string? profileImage { get; set; }
public bool TreatAsJunior { get; set; } = false;
public string? username { get; set; }
}
public class CustomAvatarItems
{
public bool isCreationAllowedForAccount { get; set; } = true;
public bool isCreationEnabled { get; set; } = true;
public bool isRenderingEnabled { get; set; } = true;
public List<string> ownedItems { get; set; } = new List<string>();
}
public class Influencer
{
public string creatorCode { get; set; } = "";
public bool isInfluencer { get; set; } = false;
public ulong SupportingInfluencer { get; set; }
}
public class MessageData
{
/*
[
{
"Id": 15909836337,
"FromPlayerId": 64495891,
"SentTime": "2025-05-27T11:39:25.12Z",
"Type": 200,
"Data": "58129955",
"RoomId": null,
"PlayerEventId": null
}
]
*/
public ulong Id { get; set; }
public ulong FromPlayerId { get; set; }
public DateTime SentTime { get; set; }
public WebsocketEvents.MessageType Type { get; set; }
public string? Data { get; set; }
public ulong? RoomId { get; set; }
public ulong? PlayerEventId { get; set; }
}
public enum DeviceClasses
{
Unknown,
VR,
Screen,
Mobile,
VRLow,
Quest2
}
public class account_login<T>
{
public bool success { get; set; }
public string? error { get; set; }
[JsonIgnore]
public ulong accid { get; set; }
}
[Flags]
public enum DevFlag
{
none = 0,
screenshare = 1,
dev = 2,
mod = 4,
owner = 8,
junior = 16,
keepsake = 32,
newly_created_account = 64,
restricted_account = 128,
unused_2 = 256,
unused_3 = 512,
unused_4 = 1024,
unused_5 = 2048,
unused_6 = 4096,
unused_7 = 8192,
}
}
@@ -0,0 +1,255 @@
using LiteDB;
using Newtonsoft.Json;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class RoomDBClasses
{
public class Resultslist<T>
{
public List<T>? Results { get; set; }
public long TotalResults { get; set; }
}
[Flags]
public enum WarningMaskType
{
None = 0,
Scary = 1,
Mature = 2,
FlashingLights = 4,
IntenseMotion = 8,
Violence = 16,
Custom = 32,
Reports = 64
}
public class RoomRoot
{
public RoomDBClasses.RoomAccessibility Accessibility { get; set; }
public int AgeRating { get; set; }
public bool AutoLocalizeRoom { get; set; }
public DateTime? BecameRRStudioRoomAt { get; set; }
public bool CloningAllowed { get; set; }
public DateTime CreatedAt { get; set; }
public ulong CreatorAccountId { get; set; }
public string? CurrentSnapshotId { get; set; }
public bool NeedsSnapshotId { get; set; }
public string CustomWarning { get; set; }
public string DataBlob { get; set; }
// public string DataBlobHash { get; set; }
public string Description { get; set; }
public bool DisableMicAutoMute { get; set; }
public bool DisableRoomComments { get; set; }
public bool EncryptVoiceChat { get; set; }
public bool ExcludeFromLists { get; set; }
public bool ExcludeFromSearch { get; set; }
public string ImageName { get; set; }
public bool IsDeveloperOwned { get; set; }
public bool IsDorm { get; set; }
public bool IsJuniorCreated { get; set; }
public bool IsPlacePlay { get; set; }
public bool IsRRO { get; set; }
public bool IsRecRoomApproved { get; set; }
public bool LoadScreenLocked { get; set; }
public List<LoadScreen> LoadScreens { get; set; }
public LocalizationContext LocalizationContext { get; set; }
public int MaxPlayerCalculationMode { get; set; }
public int MaxPlayers { get; set; }
public int MinLevel { get; set; }
public int? MinUgcSubVersion { get; set; }
public string Name { get; set; }
public int? PersistenceVersion { get; set; }
public List<string> PromoExternalContent { get; set; }
public List<string> PromoImages { get; set; }
public int PublishState { get; set; }
public DateTime PublishedAt { get; set; }
public string RankedEntityId { get; set; }
public object RankingContext { get; set; }
public List<string> RestrictedCircuitsAllowListNames { get; set; }
public List<RoleClass> Roles { get; set; }
public RoomBanDetails RoomBanDetails { get; set; }
[BsonId]
public ulong RoomId { get; set; }
public RoomState State { get; set; }
public Stats Stats { get; set; }
public List<SubRoom> SubRooms { get; set; }
public bool SupportsJuniors { get; set; }
public bool SupportsLevelVoting { get; set; }
public bool SupportsMobile { get; set; }
public bool SupportsQuest2 { get; set; }
public bool SupportsScreens { get; set; }
public bool SupportsTeleportVR { get; set; }
public bool SupportsVRLow { get; set; }
public bool SupportsWalkVR { get; set; }
public List<TagClass> Tags { get; set; }
public bool ToxmodEnabled { get; set; }
public int? UgcSubVersion { get; set; }
public int? UgcVersion { get; set; }
public WarningMaskType WarningMask { get; set; }
}
public class LoadScreen
{
public string ImageName { get; set; }
public string Subtitle { get; set; }
public string Title { get; set; }
}
public class LocalizationContext
{
public List<string> LocalizedFields { get; set; }
public string Scope { get; set; }
public string TargetLocale { get; set; }
}
public class RoleClass
{
public long AccountId { get; set; }
public int InvitedRole { get; set; }
public long? LastChangedByAccountId { get; set; }
public RoomDBClasses.Role_data Role { get; set; }
}
public class RoomBanDetails
{
public long AccountId { get; set; }
public DateTime? BanEndTime { get; set; }
public DateTime BanStartTime { get; set; }
public long BannedByAccountId { get; set; }
public string Reason { get; set; }
public int Status { get; set; }
public long? UnbannedByAccountId { get; set; }
}
public class Stats
{
public int CheerCount { get; set; }
public int FavoriteCount { get; set; }
public int VisitCount { get; set; }
public int VisitorCount { get; set; }
}
public class SubRoom
{
[BsonId]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public ObjectId? Id { get; set; }
public CurrentSave? CurrentSave { get; set; }
[JsonIgnore]
public List<CurrentSave> AllSaves { get; set; } = new();
public RoomAccessibility Accessibility { get; set; }
public long? CreatorAccountId { get; set; }
public bool IsSandbox { get; set; }
public int LastModeratedSaveModerationState { get; set; }
public int MaxPlayers { get; set; }
public string Name { get; set; }
public ulong RoomId { get; set; }
public bool ShouldAutoStageSaves { get; set; }
public long? StagedSubRoomDataSaveId { get; set; }
public ulong SubRoomId { get; set; }
public string UnitySceneId { get; set; }
}
public class CurrentSave
{
public DateTime CreatedAt { get; set; }
public string DataBlob { get; set; }
//public string DataBlobHash { get; set; }
public string Description { get; set; }
public int ModerationState { get; set; }
public int OMVersion { get; set; }
public int PersistenceVersion { get; set; }
public List<string> ReferencedUnityAssetIds { get; set; }
public ulong? SavedByAccountId { get; set; }
public DeviceClasses? SavedOnDeviceClass { get; set; }
public Platforms? SavedOnPlatform { get; set; }
public ulong SubRoomDataSaveId { get; set; }
public ulong SubRoomId { get; set; }
public int UgcSubVersion { get; set; }
public string UnityAssetId { get; set; } // optional, may be null
}
public class TagClass
{
public string Tag { get; set; }
public int Type { get; set; }
}
public class SubroomSaveResults
{
public List<CurrentSave> Results { get; set; } = new();
public int TotalCount { get; set; }
}
public class RoomFileData
{
public RoomData? RoomData { get; set; }
public SubRoomData? SubRoomData { get; set; }
public string? InventionUsage { get; set; }
public int PersistenceVersion { get; set; }
public int OMVersion { get; set; }
public int UgcSubVersion { get; set; }
public string? Description { get; set; }
public bool AutoPublish { get; set; }
}
public class RoomData
{
public string? Filename { get; set; }
public string? Hash { get; set; }
public string? OwnershipProof { get; set; }
}
public class SubRoomData
{
public string? Filename { get; set; }
public string? Hash { get; set; }
public string? OwnershipProof { get; set; }
}
public enum RoomAccessibility
{
Private,
Public,
Unlisted,
Dev_only,
Dev_Unlisted,
}
public enum RoomState
{
Active,
PendingJunior = 11,
Moderation_PendingReview = 100,
Moderation_Closed,
MarkedForDelete = 1000
}
public class Tags
{
public string? Tag { get; set; }
public int Type { get; set; }
}
public class LoadScreens
{
public string? ImageName { get; set; }
public string? Title { get; set; }
public string? Subtitle { get; set; }
}
public enum Role_data : byte
{
None,
Banned,
Host = 10,
Moderator = 20,
CoOwner = 30,
TemporaryCoOwner,
Creator = 255
}
}
}
@@ -0,0 +1,17 @@
using LiteDB;
namespace Rec_rewild_live_rewrite.api.server.Classes.db_class
{
public class PlayerSetting
{
[BsonId]
public ulong PlayerId { get; set; }
public List<Setting> Settings { get; set; } = new List<Setting>();
}
public class Setting
{
public string? Key { get; set; }
public string? Value { get; set; }
}
}