diff --git a/CannedNet/AppConfigs/appsettings.Clubs.json b/CannedNet/AppConfigs/appsettings.Clubs.json new file mode 100644 index 0000000..7877f2f --- /dev/null +++ b/CannedNet/AppConfigs/appsettings.Clubs.json @@ -0,0 +1,6 @@ +{ + "Hosting": { + "Url": "http://*:5009" + } +} + diff --git a/CannedNet/JSON/bulkprogression.json b/CannedNet/JSON/bulkprogression.json new file mode 100644 index 0000000..df928bd --- /dev/null +++ b/CannedNet/JSON/bulkprogression.json @@ -0,0 +1,13 @@ +[ + { + "AccountId": 1, + "Noteriety": 0, + "CheerGeneral": 0, + "CheerHelpful": 0, + "CheerCreative": 0, + "CheerGreatHost": 0, + "CheerSportsman": 0, + "CheerCredit": 20, + "SelectedCheer": null + } +] \ No newline at end of file diff --git a/CannedNet/JSON/communityboard.json b/CannedNet/JSON/communityboard.json index 18ba156..6855b96 100644 --- a/CannedNet/JSON/communityboard.json +++ b/CannedNet/JSON/communityboard.json @@ -17,7 +17,7 @@ }, "InstagramImages": [ { - "ImageName": "bfv2n2pm1qck4rba5j8qbrvgrbhlgu.jpg", + "ImageName": "gay.png", "ImageUrl": "https://epicquest.live/photo/152846" } ], @@ -26,21 +26,21 @@ "BlobName": "facq8grasrhep777er7bhxjz0.mp4", "Title": "AbyssalFrostTrailer", "Description": "AbyssalFrost\\nBy\\n@Snox\\n@Rick\\n@Jessica\\n@Fandorn", - "ThumbnailBlobName": "kk2abhn2pb699uld3ygbqnznj.jpg", + "ThumbnailBlobName": "gay.png", "SourceUrl": "https://www.youtube.com/watch?v=-eUGRKyYA0w" }, { "BlobName": "nan5xp4xmqu5izjdxoc7tq9h1.mp4", "Title": "How To Get Items & XP in Radium! [5-Stars] [Tokens] [XP]", "Description": "Today ill be teaching the Radium Players on how to get xp and cool items using basic in game rooms. Feel free to look at my other links below.\n\nguns.lol/cge\nhaunt.gg/or\nhaunt.gg/gr\nrec.net/user/rud\nepicquest.live/user/skid", - "ThumbnailBlobName": "16y6ak5kyc048ooy6bm5ergqg.png", + "ThumbnailBlobName": "gay.png", "SourceUrl": "https://www.youtube.com/watch?v=emiEDPz4Va4" }, { "BlobName": "iy3n1k9am3zc87j0mgei6831u.mp4", "Title": "Extreme quest Recap | Radium", "Description": "I tried more extreme quets, are they as hard as they look? find out!\n\nthumbnail maker: @ThatFellaRR\n\nRadium is a 2021 build of rec room which is community hosted. This is in no way meant to create any revenue.\nto learn more join discord.gg/Radium-rr/\nalso check out speedrun.com/radium_", - "ThumbnailBlobName": "fgfe5mrki1hbxbwsu09n028px.png", + "ThumbnailBlobName": "gay.png", "SourceUrl": "https://www.youtube.com/watch?v=zQZ0idzAIrA" } ] diff --git a/CannedNet/JSON/eacchallenge.txt b/CannedNet/JSON/eacchallenge.txt index e570df3..bc5c9ec 100644 --- a/CannedNet/JSON/eacchallenge.txt +++ b/CannedNet/JSON/eacchallenge.txt @@ -1 +1 @@ -"hi :3" \ No newline at end of file +"h" \ No newline at end of file diff --git a/CannedNet/JSON/endpoints.json b/CannedNet/JSON/endpoints.json index e605ac5..4a43c89 100644 --- a/CannedNet/JSON/endpoints.json +++ b/CannedNet/JSON/endpoints.json @@ -13,7 +13,7 @@ "Accounts": "http://localhost:5005", "Link": "https://link.lapis.codes", "RoomComments": "https://roomcomments.lapis.codes", - "Clubs": "https://clubs.lapis.codes", + "Clubs": "http://localhost:5009", "Rooms": "https://rooms.lapis.codes", "PlatformNotifications": "https://api.lapis.codes", "Moderation": "https://api.lapis.codes", diff --git a/CannedNet/JSON/gameconfigs.json b/CannedNet/JSON/gameconfigs.json index bceb648..ec61b59 100644 --- a/CannedNet/JSON/gameconfigs.json +++ b/CannedNet/JSON/gameconfigs.json @@ -137,7 +137,7 @@ }, { "Key": "splitTestHardOverrides", - "Value": "GottaGoFastNUX_2020_09_04=Off;PlayMenuRRUI_2021_01_11=Off;RoomRecommendations_2020_05_06=On;" + "Value": "" }, { "Key": "splitTestSegmentProbabilities", @@ -145,7 +145,7 @@ }, { "Key": "splitTestSoftOverrides", - "Value": "FentReactorDebugGuiEnabled_2025_11_20=DeveloperOnly;" + "Value": "" }, { "Key": "SynchronizedField.RemoveDefaultEntries", diff --git a/CannedNet/JSON/getplayer.json b/CannedNet/JSON/getplayer.json new file mode 100644 index 0000000..1d8560a --- /dev/null +++ b/CannedNet/JSON/getplayer.json @@ -0,0 +1,12 @@ +[ + { + "playerId": 1, + "statusVisibility": 0, + "deviceClass": 0, + "vrMovementMode": 1, + "roomInstance": null, + "isOnline": true, + "appVersion": "20210129", + "platform": 0 + } +] \ No newline at end of file diff --git a/CannedNet/JSON/namedimages.json b/CannedNet/JSON/namedimages.json index 2a7f83a..9d33ada 100644 --- a/CannedNet/JSON/namedimages.json +++ b/CannedNet/JSON/namedimages.json @@ -1,79 +1,79 @@ [ { "FriendlyImageName": "DormRoomBucket", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-10-02T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "Loft", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "StairsLeft", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "TheaterWall", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "CreativePuzzles", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "PVPwall", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "GymWall", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "Cafe", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-09-29T00:00:00", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "LoungeMain", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-11-16T07:44:44", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "LoungeDoorRight", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-11-16T07:44:44", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "DormRoomHallRight", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-11-16T07:44:44", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "LoftTrashCan", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-11-16T07:44:44", "EndTime": "2029-09-09T00:00:00" }, { "FriendlyImageName": "FeaturedLoft", - "ImageName": "qauuenm1foron0kntcwbilz7i.png", + "ImageName": "gay.png", "StartTime": "2025-11-16T07:44:44", "EndTime": "2029-09-09T00:00:00" } diff --git a/CannedNet/JSON/photonsettings.json b/CannedNet/JSON/photonsettings.json index 3e6d13d..f4f8e10 100644 --- a/CannedNet/JSON/photonsettings.json +++ b/CannedNet/JSON/photonsettings.json @@ -1,13 +1,8 @@ { - "RealtimeAppId": "038c1828-7979-4735-8d30-50c3276c30a7", - "VoiceAppId": "f6a30374-c1ce-4ea5-8919-45bc29203bc9", - "ChatAppId": "f6a30374-c1ce-4ea5-8919-45bc29203bc9", + "RealtimeAppId": "c74d22b7-6665-41cf-9ce8-fc70b625caa6", + "VoiceAppId": "f7adbf03-edae-4a7d-bb4b-9e06de75bd96", + "ChatAppId": "4538ca46-903b-48d9-bf33-247ea468a29d", "HostingOption": 1, "Protocol": 0, - "ServerAddress": "127.0.0.1", - "ServerPort": -1, - "VoiceServerPort": -1, - "ChatServerPort": -1, - "NetworkLogging": 0, - "PunLogging": 0 + "FixedRegion": "us" } \ No newline at end of file diff --git a/CannedNet/Models/PlayerSetting.cs b/CannedNet/Models/PlayerSetting.cs index dc46d04..c5a291b 100644 --- a/CannedNet/Models/PlayerSetting.cs +++ b/CannedNet/Models/PlayerSetting.cs @@ -8,8 +8,8 @@ public class PlayerSetting [JsonPropertyName("playerId")] public int PlayerId { get; set; } [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = ""; [JsonPropertyName("value")] - public string Value { get; set; } + public string Value { get; set; } = ""; } diff --git a/CannedNet/Services/APIService.cs b/CannedNet/Services/APIService.cs index 97bbcf1..733ba0a 100644 --- a/CannedNet/Services/APIService.cs +++ b/CannedNet/Services/APIService.cs @@ -1,6 +1,8 @@ using CannedNet; using CannedNet.Data; using Microsoft.EntityFrameworkCore; +using System.Text.Json; +using System.Text.Json.Serialization; namespace CannedNet.Services; @@ -35,7 +37,7 @@ public class APIService app.MapPost("/api/playerReputation/v1/bulk", async (HttpRequest httpRequest, AppDbContext db) => { - var ids = await ParseFormIds(httpRequest); + /*var ids = await ParseFormIds(httpRequest); if (!ids.Any()) return Results.Json(new List()); @@ -53,7 +55,11 @@ public class APIService SelectedCheer = (object?)null }).ToList(); - return Results.Json(reputations); + return Results.Json(reputations);*/ + + // TODO: implement real endpoint from grabbing from db + var json = File.ReadAllText("JSON/bulkprogression.json"); + return Results.Content(json, "application/json"); }); app.MapPost("/api/players/v1/progression/bulk", async (HttpRequest httpRequest, AppDbContext db) => @@ -142,7 +148,13 @@ public class APIService await db.SaveChangesAsync(); } - return Results.Json(avatar); + return Results.Json(new + { + OutfitSelections = avatar.OutfitSelections, + FaceFeatures = avatar.FaceFeatures, + SkinColor = avatar.SkinColor, + HairColor = avatar.HairColor + }); }); app.MapPost("/api/avatar/v2/set", async (HttpRequest request, AppDbContext db) => @@ -239,6 +251,47 @@ public class APIService var settings = await db.PlayerSettings .Where(s => s.PlayerId == id) .ToListAsync(); + + if (!settings.Any()) + { + var defaults = new List + { + new() { PlayerId = id, Key = "Recroom.OOBE", Value = "77" }, + new() { PlayerId = id, Key = "SplitTestAssignedSegments", Value = "1|{\"SplitTesting+PhotonMaxDatagrams_2021_01_11\":\"Off\",\"SplitTesting+Curated_Rooms_2020_08_06\":\"Off\",\"SplitTesting+RoomRecommendationsType_2020_08_14\":\"Aug14MinVisitors35000\"}" }, + new() { PlayerId = id, Key = "PlayerSessionCount", Value = "13" }, + new() { PlayerId = id, Key = "TUTORIAL_COMPLETE_MASK", Value = "11" }, + new() { PlayerId = id, Key = "BACKPACK_FAVORITE_TOOL", Value = "1" }, + new() { PlayerId = id, Key = "VoiceChat", Value = "2" }, + new() { PlayerId = id, Key = "VRAUTOSPRINT", Value = "1" }, + new() { PlayerId = id, Key = "VR_MOVEMENT_MODE", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_SPRINT", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_WALK", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_VEHICLES", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_FLY", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_ROTATE", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_FORCES", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_FALL", Value = "0" }, + new() { PlayerId = id, Key = "COMFORT_TELEPORT", Value = "0" }, + new() { PlayerId = id, Key = "ROTATE_IN_PLACE_ENABLED", Value = "1" }, + new() { PlayerId = id, Key = "ROTATION_INCREMENT", Value = "2" }, + new() { PlayerId = id, Key = "CONTINUOUS_ROTATION_MODE", Value = "1" }, + new() { PlayerId = id, Key = "DONT_LOCK_TOOLS_TO_HAND", Value = "0" }, + new() { PlayerId = id, Key = "QualitySettings", Value = "2" }, + new() { PlayerId = id, Key = "TeleportBuffer", Value = "0" }, + new() { PlayerId = id, Key = "IgnoreBuffer", Value = "1" }, + new() { PlayerId = id, Key = "FIRST_TIME_IN_FLAGS", Value = "0" }, + new() { PlayerId = id, Key = "ShowRoomCenter", Value = "1" }, + new() { PlayerId = id, Key = "USER_TRACKING", Value = "1" }, + new() { PlayerId = id, Key = "STABILIZE_HANDS", Value = "0" }, + new() { PlayerId = id, Key = "MakerPen_SnappingMode", Value = "2" }, + new() { PlayerId = id, Key = "Recroom.ChallengeMap", Value = "17" }, + new() { PlayerId = id, Key = "VoiceFilter2", Value = "1" }, + new() { PlayerId = id, Key = "SFX_VOLUME_PERCENT_PREF", Value = "1" }, + }; + db.PlayerSettings.AddRange(defaults); + await db.SaveChangesAsync(); + settings = defaults; + } return Results.Json(settings); }); @@ -264,6 +317,8 @@ public class APIService using var reader = new StreamReader(request.Body); var body = await reader.ReadToEndAsync(); + Console.WriteLine($"Settings request body: {body}"); + var settings = new List(); if (body.TrimStart().StartsWith("[")) @@ -374,8 +429,8 @@ public class APIService app.MapGet("/api/challenge/v2/getCurrent", async (HttpRequest request, AppDbContext db) => { var json = File.ReadAllText("JSON/weeklychallenge.json"); - //return Results.Content(json, "application/json"); - return "{}"; + return Results.Content(json, "application/json"); + //return "{}"; }); app.MapGet("/roomserver/rooms/createdby/me", async (HttpRequest request, AppDbContext db) => { @@ -385,9 +440,20 @@ public class APIService }); app.MapGet("/roomserver/rooms/{id}", async (HttpRequest request, AppDbContext db, string id) => { - // TODO ADD FUNCTIONALITY var json = File.ReadAllText("JSON/ownedrooms.json"); - return Results.Content(json, "application/json"); + using var doc = System.Text.Json.JsonDocument.Parse(json); + var root = doc.RootElement; + if (root.ValueKind == JsonValueKind.Array) + { + foreach (var room in root.EnumerateArray()) + { + if (room.TryGetProperty("RoomId", out var roomIdProp) && roomIdProp.TryGetInt32(out var roomId) && roomId.ToString() == id) + { + return Results.Content(room.GetRawText(), "application/json"); + } + } + } + return Results.NotFound(); }); app.MapGet("/api/images/v2/named", async (HttpRequest request, AppDbContext db) => { diff --git a/CannedNet/Services/AccountsService.cs b/CannedNet/Services/AccountsService.cs index 7e64f9d..6e3b755 100644 --- a/CannedNet/Services/AccountsService.cs +++ b/CannedNet/Services/AccountsService.cs @@ -78,6 +78,29 @@ public class AccountsService return Results.Json(accounts); }); + app.MapGet("/account/{id}", (HttpRequest request, string id) => + { + var accounts = new Account(); + + if (int.TryParse(id, out var accountId)) + { + accounts = new Account + { + AccountId = accountId, + ProfileImage = "hdqeamlcmatc6qzoi2ybgf0ddijjcf.jpg", + IsJunior = false, + Platforms = 0, + PersonalPronouns = 0, + IdentityFlags = 0, + Username = $"Player{accountId}", + DisplayName = $"Player{accountId}", + CreatedAt = DateTime.UtcNow + }; + } + + return Results.Json(accounts); + }); + app.MapPost("/account/create", async (HttpRequest httpRequest, AppDbContext db) => { int platform = 0; diff --git a/CannedNet/Services/ClubsService.cs b/CannedNet/Services/ClubsService.cs new file mode 100644 index 0000000..b54b244 --- /dev/null +++ b/CannedNet/Services/ClubsService.cs @@ -0,0 +1,14 @@ +namespace CannedNet.Services; + +public class ClubsService +{ + public WebApplicationBuilder Initialize(string[]? args = null) => ServiceExtensions.CreateRecNetBuilder(args); + + public void MapEndpoints(WebApplication app) + { + app.MapGet("/club/home/me", () => + { + return Results.NotFound(); + }); + } +} \ No newline at end of file diff --git a/CannedNet/Services/MatchmakingService.cs b/CannedNet/Services/MatchmakingService.cs index 2c23115..d8a546c 100644 --- a/CannedNet/Services/MatchmakingService.cs +++ b/CannedNet/Services/MatchmakingService.cs @@ -14,6 +14,7 @@ public class MatchmakingService app.MapGet("/player", (HttpRequest request) => { + /* var id = request.Query["id"]; var accounts = new List(); @@ -33,7 +34,10 @@ public class MatchmakingService }); } - return Results.Json(accounts); + return Results.Json(accounts);*/ + + var json = File.ReadAllText("JSON/getplayer.json"); + return Results.Content(json, "application/json"); }); app.MapPost("/goto/room/{room}", (HttpRequest request, string room) => @@ -53,6 +57,7 @@ public class MatchmakingService dataBlob = "", eventId = 0, clubId = 0, + roomCode = "", photonRegionId = "us", photonRoomId = Guid.NewGuid(), name = room, @@ -64,6 +69,35 @@ public class MatchmakingService } }); }); + + app.MapPost("/goto/none", (HttpRequest request) => + { + // dormroom location id : 76d98498-60a1-430c-ab76-b54a29b7a163 + + return Results.Json(new + { + errorCode = 0, + roomInstance = new + { + roomInstanceId = 1, + roomId = 1, + subRoomId = 1, + roomInstanceType = 2, + location = "76d98498-60a1-430c-ab76-b54a29b7a163", + dataBlob = "", + eventId = 0, + clubId = 0, + photonRegionId = "us", + photonRoomId = Guid.NewGuid(), + name = "DormRoom", + maxCapacity = 4, + isFull = false, + isPrivate = true, + isInProgress = false, + EncryptVoiceChat = false + } + }); + }); app.MapPost("/player/heartbeat", async (HttpRequest request) => { diff --git a/CannedNet/Services/ServiceRegistry.cs b/CannedNet/Services/ServiceRegistry.cs index 4e30b07..8141114 100644 --- a/CannedNet/Services/ServiceRegistry.cs +++ b/CannedNet/Services/ServiceRegistry.cs @@ -23,6 +23,7 @@ public static class Services new() { Name = "Accounts", Port = 5005, ServiceType = typeof(AccountsService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, jwt) => new AccountsService().MapEndpoints(app, jwt) }, new() { Name = "Notify", Port = 5006, ServiceType = typeof(NotifyService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, _) => new NotifyService().MapEndpoints(app) }, new() { Name = "CDN", Port = 5007, ServiceType = typeof(CDNService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, _) => new CDNService().MapEndpoints(app) }, - new() { Name = "Image", Port = 5008, ServiceType = typeof(ImageService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, _) => new ImageService().MapEndpoints(app) } + new() { Name = "Image", Port = 5008, ServiceType = typeof(ImageService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, _) => new ImageService().MapEndpoints(app) }, + new() { Name = "Clubs", Port = 5009, ServiceType = typeof(ClubsService), ConfigureBuilder = b => b.ConfigureRecNetServices(), MapEndpoints = (app, _) => new ClubsService().MapEndpoints(app) } ]; }