Namespace Cleanup, and some fun toys in the admin portal

This commit is contained in:
dingo
2026-01-10 15:06:51 -05:00
parent ff7357c557
commit 60b882f1b9
93 changed files with 448 additions and 154 deletions
+2 -2
View File
@@ -2,8 +2,8 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using Server.Services.Auth; using GameServices.Auth;
using Server.Game.Dungeon; using GameServer.Dungeon;
namespace Server.Api; namespace Server.Api;
+1 -1
View File
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using Server.Services.Auth; using GameServices.Auth;
namespace Server.Api; namespace Server.Api;
+1 -1
View File
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Server.Services; using GameServices;
namespace Server.Api; namespace Server.Api;
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public class ChestInstance public class ChestInstance
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Handles damage calculations with stats, gear, and resistances /// Handles damage calculations with stats, gear, and resistances
+1 -1
View File
@@ -7,7 +7,7 @@ using Server.Networking;
using Server.Networking.Messages; using Server.Networking.Messages;
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Handles crafting operations including recipe discovery, crafting, and skill progression /// Handles crafting operations including recipe discovery, crafting, and skill progression
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public class DungeonChestSpawn public class DungeonChestSpawn
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Procedural dungeon generator using BSP (Binary Space Partition) + room placement /// Procedural dungeon generator using BSP (Binary Space Partition) + room placement
+1 -1
View File
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Procedural dungeon generator using room templates from database /// Procedural dungeon generator using room templates from database
+1 -1
View File
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Dungeon Generator V3 - Uses the DungeonBuilder system /// Dungeon Generator V3 - Uses the DungeonBuilder system
+3 -3
View File
@@ -10,10 +10,10 @@ using Server.Networking;
using Server.Networking.Handling; using Server.Networking.Handling;
using Server.Networking.Messages; using Server.Networking.Messages;
using Server.Redis; using Server.Redis;
using Server.Services; using GameServices;
using Server.Services.Auth; using GameServices.Auth;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Handles dungeon crawler game messages via the server's message router /// Handles dungeon crawler game messages via the server's message router
+2 -2
View File
@@ -1,6 +1,6 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Admin/management extensions for DungeonHandler /// Admin/management extensions for DungeonHandler
@@ -42,7 +42,7 @@ public partial class DungeonHandler
// Note: This is a simplified version - in production you'd want to // Note: This is a simplified version - in production you'd want to
// properly handle player state transitions // properly handle player state transitions
//dungeon.Simulation.RemovePlayer(player.CharacterId); //dungeon.Simulation.RemovePlayer(player.CharacterId);
Console.WriteLine("Force Close Dungeon -- Needs Implemented"); Console.WriteLine("Remove Player - Not Implemented.");
} }
catch { /* Ignore errors during cleanup */ } catch { /* Ignore errors during cleanup */ }
} }
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Represents an active dungeon instance /// Represents an active dungeon instance
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Contains the generated dungeon layout data /// Contains the generated dungeon layout data
+1 -1
View File
@@ -1,7 +1,7 @@
using DataServer.Data.Entities; using DataServer.Data.Entities;
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Enhanced dungeon layout with full tile visual information /// Enhanced dungeon layout with full tile visual information
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public class DungeonMobSpawn public class DungeonMobSpawn
{ {
+2 -1
View File
@@ -1,4 +1,5 @@
public enum DungeonPhase namespace GameServer.Dungeon;
public enum DungeonPhase
{ {
Active, Active,
Cleared, Cleared,
+1 -1
View File
@@ -2,7 +2,7 @@ using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
using Server.Networking; using Server.Networking;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Tracks a player's dungeon session state /// Tracks a player's dungeon session state
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public struct DungeonPoint public struct DungeonPoint
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public class DungeonRoom public class DungeonRoom
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Extended room with template info /// Extended room with template info
+2 -1
View File
@@ -2,7 +2,7 @@ using System.Collections.Concurrent;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Runtime simulation for an active dungeon instance /// Runtime simulation for an active dungeon instance
@@ -1050,6 +1050,7 @@ public partial class DungeonSimulation
float dy = y2 - y1; float dy = y2 - y1;
return MathF.Sqrt(dx * dx + dy * dy); return MathF.Sqrt(dx * dx + dy * dy);
} }
} }
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Admin extensions for DungeonSimulation /// Admin extensions for DungeonSimulation
+1 -1
View File
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Extension methods for visual tile data /// Extension methods for visual tile data
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Runtime instance of a personal loot chest (from death overflow) /// Runtime instance of a personal loot chest (from death overflow)
+1 -1
View File
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Generated loot result - an item with quantity /// Generated loot result - an item with quantity
+1 -1
View File
@@ -1,7 +1,7 @@
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Handles mob AI behavior and decision making /// Handles mob AI behavior and decision making
+1 -1
View File
@@ -1,7 +1,7 @@
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Loot carried by a mob from killing a player /// Loot carried by a mob from killing a player
+1 -1
View File
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Builds sprite configuration JSON for mobs from the database animation system /// Builds sprite configuration JSON for mobs from the database animation system
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon namespace GameServer.Dungeon
{ {
/// <summary> /// <summary>
/// Placed tile with details /// Placed tile with details
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Runtime instance of a player in a dungeon /// Runtime instance of a player in a dungeon
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// Runtime instance of a portal in a dungeon /// Runtime instance of a portal in a dungeon
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
/// <summary> /// <summary>
/// A projectile in flight /// A projectile in flight
+1 -1
View File
@@ -7,7 +7,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Server.Game.Dungeon namespace GameServer.Dungeon
{ {
/// <summary> /// <summary>
/// Normalized tag info: supports comma/space separated tokens + key:value tags. /// Normalized tag info: supports comma/space separated tokens + key:value tags.
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon; namespace GameServer.Dungeon;
public class TickResult public class TickResult
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Game.Dungeon namespace GameServer.Dungeon
{ {
/// <summary> /// <summary>
/// Tilemap sheet info for client /// Tilemap sheet info for client
+1 -1
View File
@@ -5,7 +5,7 @@ using System.Net.WebSockets;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Server.Redis; using Server.Redis;
using Server.Services.Auth; using GameServices.Auth;
using StackExchange.Redis; using StackExchange.Redis;
namespace Server.Networking; namespace Server.Networking;
+4 -4
View File
@@ -1,6 +1,6 @@
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using Server.Game.Dungeon; using GameServer.Dungeon;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@@ -12,9 +12,9 @@ using Server.Networking;
using Server.Networking.Handling; using Server.Networking.Handling;
using Server.Networking.Messages; using Server.Networking.Messages;
using Server.Redis; using Server.Redis;
using Server.Services; using GameServices;
using Server.Services.Auth; using GameServices.Auth;
using Server.Game; using GameServer;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@@ -4,7 +4,7 @@ using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Services.Admin.Pages.Abilities; namespace GameServices.Admin.Pages.Abilities;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Services.Admin.Pages.Abilities; namespace GameServices.Admin.Pages.Abilities;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Server.Services.Admin.Pages; namespace GameServices.Admin.Pages;
/// <summary> /// <summary>
/// Base class for all admin pages that require authentication /// Base class for all admin pages that require authentication
+2 -2
View File
@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Server.Game.Dungeon; using GameServer.Dungeon;
namespace Server.Services.Admin.Pages; namespace GameServices.Admin.Pages;
public class ApiModel : AdminPageModel public class ApiModel : AdminPageModel
{ {
+2 -2
View File
@@ -2,11 +2,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using Server.Services; using GameServices;
using System.Net.Http; using System.Net.Http;
using System.Security.Cryptography; using System.Security.Cryptography;
namespace Server.Services.Admin.Pages.Assets; namespace GameServices.Admin.Pages.Assets;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Server.Redis; using Server.Redis;
namespace Server.Services.Admin.Pages.Broadcast; namespace GameServices.Admin.Pages.Broadcast;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class ObjectEditModel : AdminPageModel public class ObjectEditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class ObjectsModel : AdminPageModel public class ObjectsModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class PaletteEditModel : AdminPageModel public class PaletteEditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class PalettesModel : AdminPageModel public class PalettesModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class RoomEditModel : AdminPageModel public class RoomEditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using DataServer.Data.Entities;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class RoomsModel : AdminPageModel public class RoomsModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Diagnostics; using System.Diagnostics;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class TestGenModel : AdminPageModel public class TestGenModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class TileEditModel : AdminPageModel public class TileEditModel : AdminPageModel
{ {
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.DungeonBuilder; namespace GameServices.Admin.Pages.DungeonBuilder;
public class TilesModel : AdminPageModel public class TilesModel : AdminPageModel
{ {
+8 -4
View File
@@ -91,9 +91,9 @@
<div> <div>
<label class="text-xs text-gray-400 mb-1 block">Status</label> <label class="text-xs text-gray-400 mb-1 block">Status</label>
<select name="status" class="input text-sm"> <select name="status" class="input text-sm">
<option value="">All Status</option> <option value="">Active Only</option>
<option value="active" selected="@(Model.StatusFilter == "active")">Active</option> <option value="completed" selected="@(Model.StatusFilter == "completed")">Completed/Cleared</option>
<option value="completed" selected="@(Model.StatusFilter == "completed")">Completed</option> <option value="all" selected="@(Model.StatusFilter == "all")">All Dungeons</option>
</select> </select>
</div> </div>
<div> <div>
@@ -126,7 +126,11 @@
<div class="space-y-4"> <div class="space-y-4">
<h2 class="text-xl font-semibold text-white flex items-center gap-2"> <h2 class="text-xl font-semibold text-white flex items-center gap-2">
<div class="live-indicator"></div> <div class="live-indicator"></div>
Active Dungeons (@Model.Dungeons.Count) Dungeons (@Model.Dungeons.Count)
@if (string.IsNullOrEmpty(Model.StatusFilter) || Model.StatusFilter == "active")
{
<span class="text-sm font-normal text-gray-500">(active only)</span>
}
</h2> </h2>
@if (Model.Dungeons.Count > 0) @if (Model.Dungeons.Count > 0)
+15 -7
View File
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Server.Game.Dungeon; using GameServer.Dungeon;
namespace Server.Services.Admin.Pages.Dungeons; namespace GameServices.Admin.Pages.Dungeons;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -37,12 +37,20 @@ public class IndexModel : AdminPageModel
// Apply filters // Apply filters
var filtered = allDungeons.AsEnumerable(); var filtered = allDungeons.AsEnumerable();
if (!string.IsNullOrEmpty(status)) // By default, show only active dungeons (exclude cleared/completed)
if (string.IsNullOrEmpty(status))
{ {
if (status == "active") // Default: Active only
filtered = filtered.Where(d => d.Simulation.Phase == DungeonPhase.Active); filtered = filtered.Where(d => d.Simulation.Phase == DungeonPhase.Active);
else if (status == "completed") }
filtered = filtered.Where(d => d.Simulation.Phase == DungeonPhase.Cleared); else if (status == "cleared")
{
// Show completed and cleared
filtered = filtered.Where(d => d.Simulation.Phase == DungeonPhase.Cleared || d.Simulation.Phase == DungeonPhase.Cleared);
}
else if (status == "all")
{
// Show all - no filter
} }
if (tier.HasValue) if (tier.HasValue)
+223 -29
View File
@@ -1,5 +1,5 @@
@page "/admin/dungeons/view" @page "/admin/dungeons/view"
@model Admin.Pages.Dungeons.ViewModel @model GameServices.Admin.Pages.Dungeons.ViewModel
@{ @{
ViewData["Title"] = $"Dungeon View - Tier {Model.Dungeon?.Tier}"; ViewData["Title"] = $"Dungeon View - Tier {Model.Dungeon?.Tier}";
} }
@@ -19,7 +19,12 @@
position: absolute; position: absolute;
border-radius: 50%; border-radius: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
pointer-events: none; cursor: pointer;
transition: transform 0.1s;
}
.entity-dot:hover {
transform: translate(-50%, -50%) scale(1.5);
z-index: 100;
} }
.player-dot { .player-dot {
background: #4ade80; background: #4ade80;
@@ -29,8 +34,11 @@
} }
.mob-dot { .mob-dot {
background: #f87171; background: #f87171;
width: 6px; width: 8px;
height: 6px; height: 8px;
}
.mob-dot:hover {
box-shadow: 0 0 8px #f87171;
} }
.boss-dot { .boss-dot {
background: #fbbf24; background: #fbbf24;
@@ -38,6 +46,10 @@
height: 12px; height: 12px;
box-shadow: 0 0 8px #fbbf24; box-shadow: 0 0 8px #fbbf24;
} }
.mob-dot.selected, .boss-dot.selected {
outline: 2px solid white;
outline-offset: 2px;
}
.stat-card { .stat-card {
background: rgba(30, 30, 50, 0.8); background: rgba(30, 30, 50, 0.8);
border: 1px solid #374151; border: 1px solid #374151;
@@ -64,6 +76,22 @@
background: linear-gradient(90deg, #ef4444, #22c55e); background: linear-gradient(90deg, #ef4444, #22c55e);
transition: width 0.3s ease; transition: width 0.3s ease;
} }
.mob-inspector {
background: rgba(20, 20, 40, 0.95);
border: 1px solid #4f46e5;
border-radius: 8px;
padding: 16px;
min-width: 280px;
}
.inspector-stat {
display: flex;
justify-content: space-between;
padding: 4px 0;
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.inspector-stat:last-child {
border-bottom: none;
}
</style> </style>
<div class="mb-4"> <div class="mb-4">
@@ -89,7 +117,7 @@ else
<h2 class="text-xl font-semibold text-white">Live Dungeon Map</h2> <h2 class="text-xl font-semibold text-white">Live Dungeon Map</h2>
<div class="flex items-center gap-2 text-sm text-gray-400"> <div class="flex items-center gap-2 text-sm text-gray-400">
<div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></div> <div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></div>
<span>Live</span> <span id="refreshRate">500ms</span>
<button onclick="toggleAutoRefresh()" id="autoRefreshBtn" class="btn btn-sm btn-ghost ml-2"> <button onclick="toggleAutoRefresh()" id="autoRefreshBtn" class="btn btn-sm btn-ghost ml-2">
Auto: ON Auto: ON
</button> </button>
@@ -108,7 +136,7 @@ else
</div> </div>
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<div class="w-2 h-2 rounded-full bg-red-400"></div> <div class="w-2 h-2 rounded-full bg-red-400"></div>
<span>Mobs</span> <span>Mobs (click to inspect)</span>
</div> </div>
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<div class="w-3 h-3 rounded-full bg-yellow-400"></div> <div class="w-3 h-3 rounded-full bg-yellow-400"></div>
@@ -118,10 +146,32 @@ else
<div class="w-3 h-3 bg-blue-400"></div> <div class="w-3 h-3 bg-blue-400"></div>
<span>Floor</span> <span>Floor</span>
</div> </div>
<div class="flex items-center gap-1"> </div>
<div class="w-3 h-3 bg-gray-700"></div> </div>
<span>Wall</span>
</div> <!-- Mob Inspector (shown when mob is selected) -->
<div id="mobInspector" class="mob-inspector mt-4 hidden">
<div class="flex items-center justify-between mb-3">
<h3 class="text-lg font-semibold text-white" id="inspectorMobName">Mob Name</h3>
<button onclick="closeMobInspector()" class="text-gray-400 hover:text-white">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div id="inspectorContent" class="space-y-1 text-sm">
<!-- Populated by JS -->
</div>
<div class="flex gap-2 mt-4">
<button onclick="killSelectedMob()" class="btn btn-danger btn-sm flex-1">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
Kill Mob
</button>
<button onclick="teleportToMob()" class="btn btn-secondary btn-sm flex-1">
📍 Copy Position
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -150,7 +200,7 @@ else
</div> </div>
<div class="flex justify-between"> <div class="flex justify-between">
<span class="text-gray-400">Phase</span> <span class="text-gray-400">Phase</span>
<span class="@(Model.Dungeon.Simulation.Phase == DungeonPhase.Active ? "text-green-400" : "text-blue-400")"> <span class="@(Model.Dungeon.Simulation.Phase == GameServer.Dungeon.DungeonPhase.Active ? "text-green-400" : "text-blue-400")">
@Model.Dungeon.Simulation.Phase @Model.Dungeon.Simulation.Phase
</span> </span>
</div> </div>
@@ -194,6 +244,37 @@ else
</div> </div>
</div> </div>
<!-- Spawn Mob -->
<div class="stat-card">
<h3 class="text-lg font-semibold text-white mb-3">Spawn Mob</h3>
<div class="space-y-2">
<select id="spawnMobSelect" class="input text-sm w-full">
<option value="">Select a mob...</option>
@foreach (var mob in Model.MobDefinitions)
{
<option value="@mob.Id">@mob.Name (T@mob.MinTier-@mob.MaxTier)</option>
}
</select>
<div class="grid grid-cols-2 gap-2">
<div>
<label class="text-xs text-gray-400">X</label>
<input type="number" id="spawnX" class="input text-sm" placeholder="X pos" value="@(Model.MapWidth / 2 * 32)" />
</div>
<div>
<label class="text-xs text-gray-400">Y</label>
<input type="number" id="spawnY" class="input text-sm" placeholder="Y pos" value="@(Model.MapHeight / 2 * 32)" />
</div>
</div>
<button onclick="spawnMob()" class="btn btn-success w-full text-sm">
<svg class="w-4 h-4 mr-1 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
Spawn Mob
</button>
<p class="text-xs text-gray-500">Click on map to set spawn position</p>
</div>
</div>
<!-- Players --> <!-- Players -->
<div class="stat-card"> <div class="stat-card">
<h3 class="text-lg font-semibold text-white mb-3">Players (@Model.Dungeon.Simulation.Players.Count)</h3> <h3 class="text-lg font-semibold text-white mb-3">Players (@Model.Dungeon.Simulation.Players.Count)</h3>
@@ -256,9 +337,13 @@ else
const mapWidth = @(Model.MapWidth); const mapWidth = @(Model.MapWidth);
const mapHeight = @(Model.MapHeight); const mapHeight = @(Model.MapHeight);
const walkableData = @Html.Raw(Model.WalkableJson); const walkableData = @Html.Raw(Model.WalkableJson);
const tileSize = 32;
let autoRefresh = true; let autoRefresh = true;
let refreshInterval; let refreshInterval;
let selectedMobId = null;
let currentMobs = [];
let mapScale = 4;
function initMap() { function initMap() {
const canvas = document.getElementById('mapCanvas'); const canvas = document.getElementById('mapCanvas');
@@ -266,14 +351,14 @@ else
if (!canvas || !container) return; if (!canvas || !container) return;
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
const scale = Math.min( mapScale = Math.min(
(container.clientWidth - 20) / mapWidth, (container.clientWidth - 20) / mapWidth,
(container.clientHeight - 20) / mapHeight, (container.clientHeight - 20) / mapHeight,
8 // Max scale 8 // Max scale
); );
canvas.width = mapWidth * scale; canvas.width = mapWidth * mapScale;
canvas.height = mapHeight * scale; canvas.height = mapHeight * mapScale;
canvas.style.width = canvas.width + 'px'; canvas.style.width = canvas.width + 'px';
canvas.style.height = canvas.height + 'px'; canvas.style.height = canvas.height + 'px';
@@ -284,16 +369,25 @@ else
const walkable = walkableData[idx]; const walkable = walkableData[idx];
ctx.fillStyle = walkable ? '#1e3a5f' : '#1a1a2e'; ctx.fillStyle = walkable ? '#1e3a5f' : '#1a1a2e';
ctx.fillRect(x * scale, y * scale, scale, scale); ctx.fillRect(x * mapScale, y * mapScale, mapScale, mapScale);
// Grid lines // Grid lines
ctx.strokeStyle = 'rgba(255,255,255,0.05)'; ctx.strokeStyle = 'rgba(255,255,255,0.05)';
ctx.strokeRect(x * scale, y * scale, scale, scale); ctx.strokeRect(x * mapScale, y * mapScale, mapScale, mapScale);
} }
} }
// Store scale for entity positioning // Store scale for entity positioning
canvas.dataset.scale = scale; canvas.dataset.scale = mapScale;
// Click handler for spawn position
canvas.onclick = function(e) {
const rect = canvas.getBoundingClientRect();
const x = Math.floor((e.clientX - rect.left) / mapScale) * tileSize + tileSize / 2;
const y = Math.floor((e.clientY - rect.top) / mapScale) * tileSize + tileSize / 2;
document.getElementById('spawnX').value = Math.round(x);
document.getElementById('spawnY').value = Math.round(y);
};
} }
function updateEntities(players, mobs) { function updateEntities(players, mobs) {
@@ -301,18 +395,16 @@ else
const overlay = document.getElementById('entityOverlay'); const overlay = document.getElementById('entityOverlay');
if (!canvas || !overlay) return; if (!canvas || !overlay) return;
const scale = parseFloat(canvas.dataset.scale) || 4; currentMobs = mobs;
const tileSize = 32; // Game tile size
overlay.innerHTML = ''; overlay.innerHTML = '';
// Draw players // Draw players
players.forEach(p => { players.forEach(p => {
const div = document.createElement('div'); const div = document.createElement('div');
div.className = 'entity-dot player-dot'; div.className = 'entity-dot player-dot';
div.style.left = (p.x / tileSize * scale) + 'px'; div.style.left = (p.x / tileSize * mapScale) + 'px';
div.style.top = (p.y / tileSize * scale) + 'px'; div.style.top = (p.y / tileSize * mapScale) + 'px';
div.title = p.name; div.title = `${p.name} (${Math.round(p.x)}, ${Math.round(p.y)})`;
overlay.appendChild(div); overlay.appendChild(div);
}); });
@@ -321,13 +413,105 @@ else
if (!m.alive) return; if (!m.alive) return;
const div = document.createElement('div'); const div = document.createElement('div');
div.className = 'entity-dot ' + (m.isBoss ? 'boss-dot' : 'mob-dot'); div.className = 'entity-dot ' + (m.isBoss ? 'boss-dot' : 'mob-dot');
div.style.left = (m.x / tileSize * scale) + 'px'; if (m.id === selectedMobId) div.classList.add('selected');
div.style.top = (m.y / tileSize * scale) + 'px'; div.style.left = (m.x / tileSize * mapScale) + 'px';
div.title = m.name; div.style.top = (m.y / tileSize * mapScale) + 'px';
div.title = `${m.name} - Click to inspect`;
div.dataset.mobId = m.id;
div.onclick = (e) => {
e.stopPropagation();
selectMob(m);
};
overlay.appendChild(div); overlay.appendChild(div);
}); });
} }
function selectMob(mob) {
selectedMobId = mob.id;
// Update selection visual
document.querySelectorAll('.entity-dot').forEach(d => d.classList.remove('selected'));
document.querySelector(`[data-mob-id="${mob.id}"]`)?.classList.add('selected');
// Show inspector
const inspector = document.getElementById('mobInspector');
inspector.classList.remove('hidden');
document.getElementById('inspectorMobName').textContent = mob.name + (mob.isBoss ? ' ⭐' : '');
document.getElementById('inspectorContent').innerHTML = `
<div class="inspector-stat"><span class="text-gray-400">ID</span><span class="text-white font-mono text-xs">${mob.id}</span></div>
<div class="inspector-stat"><span class="text-gray-400">Type</span><span class="text-white">${mob.type || 'Normal'}</span></div>
<div class="inspector-stat"><span class="text-gray-400">Health</span><span class="text-white">${mob.health} / ${mob.maxHealth}</span></div>
<div class="inspector-stat"><span class="text-gray-400">Position</span><span class="text-white">${Math.round(mob.x)}, ${Math.round(mob.y)}</span></div>
<div class="inspector-stat"><span class="text-gray-400">State</span><span class="text-white">${mob.state || 'Unknown'}</span></div>
<div class="inspector-stat"><span class="text-gray-400">Definition ID</span><span class="text-white">${mob.definitionId || 'N/A'}</span></div>
`;
}
function closeMobInspector() {
selectedMobId = null;
document.getElementById('mobInspector').classList.add('hidden');
document.querySelectorAll('.entity-dot').forEach(d => d.classList.remove('selected'));
}
async function killSelectedMob() {
if (!selectedMobId) return;
try {
const resp = await fetch(`/admin/dungeons/view?handler=KillMob&id=${dungeonId}&mobId=${selectedMobId}`, {
method: 'POST',
headers: { 'RequestVerificationToken': document.querySelector('[name="__RequestVerificationToken"]').value }
});
if (resp.ok) {
closeMobInspector();
fetchUpdate();
} else {
alert('Failed to kill mob');
}
} catch (e) {
console.error('Failed to kill mob:', e);
alert('Error killing mob');
}
}
function teleportToMob() {
const mob = currentMobs.find(m => m.id === selectedMobId);
if (mob) {
navigator.clipboard.writeText(`${Math.round(mob.x)}, ${Math.round(mob.y)}`);
alert(`Position copied: ${Math.round(mob.x)}, ${Math.round(mob.y)}`);
}
}
async function spawnMob() {
const mobDefId = document.getElementById('spawnMobSelect').value;
const x = document.getElementById('spawnX').value;
const y = document.getElementById('spawnY').value;
if (!mobDefId) {
alert('Please select a mob to spawn');
return;
}
try {
const resp = await fetch(`/admin/dungeons/view?handler=SpawnMob&id=${dungeonId}&mobDefId=${mobDefId}&x=${x}&y=${y}`, {
method: 'POST',
headers: { 'RequestVerificationToken': document.querySelector('[name="__RequestVerificationToken"]').value }
});
if (resp.ok) {
fetchUpdate();
} else {
const text = await resp.text();
alert('Failed to spawn mob: ' + text);
}
} catch (e) {
console.error('Failed to spawn mob:', e);
alert('Error spawning mob');
}
}
async function fetchUpdate() { async function fetchUpdate() {
try { try {
const resp = await fetch(`/admin/dungeons/view?handler=Status&id=${dungeonId}`); const resp = await fetch(`/admin/dungeons/view?handler=Status&id=${dungeonId}`);
@@ -337,6 +521,16 @@ else
document.getElementById('mobCount').textContent = data.mobsAlive; document.getElementById('mobCount').textContent = data.mobsAlive;
document.getElementById('duration').textContent = data.duration; document.getElementById('duration').textContent = data.duration;
updateEntities(data.players, data.mobs); updateEntities(data.players, data.mobs);
// Update selected mob info if still selected
if (selectedMobId) {
const mob = data.mobs.find(m => m.id === selectedMobId);
if (mob && mob.alive) {
selectMob(mob);
} else {
closeMobInspector();
}
}
} }
} catch (e) { } catch (e) {
console.error('Failed to fetch update:', e); console.error('Failed to fetch update:', e);
@@ -348,7 +542,7 @@ else
document.getElementById('autoRefreshBtn').textContent = 'Auto: ' + (autoRefresh ? 'ON' : 'OFF'); document.getElementById('autoRefreshBtn').textContent = 'Auto: ' + (autoRefresh ? 'ON' : 'OFF');
if (autoRefresh) { if (autoRefresh) {
refreshInterval = setInterval(fetchUpdate, 2000); refreshInterval = setInterval(fetchUpdate, 500);
} else { } else {
clearInterval(refreshInterval); clearInterval(refreshInterval);
} }
@@ -363,8 +557,8 @@ else
const initialMobs = @Html.Raw(Model.MobsJson); const initialMobs = @Html.Raw(Model.MobsJson);
updateEntities(initialPlayers, initialMobs); updateEntities(initialPlayers, initialMobs);
// Start auto-refresh // Start auto-refresh at 500ms (faster updates)
refreshInterval = setInterval(fetchUpdate, 2000); refreshInterval = setInterval(fetchUpdate, 500);
}); });
// Handle resize // Handle resize
+94 -9
View File
@@ -1,19 +1,24 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Server.Game.Dungeon; using Microsoft.EntityFrameworkCore;
using GameServer.Dungeon;
using DataServer.Data;
using DataServer.Data.Entities;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.Dungeons; namespace GameServices.Admin.Pages.Dungeons;
public class ViewModel : AdminPageModel public class ViewModel : AdminPageModel
{ {
private readonly DungeonHandler _dungeonHandler; private readonly DungeonHandler _dungeonHandler;
private readonly GameDbContext _db;
public ViewModel(DungeonHandler dungeonHandler) public ViewModel(DungeonHandler dungeonHandler, GameDbContext db)
{ {
_dungeonHandler = dungeonHandler; _dungeonHandler = dungeonHandler;
_db = db;
} }
public DungeonInstance? Dungeon { get; set; } public GameServer.Dungeon.DungeonInstance? Dungeon { get; set; }
public string Duration { get; set; } = ""; public string Duration { get; set; } = "";
public int RoomCount { get; set; } public int RoomCount { get; set; }
public int MapWidth { get; set; } public int MapWidth { get; set; }
@@ -21,18 +26,25 @@ public class ViewModel : AdminPageModel
public string WalkableJson { get; set; } = "[]"; public string WalkableJson { get; set; } = "[]";
public string PlayersJson { get; set; } = "[]"; public string PlayersJson { get; set; } = "[]";
public string MobsJson { get; set; } = "[]"; public string MobsJson { get; set; } = "[]";
public List<DungeonMobDefinition> MobDefinitions { get; set; } = new();
public void OnGet(Guid id) public async Task OnGetAsync(Guid id)
{ {
Dungeon = _dungeonHandler.GetDungeon(id); Dungeon = _dungeonHandler.GetDungeon(id);
// Load mob definitions for spawn dropdown
MobDefinitions = await _db.DungeonMobDefinitions
.Where(m => m.IsEnabled)
.OrderBy(m => m.Name)
.ToListAsync();
if (Dungeon == null) return; if (Dungeon == null) return;
Duration = FormatDuration(DateTime.UtcNow - Dungeon.CreatedAt); Duration = FormatDuration(DateTime.UtcNow - Dungeon.CreatedAt);
RoomCount = Dungeon.LayoutV2?.Rooms?.Count ?? Dungeon.Simulation.Layout.Rooms.Count; RoomCount = Dungeon.LayoutV2?.Rooms?.Count ?? Dungeon.Simulation.Layout.Rooms.Count;
// Get map dimensions // Get map dimensions
var layout = Dungeon.LayoutV2 ?? (DungeonLayoutV2?)null; var layout = Dungeon.LayoutV2;
if (layout != null) if (layout != null)
{ {
MapWidth = layout.Width; MapWidth = layout.Width;
@@ -72,11 +84,17 @@ public class ViewModel : AdminPageModel
MobsJson = JsonSerializer.Serialize( MobsJson = JsonSerializer.Serialize(
Dungeon.Simulation.Mobs.Values.Select(m => new Dungeon.Simulation.Mobs.Values.Select(m => new
{ {
id = m.Id.ToString(),
name = m.Name, name = m.Name,
x = m.X, x = m.X,
y = m.Y, y = m.Y,
health = m.Health,
maxHealth = m.MaxHealth,
alive = m.IsAlive, alive = m.IsAlive,
isBoss = m.Type == DataServer.Data.Enums.MobType.Boss isBoss = m.Type == DataServer.Data.Enums.MobType.Boss,
type = m.Type.ToString(),
state = m.State.ToString() ?? "Idle",
definitionId = m.DefinitionId
}) })
); );
} }
@@ -98,17 +116,84 @@ public class ViewModel : AdminPageModel
x = p.X, x = p.X,
y = p.Y y = p.Y
}), }),
mobs = dungeon.Simulation.Mobs.Values.Where(m => m.IsAlive).Select(m => new mobs = dungeon.Simulation.Mobs.Values.Select(m => new
{ {
id = m.Id.ToString(),
name = m.Name, name = m.Name,
x = m.X, x = m.X,
y = m.Y, y = m.Y,
health = m.Health,
maxHealth = m.MaxHealth,
alive = m.IsAlive, alive = m.IsAlive,
isBoss = m.Type == DataServer.Data.Enums.MobType.Boss isBoss = m.Type == DataServer.Data.Enums.MobType.Boss,
type = m.Type.ToString(),
state = m.State.ToString() ?? "Idle",
definitionId = m.DefinitionId
}) })
}); });
} }
public IActionResult OnPostKillMob(Guid id, string mobId)
{
var dungeon = _dungeonHandler.GetDungeon(id);
if (dungeon == null)
return new JsonResult(new { error = "Dungeon not found" }) { StatusCode = 404 };
if (!int.TryParse(mobId, out var mobInt))
return new JsonResult(new { error = "Invalid mob ID" }) { StatusCode = 400 };
if (dungeon.Simulation.Mobs.TryGetValue(mobInt, out var mob))
{
mob.Health = 0;
mob.IsAlive = false;
return new JsonResult(new { success = true });
}
return new JsonResult(new { error = "Mob not found" }) { StatusCode = 404 };
}
public async Task<IActionResult> OnPostSpawnMob(Guid id, int mobDefId, float x, float y)
{
var dungeon = _dungeonHandler.GetDungeon(id);
if (dungeon == null)
return new JsonResult(new { error = "Dungeon not found" }) { StatusCode = 404 };
var mobDef = await _db.DungeonMobDefinitions.FindAsync(mobDefId);
if (mobDef == null)
return new JsonResult(new { error = "Mob definition not found" }) { StatusCode = 404 };
int mobId = dungeon.Simulation.Mobs.Count + 1;
var stats = mobDef.GetStatsForBracket(dungeon.LevelBracketMin);
// Create a new mob instance
var mob = new MobInstance
{
Id = mobId,
DefinitionId = mobDef.Id,
Name = mobDef.Name,
Type = mobDef.Type,
X = x,
Y = y,
Health = stats.MaxHealth,
MaxHealth = stats.MaxHealth,
Mana = mobDef.BaseMana,
MaxMana = mobDef.BaseMana,
Stats = stats,
State = MobState.Idle,
SpriteConfigJson = mobDef.SpriteConfigJson,
TintColor = mobDef.TintColor,
Scale = mobDef.Scale,
Behavior = mobDef.Behavior,
PreferredRange = mobDef.PreferredRange,
FleeThreshold = mobDef.FleeThreshold,
Phases = mobDef.Phases,
CurrentAnimation = "idle_down",
FacingDirection = "down"
};
dungeon.Simulation.Mobs[mob.Id] = mob;
return new JsonResult(new { success = true, mobId = mob.Id });
}
public IActionResult OnPostKillAllMobs(Guid id) public IActionResult OnPostKillAllMobs(Guid id)
{ {
var dungeon = _dungeonHandler.GetDungeon(id); var dungeon = _dungeonHandler.GetDungeon(id);
+1 -1
View File
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Admin.Pages; namespace GameServices.Admin.Pages;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -5,7 +5,7 @@ using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.Items; namespace GameServices.Admin.Pages.Items;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
+1 -1
View File
@@ -4,7 +4,7 @@ using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Services.Admin.Pages.Items; namespace GameServices.Admin.Pages.Items;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+2 -2
View File
@@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using Server.Services.Auth; using GameServices.Auth;
namespace Server.Services.Admin.Pages; namespace GameServices.Admin.Pages;
public class LoginModel : PageModel public class LoginModel : PageModel
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Server.Services.Admin.Pages; namespace GameServices.Admin.Pages;
public class LogoutModel : PageModel public class LogoutModel : PageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.LootTables; namespace GameServices.Admin.Pages.LootTables;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.LootTables; namespace GameServices.Admin.Pages.LootTables;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -5,7 +5,7 @@ using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.Mobs; namespace GameServices.Admin.Pages.Mobs;
// Helper class for sprite configuration (legacy - keeping for backwards compatibility) // Helper class for sprite configuration (legacy - keeping for backwards compatibility)
public class MobSpriteConfig public class MobSpriteConfig
+1 -1
View File
@@ -4,7 +4,7 @@ using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using DataServer.Data.Enums; using DataServer.Data.Enums;
namespace Server.Services.Admin.Pages.Mobs; namespace GameServices.Admin.Pages.Mobs;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.Players; namespace GameServices.Admin.Pages.Players;
public class CharacterModel : AdminPageModel public class CharacterModel : AdminPageModel
{ {
+2 -2
View File
@@ -2,10 +2,10 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
using Server.Services.Auth; using GameServices.Auth;
using Server.Redis; using Server.Redis;
namespace Server.Services.Admin.Pages.Players; namespace GameServices.Admin.Pages.Players;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
+1 -1
View File
@@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Admin.Pages.Players; namespace GameServices.Admin.Pages.Players;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.Recipes; namespace GameServices.Admin.Pages.Recipes;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
+1 -1
View File
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.Recipes; namespace GameServices.Admin.Pages.Recipes;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.Resistances; namespace GameServices.Admin.Pages.Resistances;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -4,7 +4,7 @@ using DataServer.Data;
using Server.Redis; using Server.Redis;
using System.Text.Json; using System.Text.Json;
namespace Server.Services.Admin.Pages.Server; namespace GameServices.Admin.Pages.Server;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+7 -6
View File
@@ -159,12 +159,6 @@
TileMaps TileMaps
</a> </a>
<a href="/admin/roomtemplates" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/RoomTemplates") == true ? "active" : "")" onclick="closeMobileMenu()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/>
</svg>
Room Templates
</a>
<a href="/admin/dungeonbuilder" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.Contains("DungeonBuilder") == true ? "active" : "")" onclick="closeMobileMenu()"> <a href="/admin/dungeonbuilder" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.Contains("DungeonBuilder") == true ? "active" : "")" onclick="closeMobileMenu()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -198,6 +192,13 @@
<p class="px-4 text-xs font-semibold text-gray-500 uppercase tracking-wider">Management</p> <p class="px-4 text-xs font-semibold text-gray-500 uppercase tracking-wider">Management</p>
</div> </div>
<a href="/admin/dungeons" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Dungeons") == true ? "active" : "")" onclick="closeMobileMenu()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/>
</svg>
Dungeons
</a>
<a href="/admin/players" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Players") == true ? "active" : "")" onclick="closeMobileMenu()"> <a href="/admin/players" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Players") == true ? "active" : "")" onclick="closeMobileMenu()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.SpriteSheets; namespace GameServices.Admin.Pages.SpriteSheets;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.SpriteSheets; namespace GameServices.Admin.Pages.SpriteSheets;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.TileMaps; namespace GameServices.Admin.Pages.TileMaps;
public class EditModel : AdminPageModel public class EditModel : AdminPageModel
{ {
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
using DataServer.Data.Entities; using DataServer.Data.Entities;
namespace Server.Services.Admin.Pages.TileMaps; namespace GameServices.Admin.Pages.TileMaps;
public class IndexModel : AdminPageModel public class IndexModel : AdminPageModel
{ {
+1 -1
View File
@@ -1,2 +1,2 @@
@namespace Server.Services.Admin.Pages @namespace GameServices.Admin.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+1 -1
View File
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Auth; namespace GameServices.Auth;
public sealed class AccountsRepository : IAccountsRepository public sealed class AccountsRepository : IAccountsRepository
{ {
+1 -1
View File
@@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Auth; namespace GameServices.Auth;
/// <summary> /// <summary>
/// Service for validating admin authentication via session tokens /// Service for validating admin authentication via session tokens
+1 -1
View File
@@ -7,7 +7,7 @@ using Server.Networking;
using Server.Networking.Handling; using Server.Networking.Handling;
using Server.Networking.Messages; using Server.Networking.Messages;
namespace Server.Services.Auth; namespace GameServices.Auth;
public sealed class AuthHandler : IClientMessageHandler public sealed class AuthHandler : IClientMessageHandler
{ {
+1 -1
View File
@@ -5,7 +5,7 @@ using DataServer.Data;
using Server.Redis; using Server.Redis;
using StackExchange.Redis; using StackExchange.Redis;
namespace Server.Services.Auth; namespace GameServices.Auth;
public interface IAuthService public interface IAuthService
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Auth; namespace GameServices.Auth;
public interface IAccountsRepository public interface IAccountsRepository
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
namespace Server.Services.Auth; namespace GameServices.Auth;
public interface IPasswordHasher public interface IPasswordHasher
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Server.Services.Auth; namespace GameServices.Auth;
public interface ISessionAudit public interface ISessionAudit
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Server.Services.Auth; namespace GameServices.Auth;
public interface ISessionRegistry public interface ISessionRegistry
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Security.Cryptography; using System.Security.Cryptography;
namespace Server.Services.Auth; namespace GameServices.Auth;
public sealed class Pbkdf2PasswordHasher : IPasswordHasher public sealed class Pbkdf2PasswordHasher : IPasswordHasher
{ {
+1 -1
View File
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using DataServer.Data; using DataServer.Data;
namespace Server.Services.Auth; namespace GameServices.Auth;
public sealed class SessionAudit : ISessionAudit public sealed class SessionAudit : ISessionAudit
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Server.Services.Auth; namespace GameServices.Auth;
public sealed class SessionRegistry : ISessionRegistry public sealed class SessionRegistry : ISessionRegistry
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using Minio; using Minio;
using Minio.DataModel.Args; using Minio.DataModel.Args;
namespace Server.Services; namespace GameServices;
public class MinioConfig public class MinioConfig
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
namespace Server.Services; namespace GameServices;
/// <summary> /// <summary>
/// Service for broadcasting messages to connected game clients /// Service for broadcasting messages to connected game clients