Harden runtime logging, normalize log prefixes, and document DB schemas

This commit is contained in:
nizar 2026-02-24 13:45:12 +01:00
parent 18d24f3cbe
commit a24f562e30
32 changed files with 245 additions and 49 deletions

77
SCHEMA.md Normal file
View file

@ -0,0 +1,77 @@
# Database Schema Layout (`game`)
This project uses multiple PostgreSQL schemas to keep domain data separated and maintainable.
## Search Path
Configured on database level:
```sql
ALTER DATABASE game SET search_path = world, economy, progression, gameplay, resources, system, public;
```
So unqualified table names still resolve in this order.
---
## Schemas
### `world`
Map/world topology and placements.
- `server_maps`
- `server_map_flags`
- `map_portals`
- `map_npcs`
- `map_monsters`
- `map_teleporters`
### `economy`
Shops, drops, and loot containers.
- `shops`
- `shop_items`
- `shop_skills`
- `item_boxes`
- `item_box_items`
- `drops`
### `progression`
Questing and recipe progression data.
- `recipes`
- `recipe_items`
- `quests`
- `quest_objectives`
- `quest_prizes`
- `quest_npcs`
- `tutorials`
### `gameplay`
Combat/gameplay mechanics and event configs.
- `skills`
- `skill_bcards`
- `skill_combos`
- `minigame_config`
- `minigame_scores_holders`
- `global_minigame_config`
- `gameevent_instant_battle_configs`
### `resources`
Raw synced file resources (DB-first support).
- `resource_files`
### `system`
System-level metadata.
- `__EFMigrationsHistory`
---
## Notes
- Keep new feature tables in the matching domain schema, **not** in `public`.
- If you add EF migrations, ensure schema-qualified table mapping is explicit.
- DB-first runtime loaders depend on these tables being present and populated.

79
docker-compose.prod.yml Normal file
View file

@ -0,0 +1,79 @@
services:
master:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
login:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
gamechannel:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
database:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
bazaar:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
family:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
relation:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
mail:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
translation:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
logs:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}
scheduler:
environment:
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT_OVERRIDE:-Production}
Logging__LogLevel__Default: ${LOG_LEVEL_DEFAULT:-Error}
Logging__LogLevel__Microsoft: ${LOG_LEVEL_MICROSOFT:-Error}
Logging__LogLevel__Microsoft.AspNetCore: ${LOG_LEVEL_ASPNETCORE:-Error}
Logging__LogLevel__Microsoft.Hosting.Lifetime: ${LOG_LEVEL_HOSTING_LIFETIME:-Error}

View file

@ -100,6 +100,8 @@ services:
WINGSEMU_MONGO_PWD: ${MONGO_ROOT_PASSWORD} WINGSEMU_MONGO_PWD: ${MONGO_ROOT_PASSWORD}
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
ASPNETCORE_URLS: ""
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/Master.dll"] command: ["/app/Master.dll"]
ports: ports:
- "20500:20500" - "20500:20500"
@ -237,6 +239,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/DatabaseServer.dll"] command: ["/app/DatabaseServer.dll"]
ports: ports:
- "29999:29999" - "29999:29999"
@ -273,6 +276,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/BazaarServer.dll"] command: ["/app/BazaarServer.dll"]
volumes: volumes:
- ./resources:/app/resources:ro - ./resources:/app/resources:ro
@ -312,6 +316,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/FamilyServer.dll"] command: ["/app/FamilyServer.dll"]
volumes: volumes:
- ./resources:/app/resources:ro - ./resources:/app/resources:ro
@ -351,6 +356,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/RelationServer.dll"] command: ["/app/RelationServer.dll"]
volumes: volumes:
- ./resources:/app/resources:ro - ./resources:/app/resources:ro
@ -390,6 +396,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/MailServer.dll"] command: ["/app/MailServer.dll"]
volumes: volumes:
- ./resources:/app/resources:ro - ./resources:/app/resources:ro
@ -420,6 +427,7 @@ services:
REDIS_PORT: 6379 REDIS_PORT: 6379
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/TranslationsServer.dll"] command: ["/app/TranslationsServer.dll"]
volumes: volumes:
- ./translations:/app/translations:ro - ./translations:/app/translations:ro
@ -456,6 +464,8 @@ services:
WINGSEMU_MONGO_PWD: ${MONGO_ROOT_PASSWORD} WINGSEMU_MONGO_PWD: ${MONGO_ROOT_PASSWORD}
MQTT_BROKER_ADDRESS: mqtt MQTT_BROKER_ADDRESS: mqtt
MQTT_BROKER_PORT: 1883 MQTT_BROKER_PORT: 1883
ASPNETCORE_URLS: ""
Logging__LogLevel__Microsoft.AspNetCore.Server.Kestrel: Error
command: ["/app/LogsServer.dll"] command: ["/app/LogsServer.dll"]
ports: ports:
- "28888:28888" - "28888:28888"
@ -493,3 +503,4 @@ volumes:

