mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-25 23:18:54 -07:00
Revert "remove old instances if no heartbeat is sent to it after a bit"
This reverts commit 46d62a1c25.
This commit is contained in:
-702
@@ -1,702 +0,0 @@
|
||||
// <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("20260404153303_AddPlayerCountAndLastHeartbeat")]
|
||||
partial class AddPlayerCountAndLastHeartbeat
|
||||
{
|
||||
/// <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.LoadScreen", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "imageUrl");
|
||||
|
||||
b.Property<bool>("IsThumbnail")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "isThumbnail");
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tooltip")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "tooltip");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoomId");
|
||||
|
||||
b.ToTable("load_screens", (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.PromoExternalContent", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Tooltip")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "tooltip");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "type");
|
||||
|
||||
b.Property<string>("Url")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "url");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoomId");
|
||||
|
||||
b.ToTable("promo_external_contents", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CannedNet.PromoImage", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ImageUrl")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "imageUrl");
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "sortOrder");
|
||||
|
||||
b.Property<string>("Tooltip")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "tooltip");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoomId");
|
||||
|
||||
b.ToTable("promo_images", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CannedNet.Room", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Accessibility")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "accessibility");
|
||||
|
||||
b.Property<bool>("CloningAllowed")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "cloningAllowed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "createdAt");
|
||||
|
||||
b.Property<int>("CreatorAccountId")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "creatorAccountId");
|
||||
|
||||
b.Property<string>("CustomWarning")
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "customWarning");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "description");
|
||||
|
||||
b.Property<bool>("DisableMicAutoMute")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "disableMicAutoMute");
|
||||
|
||||
b.Property<bool>("DisableRoomComments")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "disableRoomComments");
|
||||
|
||||
b.Property<bool>("EncryptVoiceChat")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "encryptVoiceChat");
|
||||
|
||||
b.Property<string>("ImageName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "imageName");
|
||||
|
||||
b.Property<bool>("IsDorm")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "isDorm");
|
||||
|
||||
b.Property<bool>("IsRRO")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "isRRO");
|
||||
|
||||
b.Property<int>("MinLevel")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "minLevel");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "name");
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "roomId");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "state");
|
||||
|
||||
b.Property<bool>("SupportsJuniors")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsJuniors");
|
||||
|
||||
b.Property<bool>("SupportsLevelVoting")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsLevelVoting");
|
||||
|
||||
b.Property<bool>("SupportsMobile")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsMobile");
|
||||
|
||||
b.Property<bool>("SupportsQuest2")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsQuest2");
|
||||
|
||||
b.Property<bool>("SupportsScreens")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsScreens");
|
||||
|
||||
b.Property<bool>("SupportsTeleportVR")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsTeleportVR");
|
||||
|
||||
b.Property<bool>("SupportsVRLow")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsVRLow");
|
||||
|
||||
b.Property<bool>("SupportsWalkVR")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "supportsWalkVR");
|
||||
|
||||
b.Property<string>("Tags")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "tags");
|
||||
|
||||
b.Property<int>("WarningMask")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "warningMask");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreatorAccountId");
|
||||
|
||||
b.ToTable("rooms", (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<DateTime>("lastHeartbeat")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
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<bool>("pendingJoin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("photonRegionId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "photonRegionId");
|
||||
|
||||
b.Property<string>("photonRoomId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "photonRoomId");
|
||||
|
||||
b.Property<int>("playerCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
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", "roomId");
|
||||
|
||||
b.ToTable("room_instances", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CannedNet.RoomRole", 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<int>("InvitedRole")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "invitedRole");
|
||||
|
||||
b.Property<int>("Role")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "role");
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoomId");
|
||||
|
||||
b.ToTable("room_roles", (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);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CannedNet.SubRoom", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("Accessibility")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "accessibility");
|
||||
|
||||
b.Property<string>("DataBlob")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "dataBlob");
|
||||
|
||||
b.Property<DateTime>("DataSavedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "dataSavedAt");
|
||||
|
||||
b.Property<bool>("IsSandbox")
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "isSandbox");
|
||||
|
||||
b.Property<int>("MaxPlayers")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "maxPlayers");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "name");
|
||||
|
||||
b.Property<int>("RoomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("SubRoomId")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "subRoomId");
|
||||
|
||||
b.Property<string>("UnitySceneId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "unitySceneId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoomId");
|
||||
|
||||
b.ToTable("sub_rooms", (string)null);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CannedNet.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPlayerCountAndLastHeartbeat : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "lastHeartbeat",
|
||||
table: "room_instances",
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "playerCount",
|
||||
table: "room_instances",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "lastHeartbeat",
|
||||
table: "room_instances");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "playerCount",
|
||||
table: "room_instances");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,9 +502,6 @@ namespace CannedNet.Migrations
|
||||
.HasColumnType("boolean")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "isPrivate");
|
||||
|
||||
b.Property<DateTime>("lastHeartbeat")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("location")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
@@ -532,9 +529,6 @@ namespace CannedNet.Migrations
|
||||
.HasColumnType("text")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "photonRoomId");
|
||||
|
||||
b.Property<int>("playerCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("roomCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
|
||||
@@ -244,23 +244,6 @@ public class MatchmakingService
|
||||
.OrderByDescending(r => r.Id)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (roomInstance != null)
|
||||
{
|
||||
roomInstance.lastHeartbeat = DateTime.UtcNow;
|
||||
roomInstance.playerCount = Math.Max(roomInstance.playerCount, 1);
|
||||
}
|
||||
|
||||
var oldInstances = await db.RoomInstances
|
||||
.Where(r => r.lastHeartbeat < DateTime.UtcNow.AddMinutes(-5) && r.playerCount <= 0)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var old in oldInstances)
|
||||
{
|
||||
db.RoomInstances.Remove(old);
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
return Results.Json(new
|
||||
{
|
||||
playerId = heartbeat.playerId != 0 ? heartbeat.playerId : id,
|
||||
|
||||
Reference in New Issue
Block a user