Compare commits
9 Commits
chat
...
canadians-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86fd24f756 | ||
|
|
5ed802e37c | ||
| 63211b2e8b | |||
|
|
a1280d58bf | ||
| 34f0223a85 | |||
| 69f06f5868 | |||
| 066f56e5a2 | |||
|
|
287f72b6ad | ||
| ef13566b7a |
@@ -44,12 +44,14 @@ public class GeoIPService : IHostedService
|
||||
if (_dbReader!.TryCity(ip, out var response))
|
||||
{
|
||||
string? continent = response?.Continent.Code;
|
||||
string? countryIso = response?.Country.IsoCode;
|
||||
|
||||
if (!string.IsNullOrEmpty(continent) &&
|
||||
string.Equals(continent, "NA", StringComparison.Ordinal)
|
||||
&& response?.Location.Longitude != null)
|
||||
{
|
||||
if (response.Location.Longitude < -102)
|
||||
if (response.Location.Longitude < -102 &&
|
||||
!string.Equals(countryIso, "CA", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continent = "NA-W";
|
||||
}
|
||||
@@ -57,6 +59,8 @@ public class GeoIPService : IHostedService
|
||||
{
|
||||
continent = "NA-E";
|
||||
}
|
||||
|
||||
_logger.LogDebug("Connecting {countryIso} to {continent}", countryIso, continent);
|
||||
}
|
||||
|
||||
return continent ?? "*";
|
||||
|
||||
@@ -329,7 +329,7 @@ public partial class LightlessWizardModule : InteractionModuleBase
|
||||
|
||||
private int? ParseCharacterIdFromLodestoneUrl(string lodestoneUrl)
|
||||
{
|
||||
var regex = new Regex(@"^https:\/\/(na|eu|de|fr|jp)\.finalfantasyxiv\.com\/lodestone\/character\/(\d{8})/?$");
|
||||
var regex = new Regex(@"^https:\/\/(na|eu|de|fr|jp)\.finalfantasyxiv\.com\/lodestone\/character\/(\d+)/?$");
|
||||
var matches = regex.Match(lodestoneUrl);
|
||||
var isLodestoneUrl = matches.Success;
|
||||
if (!isLodestoneUrl || matches.Groups.Count < 1) return null;
|
||||
|
||||
@@ -91,6 +91,12 @@ public class LightlessDbContext : DbContext
|
||||
mb.Entity<GroupProfile>().ToTable("group_profiles");
|
||||
mb.Entity<GroupProfile>().HasKey(u => u.GroupGID);
|
||||
mb.Entity<GroupProfile>().HasIndex(c => c.GroupGID);
|
||||
mb.Entity<Group>()
|
||||
.HasOne(g => g.Profile)
|
||||
.WithOne(p => p.Group)
|
||||
.HasForeignKey<GroupProfile>(p => p.GroupGID)
|
||||
.IsRequired(false)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
mb.Entity<GroupTempInvite>().ToTable("group_temp_invites");
|
||||
mb.Entity<GroupTempInvite>().HasKey(u => new { u.GroupGID, u.Invite });
|
||||
mb.Entity<GroupTempInvite>().HasIndex(c => c.GroupGID);
|
||||
|
||||
1319
LightlessSyncServer/LightlessSyncShared/Migrations/20251117153226_FixForeignKeyGroupProfiles.Designer.cs
generated
Normal file
1319
LightlessSyncServer/LightlessSyncShared/Migrations/20251117153226_FixForeignKeyGroupProfiles.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LightlessSyncServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixForeignKeyGroupProfiles : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_group_profiles_groups_group_gid",
|
||||
table: "group_profiles");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_group_profiles_groups_group_gid",
|
||||
table: "group_profiles",
|
||||
column: "group_gid",
|
||||
principalTable: "groups",
|
||||
principalColumn: "gid",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_group_profiles_groups_group_gid",
|
||||
table: "group_profiles");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_group_profiles_groups_group_gid",
|
||||
table: "group_profiles",
|
||||
column: "group_gid",
|
||||
principalTable: "groups",
|
||||
principalColumn: "gid");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -820,14 +820,14 @@ namespace LightlessSyncServer.Migrations
|
||||
.HasColumnType("character varying(15)")
|
||||
.HasColumnName("alias");
|
||||
|
||||
b.Property<bool>("HasVanity")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("has_vanity");
|
||||
|
||||
b.Property<bool>("ChatBanned")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("chat_banned");
|
||||
|
||||
b.Property<bool>("HasVanity")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("has_vanity");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_admin");
|
||||
@@ -1220,6 +1220,7 @@ namespace LightlessSyncServer.Migrations
|
||||
b.HasOne("LightlessSyncShared.Models.Group", "Group")
|
||||
.WithOne("Profile")
|
||||
.HasForeignKey("LightlessSyncShared.Models.GroupProfile", "GroupGID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("fk_group_profiles_groups_group_gid");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
Reference in New Issue
Block a user