View file

@ -70,6 +70,7 @@ namespace BazaarServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("BAZAAR_SERVER_PORT") ?? "25555"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("BAZAAR_SERVER_PORT") ?? "25555"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Diagnostics; using System.Diagnostics;
@ -123,7 +123,7 @@ namespace DatabaseServer.Managers
character = await GetCharacterBySlot(characterDto.AccountId, characterDto.Slot); character = await GetCharacterBySlot(characterDto.AccountId, characterDto.Slot);
if (character != null) if (character != null)
{ {
Log.Warn("[CHARACTER_SAVE_SYSTEM][CreateCharacter] Found a character already in the desired slot." + Log.Warn("[CHARACTER_SAVE_SYSTEM][CREATE_CHARACTER] Found a character already in the desired slot." +
$"AccountId: '{character.AccountId.ToString()}' CharacterId: '{character.Id.ToString()}' Slot: '{character.Slot.ToString()}'"); $"AccountId: '{character.AccountId.ToString()}' CharacterId: '{character.Id.ToString()}' Slot: '{character.Slot.ToString()}'");
return null; return null;
} }

View file

@ -92,6 +92,7 @@ namespace DatabaseServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("DATABASE_SERVER_PORT") ?? "29999"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("DATABASE_SERVER_PORT") ?? "29999"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -66,6 +66,7 @@ namespace DiscordNotifier
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => { s.ListenAnyIP(28000); }); webBuilder.ConfigureKestrel(s => { s.ListenAnyIP(28000); });
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}); });

View file

@ -75,6 +75,7 @@ namespace FamilyServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("FAMILY_SERVER_PORT") ?? "26666"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("FAMILY_SERVER_PORT") ?? "26666"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -699,7 +699,7 @@ namespace GameChannel.Network
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error("[Handler Error]", ex); Log.Error("[HANDLER_ERROR]", ex);
} }
} }

View file

@ -167,7 +167,8 @@ namespace GameChannel
IHostBuilder hostBuilder = Host.CreateDefaultBuilder(args); IHostBuilder hostBuilder = Host.CreateDefaultBuilder(args);
hostBuilder.ConfigureWebHostDefaults(webBuilder => hostBuilder.ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.ConfigureKestrel(s => webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(Convert.ToInt32(Environment.GetEnvironmentVariable("HTTP_LISTEN_PORT") ?? "17500"), s.ListenAnyIP(Convert.ToInt32(Environment.GetEnvironmentVariable("HTTP_LISTEN_PORT") ?? "17500"),
options => { options.Protocols = HttpProtocols.Http1AndHttp2; }); options => { options.Protocols = HttpProtocols.Http1AndHttp2; });

View file

@ -1,4 +1,4 @@
// WingsEmu // WingsEmu
// //
// Developed by NosWings Team // Developed by NosWings Team
@ -65,12 +65,12 @@ namespace LoginServer.Network
protected override void OnStarted() protected override void OnStarted()
{ {
Log.Info("[TCP-SERVER] Started!"); Log.Info("[TCP_SERVER] Started!");
} }
protected override void OnError(SocketError error) protected override void OnError(SocketError error)
{ {
Log.Info("[TCP-SERVER] SocketError"); Log.Info("[TCP_SERVER] SocketError");
Stop(); Stop();
} }
} }

View file

@ -66,6 +66,7 @@ namespace LogsServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("LOGS_SERVER_PORT") ?? "28888"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("LOGS_SERVER_PORT") ?? "28888"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -69,6 +69,7 @@ namespace MailServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("MAIL_SERVER_PORT") ?? "27777"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("MAIL_SERVER_PORT") ?? "27777"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -65,6 +65,7 @@ namespace Master
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(Convert.ToInt32(Environment.GetEnvironmentVariable("MASTER_PORT") ?? "20500"), options => options.Protocols = HttpProtocols.Http2); s.ListenAnyIP(Convert.ToInt32(Environment.GetEnvironmentVariable("MASTER_PORT") ?? "20500"), options => options.Protocols = HttpProtocols.Http2);

