Clothing and pronoun fields (#2689)
* Clothing & Gender fields: Add to database [MODIFIED TO NOT DEPEND ON SAPHIRE-DB-REFACTOR] Sorry about this, Saphire. * Clothing & Gender fields: Add UI [FALLBACK II] * Clothing & Gender fields: Actually apply gender * Clothing & Gender fields: Import innerclothingskirt field from my previous attempt Couldn't import actual prototypes because of a change to IDs * Clothing & Gender fields: Add innerclothingskirt field to everything * Clothing & Gender fields: Jumpskirts now work * Clothing & Gender fields: Gender field will follow sex field if it's not different (UX improvement) [FALLBACK II] * Clothing & Gender fields: Gender -> Pronouns to reduce confusion. Also, fix profile summary. Properly. [FALLBACK II] * Clothing & Pronoun fields: Refactor so that profile equipment adjustments are performed in StartingGearPrototype.
This commit is contained in:
@@ -17,6 +17,8 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Profile = HumanoidCharacterProfile.Random();
|
||||
UpdateSexControls();
|
||||
UpdateGenderControls();
|
||||
UpdateClothingControls();
|
||||
UpdateAgeEdit();
|
||||
UpdateNameEdit();
|
||||
UpdateHairPickers();
|
||||
|
||||
@@ -17,6 +17,7 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -40,7 +41,8 @@ namespace Content.Client.UserInterface
|
||||
private readonly Button _saveButton;
|
||||
private readonly Button _sexFemaleButton;
|
||||
private readonly Button _sexMaleButton;
|
||||
private readonly Button _sexClassifiedButton;
|
||||
private readonly OptionButton _genderButton;
|
||||
private readonly OptionButton _clothingButton;
|
||||
private readonly HairStylePicker _hairPicker;
|
||||
private readonly FacialHairStylePicker _facialHairPicker;
|
||||
|
||||
@@ -165,27 +167,34 @@ namespace Content.Client.UserInterface
|
||||
Text = Loc.GetString("Male"),
|
||||
Group = sexButtonGroup
|
||||
};
|
||||
_sexMaleButton.OnPressed += args => { SetSex(Sex.Male); };
|
||||
_sexMaleButton.OnPressed += args =>
|
||||
{
|
||||
SetSex(Sex.Male);
|
||||
if (Profile.Gender == Gender.Female)
|
||||
{
|
||||
SetGender(Gender.Male);
|
||||
UpdateGenderControls();
|
||||
}
|
||||
};
|
||||
|
||||
_sexFemaleButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Female"),
|
||||
Group = sexButtonGroup
|
||||
};
|
||||
_sexFemaleButton.OnPressed += args => { SetSex(Sex.Female); };
|
||||
|
||||
_sexClassifiedButton = new Button
|
||||
_sexFemaleButton.OnPressed += args =>
|
||||
{
|
||||
/* DUR WHAT IF I PUT ATTACK HELICOPTER HERE DUR HUR AHUHRUHWUIDHAEILUBFOWEL(*&RFH#W*(OBFD&*/
|
||||
Text = Loc.GetString("Classified"),
|
||||
Group = sexButtonGroup
|
||||
SetSex(Sex.Female);
|
||||
if (Profile.Gender == Gender.Male)
|
||||
{
|
||||
SetGender(Gender.Female);
|
||||
UpdateGenderControls();
|
||||
}
|
||||
};
|
||||
_sexClassifiedButton.OnPressed += args => { SetSex(Sex.Classified); };
|
||||
|
||||
hBox.AddChild(sexLabel);
|
||||
hBox.AddChild(_sexMaleButton);
|
||||
hBox.AddChild(_sexFemaleButton);
|
||||
hBox.AddChild(_sexClassifiedButton);
|
||||
panel.AddChild(hBox);
|
||||
sexAndAgeRow.AddChild(panel);
|
||||
}
|
||||
@@ -213,6 +222,34 @@ namespace Content.Client.UserInterface
|
||||
|
||||
#endregion Age
|
||||
|
||||
#region Gender
|
||||
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var genderLabel = new Label { Text = Loc.GetString("Pronouns:") };
|
||||
|
||||
_genderButton = new OptionButton();
|
||||
|
||||
_genderButton.AddItem(Loc.GetString("He / Him"), (int) Gender.Male);
|
||||
_genderButton.AddItem(Loc.GetString("She / Her"), (int) Gender.Female);
|
||||
_genderButton.AddItem(Loc.GetString("They / Them"), (int) Gender.Epicene);
|
||||
_genderButton.AddItem(Loc.GetString("It / It"), (int) Gender.Neuter);
|
||||
|
||||
_genderButton.OnItemSelected += args =>
|
||||
{
|
||||
_genderButton.SelectId(args.Id);
|
||||
SetGender((Gender) args.Id);
|
||||
};
|
||||
|
||||
hBox.AddChild(genderLabel);
|
||||
hBox.AddChild(_genderButton);
|
||||
panel.AddChild(hBox);
|
||||
sexAndAgeRow.AddChild(panel);
|
||||
}
|
||||
|
||||
#endregion Gender
|
||||
|
||||
#region Hair
|
||||
|
||||
{
|
||||
@@ -270,6 +307,32 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
|
||||
#endregion Hair
|
||||
|
||||
#region Clothing
|
||||
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var clothingLabel = new Label { Text = Loc.GetString("Clothing:") };
|
||||
|
||||
_clothingButton = new OptionButton();
|
||||
|
||||
_clothingButton.AddItem(Loc.GetString("Jumpsuit"), (int) ClothingPreference.Jumpsuit);
|
||||
_clothingButton.AddItem(Loc.GetString("Jumpskirt"), (int) ClothingPreference.Jumpskirt);
|
||||
|
||||
_clothingButton.OnItemSelected += args =>
|
||||
{
|
||||
_clothingButton.SelectId(args.Id);
|
||||
SetClothing((ClothingPreference) args.Id);
|
||||
};
|
||||
|
||||
hBox.AddChild(clothingLabel);
|
||||
hBox.AddChild(_clothingButton);
|
||||
panel.AddChild(hBox);
|
||||
appearanceVBox.AddChild(panel);
|
||||
}
|
||||
|
||||
#endregion Clothing
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -588,12 +651,24 @@ namespace Content.Client.UserInterface
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
private void SetGender(Gender newGender)
|
||||
{
|
||||
Profile = Profile?.WithGender(newGender);
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
private void SetName(string newName)
|
||||
{
|
||||
Profile = Profile?.WithName(newName);
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
private void SetClothing(ClothingPreference newClothing)
|
||||
{
|
||||
Profile = Profile?.WithClothingPreference(newClothing);
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
IsDirty = false;
|
||||
@@ -638,6 +713,16 @@ namespace Content.Client.UserInterface
|
||||
_sexFemaleButton.Pressed = true;
|
||||
}
|
||||
|
||||
private void UpdateGenderControls()
|
||||
{
|
||||
_genderButton.SelectId((int) Profile.Gender);
|
||||
}
|
||||
|
||||
private void UpdateClothingControls()
|
||||
{
|
||||
_clothingButton.SelectId((int) Profile.Clothing);
|
||||
}
|
||||
|
||||
private void UpdateHairPickers()
|
||||
{
|
||||
_hairPicker.SetData(
|
||||
@@ -667,6 +752,8 @@ namespace Content.Client.UserInterface
|
||||
if (Profile is null) return;
|
||||
UpdateNameEdit();
|
||||
UpdateSexControls();
|
||||
UpdateGenderControls();
|
||||
UpdateClothingControls();
|
||||
UpdateAgeEdit();
|
||||
UpdateHairPickers();
|
||||
UpdateSaveButton();
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Roles;
|
||||
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
||||
using Robust.Client.Interfaces.GameObjects.Components;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -140,14 +141,16 @@ namespace Content.Client.UserInterface
|
||||
|
||||
inventory.ClearAllSlotVisuals();
|
||||
|
||||
foreach (var (slot, itemType) in gear.Equipment)
|
||||
foreach (var slot in AllSlots)
|
||||
{
|
||||
var itemType = gear.GetGear(slot, profile);
|
||||
if (itemType != "")
|
||||
{
|
||||
var item = entityMan.SpawnEntity(itemType, MapCoordinates.Nullspace);
|
||||
|
||||
inventory.SetSlotVisuals(slot, item);
|
||||
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Server.Mobs;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
@@ -76,7 +77,7 @@ namespace Content.IntegrationTests
|
||||
public EntityCoordinates GetJobSpawnPoint(string jobId) => EntityCoordinates.Invalid;
|
||||
public EntityCoordinates GetObserverSpawnPoint() => EntityCoordinates.Invalid;
|
||||
|
||||
public void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear)
|
||||
public void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear, HumanoidCharacterProfile profile)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
570
Content.Server.Database/Migrations/Postgres/20201203093409_ClothingAndPronouns.Designer.cs
generated
Normal file
570
Content.Server.Database/Migrations/Postgres/20201203093409_ClothingAndPronouns.Designer.cs
generated
Normal file
@@ -0,0 +1,570 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Net;
|
||||
using Content.Server.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
[DbContext(typeof(PostgresServerDbContext))]
|
||||
[Migration("20201203093409_ClothingAndPronouns")]
|
||||
partial class ClothingAndPronouns
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseIdentityByDefaultColumns()
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63)
|
||||
.HasAnnotation("ProductVersion", "5.0.0");
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<int?>("AdminRankId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.HasIndex("AdminRankId");
|
||||
|
||||
b.ToTable("admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_flag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<Guid>("AdminId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("admin_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.Property<bool>("Negative")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("negative");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AdminId");
|
||||
|
||||
b.HasIndex("Flag", "AdminId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("admin_flag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("admin_rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_flag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("AdminRankId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AdminRankId");
|
||||
|
||||
b.HasIndex("Flag", "AdminRankId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("admin_rank_flag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("antag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("AntagName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("antag_name");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProfileId", "AntagName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("antag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AssignedUserId", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("assigned_user_id_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("UserName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("assigned_user_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("job_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("JobName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("job_name");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("priority");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProfileId");
|
||||
|
||||
b.ToTable("job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresConnectionLog", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("connection_log_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<IPAddress>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("time");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("connection_log");
|
||||
|
||||
b.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresPlayer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("player_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<DateTime>("FirstSeenTime")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("first_seen_time");
|
||||
|
||||
b.Property<IPAddress>("LastSeenAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("last_seen_address");
|
||||
|
||||
b.Property<DateTime>("LastSeenTime")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("last_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("last_seen_user_name");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LastSeenUserName");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("player");
|
||||
|
||||
b.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerBan", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("server_ban_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<ValueTuple<IPAddress, int>?>("Address")
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("BanTime")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("ban_time");
|
||||
|
||||
b.Property<Guid?>("BanningAdmin")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("banning_admin");
|
||||
|
||||
b.Property<DateTime?>("ExpirationTime")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("expiration_time");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("reason");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Address");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("server_ban");
|
||||
|
||||
b.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address");
|
||||
|
||||
b.HasCheckConstraint("HaveEitherAddressOrUserId", "address IS NOT NULL OR user_id IS NOT NULL");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerUnban", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("unban_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("BanId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<DateTime>("UnbanTime")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("unban_time");
|
||||
|
||||
b.Property<Guid?>("UnbanningAdmin")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("unbanning_admin");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BanId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("server_unban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("preference_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("SelectedCharacterSlot")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("selected_character_slot");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("profile_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("age");
|
||||
|
||||
b.Property<string>("CharacterName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("char_name");
|
||||
|
||||
b.Property<string>("Clothing")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("clothing");
|
||||
|
||||
b.Property<string>("EyeColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("eye_color");
|
||||
|
||||
b.Property<string>("FacialHairColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("facial_hair_color");
|
||||
|
||||
b.Property<string>("FacialHairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("facial_hair_name");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("gender");
|
||||
|
||||
b.Property<string>("HairColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hair_color");
|
||||
|
||||
b.Property<string>("HairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<int>("PreferenceId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("PreferenceUnavailable")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("pref_unavailable");
|
||||
|
||||
b.Property<string>("Sex")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("sex");
|
||||
|
||||
b.Property<string>("SkinColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("skin_color");
|
||||
|
||||
b.Property<int>("Slot")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("slot");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PreferenceId");
|
||||
|
||||
b.HasIndex("Slot", "PreferenceId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "AdminRank")
|
||||
.WithMany("Admins")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("AdminRank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Admin", "Admin")
|
||||
.WithMany("Flags")
|
||||
.HasForeignKey("AdminId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "Rank")
|
||||
.WithMany("Flags")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Profile", "Profile")
|
||||
.WithMany("Antags")
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Profile", "Profile")
|
||||
.WithMany("Jobs")
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerUnban", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.PostgresServerBan", "Ban")
|
||||
.WithOne("Unban")
|
||||
.HasForeignKey("Content.Server.Database.PostgresServerUnban", "BanId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Ban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Preference", "Preference")
|
||||
.WithMany("Profiles")
|
||||
.HasForeignKey("PreferenceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Navigation("Admins");
|
||||
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerBan", b =>
|
||||
{
|
||||
b.Navigation("Unban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Navigation("Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Navigation("Antags");
|
||||
|
||||
b.Navigation("Jobs");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
public partial class ClothingAndPronouns : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "clothing",
|
||||
table: "profile",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "gender",
|
||||
table: "profile",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "clothing",
|
||||
table: "profile");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "gender",
|
||||
table: "profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,24 +16,24 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
.UseIdentityByDefaultColumns()
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63)
|
||||
.HasAnnotation("ProductVersion", "5.0.0");
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<int?>("AdminRankId")
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnName("title")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
@@ -46,22 +46,22 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_flag_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("admin_flag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<Guid>("AdminId")
|
||||
.HasColumnName("admin_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("admin_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnName("flag")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.Property<bool>("Negative")
|
||||
.HasColumnName("negative")
|
||||
.HasColumnType("boolean");
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("negative");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -77,14 +77,14 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("admin_rank_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -95,18 +95,18 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_rank_flag_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("admin_rank_flag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("AdminRankId")
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnName("flag")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -122,18 +122,18 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("antag_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("antag_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("AntagName")
|
||||
.IsRequired()
|
||||
.HasColumnName("antag_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("antag_name");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -147,18 +147,18 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("assigned_user_id_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("assigned_user_id_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("user_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -175,22 +175,22 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("job_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("job_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<string>("JobName")
|
||||
.IsRequired()
|
||||
.HasColumnName("job_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("job_name");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnName("priority")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("priority");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -203,27 +203,27 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("connection_log_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("connection_log_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<IPAddress>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnName("address")
|
||||
.HasColumnType("inet");
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnName("time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("time");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("user_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -238,31 +238,31 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("player_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("player_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<DateTime>("FirstSeenTime")
|
||||
.HasColumnName("first_seen_time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("first_seen_time");
|
||||
|
||||
b.Property<IPAddress>("LastSeenAddress")
|
||||
.IsRequired()
|
||||
.HasColumnName("last_seen_address")
|
||||
.HasColumnType("inet");
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("last_seen_address");
|
||||
|
||||
b.Property<DateTime>("LastSeenTime")
|
||||
.HasColumnName("last_seen_time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("last_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenUserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("last_seen_user_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("last_seen_user_name");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -280,34 +280,34 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("server_ban_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("server_ban_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<ValueTuple<IPAddress, int>?>("Address")
|
||||
.HasColumnName("address")
|
||||
.HasColumnType("inet");
|
||||
.HasColumnType("inet")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("BanTime")
|
||||
.HasColumnName("ban_time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("ban_time");
|
||||
|
||||
b.Property<Guid?>("BanningAdmin")
|
||||
.HasColumnName("banning_admin")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("banning_admin");
|
||||
|
||||
b.Property<DateTime?>("ExpirationTime")
|
||||
.HasColumnName("expiration_time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("expiration_time");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired()
|
||||
.HasColumnName("reason")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("reason");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -326,21 +326,21 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("unban_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("unban_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("BanId")
|
||||
.HasColumnName("ban_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<DateTime>("UnbanTime")
|
||||
.HasColumnName("unban_time")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("unban_time");
|
||||
|
||||
b.Property<Guid?>("UnbanningAdmin")
|
||||
.HasColumnName("unbanning_admin")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("unbanning_admin");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -354,17 +354,17 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("preference_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("preference_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("SelectedCharacterSlot")
|
||||
.HasColumnName("selected_character_slot")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("selected_character_slot");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("uuid");
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -378,65 +378,75 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
.HasColumnName("profile_id")
|
||||
.UseIdentityByDefaultColumn();
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnName("age")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("age");
|
||||
|
||||
b.Property<string>("CharacterName")
|
||||
.IsRequired()
|
||||
.HasColumnName("char_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("char_name");
|
||||
|
||||
b.Property<string>("Clothing")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("clothing");
|
||||
|
||||
b.Property<string>("EyeColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("eye_color")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("eye_color");
|
||||
|
||||
b.Property<string>("FacialHairColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("facial_hair_color")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("facial_hair_color");
|
||||
|
||||
b.Property<string>("FacialHairName")
|
||||
.IsRequired()
|
||||
.HasColumnName("facial_hair_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("facial_hair_name");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("gender");
|
||||
|
||||
b.Property<string>("HairColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("hair_color")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hair_color");
|
||||
|
||||
b.Property<string>("HairName")
|
||||
.IsRequired()
|
||||
.HasColumnName("hair_name")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<int>("PreferenceId")
|
||||
.HasColumnName("preference_id")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("PreferenceUnavailable")
|
||||
.HasColumnName("pref_unavailable")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("pref_unavailable");
|
||||
|
||||
b.Property<string>("Sex")
|
||||
.IsRequired()
|
||||
.HasColumnName("sex")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("sex");
|
||||
|
||||
b.Property<string>("SkinColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("skin_color")
|
||||
.HasColumnType("text");
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("skin_color");
|
||||
|
||||
b.Property<int>("Slot")
|
||||
.HasColumnName("slot")
|
||||
.HasColumnType("integer");
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("slot");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -454,6 +464,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.WithMany("Admins")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("AdminRank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
@@ -463,6 +475,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("AdminId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
@@ -472,6 +486,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
@@ -481,6 +497,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
@@ -490,6 +508,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerUnban", b =>
|
||||
@@ -499,6 +519,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("Content.Server.Database.PostgresServerUnban", "BanId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Ban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
@@ -508,6 +530,37 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasForeignKey("PreferenceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Navigation("Admins");
|
||||
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PostgresServerBan", b =>
|
||||
{
|
||||
b.Navigation("Unban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Navigation("Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Navigation("Antags");
|
||||
|
||||
b.Navigation("Jobs");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
537
Content.Server.Database/Migrations/Sqlite/20201203093351_ClothingAndPronouns.Designer.cs
generated
Normal file
537
Content.Server.Database/Migrations/Sqlite/20201203093351_ClothingAndPronouns.Designer.cs
generated
Normal file
@@ -0,0 +1,537 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Content.Server.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
[DbContext(typeof(SqliteServerDbContext))]
|
||||
[Migration("20201203093351_ClothingAndPronouns")]
|
||||
partial class ClothingAndPronouns
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "5.0.0");
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<int?>("AdminRankId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
b.HasIndex("AdminRankId");
|
||||
|
||||
b.ToTable("admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_flag_id");
|
||||
|
||||
b.Property<Guid>("AdminId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("admin_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.Property<bool>("Negative")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("negative");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AdminId");
|
||||
|
||||
b.HasIndex("Flag", "AdminId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("admin_flag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("admin_rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_flag_id");
|
||||
|
||||
b.Property<int>("AdminRankId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AdminRankId");
|
||||
|
||||
b.HasIndex("Flag", "AdminRankId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("admin_rank_flag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("antag_id");
|
||||
|
||||
b.Property<string>("AntagName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("antag_name");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProfileId", "AntagName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("antag");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AssignedUserId", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("assigned_user_id_id");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("UserName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("assigned_user_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("job_id");
|
||||
|
||||
b.Property<string>("JobName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("job_name");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("priority");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProfileId");
|
||||
|
||||
b.ToTable("job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("SelectedCharacterSlot")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("selected_character_slot");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("age");
|
||||
|
||||
b.Property<string>("CharacterName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("char_name");
|
||||
|
||||
b.Property<string>("Clothing")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("clothing");
|
||||
|
||||
b.Property<string>("EyeColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("eye_color");
|
||||
|
||||
b.Property<string>("FacialHairColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("facial_hair_color");
|
||||
|
||||
b.Property<string>("FacialHairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("facial_hair_name");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("gender");
|
||||
|
||||
b.Property<string>("HairColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("hair_color");
|
||||
|
||||
b.Property<string>("HairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<int>("PreferenceId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("PreferenceUnavailable")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("pref_unavailable");
|
||||
|
||||
b.Property<string>("Sex")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("sex");
|
||||
|
||||
b.Property<string>("SkinColor")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("skin_color");
|
||||
|
||||
b.Property<int>("Slot")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("slot");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PreferenceId");
|
||||
|
||||
b.HasIndex("Slot", "PreferenceId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteConnectionLog", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("connection_log_id");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("connection_log");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqlitePlayer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("player_id");
|
||||
|
||||
b.Property<DateTime>("FirstSeenTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("first_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_address");
|
||||
|
||||
b.Property<DateTime>("LastSeenTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_user_name");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LastSeenUserName");
|
||||
|
||||
b.ToTable("player");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerBan", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("BanTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ban_time");
|
||||
|
||||
b.Property<Guid?>("BanningAdmin")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("banning_admin");
|
||||
|
||||
b.Property<DateTime?>("ExpirationTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("expiration_time");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("reason");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerUnban", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("unban_id");
|
||||
|
||||
b.Property<int>("BanId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<DateTime>("UnbanTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("unban_time");
|
||||
|
||||
b.Property<Guid?>("UnbanningAdmin")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("unbanning_admin");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BanId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("unban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "AdminRank")
|
||||
.WithMany("Admins")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("AdminRank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Admin", "Admin")
|
||||
.WithMany("Flags")
|
||||
.HasForeignKey("AdminId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.AdminRank", "Rank")
|
||||
.WithMany("Flags")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Profile", "Profile")
|
||||
.WithMany("Antags")
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Profile", "Profile")
|
||||
.WithMany("Jobs")
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.Preference", "Preference")
|
||||
.WithMany("Profiles")
|
||||
.HasForeignKey("PreferenceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerUnban", b =>
|
||||
{
|
||||
b.HasOne("Content.Server.Database.SqliteServerBan", "Ban")
|
||||
.WithOne("Unban")
|
||||
.HasForeignKey("Content.Server.Database.SqliteServerUnban", "BanId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Ban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Navigation("Admins");
|
||||
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Navigation("Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Navigation("Antags");
|
||||
|
||||
b.Navigation("Jobs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerBan", b =>
|
||||
{
|
||||
b.Navigation("Unban");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
public partial class ClothingAndPronouns : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "clothing",
|
||||
table: "profile",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "gender",
|
||||
table: "profile",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "clothing",
|
||||
table: "profile");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "gender",
|
||||
table: "profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,22 +14,22 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "3.1.4");
|
||||
.HasAnnotation("ProductVersion", "5.0.0");
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<int?>("AdminRankId")
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnName("title")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("UserId");
|
||||
|
||||
@@ -42,21 +42,21 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_flag_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_flag_id");
|
||||
|
||||
b.Property<Guid>("AdminId")
|
||||
.HasColumnName("admin_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("admin_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnName("flag")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.Property<bool>("Negative")
|
||||
.HasColumnName("negative")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("negative");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -72,13 +72,13 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -89,17 +89,17 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("admin_rank_flag_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_flag_id");
|
||||
|
||||
b.Property<int>("AdminRankId")
|
||||
.HasColumnName("admin_rank_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("admin_rank_id");
|
||||
|
||||
b.Property<string>("Flag")
|
||||
.IsRequired()
|
||||
.HasColumnName("flag")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("flag");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -115,17 +115,17 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("antag_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("antag_id");
|
||||
|
||||
b.Property<string>("AntagName")
|
||||
.IsRequired()
|
||||
.HasColumnName("antag_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("antag_name");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -139,17 +139,17 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("assigned_user_id_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("assigned_user_id_id");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("user_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -166,21 +166,21 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("job_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("job_id");
|
||||
|
||||
b.Property<string>("JobName")
|
||||
.IsRequired()
|
||||
.HasColumnName("job_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("job_name");
|
||||
|
||||
b.Property<int>("Priority")
|
||||
.HasColumnName("priority")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("priority");
|
||||
|
||||
b.Property<int>("ProfileId")
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -193,16 +193,16 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("preference_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("SelectedCharacterSlot")
|
||||
.HasColumnName("selected_character_slot")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("selected_character_slot");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -216,64 +216,74 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("profile_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("profile_id");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnName("age")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("age");
|
||||
|
||||
b.Property<string>("CharacterName")
|
||||
.IsRequired()
|
||||
.HasColumnName("char_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("char_name");
|
||||
|
||||
b.Property<string>("Clothing")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("clothing");
|
||||
|
||||
b.Property<string>("EyeColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("eye_color")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("eye_color");
|
||||
|
||||
b.Property<string>("FacialHairColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("facial_hair_color")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("facial_hair_color");
|
||||
|
||||
b.Property<string>("FacialHairName")
|
||||
.IsRequired()
|
||||
.HasColumnName("facial_hair_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("facial_hair_name");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("gender");
|
||||
|
||||
b.Property<string>("HairColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("hair_color")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("hair_color");
|
||||
|
||||
b.Property<string>("HairName")
|
||||
.IsRequired()
|
||||
.HasColumnName("hair_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<int>("PreferenceId")
|
||||
.HasColumnName("preference_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("preference_id");
|
||||
|
||||
b.Property<int>("PreferenceUnavailable")
|
||||
.HasColumnName("pref_unavailable")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("pref_unavailable");
|
||||
|
||||
b.Property<string>("Sex")
|
||||
.IsRequired()
|
||||
.HasColumnName("sex")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("sex");
|
||||
|
||||
b.Property<string>("SkinColor")
|
||||
.IsRequired()
|
||||
.HasColumnName("skin_color")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("skin_color");
|
||||
|
||||
b.Property<int>("Slot")
|
||||
.HasColumnName("slot")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("slot");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -289,26 +299,26 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("connection_log_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("connection_log_id");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnName("address")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnName("time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("user_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -319,30 +329,30 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("player_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("player_id");
|
||||
|
||||
b.Property<DateTime>("FirstSeenTime")
|
||||
.HasColumnName("first_seen_time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("first_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenAddress")
|
||||
.IsRequired()
|
||||
.HasColumnName("last_seen_address")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_address");
|
||||
|
||||
b.Property<DateTime>("LastSeenTime")
|
||||
.HasColumnName("last_seen_time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_time");
|
||||
|
||||
b.Property<string>("LastSeenUserName")
|
||||
.IsRequired()
|
||||
.HasColumnName("last_seen_user_name")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_seen_user_name");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -355,33 +365,33 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("ban_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnName("address")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("address");
|
||||
|
||||
b.Property<DateTime>("BanTime")
|
||||
.HasColumnName("ban_time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ban_time");
|
||||
|
||||
b.Property<Guid?>("BanningAdmin")
|
||||
.HasColumnName("banning_admin")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("banning_admin");
|
||||
|
||||
b.Property<DateTime?>("ExpirationTime")
|
||||
.HasColumnName("expiration_time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("expiration_time");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired()
|
||||
.HasColumnName("reason")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("reason");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnName("user_id")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -392,20 +402,20 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("unban_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("unban_id");
|
||||
|
||||
b.Property<int>("BanId")
|
||||
.HasColumnName("ban_id")
|
||||
.HasColumnType("INTEGER");
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("ban_id");
|
||||
|
||||
b.Property<DateTime>("UnbanTime")
|
||||
.HasColumnName("unban_time")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("unban_time");
|
||||
|
||||
b.Property<Guid?>("UnbanningAdmin")
|
||||
.HasColumnName("unbanning_admin")
|
||||
.HasColumnType("TEXT");
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("unbanning_admin");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -421,6 +431,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.WithMany("Admins")
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("AdminRank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminFlag", b =>
|
||||
@@ -430,6 +442,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("AdminId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Admin");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b =>
|
||||
@@ -439,6 +453,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("AdminRankId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Rank");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Antag", b =>
|
||||
@@ -448,6 +464,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Job", b =>
|
||||
@@ -457,6 +475,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Profile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
@@ -466,6 +486,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("PreferenceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Preference");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerUnban", b =>
|
||||
@@ -475,6 +497,37 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasForeignKey("Content.Server.Database.SqliteServerUnban", "BanId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Ban");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Admin", b =>
|
||||
{
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.AdminRank", b =>
|
||||
{
|
||||
b.Navigation("Admins");
|
||||
|
||||
b.Navigation("Flags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Navigation("Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Profile", b =>
|
||||
{
|
||||
b.Navigation("Antags");
|
||||
|
||||
b.Navigation("Jobs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.SqliteServerBan", b =>
|
||||
{
|
||||
b.Navigation("Unban");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
@@ -91,12 +91,14 @@ namespace Content.Server.Database
|
||||
[Column("char_name")] public string CharacterName { get; set; } = null!;
|
||||
[Column("age")] public int Age { get; set; }
|
||||
[Column("sex")] public string Sex { get; set; } = null!;
|
||||
[Column("gender")] public string Gender { get; set; } = null!;
|
||||
[Column("hair_name")] public string HairName { get; set; } = null!;
|
||||
[Column("hair_color")] public string HairColor { get; set; } = null!;
|
||||
[Column("facial_hair_name")] public string FacialHairName { get; set; } = null!;
|
||||
[Column("facial_hair_color")] public string FacialHairColor { get; set; } = null!;
|
||||
[Column("eye_color")] public string EyeColor { get; set; } = null!;
|
||||
[Column("skin_color")] public string SkinColor { get; set; } = null!;
|
||||
[Column("clothing")] public string Clothing { get; set; } = null!;
|
||||
public List<Job> Jobs { get; } = new();
|
||||
public List<Antag> Antags { get; } = new();
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Preferences;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
|
||||
namespace Content.Server.Database
|
||||
{
|
||||
@@ -130,10 +131,24 @@ namespace Content.Server.Database
|
||||
{
|
||||
var jobs = profile.Jobs.ToDictionary(j => j.JobName, j => (JobPriority) j.Priority);
|
||||
var antags = profile.Antags.Select(a => a.AntagName);
|
||||
|
||||
var sex = Sex.Male;
|
||||
if (Enum.TryParse<Sex>(profile.Sex, true, out var sexVal))
|
||||
sex = sexVal;
|
||||
|
||||
var clothing = ClothingPreference.Jumpsuit;
|
||||
if (Enum.TryParse<ClothingPreference>(profile.Clothing, true, out var clothingVal))
|
||||
clothing = clothingVal;
|
||||
|
||||
var gender = sex == Sex.Male ? Gender.Male : Gender.Female;
|
||||
if (Enum.TryParse<Gender>(profile.Gender, true, out var genderVal))
|
||||
gender = genderVal;
|
||||
|
||||
return new HumanoidCharacterProfile(
|
||||
profile.CharacterName,
|
||||
profile.Age,
|
||||
profile.Sex == "Male" ? Sex.Male : Sex.Female,
|
||||
sex,
|
||||
gender,
|
||||
new HumanoidCharacterAppearance
|
||||
(
|
||||
profile.HairName,
|
||||
@@ -143,6 +158,7 @@ namespace Content.Server.Database
|
||||
Color.FromHex(profile.EyeColor),
|
||||
Color.FromHex(profile.SkinColor)
|
||||
),
|
||||
clothing,
|
||||
jobs,
|
||||
(PreferenceUnavailableMode) profile.PreferenceUnavailable,
|
||||
antags.ToList()
|
||||
@@ -158,12 +174,14 @@ namespace Content.Server.Database
|
||||
CharacterName = humanoid.Name,
|
||||
Age = humanoid.Age,
|
||||
Sex = humanoid.Sex.ToString(),
|
||||
Gender = humanoid.Gender.ToString(),
|
||||
HairName = appearance.HairStyleName,
|
||||
HairColor = appearance.HairColor.ToHex(),
|
||||
FacialHairName = appearance.FacialHairStyleName,
|
||||
FacialHairColor = appearance.FacialHairColor.ToHex(),
|
||||
EyeColor = appearance.EyeColor.ToHex(),
|
||||
SkinColor = appearance.SkinColor.ToHex(),
|
||||
Clothing = humanoid.Clothing.ToString(),
|
||||
Slot = slot,
|
||||
PreferenceUnavailable = (DbPreferenceUnavailableMode) humanoid.PreferenceUnavailable
|
||||
};
|
||||
|
||||
@@ -4,6 +4,8 @@ using Content.Server.GameObjects.EntitySystems.AI;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Server.AI;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
@@ -68,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Movement
|
||||
if (StartingGearPrototype != null)
|
||||
{
|
||||
var startingGear = _prototypeManager.Index<StartingGearPrototype>(StartingGearPrototype);
|
||||
_gameTicker.EquipStartingGear(Owner, startingGear);
|
||||
_gameTicker.EquipStartingGear(Owner, startingGear, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -577,28 +577,36 @@ namespace Content.Server.GameTicking
|
||||
return Paused;
|
||||
}
|
||||
|
||||
private IEntity _spawnPlayerMob(Job job, bool lateJoin = true)
|
||||
private IEntity _spawnPlayerMob(Job job, HumanoidCharacterProfile profile, bool lateJoin = true)
|
||||
{
|
||||
EntityCoordinates coordinates = lateJoin ? GetLateJoinSpawnPoint() : GetJobSpawnPoint(job.Prototype.ID);
|
||||
var entity = _entityManager.SpawnEntity(PlayerPrototypeName, coordinates);
|
||||
var startingGear = _prototypeManager.Index<StartingGearPrototype>(job.StartingGear);
|
||||
EquipStartingGear(entity, startingGear);
|
||||
EquipStartingGear(entity, startingGear, profile);
|
||||
|
||||
if (profile != null)
|
||||
{
|
||||
entity.GetComponent<HumanoidAppearanceComponent>().UpdateFromProfile(profile);
|
||||
entity.Name = profile.Name;
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear)
|
||||
public void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear, HumanoidCharacterProfile profile)
|
||||
{
|
||||
if (entity.TryGetComponent(out InventoryComponent inventory))
|
||||
{
|
||||
var gear = startingGear.Equipment;
|
||||
|
||||
foreach (var (slot, equipmentStr) in gear)
|
||||
foreach (var slot in AllSlots)
|
||||
{
|
||||
var equipmentStr = startingGear.GetGear(slot, profile);
|
||||
if (equipmentStr != "")
|
||||
{
|
||||
var equipmentEntity = _entityManager.SpawnEntity(equipmentStr, entity.Transform.Coordinates);
|
||||
inventory.Equip(slot, equipmentEntity.GetComponent<ItemComponent>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out HandsComponent handsComponent))
|
||||
{
|
||||
@@ -611,14 +619,6 @@ namespace Content.Server.GameTicking
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyCharacterProfile(IEntity entity, ICharacterProfile profile)
|
||||
{
|
||||
if (profile is null)
|
||||
return;
|
||||
entity.GetComponent<HumanoidAppearanceComponent>().UpdateFromProfile(profile);
|
||||
entity.Name = profile.Name;
|
||||
}
|
||||
|
||||
private IEntity _spawnObserverMob()
|
||||
{
|
||||
var coordinates = GetObserverSpawnPoint();
|
||||
@@ -888,9 +888,8 @@ namespace Content.Server.GameTicking
|
||||
var job = new Job(data.Mind, jobPrototype);
|
||||
data.Mind.AddRole(job);
|
||||
|
||||
var mob = _spawnPlayerMob(job, lateJoin);
|
||||
var mob = _spawnPlayerMob(job, character, lateJoin);
|
||||
data.Mind.TransferTo(mob);
|
||||
ApplyCharacterProfile(mob, character);
|
||||
|
||||
if (session.UserId == new Guid("{e887eb93-f503-4b65-95b6-2f282c014192}"))
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -51,7 +52,7 @@ namespace Content.Server.Interfaces.GameTicking
|
||||
EntityCoordinates GetJobSpawnPoint(string jobId);
|
||||
EntityCoordinates GetObserverSpawnPoint();
|
||||
|
||||
void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear);
|
||||
void EquipStartingGear(IEntity entity, StartingGearPrototype startingGear, HumanoidCharacterProfile profile);
|
||||
|
||||
// GameRule system.
|
||||
T AddGameRule<T>() where T : GameRule, new();
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
private HumanoidCharacterAppearance _appearance;
|
||||
private Sex _sex;
|
||||
private Gender _gender;
|
||||
|
||||
public sealed override string Name => "HumanoidAppearance";
|
||||
public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE;
|
||||
@@ -37,17 +38,20 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
}
|
||||
}
|
||||
|
||||
public Gender Gender => Sex switch
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public virtual Gender Gender
|
||||
{
|
||||
Sex.Female => Gender.Female,
|
||||
Sex.Male => Gender.Male,
|
||||
Sex.Classified => Gender.Neuter,
|
||||
_ => Gender.Epicene,
|
||||
};
|
||||
get => _gender;
|
||||
set
|
||||
{
|
||||
_gender = value;
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new HumanoidAppearanceComponentState(Appearance, Sex);
|
||||
return new HumanoidAppearanceComponentState(Appearance, Sex, Gender);
|
||||
}
|
||||
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
@@ -59,6 +63,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
|
||||
Appearance = cast.Appearance;
|
||||
Sex = cast.Sex;
|
||||
Gender = cast.Gender;
|
||||
}
|
||||
|
||||
public void UpdateFromProfile(ICharacterProfile profile)
|
||||
@@ -66,20 +71,23 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
var humanoid = (HumanoidCharacterProfile) profile;
|
||||
Appearance = (HumanoidCharacterAppearance) humanoid.CharacterAppearance;
|
||||
Sex = humanoid.Sex;
|
||||
Gender = humanoid.Gender;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[NetSerializable]
|
||||
private sealed class HumanoidAppearanceComponentState : ComponentState
|
||||
{
|
||||
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex) : base(ContentNetIDs.HUMANOID_APPEARANCE)
|
||||
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender) : base(ContentNetIDs.HUMANOID_APPEARANCE)
|
||||
{
|
||||
Appearance = appearance;
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
}
|
||||
|
||||
public HumanoidCharacterAppearance Appearance { get; }
|
||||
public Sex Sex { get; }
|
||||
public Gender Gender { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
Content.Shared/Preferences/ClothingPreference.cs
Normal file
11
Content.Shared/Preferences/ClothingPreference.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Content.Shared.Preferences
|
||||
{
|
||||
/// <summary>
|
||||
/// The clothing preference for a profile. Stored in database!
|
||||
/// </summary>
|
||||
public enum ClothingPreference
|
||||
{
|
||||
Jumpsuit,
|
||||
Jumpskirt
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,16 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
namespace Content.Shared.Preferences
|
||||
{
|
||||
/// <summary>
|
||||
/// Character profile. Looks immutable, but uses non-immutable semantics internally for serialization/code sanity purposes.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public class HumanoidCharacterProfile : ICharacterProfile
|
||||
public class HumanoidCharacterProfile : ICharacterProfile, IGenderable
|
||||
{
|
||||
private readonly Dictionary<string, JobPriority> _jobPriorities;
|
||||
private readonly List<string> _antagPreferences;
|
||||
@@ -26,7 +31,9 @@ namespace Content.Shared.Preferences
|
||||
string name,
|
||||
int age,
|
||||
Sex sex,
|
||||
Gender gender,
|
||||
HumanoidCharacterAppearance appearance,
|
||||
ClothingPreference clothing,
|
||||
Dictionary<string, JobPriority> jobPriorities,
|
||||
PreferenceUnavailableMode preferenceUnavailable,
|
||||
List<string> antagPreferences)
|
||||
@@ -34,21 +41,41 @@ namespace Content.Shared.Preferences
|
||||
Name = name;
|
||||
Age = age;
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
Appearance = appearance;
|
||||
Clothing = clothing;
|
||||
_jobPriorities = jobPriorities;
|
||||
PreferenceUnavailable = preferenceUnavailable;
|
||||
_antagPreferences = antagPreferences;
|
||||
}
|
||||
|
||||
/// <summary>Copy constructor but with overridable references (to prevent useless copies)</summary>
|
||||
private HumanoidCharacterProfile(
|
||||
HumanoidCharacterProfile other,
|
||||
Dictionary<string, JobPriority> jobPriorities,
|
||||
List<string> antagPreferences)
|
||||
: this(other.Name, other.Age, other.Sex, other.Gender, other.Appearance, other.Clothing,
|
||||
jobPriorities, other.PreferenceUnavailable, antagPreferences)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Copy constructor</summary>
|
||||
private HumanoidCharacterProfile(HumanoidCharacterProfile other)
|
||||
: this(other, new Dictionary<string, JobPriority>(other.JobPriorities), new List<string>(other.AntagPreferences))
|
||||
{
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile(
|
||||
string name,
|
||||
int age,
|
||||
Sex sex,
|
||||
Gender gender,
|
||||
HumanoidCharacterAppearance appearance,
|
||||
ClothingPreference clothing,
|
||||
IReadOnlyDictionary<string, JobPriority> jobPriorities,
|
||||
PreferenceUnavailableMode preferenceUnavailable,
|
||||
IReadOnlyList<string> antagPreferences)
|
||||
: this(name, age, sex, appearance, new Dictionary<string, JobPriority>(jobPriorities),
|
||||
: this(name, age, sex, gender, appearance, clothing, new Dictionary<string, JobPriority>(jobPriorities),
|
||||
preferenceUnavailable, new List<string>(antagPreferences))
|
||||
{
|
||||
}
|
||||
@@ -62,6 +89,7 @@ namespace Content.Shared.Preferences
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var sex = random.Prob(0.5f) ? Sex.Male : Sex.Female;
|
||||
var gender = sex == Sex.Male ? Gender.Male : Gender.Female;
|
||||
|
||||
var firstName = random.Pick(sex == Sex.Male
|
||||
? Names.MaleFirstNames
|
||||
@@ -70,52 +98,57 @@ namespace Content.Shared.Preferences
|
||||
var name = $"{firstName} {lastName}";
|
||||
var age = random.Next(MinimumAge, MaximumAge);
|
||||
|
||||
return new HumanoidCharacterProfile(name, age, sex, HumanoidCharacterAppearance.Random(sex),
|
||||
return new HumanoidCharacterProfile(name, age, sex, gender, HumanoidCharacterAppearance.Random(sex), ClothingPreference.Jumpsuit,
|
||||
new Dictionary<string, JobPriority>
|
||||
{
|
||||
{SharedGameTicker.OverflowJob, JobPriority.High}
|
||||
}, PreferenceUnavailableMode.StayInLobby, new List<string>());
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public int Age { get; }
|
||||
public Sex Sex { get; }
|
||||
public string Name { get; private set; }
|
||||
public int Age { get; private set; }
|
||||
public Sex Sex { get; private set; }
|
||||
public Gender Gender { get; private set; }
|
||||
public ICharacterAppearance CharacterAppearance => Appearance;
|
||||
public HumanoidCharacterAppearance Appearance { get; }
|
||||
public HumanoidCharacterAppearance Appearance { get; private set; }
|
||||
public ClothingPreference Clothing { get; private set; }
|
||||
public IReadOnlyDictionary<string, JobPriority> JobPriorities => _jobPriorities;
|
||||
public IReadOnlyList<string> AntagPreferences => _antagPreferences;
|
||||
public PreferenceUnavailableMode PreferenceUnavailable { get; }
|
||||
public PreferenceUnavailableMode PreferenceUnavailable { get; private set; }
|
||||
|
||||
public HumanoidCharacterProfile WithName(string name)
|
||||
{
|
||||
return new(name, Age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
return new(this) { Name = name };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithAge(int age)
|
||||
{
|
||||
return new(Name, Math.Clamp(age, MinimumAge, MaximumAge), Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
return new(this) { Age = age };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithSex(Sex sex)
|
||||
{
|
||||
return new(Name, Age, sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
return new(this) { Sex = sex };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithGender(Gender gender)
|
||||
{
|
||||
return new(this) { Gender = gender };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithCharacterAppearance(HumanoidCharacterAppearance appearance)
|
||||
{
|
||||
return new(Name, Age, Sex, appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences);
|
||||
return new(this) { Appearance = appearance };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithClothingPreference(ClothingPreference clothing)
|
||||
{
|
||||
return new(this) { Clothing = clothing };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithJobPriorities(IEnumerable<KeyValuePair<string, JobPriority>> jobPriorities)
|
||||
{
|
||||
return new(
|
||||
Name,
|
||||
Age,
|
||||
Sex,
|
||||
Appearance,
|
||||
new Dictionary<string, JobPriority>(jobPriorities),
|
||||
PreferenceUnavailable,
|
||||
_antagPreferences);
|
||||
return new(this, new Dictionary<string, JobPriority>(jobPriorities), _antagPreferences);
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithJobPriority(string jobId, JobPriority priority)
|
||||
@@ -129,25 +162,17 @@ namespace Content.Shared.Preferences
|
||||
{
|
||||
dictionary[jobId] = priority;
|
||||
}
|
||||
|
||||
return new HumanoidCharacterProfile(Name, Age, Sex, Appearance, dictionary, PreferenceUnavailable, _antagPreferences);
|
||||
return new(this, dictionary, _antagPreferences);
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithPreferenceUnavailable(PreferenceUnavailableMode mode)
|
||||
{
|
||||
return new(Name, Age, Sex, Appearance, _jobPriorities, mode, _antagPreferences);
|
||||
return new(this) { PreferenceUnavailable = mode };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithAntagPreferences(IEnumerable<string> antagPreferences)
|
||||
{
|
||||
return new(
|
||||
Name,
|
||||
Age,
|
||||
Sex,
|
||||
Appearance,
|
||||
_jobPriorities,
|
||||
PreferenceUnavailable,
|
||||
new List<string>(antagPreferences));
|
||||
return new(this, _jobPriorities, new List<string>(antagPreferences));
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithAntagPreference(string antagId, bool pref)
|
||||
@@ -167,7 +192,7 @@ namespace Content.Shared.Preferences
|
||||
list.Remove(antagId);
|
||||
}
|
||||
}
|
||||
return new HumanoidCharacterProfile(Name, Age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, list);
|
||||
return new(this, _jobPriorities, list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -184,6 +209,14 @@ namespace Content.Shared.Preferences
|
||||
Sex.Female => Sex.Female,
|
||||
_ => Sex.Male // Invalid enum values.
|
||||
};
|
||||
var gender = profile.Gender switch
|
||||
{
|
||||
Gender.Epicene => Gender.Epicene,
|
||||
Gender.Female => Gender.Female,
|
||||
Gender.Male => Gender.Male,
|
||||
Gender.Neuter => Gender.Neuter,
|
||||
_ => Gender.Epicene // Invalid enum values.
|
||||
};
|
||||
|
||||
string name;
|
||||
if (string.IsNullOrEmpty(profile.Name))
|
||||
@@ -214,6 +247,13 @@ namespace Content.Shared.Preferences
|
||||
_ => PreferenceUnavailableMode.StayInLobby // Invalid enum values.
|
||||
};
|
||||
|
||||
var clothing = profile.Clothing switch
|
||||
{
|
||||
ClothingPreference.Jumpsuit => ClothingPreference.Jumpsuit,
|
||||
ClothingPreference.Jumpskirt => ClothingPreference.Jumpskirt,
|
||||
_ => ClothingPreference.Jumpsuit // Invalid enum values.
|
||||
};
|
||||
|
||||
var priorities = new Dictionary<string, JobPriority>(profile.JobPriorities
|
||||
.Where(p => prototypeManager.HasIndex<JobPrototype>(p.Key) && p.Value switch
|
||||
{
|
||||
@@ -228,11 +268,11 @@ namespace Content.Shared.Preferences
|
||||
.Where(prototypeManager.HasIndex<AntagPrototype>)
|
||||
.ToList();
|
||||
|
||||
return new HumanoidCharacterProfile(name, age, sex, appearance, priorities, prefsUnavailableMode, antags);
|
||||
return new HumanoidCharacterProfile(name, age, sex, gender, appearance, clothing, priorities, prefsUnavailableMode, antags);
|
||||
}
|
||||
|
||||
public string Summary =>
|
||||
$"{Name}, {Age} years old human. Their gender is {Sex.ToString().ToLower()}.";
|
||||
Loc.GetString("{0}, {1} years old human. {2:Their} pronouns are {2:they}/{2:them}.", Name, Age, this);
|
||||
|
||||
public bool MemberwiseEquals(ICharacterProfile maybeOther)
|
||||
{
|
||||
@@ -240,7 +280,9 @@ namespace Content.Shared.Preferences
|
||||
if (Name != other.Name) return false;
|
||||
if (Age != other.Age) return false;
|
||||
if (Sex != other.Sex) return false;
|
||||
if (Gender != other.Gender) return false;
|
||||
if (PreferenceUnavailable != other.PreferenceUnavailable) return false;
|
||||
if (Clothing != other.Clothing) return false;
|
||||
if (!_jobPriorities.SequenceEqual(other._jobPriorities)) return false;
|
||||
if (!_antagPreferences.SequenceEqual(other._antagPreferences)) return false;
|
||||
return Appearance.MemberwiseEquals(other.Appearance);
|
||||
@@ -254,13 +296,18 @@ namespace Content.Shared.Preferences
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(
|
||||
HashCode.Combine(
|
||||
Name,
|
||||
Age,
|
||||
Sex,
|
||||
Gender,
|
||||
Appearance,
|
||||
Clothing
|
||||
),
|
||||
PreferenceUnavailable,
|
||||
_jobPriorities,
|
||||
_antagPreferences,
|
||||
Appearance);
|
||||
_antagPreferences
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
public enum Sex
|
||||
{
|
||||
Male,
|
||||
Female,
|
||||
Classified
|
||||
Female
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -5,6 +6,7 @@ using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using Content.Shared.Preferences;
|
||||
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
||||
|
||||
namespace Content.Shared.Roles
|
||||
@@ -12,19 +14,22 @@ namespace Content.Shared.Roles
|
||||
[Prototype("startingGear")]
|
||||
public class StartingGearPrototype : IPrototype, IIndexedPrototype
|
||||
{
|
||||
private string _id;
|
||||
private Dictionary<Slots, string> _equipment;
|
||||
private string _id = default!;
|
||||
private Dictionary<Slots, string> _equipment = default!;
|
||||
|
||||
/// <summary>
|
||||
/// if empty, there is no skirt override - instead the uniform provided in equipment is added.
|
||||
/// </summary>
|
||||
private string _innerClothingSkirt = default!;
|
||||
|
||||
public IReadOnlyDictionary<string, string> Inhand => _inHand;
|
||||
/// <summary>
|
||||
/// hand index, item prototype
|
||||
/// </summary>
|
||||
private Dictionary<string, string> _inHand;
|
||||
private Dictionary<string, string> _inHand = default!;
|
||||
|
||||
[ViewVariables] public string ID => _id;
|
||||
|
||||
[ViewVariables] public IReadOnlyDictionary<Slots, string> Equipment => _equipment;
|
||||
|
||||
public void LoadFrom(YamlMappingNode mapping)
|
||||
{
|
||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||
@@ -44,6 +49,26 @@ namespace Content.Shared.Roles
|
||||
|
||||
return slot;
|
||||
}, type => type.Value);
|
||||
|
||||
serializer.DataField(ref _innerClothingSkirt, "innerclothingskirt", string.Empty);
|
||||
}
|
||||
|
||||
public string GetGear(Slots slot, HumanoidCharacterProfile? profile)
|
||||
{
|
||||
if (profile != null)
|
||||
{
|
||||
if ((slot == Slots.INNERCLOTHING) && (profile.Clothing == ClothingPreference.Jumpskirt) && (_innerClothingSkirt != ""))
|
||||
return _innerClothingSkirt;
|
||||
}
|
||||
|
||||
if (_equipment.ContainsKey(slot))
|
||||
{
|
||||
return _equipment[slot];
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ using NUnit.Framework;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.UnitTesting;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
|
||||
namespace Content.Tests.Server.Preferences
|
||||
{
|
||||
@@ -24,6 +26,7 @@ namespace Content.Tests.Server.Preferences
|
||||
"Charlie Charlieson",
|
||||
21,
|
||||
Sex.Male,
|
||||
Gender.Epicene,
|
||||
new HumanoidCharacterAppearance(
|
||||
"Afro",
|
||||
Color.Aqua,
|
||||
@@ -32,6 +35,7 @@ namespace Content.Tests.Server.Preferences
|
||||
Color.Azure,
|
||||
Color.Beige
|
||||
),
|
||||
ClothingPreference.Jumpskirt,
|
||||
new Dictionary<string, JobPriority>
|
||||
{
|
||||
{SharedGameTicker.OverflowJob, JobPriority.High}
|
||||
|
||||
@@ -20,3 +20,5 @@
|
||||
shoes: ClothingShoesColorBlack
|
||||
idcard: CargoPDA
|
||||
ears: ClothingHeadsetCargo
|
||||
innerclothingskirt: ClothingUniformJumpskirtCargo
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@
|
||||
shoes: ClothingShoesColorBrown
|
||||
idcard: QuartermasterPDA
|
||||
ears: ClothingHeadsetCargo
|
||||
innerclothingskirt: ClothingUniformJumpskirtQM
|
||||
|
||||
|
||||
@@ -17,3 +17,5 @@
|
||||
shoes: ClothingShoesColorBlack
|
||||
idcard: AssistantPDA
|
||||
ears: ClothingHeadsetService
|
||||
innerclothingskirt: ClothingUniformJumpskirtColorGrey
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@
|
||||
shoes: ClothingShoesColorBlack
|
||||
idcard: BartenderPDA
|
||||
ears: ClothingHeadsetService
|
||||
innerclothingskirt: ClothingUniformJumpskirtBartender
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@
|
||||
idcard: BotanistPDA
|
||||
ears: ClothingHeadsetService
|
||||
outerclothing: ClothingOuterApronBotanist
|
||||
innerclothingskirt: ClothingUniformJumpskirtHydroponics
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
# access:
|
||||
# - Chapel
|
||||
# - Maintenance
|
||||
|
||||
#- type: startingGear
|
||||
# id: ChaplainGear
|
||||
# equipment:
|
||||
@@ -18,3 +17,5 @@
|
||||
# shoes: ClothingShoesColorBlack
|
||||
# idcard: ChaplainPDA
|
||||
# ears: ClothingHeadsetService
|
||||
# innerclothingskirt: ClothingUniformJumpskirtChaplain
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@
|
||||
idcard: ChefPDA
|
||||
ears: ClothingHeadsetService
|
||||
outerclothing: ClothingOuterApronChef
|
||||
innerclothingskirt: ClothingUniformJumpskirtChef
|
||||
|
||||
|
||||
@@ -20,3 +20,5 @@
|
||||
idcard: JanitorPDA
|
||||
ears: ClothingHeadsetService
|
||||
belt: ClothingBeltJanitorFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtJanitor
|
||||
|
||||
|
||||
@@ -24,3 +24,5 @@
|
||||
mask: ClothingMaskMime
|
||||
idcard: MimePDA
|
||||
ears: ClothingHeadsetService
|
||||
innerclothingskirt: ClothingUniformJumpskirtMime
|
||||
|
||||
|
||||
@@ -28,3 +28,5 @@
|
||||
head: ClothingHeadHatHopcap
|
||||
idcard: HoPPDA
|
||||
ears: ClothingHeadsetAltCommand
|
||||
innerclothingskirt: ClothingUniformJumpskirtHoP
|
||||
|
||||
|
||||
@@ -25,3 +25,5 @@
|
||||
idcard: CEPDA
|
||||
ears: ClothingHeadsetEngineering
|
||||
belt: ClothingBeltChiefEngineerFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtChiefEngineer
|
||||
|
||||
|
||||
@@ -23,3 +23,5 @@
|
||||
idcard: EngineerPDA
|
||||
belt: ClothingBeltUtilityFilled
|
||||
ears: ClothingHeadsetEngineering
|
||||
innerclothingskirt: ClothingUniformJumpskirtEngineering
|
||||
|
||||
|
||||
@@ -26,3 +26,5 @@
|
||||
idcard: CMOPDA
|
||||
ears: ClothingHeadsetAltMedical
|
||||
belt: ClothingBeltMedical
|
||||
innerclothingskirt: ClothingUniformJumpskirtCMO
|
||||
|
||||
|
||||
@@ -21,3 +21,5 @@
|
||||
idcard: MedicalPDA
|
||||
ears: ClothingHeadsetMedical
|
||||
belt: ClothingBeltMedical
|
||||
innerclothingskirt: ClothingUniformJumpskirtMedicalDoctor
|
||||
|
||||
|
||||
@@ -22,3 +22,5 @@
|
||||
shoes: ClothingShoesColorBrown
|
||||
idcard: RnDPDA
|
||||
ears: ClothingHeadsetScience
|
||||
innerclothingskirt: ClothingUniformJumpskirtResearchDirector
|
||||
|
||||
|
||||
@@ -20,3 +20,5 @@
|
||||
outerclothing: ClothingOuterCoatLab
|
||||
idcard: SciencePDA
|
||||
ears: ClothingHeadsetScience
|
||||
innerclothingskirt: ClothingUniformJumpskirtScientist
|
||||
|
||||
|
||||
@@ -29,3 +29,5 @@
|
||||
idcard: HoSPDA
|
||||
ears: ClothingHeadsetAltSecurity
|
||||
belt: ClothingBeltSecurityFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtHoS
|
||||
|
||||
|
||||
@@ -24,3 +24,5 @@
|
||||
idcard: SecurityPDA
|
||||
ears: ClothingHeadsetSecurity
|
||||
belt: ClothingBeltSecurityFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtSec
|
||||
|
||||
|
||||
@@ -25,3 +25,5 @@
|
||||
idcard: WardenPDA
|
||||
ears: ClothingHeadsetSecurity
|
||||
belt: ClothingBeltSecurityFilled
|
||||
innerclothingskirt: ClothingUniformJumpskirtWarden
|
||||
|
||||
|
||||
Reference in New Issue
Block a user