mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-25 23:18:54 -07:00
WE'RE IN THE FUCKING DORM
I JUST HIT THE JACKPOTTTT!!!!!!!!!! YUH YUH YUH YUH!!!
This commit is contained in:
@@ -15,6 +15,7 @@ public class AppDbContext : DbContext
|
|||||||
public DbSet<AvatarItem> AvatarItems { get; set; }
|
public DbSet<AvatarItem> AvatarItems { get; set; }
|
||||||
public DbSet<PlayerAvatar> PlayerAvatars { get; set; }
|
public DbSet<PlayerAvatar> PlayerAvatars { get; set; }
|
||||||
public DbSet<SavedOutfit> SavedOutfits { get; set; }
|
public DbSet<SavedOutfit> SavedOutfits { get; set; }
|
||||||
|
public DbSet<RoomInstance> RoomInstances { get; set; }
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@@ -91,6 +92,16 @@ public class AppDbContext : DbContext
|
|||||||
entity.HasIndex(e => e.OwnerAccountId).IsUnique();
|
entity.HasIndex(e => e.OwnerAccountId).IsUnique();
|
||||||
entity.ToTable("saved_outfits");
|
entity.ToTable("saved_outfits");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// room_instances
|
||||||
|
modelBuilder.Entity<RoomInstance>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id);
|
||||||
|
entity.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||||
|
entity.Property(e => e.OwnerAccountId).IsRequired();
|
||||||
|
entity.HasIndex(e => e.OwnerAccountId).IsUnique();
|
||||||
|
entity.ToTable("room_instances");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,142 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Name": "bf5d8d41a7184e779399ff45a9e8785a",
|
"Name": "bf5d8d41a7184e779399ff45a9e8785a",
|
||||||
"Title": "CannedNet",
|
"Title": "Rec Room Tokens",
|
||||||
"Message": "dude why am i even doing this, this is hell",
|
"Message": "Redeem your Rec Room Tokens for all kinds of fun rewards! You can shop at the Rec Center Merch Booth or the Store section of your Watch Menu.",
|
||||||
"RoomNames": [],
|
"RoomNames": [],
|
||||||
"Context": 0,
|
"Context": 0,
|
||||||
"InputType": 0,
|
"InputType": 0,
|
||||||
"Visibility": 0,
|
"Visibility": 0,
|
||||||
"AllowCycling": false,
|
"AllowCycling": true,
|
||||||
"RestrictToNewUsers": false,
|
"RestrictToNewUsers": false,
|
||||||
"ImageName": "gay",
|
"ImageName": "gay",
|
||||||
"PlatformMask": 175,
|
"PlatformMask": 175,
|
||||||
"CreatedAt": "2019-02-28T18:27:25Z"
|
"CreatedAt": "2019-02-28T18:27:25Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "3801fdd940334b85a7460ffdda73f9de",
|
||||||
|
"Title": "Become a Star!",
|
||||||
|
"Message": "Use #RecRoom on your Instagram and Twitter posts for a chance to make it onto our Community Board!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 167,
|
||||||
|
"CreatedAt": "2019-02-28T18:15:33Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "d517b46a3f734db39d77f2a15b105495",
|
||||||
|
"Title": "Find Your Style",
|
||||||
|
"Message": "Personalize your outfit and appearance in your Dorm Room.",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 175,
|
||||||
|
"CreatedAt": "2019-03-02T00:12:59Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "bc8569de432a4cc4b0e69d1b619921cb",
|
||||||
|
"Title": "Room Cheers",
|
||||||
|
"Message": "Cheer and Favorite any room in the This Room section of your Watch Menu.",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 175,
|
||||||
|
"CreatedAt": "2019-02-28T18:08:56Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "4a9bec133a26457280eb30887e9442d9",
|
||||||
|
"Title": "Daily Challenges",
|
||||||
|
"Message": "Check out the Challenges section in your watch for fun ways to earn in-game rewards.",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 175,
|
||||||
|
"CreatedAt": "2019-02-28T18:22:44Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "511adb340964437cbbe4ad382a658b52",
|
||||||
|
"Title": "Welcome to Rec Room",
|
||||||
|
"Message": "Rec Room is a virtual social club where you create and play games with friends. It's a fun and welcoming environment for people from all walks of life!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 175,
|
||||||
|
"CreatedAt": "2019-02-28T18:28:32Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "0ec7868f309843158bfb7fd94fd2a80a",
|
||||||
|
"Title": "Join the Rec Room Community!",
|
||||||
|
"Message": "See recroom.com/community for links to Rec Room's YouTube, Instagram, Discord, and MORE!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 167,
|
||||||
|
"CreatedAt": "2019-02-28T18:24:33Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "f0c49e1d5ce146638f1cb53f5d4f0bb2",
|
||||||
|
"Title": "Play on the go!",
|
||||||
|
"Message": "Download Rec Room on your iOS device and play anywhere!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 131,
|
||||||
|
"CreatedAt": "2019-12-21T01:24:23Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "ae71ae948ce041bba799ee8d6ee9a0ba",
|
||||||
|
"Title": "Laser Tag Merch",
|
||||||
|
"Message": "You earn tickets for every game of Laser Tag. Redeem them for awesome Laser Tag gear!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 0,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 175,
|
||||||
|
"CreatedAt": "2019-02-28T18:07:50Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "169b34a66ed046ba84cb2dbf43562a26",
|
||||||
|
"Title": "We're all on Rec.Net!",
|
||||||
|
"Message": "Log into your Rec.Net profile to stay in touch with your friends any time!",
|
||||||
|
"RoomNames": [],
|
||||||
|
"Context": 0,
|
||||||
|
"InputType": 0,
|
||||||
|
"Visibility": 1,
|
||||||
|
"AllowCycling": true,
|
||||||
|
"RestrictToNewUsers": false,
|
||||||
|
"ImageName": "gay",
|
||||||
|
"PlatformMask": 239,
|
||||||
|
"CreatedAt": "2019-02-28T18:21:25Z"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
+1
-31951
File diff suppressed because one or more lines are too long
@@ -0,0 +1,395 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using CannedNet.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CannedNet.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(AppDbContext))]
|
||||||
|
[Migration("20260403164448_AddRoomInstances")]
|
||||||
|
partial class AddRoomInstances
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.0")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.Account", b =>
|
||||||
|
{
|
||||||
|
b.Property<int?>("AccountId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "accountId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "createdAt");
|
||||||
|
|
||||||
|
b.Property<string>("DisplayName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "displayName");
|
||||||
|
|
||||||
|
b.Property<int?>("IdentityFlags")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "identityFlags");
|
||||||
|
|
||||||
|
b.Property<bool>("IsJunior")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isJunior");
|
||||||
|
|
||||||
|
b.Property<int?>("PersonalPronouns")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "personalPronouns");
|
||||||
|
|
||||||
|
b.Property<int?>("Platforms")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "platforms");
|
||||||
|
|
||||||
|
b.Property<string>("ProfileImage")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "profileImage");
|
||||||
|
|
||||||
|
b.Property<string>("Username")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "username");
|
||||||
|
|
||||||
|
b.HasKey("AccountId");
|
||||||
|
|
||||||
|
b.ToTable("accounts", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.AvatarItem", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("AvatarItemDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "avatarItemDesc");
|
||||||
|
|
||||||
|
b.Property<int>("AvatarItemType")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "avatarItemType");
|
||||||
|
|
||||||
|
b.Property<string>("FriendlyName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "friendlyName");
|
||||||
|
|
||||||
|
b.Property<int>("OwnerAccountId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("PlatformMask")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "platformMask");
|
||||||
|
|
||||||
|
b.Property<int>("Rarity")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "rarity");
|
||||||
|
|
||||||
|
b.Property<string>("Tooltip")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "tooltip");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerAccountId");
|
||||||
|
|
||||||
|
b.ToTable("avatar_items", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.CachedLogin", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("AccountId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "accountId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("LastLoginTime")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "lastLoginTime");
|
||||||
|
|
||||||
|
b.Property<int>("Platform")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "platform");
|
||||||
|
|
||||||
|
b.Property<string>("PlatformID")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "platformId");
|
||||||
|
|
||||||
|
b.Property<bool>("RequirePassword")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "requirePassword");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Platform", "PlatformID")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("cached_logins", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.PlayerAvatar", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("FaceFeatures")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "FaceFeatures");
|
||||||
|
|
||||||
|
b.Property<string>("HairColor")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "HairColor");
|
||||||
|
|
||||||
|
b.Property<string>("OutfitSelections")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "OutfitSelections");
|
||||||
|
|
||||||
|
b.Property<int>("OwnerAccountId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("SkinColor")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "SkinColor");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerAccountId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("player_avatars", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.PlayerProgression", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("Level")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "level");
|
||||||
|
|
||||||
|
b.Property<int>("PlayerId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "playerId");
|
||||||
|
|
||||||
|
b.Property<int>("Xp")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "xp");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("PlayerId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("player_progressions", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.PlayerSetting", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Key")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "key");
|
||||||
|
|
||||||
|
b.Property<int>("PlayerId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "playerId");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "value");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("PlayerId", "Key")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("player_settings", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.RoomInstance", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<bool>("EncryptVoiceChat")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "EncryptVoiceChat");
|
||||||
|
|
||||||
|
b.Property<int>("OwnerAccountId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("clubId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "clubId");
|
||||||
|
|
||||||
|
b.Property<string>("dataBlob")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "dataBlob");
|
||||||
|
|
||||||
|
b.Property<int>("eventId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "eventId");
|
||||||
|
|
||||||
|
b.Property<bool>("isFull")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isFull");
|
||||||
|
|
||||||
|
b.Property<bool>("isInProgress")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isInProgress");
|
||||||
|
|
||||||
|
b.Property<bool>("isPrivate")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isPrivate");
|
||||||
|
|
||||||
|
b.Property<string>("location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "location");
|
||||||
|
|
||||||
|
b.Property<int>("maxCapacity")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "maxCapacity");
|
||||||
|
|
||||||
|
b.Property<string>("name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "name");
|
||||||
|
|
||||||
|
b.Property<string>("photonRegionId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "photonRegionId");
|
||||||
|
|
||||||
|
b.Property<string>("photonRoomId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "photonRoomId");
|
||||||
|
|
||||||
|
b.Property<string>("roomCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomCode");
|
||||||
|
|
||||||
|
b.Property<int>("roomId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomId");
|
||||||
|
|
||||||
|
b.Property<int>("roomInstanceId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomInstanceId");
|
||||||
|
|
||||||
|
b.Property<int>("roomInstanceType")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomInstanceType");
|
||||||
|
|
||||||
|
b.Property<int>("subRoomId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "subRoomId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerAccountId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("room_instances", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.SavedOutfit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("FaceFeatures")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "FaceFeatures");
|
||||||
|
|
||||||
|
b.Property<string>("HairColor")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "HairColor");
|
||||||
|
|
||||||
|
b.Property<string>("OutfitSelections")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "OutfitSelections");
|
||||||
|
|
||||||
|
b.Property<int>("OwnerAccountId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("PreviewImageName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "PreviewImageName");
|
||||||
|
|
||||||
|
b.Property<string>("SkinColor")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "SkinColor");
|
||||||
|
|
||||||
|
b.Property<int>("Slot")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "Slot");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerAccountId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("saved_outfits", (string)null);
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CannedNet.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddRoomInstances : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "room_instances",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
OwnerAccountId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
roomInstanceId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
roomId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
subRoomId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
roomInstanceType = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
location = table.Column<string>(type: "text", nullable: false),
|
||||||
|
dataBlob = table.Column<string>(type: "text", nullable: false),
|
||||||
|
eventId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
clubId = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
roomCode = table.Column<string>(type: "text", nullable: false),
|
||||||
|
photonRegionId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
photonRoomId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
maxCapacity = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
isFull = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
isPrivate = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
isInProgress = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
EncryptVoiceChat = table.Column<bool>(type: "boolean", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_room_instances", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_room_instances_OwnerAccountId",
|
||||||
|
table: "room_instances",
|
||||||
|
column: "OwnerAccountId",
|
||||||
|
unique: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "room_instances");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -246,6 +246,99 @@ namespace CannedNet.Migrations
|
|||||||
b.ToTable("player_settings", (string)null);
|
b.ToTable("player_settings", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CannedNet.RoomInstance", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<bool>("EncryptVoiceChat")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "EncryptVoiceChat");
|
||||||
|
|
||||||
|
b.Property<int>("OwnerAccountId")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("clubId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "clubId");
|
||||||
|
|
||||||
|
b.Property<string>("dataBlob")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "dataBlob");
|
||||||
|
|
||||||
|
b.Property<int>("eventId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "eventId");
|
||||||
|
|
||||||
|
b.Property<bool>("isFull")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isFull");
|
||||||
|
|
||||||
|
b.Property<bool>("isInProgress")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isInProgress");
|
||||||
|
|
||||||
|
b.Property<bool>("isPrivate")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "isPrivate");
|
||||||
|
|
||||||
|
b.Property<string>("location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "location");
|
||||||
|
|
||||||
|
b.Property<int>("maxCapacity")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "maxCapacity");
|
||||||
|
|
||||||
|
b.Property<string>("name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "name");
|
||||||
|
|
||||||
|
b.Property<string>("photonRegionId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "photonRegionId");
|
||||||
|
|
||||||
|
b.Property<string>("photonRoomId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "photonRoomId");
|
||||||
|
|
||||||
|
b.Property<string>("roomCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomCode");
|
||||||
|
|
||||||
|
b.Property<int>("roomId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomId");
|
||||||
|
|
||||||
|
b.Property<int>("roomInstanceId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomInstanceId");
|
||||||
|
|
||||||
|
b.Property<int>("roomInstanceType")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "roomInstanceType");
|
||||||
|
|
||||||
|
b.Property<int>("subRoomId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Relational:JsonPropertyName", "subRoomId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerAccountId")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("room_instances", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("CannedNet.SavedOutfit", b =>
|
modelBuilder.Entity("CannedNet.SavedOutfit", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace CannedNet;
|
||||||
|
|
||||||
|
public class RoomInstance
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int OwnerAccountId { get; set; }
|
||||||
|
[JsonPropertyName("roomInstanceId")]
|
||||||
|
public int roomInstanceId { get; set; }
|
||||||
|
[JsonPropertyName("roomId")]
|
||||||
|
public int roomId { get; set; }
|
||||||
|
[JsonPropertyName("subRoomId")]
|
||||||
|
public int subRoomId { get; set; }
|
||||||
|
[JsonPropertyName("roomInstanceType")]
|
||||||
|
public int roomInstanceType { get; set; }
|
||||||
|
[JsonPropertyName("location")]
|
||||||
|
public string location { get; set; }
|
||||||
|
[JsonPropertyName("dataBlob")]
|
||||||
|
public string dataBlob { get; set; }
|
||||||
|
[JsonPropertyName("eventId")]
|
||||||
|
public int eventId { get; set; }
|
||||||
|
[JsonPropertyName("clubId")]
|
||||||
|
public int clubId { get; set; }
|
||||||
|
[JsonPropertyName("roomCode")]
|
||||||
|
public string roomCode { get; set; }
|
||||||
|
[JsonPropertyName("photonRegionId")]
|
||||||
|
public string photonRegionId { get; set; }
|
||||||
|
[JsonPropertyName("photonRoomId")]
|
||||||
|
public string photonRoomId { get; set; }
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public string name { get; set; }
|
||||||
|
[JsonPropertyName("maxCapacity")]
|
||||||
|
public int maxCapacity { get; set; }
|
||||||
|
[JsonPropertyName("isFull")]
|
||||||
|
public bool isFull { get; set; }
|
||||||
|
[JsonPropertyName("isPrivate")]
|
||||||
|
public bool isPrivate { get; set; }
|
||||||
|
[JsonPropertyName("isInProgress")]
|
||||||
|
public bool isInProgress { get; set; }
|
||||||
|
[JsonPropertyName("EncryptVoiceChat")]
|
||||||
|
public bool EncryptVoiceChat { get; set; }
|
||||||
|
}
|
||||||
@@ -16,9 +16,9 @@ public class APIService
|
|||||||
|
|
||||||
app.MapGet("/api/config/v1/amplitude", () => Results.Ok(new
|
app.MapGet("/api/config/v1/amplitude", () => Results.Ok(new
|
||||||
{
|
{
|
||||||
AmplitudeKey = "fd846cd67066d19eec62fbdd00be9258",
|
AmplitudeKey = "a",
|
||||||
StatSigKey = "client-mnew4Ggjuu3Fbh86Ed3tRgWUxapp0D7PPB0i3MXUEao",
|
StatSigKey = "a",
|
||||||
RudderStackKey = "37qVlzZyXqdmZckXJ61vQeEJp8Y",
|
RudderStackKey = "a",
|
||||||
UseRudderStack = false
|
UseRudderStack = false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -460,6 +460,11 @@ public class APIService
|
|||||||
var json = File.ReadAllText("JSON/namedimages.json");
|
var json = File.ReadAllText("JSON/namedimages.json");
|
||||||
return Results.Content(json, "application/json");
|
return Results.Content(json, "application/json");
|
||||||
});
|
});
|
||||||
|
app.MapPost("/api/PlayerReporting/v1/hile", async (HttpRequest request, AppDbContext db) =>
|
||||||
|
{
|
||||||
|
// stops crashing the game due to bepinex winhttp.dll (or melonloader version.dll)
|
||||||
|
return Results.Ok();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<List<int>> ParseFormIds(HttpRequest httpRequest)
|
private static async Task<List<int>> ParseFormIds(HttpRequest httpRequest)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using CannedNet.Data;
|
using CannedNet.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace CannedNet.Services;
|
namespace CannedNet.Services;
|
||||||
|
|
||||||
@@ -10,6 +11,8 @@ public class MatchmakingService
|
|||||||
|
|
||||||
public void MapEndpoints(WebApplication app)
|
public void MapEndpoints(WebApplication app)
|
||||||
{
|
{
|
||||||
|
var jwtService = app.Services.GetRequiredService<JwtTokenService>();
|
||||||
|
|
||||||
app.MapPost("/player/login", () => Results.Ok());
|
app.MapPost("/player/login", () => Results.Ok());
|
||||||
|
|
||||||
app.MapGet("/player", (HttpRequest request) =>
|
app.MapGet("/player", (HttpRequest request) =>
|
||||||
@@ -40,9 +43,72 @@ public class MatchmakingService
|
|||||||
return Results.Content(json, "application/json");
|
return Results.Content(json, "application/json");
|
||||||
});
|
});
|
||||||
|
|
||||||
app.MapPost("/goto/room/{room}", (HttpRequest request, string room) =>
|
app.MapPost("/goto/room/{room}", async (HttpRequest request, string room, AppDbContext db) =>
|
||||||
{
|
{
|
||||||
// dormroom location id : 76d98498-60a1-430c-ab76-b54a29b7a163
|
var authHeader = request.Headers.Authorization.ToString();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(authHeader) || !authHeader.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
var token = authHeader.Substring("Bearer ".Length);
|
||||||
|
var accountId = jwtService.ValidateAndGetAccountId(token);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(accountId))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
if (!int.TryParse(accountId.AsSpan(), out var id))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
var photonRoomId = Guid.NewGuid().ToString();
|
||||||
|
|
||||||
|
var existingInstance = await db.RoomInstances.FirstOrDefaultAsync(r => r.OwnerAccountId == id);
|
||||||
|
|
||||||
|
if (existingInstance != null)
|
||||||
|
{
|
||||||
|
existingInstance.roomInstanceId = 1;
|
||||||
|
existingInstance.roomId = 1;
|
||||||
|
existingInstance.subRoomId = 1;
|
||||||
|
existingInstance.roomInstanceType = 2;
|
||||||
|
existingInstance.location = "76d98498-60a1-430c-ab76-b54a29b7a163";
|
||||||
|
existingInstance.dataBlob = "";
|
||||||
|
existingInstance.eventId = 0;
|
||||||
|
existingInstance.clubId = 0;
|
||||||
|
existingInstance.roomCode = "";
|
||||||
|
existingInstance.photonRegionId = "us";
|
||||||
|
existingInstance.photonRoomId = photonRoomId;
|
||||||
|
existingInstance.name = room;
|
||||||
|
existingInstance.maxCapacity = 4;
|
||||||
|
existingInstance.isFull = false;
|
||||||
|
existingInstance.isPrivate = true;
|
||||||
|
existingInstance.isInProgress = false;
|
||||||
|
existingInstance.EncryptVoiceChat = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
db.RoomInstances.Add(new RoomInstance
|
||||||
|
{
|
||||||
|
OwnerAccountId = id,
|
||||||
|
roomInstanceId = 1,
|
||||||
|
roomId = 1,
|
||||||
|
subRoomId = 1,
|
||||||
|
roomInstanceType = 2,
|
||||||
|
location = "76d98498-60a1-430c-ab76-b54a29b7a163",
|
||||||
|
dataBlob = "",
|
||||||
|
eventId = 0,
|
||||||
|
clubId = 0,
|
||||||
|
roomCode = "",
|
||||||
|
photonRegionId = "us",
|
||||||
|
photonRoomId = photonRoomId,
|
||||||
|
name = room,
|
||||||
|
maxCapacity = 4,
|
||||||
|
isFull = false,
|
||||||
|
isPrivate = true,
|
||||||
|
isInProgress = false,
|
||||||
|
EncryptVoiceChat = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await db.SaveChangesAsync();
|
||||||
|
|
||||||
return Results.Json(new
|
return Results.Json(new
|
||||||
{
|
{
|
||||||
@@ -59,7 +125,7 @@ public class MatchmakingService
|
|||||||
clubId = 0,
|
clubId = 0,
|
||||||
roomCode = "",
|
roomCode = "",
|
||||||
photonRegionId = "us",
|
photonRegionId = "us",
|
||||||
photonRoomId = Guid.NewGuid(),
|
photonRoomId = photonRoomId,
|
||||||
name = room,
|
name = room,
|
||||||
maxCapacity = 4,
|
maxCapacity = 4,
|
||||||
isFull = false,
|
isFull = false,
|
||||||
@@ -73,6 +139,7 @@ public class MatchmakingService
|
|||||||
app.MapPost("/goto/none", (HttpRequest request) =>
|
app.MapPost("/goto/none", (HttpRequest request) =>
|
||||||
{
|
{
|
||||||
// dormroom location id : 76d98498-60a1-430c-ab76-b54a29b7a163
|
// dormroom location id : 76d98498-60a1-430c-ab76-b54a29b7a163
|
||||||
|
// offline dorm
|
||||||
|
|
||||||
return Results.Json(new
|
return Results.Json(new
|
||||||
{
|
{
|
||||||
@@ -99,9 +166,72 @@ public class MatchmakingService
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.MapPost("/player/heartbeat", async (HttpRequest request) =>
|
app.MapPost("/player/heartbeat", async (HttpRequest request, AppDbContext db) =>
|
||||||
{
|
{
|
||||||
|
var authHeader = request.Headers.Authorization.ToString();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(authHeader) || !authHeader.StartsWith("Bearer ", StringComparison.OrdinalIgnoreCase))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
var token = authHeader.Substring("Bearer ".Length);
|
||||||
|
var accountId = jwtService.ValidateAndGetAccountId(token);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(accountId))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
if (!int.TryParse(accountId.AsSpan(), out var id))
|
||||||
|
return Results.Unauthorized();
|
||||||
|
|
||||||
|
request.EnableBuffering();
|
||||||
|
request.Body.Position = 0;
|
||||||
|
using var reader = new StreamReader(request.Body);
|
||||||
|
var body = await reader.ReadToEndAsync();
|
||||||
|
|
||||||
|
request.Body.Position = 0;
|
||||||
|
var form = await request.ReadFormAsync();
|
||||||
|
var loginLock = form["LoginLock"].ToString();
|
||||||
|
|
||||||
|
HeartbeatRequest? heartbeat = null;
|
||||||
|
if (!string.IsNullOrWhiteSpace(body) && body.TrimStart().StartsWith("{"))
|
||||||
|
{
|
||||||
|
heartbeat = JsonSerializer.Deserialize<HeartbeatRequest>(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (heartbeat == null)
|
||||||
|
heartbeat = new HeartbeatRequest();
|
||||||
|
|
||||||
|
var roomInstance = await db.RoomInstances.FirstOrDefaultAsync(r => r.OwnerAccountId == id);
|
||||||
|
|
||||||
|
return Results.Json(new
|
||||||
|
{
|
||||||
|
playerId = id,
|
||||||
|
statusVisibility = heartbeat.statusVisibility,
|
||||||
|
deviceClass = heartbeat.deviceClass,
|
||||||
|
vrMovementMode = heartbeat.vrMovementMode,
|
||||||
|
roomInstance = new
|
||||||
|
{
|
||||||
|
roomInstanceId = roomInstance?.roomInstanceId ?? 0,
|
||||||
|
roomId = roomInstance?.roomId ?? 0,
|
||||||
|
subRoomId = roomInstance?.subRoomId ?? 0,
|
||||||
|
roomInstanceType = roomInstance?.roomInstanceType ?? 0,
|
||||||
|
location = roomInstance?.location ?? "",
|
||||||
|
dataBlob = roomInstance?.dataBlob ?? "",
|
||||||
|
eventId = roomInstance?.eventId ?? 0,
|
||||||
|
clubId = roomInstance?.clubId ?? 0,
|
||||||
|
roomCode = roomInstance?.roomCode ?? "",
|
||||||
|
photonRegionId = roomInstance?.photonRegionId ?? "us",
|
||||||
|
photonRoomId = roomInstance?.photonRoomId ?? "",
|
||||||
|
name = roomInstance?.name ?? "",
|
||||||
|
maxCapacity = roomInstance?.maxCapacity ?? 0,
|
||||||
|
isFull = roomInstance?.isFull ?? false,
|
||||||
|
isPrivate = roomInstance?.isPrivate ?? false,
|
||||||
|
isInProgress = roomInstance?.isInProgress ?? false,
|
||||||
|
EncryptVoiceChat = roomInstance?.EncryptVoiceChat ?? false
|
||||||
|
},
|
||||||
|
isOnline = true,
|
||||||
|
appVersion = heartbeat.appVersion ?? "",
|
||||||
|
platform = heartbeat.platform
|
||||||
|
});
|
||||||
});
|
});
|
||||||
app.MapPut("/player/statusvisibility", async (HttpRequest request, AppDbContext db) =>
|
app.MapPut("/player/statusvisibility", async (HttpRequest request, AppDbContext db) =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user