View file

@ -65,6 +65,7 @@ namespace RelationServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("RELATION_SERVER_PORT") ?? "21111"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("RELATION_SERVER_PORT") ?? "21111"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -37,6 +37,7 @@ namespace WingsEmu.ClusterScheduler
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => { s.ListenAnyIP(25000); }); webBuilder.ConfigureKestrel(s => { s.ListenAnyIP(25000); });
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}); });

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -62,7 +62,7 @@ public class CreateAccountCommandHandler
await context.Database.MigrateAsync(); await context.Database.MigrateAsync();
if (context.Account.Any()) if (context.Account.Any())
{ {
Log.Info("[DEFAULT ACCOUNT] Accounts were already present!"); Log.Info("[DEFAULT_ACCOUNT] Accounts were already present!");
return 0; return 0;
} }
@ -84,12 +84,12 @@ public class CreateAccountCommandHandler
Password = adminPassword.ToSha512() Password = adminPassword.ToSha512()
}); });
await context.SaveChangesAsync(); await context.SaveChangesAsync();
Log.Info("[DEFAULT ACCOUNT] Accounts created!"); Log.Info("[DEFAULT_ACCOUNT] Accounts created!");
return 0; return 0;
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[DEFAULT ACCOUNT] Error", e); Log.Error("[DEFAULT_ACCOUNT] Error", e);
return 1; return 1;
} }
} }

View file

@ -77,6 +77,7 @@ namespace TranslationServer
IHostBuilder host = Host.CreateDefaultBuilder(args) IHostBuilder host = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, string.Empty);
webBuilder.ConfigureKestrel(s => webBuilder.ConfigureKestrel(s =>
{ {
s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("TRANSLATION_SERVER_PORT") ?? "19999"), options => { options.Protocols = HttpProtocols.Http2; }); s.ListenAnyIP(short.Parse(Environment.GetEnvironmentVariable("TRANSLATION_SERVER_PORT") ?? "19999"), options => { options.Protocols = HttpProtocols.Http2; });

View file

@ -89,7 +89,7 @@ public class FamilyAchievementManager : BackgroundService, IFamilyAchievementMan
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FamilyAchievementManager] ExecuteAsync", e); Log.Error("[FAMILY_ACHIEVEMENT_MANAGER] ExecuteAsync", e);
} }
} }
@ -109,7 +109,7 @@ public class FamilyAchievementManager : BackgroundService, IFamilyAchievementMan
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FamilyAchievementManager] ExecuteAsync", e); Log.Error("[FAMILY_ACHIEVEMENT_MANAGER] ExecuteAsync", e);
} }
} }
} }

View file

@ -8,6 +8,8 @@ namespace Plugin.Database.DB.Configs
{ {
public void Configure(EntityTypeBuilder<DbBazaarItemEntity> builder) public void Configure(EntityTypeBuilder<DbBazaarItemEntity> builder)
{ {
builder.HasQueryFilter(s => s.DeletedAt == null && s.DbCharacter.DeletedAt == null);
builder builder
.HasOne(s => s.DbCharacter) .HasOne(s => s.DbCharacter)
.WithMany(s => s.BazaarItem) .WithMany(s => s.BazaarItem)

View file

@ -10,6 +10,8 @@ namespace Plugin.Database.DB.Configs
{ {
builder.HasKey(s => new { s.CharacterId, s.RelatedCharacterId }); builder.HasKey(s => new { s.CharacterId, s.RelatedCharacterId });
builder.HasQueryFilter(s => s.Source.DeletedAt == null && s.Target.DeletedAt == null);
builder.HasOne(s => s.Source) builder.HasOne(s => s.Source)
.WithMany(s => s.SourceRelations) .WithMany(s => s.SourceRelations)
.HasForeignKey(s => s.CharacterId); .HasForeignKey(s => s.CharacterId);

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -32,7 +32,7 @@ namespace Plugin.Database.Families
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][SaveAsync] ", e); Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][SAVE_ASYNC] ", e);
throw; throw;
} }
} }
@ -48,7 +48,7 @@ namespace Plugin.Database.Families
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][DeleteAsync] ", e); Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][DELETE_ASYNC] ", e);
throw; throw;
} }
} }
@ -63,7 +63,7 @@ namespace Plugin.Database.Families
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][GetByFamilyIdAsync] ", e); Log.Error("[FAMILY_WAREHOUSE_ITEM_DAO][GET_BY_FAMILY_ID_ASYNC] ", e);
throw; throw;
} }
} }

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -29,7 +29,7 @@ namespace Plugin.Database.Families
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FAMILY_WAREHOUSE_LOG_DAO][SaveAsync] ", e); Log.Error("[FAMILY_WAREHOUSE_LOG_DAO][SAVE_ASYNC] ", e);
throw; throw;
} }
} }
@ -44,7 +44,7 @@ namespace Plugin.Database.Families
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[FAMILY_WAREHOUSE_LOG_DAO][GetByFamilyIdAsync] ", e); Log.Error("[FAMILY_WAREHOUSE_LOG_DAO][GET_BY_FAMILY_ID_ASYNC] ", e);
throw; throw;
} }
} }

View file

@ -9,6 +9,8 @@ namespace Plugin.Database.Families
{ {
builder.HasKey(s => new { s.FamilyId }); builder.HasKey(s => new { s.FamilyId });
builder.HasQueryFilter(s => s.DeletedAt == null && s.Family.DeletedAt == null);
builder.HasOne(s => s.Family) builder.HasOne(s => s.Family)
.WithOne(s => s.WarehouseLogs); .WithOne(s => s.WarehouseLogs);
} }

View file

@ -33,7 +33,7 @@ namespace Plugin.Database.Warehouse
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][SaveAsync] ", e); Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][SAVE_ASYNC] ", e);
throw; throw;
} }
} }
@ -49,7 +49,7 @@ namespace Plugin.Database.Warehouse
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][DeleteAsync] ", e); Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][DELETE_ASYNC] ", e);
throw; throw;
} }
} }
@ -64,7 +64,7 @@ namespace Plugin.Database.Warehouse
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][GetByFamilyIdAsync] ", e); Log.Error("[ACCOUNT_WAREHOUSE_ITEM_DAO][GET_BY_FAMILY_ID_ASYNC] ", e);
throw; throw;
} }
} }

View file

@ -1,6 +1,8 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions; using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Bson.Serialization.Serializers;
using PhoenixLib.Logging; using PhoenixLib.Logging;
using PhoenixLib.ServiceBus.Extensions; using PhoenixLib.ServiceBus.Extensions;
using Plugin.MongoLogs.Services; using Plugin.MongoLogs.Services;
@ -34,6 +36,16 @@ namespace Plugin.MongoLogs.Extensions
public static void AddMongoLogsPlugin(this IServiceCollection services) public static void AddMongoLogsPlugin(this IServiceCollection services)
{ {
// Allow serialization of plugin log entities that are passed as object through generic logging pipeline.
try
{
BsonSerializer.RegisterSerializer(new ObjectSerializer(_ => true));
}
catch
{
// serializer may already be registered by another startup path
}
var pack = new ConventionPack var pack = new ConventionPack
{ {
new TypedIgnoreDefaultPropertiesConvention<ItemInstanceDTO>() new TypedIgnoreDefaultPropertiesConvention<ItemInstanceDTO>()

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using PhoenixLib.Caching; using PhoenixLib.Caching;
@ -49,7 +49,7 @@ public class BazaarManager : IBazaarManager
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[BAZAAR_MANAGER][GetCharacterName] Unexpected error:", e); Log.Error("[BAZAAR_MANAGER][GET_CHARACTER_NAME] Unexpected error:", e);
} }
if (response?.RpcResponseType != RpcResponseType.SUCCESS) if (response?.RpcResponseType != RpcResponseType.SUCCESS)
@ -74,7 +74,7 @@ public class BazaarManager : IBazaarManager
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[BAZAAR_MANAGER][GetBazaarItemById] Unexpected error:", e); Log.Error("[BAZAAR_MANAGER][GET_BAZAAR_ITEM_BY_ID] Unexpected error:", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -98,7 +98,7 @@ public class BazaarManager : IBazaarManager
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[BAZAAR_MANAGER][GetListedItemsByCharacterId]", e); Log.Error("[BAZAAR_MANAGER][GET_LISTED_ITEMS_BY_CHARACTER_ID]", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -121,7 +121,7 @@ public class BazaarManager : IBazaarManager
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[BAZAAR_MANAGER][GetListedItemsByCharacterId]", e); Log.Error("[BAZAAR_MANAGER][GET_LISTED_ITEMS_BY_CHARACTER_ID]", e);
} }
if (response == null) if (response == null)

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using PhoenixLib.Events; using PhoenixLib.Events;
@ -58,19 +58,19 @@ public class PlayerChangeChannelAct4EventHandler : IAsyncEventProcessor<PlayerCh
SerializableGameServer gameServer = response?.GameServer; SerializableGameServer gameServer = response?.GameServer;
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
{ {
Log.Error("[GetAct4ChannelInfoRequest] Response type is not success.", new Exception()); Log.Error("[GET_ACT4_CHANNEL_INFO_REQUEST] Response type is not success.", new Exception());
return; return;
} }
if (gameServer == null) if (gameServer == null)
{ {
Log.Error("[GetAct4ChannelInfoRequest] Game server is null.", new Exception()); Log.Error("[GET_ACT4_CHANNEL_INFO_REQUEST] Game server is null.", new Exception());
return; return;
} }
if (gameServer.ChannelId == _gameServer.ChannelId) if (gameServer.ChannelId == _gameServer.ChannelId)
{ {
Log.Error("[GetAct4ChannelInfoRequest] It's the same channel id.", new Exception()); Log.Error("[GET_ACT4_CHANNEL_INFO_REQUEST] It's the same channel id.", new Exception());
return; return;
} }

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -83,7 +83,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'penaltyinfo'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_PENALTYINFO] Unexpected error: ", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -256,7 +256,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -278,7 +278,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS) if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS)
@ -305,7 +305,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
return response2?.ResponseType != RpcResponseType.SUCCESS return response2?.ResponseType != RpcResponseType.SUCCESS
@ -347,7 +347,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -369,7 +369,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS) if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS)
@ -397,7 +397,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
return response2?.ResponseType != RpcResponseType.SUCCESS return response2?.ResponseType != RpcResponseType.SUCCESS
@ -419,7 +419,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'unban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_UNBAN] Unexpected error: ", e);
} }
if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS) if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS)
@ -439,7 +439,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'unban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_UNBAN] Unexpected error: ", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -462,7 +462,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'unban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_UNBAN] Unexpected error: ", e);
} }
return saveResponse?.ResponseType != RpcResponseType.SUCCESS return saveResponse?.ResponseType != RpcResponseType.SUCCESS
@ -484,7 +484,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'unban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_UNBAN] Unexpected error: ", e);
} }
if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS) if (targetResponse?.RpcResponseType != RpcResponseType.SUCCESS)
@ -504,7 +504,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'unban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_UNBAN] Unexpected error: ", e);
} }
if (response?.ResponseType != RpcResponseType.SUCCESS) if (response?.ResponseType != RpcResponseType.SUCCESS)
@ -525,7 +525,7 @@ public class PunishmentModule : SaltyModuleBase
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error("[PUNISHMENT_MODULE][Command: 'ban'] Unexpected error: ", e); Log.Error("[PUNISHMENT_MODULE][COMMAND_BAN] Unexpected error: ", e);
} }
return saveResponse?.ResponseType != RpcResponseType.SUCCESS return saveResponse?.ResponseType != RpcResponseType.SUCCESS

View file

@ -40,7 +40,7 @@ namespace WingsEmu.Plugins.GameEvents.EventHandler.Global
_ => null _ => null
}; };
Log.Debug("[GameEvent] Locked Registration for Event: " + e.Type); Log.Debug("[GAME_EVENT] Locked Registration for Event: " + e.Type);
_sessionManager.Broadcast(x => _sessionManager.Broadcast(x =>
{ {

View file

@ -33,7 +33,7 @@ namespace WingsEmu.Plugins.GameEvents.EventHandler.Global
public async Task HandleAsync(GameEventMatchmakeEvent e, CancellationToken cancellation) public async Task HandleAsync(GameEventMatchmakeEvent e, CancellationToken cancellation)
{ {
Log.Debug("[GameEvent] Processing matchmaking for Event: " + e.Type); Log.Debug("[GAME_EVENT] Processing matchmaking for Event: " + e.Type);
FilterResult filterResult = _matchmaking.Filter(e.Sessions, new InBaseMapFilter()); FilterResult filterResult = _matchmaking.Filter(e.Sessions, new InBaseMapFilter());
TellToRefusedSessions(filterResult.RefusedSessions); TellToRefusedSessions(filterResult.RefusedSessions);

View file

@ -51,7 +51,7 @@ namespace WingsEmu.Plugins.GameEvents.EventHandler.Global
} }
GameEventType type = e.Type; GameEventType type = e.Type;
Log.Debug("[GameEvent] Preparing Event: " + type); Log.Debug("[GAME_EVENT] Preparing Event: " + type);
if (e.NoDelay) if (e.NoDelay)
{ {