From c05b62f04a3fdcd7f128d9f25cbda79e46ac400c Mon Sep 17 00:00:00 2001
From: Wighty <53131013+PowerShellYoungTeam@users.noreply.github.com>
Date: Wed, 12 Nov 2025 21:19:48 +0000
Subject: [PATCH 01/19] Refactor game data structure and enhance auto-loading
functionality
- Updated gamedata.json to include new locations and metadata.
- Implemented auto-loading of gamedata.json in app.js with error handling and user feedback.
- Improved visitLocation method in app.js to handle errors and provide feedback on location visits.
- Enhanced map.js to support dynamic button creation for visiting locations.
- Updated event handling in events.js to prevent infinite loops on error events.
- Added progress bar handling in Generate-GameData.ps1 for better user experience.
- Created new demo and test scripts for command registry and communication systems.
- Added various documentation files for integration guides and architecture overviews.
---
Communication-Success-Report.md | 0
Data/Backups/test-save_20250801_002044.json | 1 -
Data/Backups/test-save_20251112_210425.json | 1 +
Data/Saves/test-save.json | 2 +-
Demo-CommandRegistry.ps1 | 0
Demo-CommunicationBridge.ps1 | 0
Demo-CommunicationSystem.ps1 | 0
Docs/CommandRegistry-Integration-Guide.md | 0
Docs/Communication-Architecture.md | 0
Docs/CommunicationBridge-Integration-Guide.md | 0
Docs/DataModels-Implementation-Guide.md | 0
Docs/DataModels-Specification.md | 0
Docs/EventSystemGuide.md | 0
Docs/StateManager-Implementation-Status.md | 0
Docs/StateManager-Integration-Guide.md | 0
Docs/StateManager-Integration-Summary.md | 0
Final-CommandRegistry-Demo.ps1 | 0
Logs/game.log | 50 +++
Minimal-CommandRegistry-Test.ps1 | 0
Modules/CoreGame/CommunicationBridge.psm1 | 0
Modules/CoreGame/CommunicationSystem.psm1 | 0
Modules/CoreGame/DataModels-Clean.psm1 | 0
.../CoreGame/SimpleCommunicationSystem.psm1 | 0
Simple-CommandRegistry-Demo.ps1 | 0
Simple-StateManager-Test.ps1 | 0
Test-CommunicationBridge.ps1 | 0
Test-CommunicationSystem.ps1 | 0
Test-StateManager.ps1 | 0
Tests/CommandRegistry-Demo.html | 0
Tests/CommandRegistry-Live-Demo.html | 0
Tests/CommandRegistry-Working-Demo.html | 0
Tests/Demo-Server.ps1 | 0
Tests/Enhanced-Integration-Test.ps1 | 0
Tests/Final-Integration-Test.ps1 | 0
.../CommandRegistry-Integration.Tests.ps1 | 0
Tests/Quick-Integration-Test.ps1 | 0
Tests/Simple-StateManager-Test.ps1 | 0
Tests/Start-Demo.ps1 | 0
Tests/StateManager-Integration-Test.ps1 | 0
Tests/Working-Integration-Test.ps1 | 0
Working-CommandRegistry-Test.ps1 | 0
command-registry-demo.html | 0
communication-bridge-demo.html | 0
event_log.json | 358 +++++++--------
events.json | 414 +++++++++---------
gamedata.json | 346 +++++++++------
js/app.js | 82 +++-
js/communicationBridge.js | 0
js/events.js | 18 +-
js/map.js | 44 +-
scripts/Generate-GameData.ps1 | 17 +-
test-datamodels.html | 0
test-gamedata.json | 77 ++++
test-state-manager.html | 0
test-syntax.ps1 | 0
55 files changed, 840 insertions(+), 570 deletions(-)
create mode 100644 Communication-Success-Report.md
delete mode 100644 Data/Backups/test-save_20250801_002044.json
create mode 100644 Data/Backups/test-save_20251112_210425.json
create mode 100644 Demo-CommandRegistry.ps1
create mode 100644 Demo-CommunicationBridge.ps1
create mode 100644 Demo-CommunicationSystem.ps1
create mode 100644 Docs/CommandRegistry-Integration-Guide.md
create mode 100644 Docs/Communication-Architecture.md
create mode 100644 Docs/CommunicationBridge-Integration-Guide.md
create mode 100644 Docs/DataModels-Implementation-Guide.md
create mode 100644 Docs/DataModels-Specification.md
create mode 100644 Docs/EventSystemGuide.md
create mode 100644 Docs/StateManager-Implementation-Status.md
create mode 100644 Docs/StateManager-Integration-Guide.md
create mode 100644 Docs/StateManager-Integration-Summary.md
create mode 100644 Final-CommandRegistry-Demo.ps1
create mode 100644 Minimal-CommandRegistry-Test.ps1
create mode 100644 Modules/CoreGame/CommunicationBridge.psm1
create mode 100644 Modules/CoreGame/CommunicationSystem.psm1
create mode 100644 Modules/CoreGame/DataModels-Clean.psm1
create mode 100644 Modules/CoreGame/SimpleCommunicationSystem.psm1
create mode 100644 Simple-CommandRegistry-Demo.ps1
create mode 100644 Simple-StateManager-Test.ps1
create mode 100644 Test-CommunicationBridge.ps1
create mode 100644 Test-CommunicationSystem.ps1
create mode 100644 Test-StateManager.ps1
create mode 100644 Tests/CommandRegistry-Demo.html
create mode 100644 Tests/CommandRegistry-Live-Demo.html
create mode 100644 Tests/CommandRegistry-Working-Demo.html
create mode 100644 Tests/Demo-Server.ps1
create mode 100644 Tests/Enhanced-Integration-Test.ps1
create mode 100644 Tests/Final-Integration-Test.ps1
create mode 100644 Tests/Integration/CommandRegistry-Integration.Tests.ps1
create mode 100644 Tests/Quick-Integration-Test.ps1
create mode 100644 Tests/Simple-StateManager-Test.ps1
create mode 100644 Tests/Start-Demo.ps1
create mode 100644 Tests/StateManager-Integration-Test.ps1
create mode 100644 Tests/Working-Integration-Test.ps1
create mode 100644 Working-CommandRegistry-Test.ps1
create mode 100644 command-registry-demo.html
create mode 100644 communication-bridge-demo.html
create mode 100644 js/communicationBridge.js
create mode 100644 test-datamodels.html
create mode 100644 test-gamedata.json
create mode 100644 test-state-manager.html
create mode 100644 test-syntax.ps1
diff --git a/Communication-Success-Report.md b/Communication-Success-Report.md
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Backups/test-save_20250801_002044.json b/Data/Backups/test-save_20250801_002044.json
deleted file mode 100644
index 25efb46..0000000
--- a/Data/Backups/test-save_20250801_002044.json
+++ /dev/null
@@ -1 +0,0 @@
-{"AdditionalData":{},"Performance":{"LastActivity":"2025-08-01T00:18:36.060344+01:00","AverageLoadTime":0,"SaveCount":0,"SyncCount":0,"LoadCount":0,"AverageSaveTime":0,"TotalDataSize":0,"LastSaveSize":0,"ErrorCount":0},"Entities":{"test-entity-20250801-001836":{"IsDirty":false,"EntityType":"test","Changes":[],"LastModified":"2025-08-01T00:18:36.0709636+01:00","State":{"Version":"1.0.0","Id":"test-entity-20250801-001836","OriginalValues":{},"Name":"","UpdatedAt":"2025-08-01T00:18:36.0705597+01:00","Type":"test","CreatedAt":"2025-08-01T00:18:36.0705369+01:00","Metadata":{},"Tags":{},"PropertyChanges":{},"Properties":{},"IsActive":true,"Description":"","IsTrackingChanges":true}}},"GameState":{},"Version":"1.0.0","Metadata":{"GameVersion":"1.0.0","TotalEntities":1,"PlayerCount":0,"SavedAt":"2025-08-01T00:18:36.0720782+01:00","Platform":"PowerShell"}}
diff --git a/Data/Backups/test-save_20251112_210425.json b/Data/Backups/test-save_20251112_210425.json
new file mode 100644
index 0000000..2463782
--- /dev/null
+++ b/Data/Backups/test-save_20251112_210425.json
@@ -0,0 +1 @@
+{"AdditionalData":{},"Performance":{"LastActivity":"2025-08-01T00:37:39.038934+01:00","AverageLoadTime":0,"SaveCount":0,"SyncCount":0,"LoadCount":0,"AverageSaveTime":0,"TotalDataSize":0,"LastSaveSize":0,"ErrorCount":0},"Entities":{"test-entity-20250801-003739":{"IsDirty":false,"EntityType":"test","Changes":[],"LastModified":"2025-08-01T00:37:39.051054+01:00","State":{"Version":"1.0.0","Id":"test-entity-20250801-003739","OriginalValues":{},"Name":"","UpdatedAt":"2025-08-01T00:37:39.0506457+01:00","Type":"test","CreatedAt":"2025-08-01T00:37:39.0506235+01:00","Metadata":{},"Tags":{},"PropertyChanges":{},"Properties":{},"IsActive":true,"Description":"","IsTrackingChanges":true}}},"GameState":{},"Version":"1.0.0","Metadata":{"GameVersion":"1.0.0","TotalEntities":1,"PlayerCount":0,"SavedAt":"2025-08-01T00:37:39.0522007+01:00","Platform":"PowerShell"}}
diff --git a/Data/Saves/test-save.json b/Data/Saves/test-save.json
index 2463782..addd95d 100644
--- a/Data/Saves/test-save.json
+++ b/Data/Saves/test-save.json
@@ -1 +1 @@
-{"AdditionalData":{},"Performance":{"LastActivity":"2025-08-01T00:37:39.038934+01:00","AverageLoadTime":0,"SaveCount":0,"SyncCount":0,"LoadCount":0,"AverageSaveTime":0,"TotalDataSize":0,"LastSaveSize":0,"ErrorCount":0},"Entities":{"test-entity-20250801-003739":{"IsDirty":false,"EntityType":"test","Changes":[],"LastModified":"2025-08-01T00:37:39.051054+01:00","State":{"Version":"1.0.0","Id":"test-entity-20250801-003739","OriginalValues":{},"Name":"","UpdatedAt":"2025-08-01T00:37:39.0506457+01:00","Type":"test","CreatedAt":"2025-08-01T00:37:39.0506235+01:00","Metadata":{},"Tags":{},"PropertyChanges":{},"Properties":{},"IsActive":true,"Description":"","IsTrackingChanges":true}}},"GameState":{},"Version":"1.0.0","Metadata":{"GameVersion":"1.0.0","TotalEntities":1,"PlayerCount":0,"SavedAt":"2025-08-01T00:37:39.0522007+01:00","Platform":"PowerShell"}}
+{"AdditionalData":{},"Version":"1.0.0","Performance":{"LoadCount":0,"SaveCount":0,"AverageSaveTime":0,"LastActivity":"2025-11-12T21:04:25.1571824+00:00","AverageLoadTime":0,"TotalDataSize":0,"ErrorCount":0,"LastSaveSize":0,"SyncCount":0},"Entities":{"test-entity-20251112-210425":{"State":{"IsTrackingChanges":true,"OriginalValues":{},"IsActive":true,"UpdatedAt":"2025-11-12T21:04:25.2267045+00:00","Tags":{},"CreatedAt":"2025-11-12T21:04:25.2254424+00:00","Id":"test-entity-20251112-210425","Properties":{},"Type":"test","Metadata":{},"PropertyChanges":{},"Version":"1.0.0","Name":"","Description":""},"LastModified":"2025-11-12T21:04:25.2716066+00:00","IsDirty":false,"Changes":[],"EntityType":"test"}},"Metadata":{"SavedAt":"2025-11-12T21:04:25.2976467+00:00","GameVersion":"1.0.0","Platform":"PowerShell","PlayerCount":0,"TotalEntities":1},"GameState":{}}
diff --git a/Demo-CommandRegistry.ps1 b/Demo-CommandRegistry.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Demo-CommunicationBridge.ps1 b/Demo-CommunicationBridge.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Demo-CommunicationSystem.ps1 b/Demo-CommunicationSystem.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/CommandRegistry-Integration-Guide.md b/Docs/CommandRegistry-Integration-Guide.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/Communication-Architecture.md b/Docs/Communication-Architecture.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/CommunicationBridge-Integration-Guide.md b/Docs/CommunicationBridge-Integration-Guide.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/DataModels-Implementation-Guide.md b/Docs/DataModels-Implementation-Guide.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/DataModels-Specification.md b/Docs/DataModels-Specification.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/EventSystemGuide.md b/Docs/EventSystemGuide.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/StateManager-Implementation-Status.md b/Docs/StateManager-Implementation-Status.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/StateManager-Integration-Guide.md b/Docs/StateManager-Integration-Guide.md
new file mode 100644
index 0000000..e69de29
diff --git a/Docs/StateManager-Integration-Summary.md b/Docs/StateManager-Integration-Summary.md
new file mode 100644
index 0000000..e69de29
diff --git a/Final-CommandRegistry-Demo.ps1 b/Final-CommandRegistry-Demo.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Logs/game.log b/Logs/game.log
index dc6ed4e..6270c9c 100644
--- a/Logs/game.log
+++ b/Logs/game.log
@@ -465,3 +465,53 @@
[2025-08-01 00:37:39.839] [Info] [CommandRegistry] Command executed successfully: registry.getStatistics
[2025-08-01 00:37:39.842] [Info] [CommandRegistry] Executing command: registry.getPerformanceMetrics
[2025-08-01 00:37:39.845] [Error] [CommandRegistry] Failed to execute command: registry.getPerformanceMetrics
+[2025-11-12 21:04:24.563] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:24.589] [Info] [TestModule] Test log message
+[2025-11-12 21:04:24.590] [Warning] [TestModule] Warning message
+[2025-11-12 21:04:24.625] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:24.633] [Info] [EventSystem] Initializing PowerShell Event System...
+[2025-11-12 21:04:24.639] [Info] [EventSystem] Loaded existing event log with 20 events
+[2025-11-12 21:04:24.652] [Info] [EventSystem] Cleaned up 20 old events (older than 7 days)
+[2025-11-12 21:04:24.670] [Info] [EventSystem] Event system initialized successfully
+[2025-11-12 21:04:24.802] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:24.808] [Info] [CommandRegistry] Initializing Command Registry system...
+[2025-11-12 21:04:24.842] [Info] [CommandRegistry] Command Registry initialized successfully
+[2025-11-12 21:04:24.846] [Info] [CommandRegistry] Registering built-in commands...
+[2025-11-12 21:04:24.926] [Info] [CommandRegistry] Built-in commands registered successfully
+[2025-11-12 21:04:24.929] [Warning] [CommandRegistry] Failed to send initialization event
+[2025-11-12 21:04:24.936] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:25.005] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:25.010] [Info] [CommandRegistry] Executing command: registry.getDocumentation
+[2025-11-12 21:04:25.044] [Info] [CommandRegistry] Command executed successfully: registry.getDocumentation
+[2025-11-12 21:04:25.049] [Info] [CommandRegistry] Executing command: registry.getStatistics
+[2025-11-12 21:04:25.059] [Info] [CommandRegistry] Command executed successfully: registry.getStatistics
+[2025-11-12 21:04:25.094] [Info] [CommandRegistry] Registering command: test.testCommand
+[2025-11-12 21:04:25.100] [Info] [CommandRegistry] Command registered successfully: test.testCommand
+[2025-11-12 21:04:25.102] [Info] [CommandRegistry] Executing command: test.testCommand
+[2025-11-12 21:04:25.107] [Info] [CommandRegistry] Command executed successfully: test.testCommand
+[2025-11-12 21:04:25.155] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:25.966] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:25.981] [Info] [CommandRegistry] Registering command: test.updateState
+[2025-11-12 21:04:25.985] [Info] [CommandRegistry] Command registered successfully: test.updateState
+[2025-11-12 21:04:25.988] [Info] [CommandRegistry] Executing command: test.updateState
+[2025-11-12 21:04:26.000] [Info] [CommandRegistry] Command executed successfully: test.updateState
+[2025-11-12 21:04:26.084] [Info] [Logging] Game logging system initialized
+[2025-11-12 21:04:26.086] [Error] [TestModule] Caught test exception
+[2025-11-12 21:04:26.088] [Info] [CommandRegistry] Registering command: test.errorCommand
+[2025-11-12 21:04:26.096] [Info] [CommandRegistry] Command registered successfully: test.errorCommand
+[2025-11-12 21:04:26.098] [Info] [CommandRegistry] Executing command: test.errorCommand
+[2025-11-12 21:04:26.116] [Error] [CommandRegistry] Failed to execute command: test.errorCommand
+[2025-11-12 21:04:26.123] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:26.130] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:26.256] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:26.259] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:26.380] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:26.384] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:26.504] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:26.507] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:26.626] [Info] [CommandRegistry] Executing command: registry.listCommands
+[2025-11-12 21:04:26.631] [Info] [CommandRegistry] Command executed successfully: registry.listCommands
+[2025-11-12 21:04:26.749] [Info] [CommandRegistry] Executing command: registry.getStatistics
+[2025-11-12 21:04:26.753] [Info] [CommandRegistry] Command executed successfully: registry.getStatistics
+[2025-11-12 21:04:26.759] [Info] [CommandRegistry] Executing command: registry.getPerformanceMetrics
+[2025-11-12 21:04:26.766] [Error] [CommandRegistry] Failed to execute command: registry.getPerformanceMetrics
diff --git a/Minimal-CommandRegistry-Test.ps1 b/Minimal-CommandRegistry-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/CoreGame/CommunicationBridge.psm1 b/Modules/CoreGame/CommunicationBridge.psm1
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/CoreGame/CommunicationSystem.psm1 b/Modules/CoreGame/CommunicationSystem.psm1
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/CoreGame/DataModels-Clean.psm1 b/Modules/CoreGame/DataModels-Clean.psm1
new file mode 100644
index 0000000..e69de29
diff --git a/Modules/CoreGame/SimpleCommunicationSystem.psm1 b/Modules/CoreGame/SimpleCommunicationSystem.psm1
new file mode 100644
index 0000000..e69de29
diff --git a/Simple-CommandRegistry-Demo.ps1 b/Simple-CommandRegistry-Demo.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Simple-StateManager-Test.ps1 b/Simple-StateManager-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Test-CommunicationBridge.ps1 b/Test-CommunicationBridge.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Test-CommunicationSystem.ps1 b/Test-CommunicationSystem.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Test-StateManager.ps1 b/Test-StateManager.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/CommandRegistry-Demo.html b/Tests/CommandRegistry-Demo.html
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/CommandRegistry-Live-Demo.html b/Tests/CommandRegistry-Live-Demo.html
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/CommandRegistry-Working-Demo.html b/Tests/CommandRegistry-Working-Demo.html
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Demo-Server.ps1 b/Tests/Demo-Server.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Enhanced-Integration-Test.ps1 b/Tests/Enhanced-Integration-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Final-Integration-Test.ps1 b/Tests/Final-Integration-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Integration/CommandRegistry-Integration.Tests.ps1 b/Tests/Integration/CommandRegistry-Integration.Tests.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Quick-Integration-Test.ps1 b/Tests/Quick-Integration-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Simple-StateManager-Test.ps1 b/Tests/Simple-StateManager-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Start-Demo.ps1 b/Tests/Start-Demo.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/StateManager-Integration-Test.ps1 b/Tests/StateManager-Integration-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/Working-Integration-Test.ps1 b/Tests/Working-Integration-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/Working-CommandRegistry-Test.ps1 b/Working-CommandRegistry-Test.ps1
new file mode 100644
index 0000000..e69de29
diff --git a/command-registry-demo.html b/command-registry-demo.html
new file mode 100644
index 0000000..e69de29
diff --git a/communication-bridge-demo.html b/communication-bridge-demo.html
new file mode 100644
index 0000000..e69de29
diff --git a/event_log.json b/event_log.json
index 6342bfb..ba44faa 100644
--- a/event_log.json
+++ b/event_log.json
@@ -1,266 +1,266 @@
[
{
- "id": "ps_20250801_003739_aa415b26",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.registered",
- "timestamp": "2025-08-01T00:37:39.153",
"data": {
+ "Command": "test.updateState",
"Module": "test",
- "Description": "Test command for state updates",
- "Command": "test.updateState"
- }
+ "Description": "Test command for state updates"
+ },
+ "priority": "Normal",
+ "type": "command.registered",
+ "id": "ps_20251112_210425_fed835b3",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:25.983"
},
{
- "id": "ps_20250801_003739_676a80fd",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandRegistered",
- "timestamp": "2025-08-01T00:37:39.154",
"data": {
+ "RegistrationTime": "2025-11-12T21:04:25.9844755+00:00",
"CommandName": "test.updateState",
- "RegistrationTime": "2025-08-01T00:37:39.1543466+01:00",
"Category": null,
"Module": "test"
- }
+ },
+ "priority": "Normal",
+ "type": "system.commandRegistered",
+ "id": "ps_20251112_210425_a6814643",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:25.984"
},
{
- "id": "ps_20250801_003739_143b9112",
- "priority": "Normal",
- "source": "powershell",
- "type": "state.changed",
- "timestamp": "2025-08-01T00:37:39.158",
"data": {
- "timestamp": "2025-08-01T00:37:39.1583299+01:00",
+ "entityId": "test-entity-123",
"changeType": "update",
- "entityId": "test-entity-123"
- }
- },
- {
- "id": "ps_20250801_003739_d6c2c046",
+ "timestamp": "2025-11-12T21:04:25.9927858+00:00"
+ },
"priority": "Normal",
+ "type": "state.changed",
+ "id": "ps_20251112_210425_f87bf4a1",
"source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.164",
+ "timestamp": "2025-11-12T21:04:25.992"
+ },
+ {
"data": {
+ "ExecutionTime": 7.1641,
"Success": true,
- "ExecutionTime": 6.239,
- "ExecutionId": "19490904-d491-4aaf-8ba4-bf5fd9ee0798",
- "Command": "test.updateState"
- }
+ "Command": "test.updateState",
+ "ExecutionId": "fde66c2e-4be0-49bb-9ea9-aa58f3daa90d"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210425_6629aad7",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:25.997"
},
{
- "id": "ps_20250801_003739_122f2a1f",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.166",
"data": {
- "ExecutionTimeMs": 9.0065,
- "CommandName": "test.updateState",
+ "ExecutionTime": "2025-11-12T21:04:26.0018082+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.1662946+01:00",
- "ExecutionId": "d38cdd87"
- }
+ "CommandName": "test.updateState",
+ "ExecutionTimeMs": 12.4322,
+ "ExecutionId": "4749a959"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_2e3d742c",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.001"
},
{
- "id": "ps_20250801_003739_144d06d4",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.registered",
- "timestamp": "2025-08-01T00:37:39.242",
"data": {
+ "Command": "test.errorCommand",
"Module": "test",
- "Description": "Command that intentionally throws an error",
- "Command": "test.errorCommand"
- }
+ "Description": "Command that intentionally throws an error"
+ },
+ "priority": "Normal",
+ "type": "command.registered",
+ "id": "ps_20251112_210426_cc7acaa8",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.090"
},
{
- "id": "ps_20250801_003739_19bbbd1f",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandRegistered",
- "timestamp": "2025-08-01T00:37:39.243",
"data": {
+ "RegistrationTime": "2025-11-12T21:04:26.0933098+00:00",
"CommandName": "test.errorCommand",
- "RegistrationTime": "2025-08-01T00:37:39.2434871+01:00",
"Category": null,
"Module": "test"
- }
+ },
+ "priority": "Normal",
+ "type": "system.commandRegistered",
+ "id": "ps_20251112_210426_21cac303",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.093"
},
{
- "id": "ps_20250801_003739_88e42d90",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.error",
- "timestamp": "2025-08-01T00:37:39.247",
"data": {
- "ExecutionTime": 0.3703,
+ "ExecutionTime": 5.0664,
+ "Command": "test.errorCommand",
"Error": "Intentional test error",
- "ExecutionId": "084a19b6-c480-4141-8024-2ba88cd8393c",
- "Command": "test.errorCommand"
- }
+ "ExecutionId": "b65b9cf7-313f-4aea-93d2-33a20b47b081"
+ },
+ "priority": "Normal",
+ "type": "command.error",
+ "id": "ps_20251112_210426_11080f68",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.106"
},
{
- "id": "ps_20250801_003739_3ff56d86",
- "priority": "High",
- "source": "CommandRegistry",
- "type": "system.commandExecutionFailed",
- "timestamp": "2025-08-01T00:37:39.252",
"data": {
- "ExecutionTimeMs": 3.0574,
+ "ExecutionTime": "2025-11-12T21:04:26.1185103+00:00",
"CommandName": "test.errorCommand",
- "ExecutionTime": "2025-08-01T00:37:39.2524548+01:00",
"Error": "Intentional test error",
- "ExecutionId": "561eb816"
- }
+ "ExecutionTimeMs": 10.3137,
+ "ExecutionId": "d3009033"
+ },
+ "priority": "High",
+ "type": "system.commandExecutionFailed",
+ "id": "ps_20251112_210426_c1177a9a",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.118"
},
{
- "id": "ps_20250801_003739_286a925f",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.256",
"data": {
+ "ExecutionTime": 0.3518,
"Success": true,
- "ExecutionTime": 0.2019,
- "ExecutionId": "70792fbe-9d7c-443f-b0a2-37f91008cda7",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "ae9629b4-5121-4976-929a-bfda38dd1ab0"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_19a14a93",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.125"
},
{
- "id": "ps_20250801_003739_420fc72b",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.259",
"data": {
- "ExecutionTimeMs": 3.0934,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.1319551+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.259321+01:00",
- "ExecutionId": "fb7ad3d0"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 7.4111,
+ "ExecutionId": "cb86fe38"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_e6f8ade4",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.132"
},
{
- "id": "ps_20250801_003739_5d11dcd7",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.375",
"data": {
+ "ExecutionTime": 0.2854,
"Success": true,
- "ExecutionTime": 0.2444,
- "ExecutionId": "51be9fa5-02a2-4f9b-874c-7929af4883ff",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "b7d020b1-c46c-473e-843b-68c37ebb2ffd"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_a486ad7e",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.258"
},
{
- "id": "ps_20250801_003739_5f3f0176",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.377",
"data": {
- "ExecutionTimeMs": 2.9553,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.2608146+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.3772941+01:00",
- "ExecutionId": "489b9360"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.53,
+ "ExecutionId": "82076ae0"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_90eac360",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.260"
},
{
- "id": "ps_20250801_003739_312cd0d2",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.498",
"data": {
+ "ExecutionTime": 0.2586,
"Success": true,
- "ExecutionTime": 0.2055,
- "ExecutionId": "ba4362ae-f159-4dd9-bbad-0e3dec1e8404",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "99c59785-a042-4b46-bc80-3099b63bc212"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_8d4d2921",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.382"
},
{
- "id": "ps_20250801_003739_416d256d",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.502",
"data": {
- "ExecutionTimeMs": 4.4071,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.3863813+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.502326+01:00",
- "ExecutionId": "1463c9ed"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.8771,
+ "ExecutionId": "d0627246"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_0c317298",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.386"
},
{
- "id": "ps_20250801_003739_67810e6f",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.621",
"data": {
+ "ExecutionTime": 0.2244,
"Success": true,
- "ExecutionTime": 0.2191,
- "ExecutionId": "83cffc64-2a67-45fe-88d8-a4ac8c48b804",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "727b7016-d900-4bce-9537-620f0d3e73c6"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_2ef6d88a",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.506"
},
{
- "id": "ps_20250801_003739_cddd1fec",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.623",
"data": {
- "ExecutionTimeMs": 2.7398,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.508997+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.6232161+01:00",
- "ExecutionId": "fb23a660"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.4571,
+ "ExecutionId": "cff9712a"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_a2a5cfe2",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.509"
},
{
- "id": "ps_20250801_003739_25f19d01",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.728",
"data": {
+ "ExecutionTime": 0.219,
"Success": true,
- "ExecutionTime": 0.2079,
- "ExecutionId": "cc866787-b020-45c2-9f22-014b616723ed",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "62ffa132-4980-43b5-ba91-0184d7561763"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_68581e6e",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.629"
},
{
- "id": "ps_20250801_003739_ac2788e2",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.730",
"data": {
- "ExecutionTimeMs": 2.6571,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.6323813+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.7304159+01:00",
- "ExecutionId": "cb8a5108"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 5.1186,
+ "ExecutionId": "d0e62638"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_b174f19c",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.632"
},
{
- "id": "ps_20250801_003739_f5cd7892",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.836",
"data": {
+ "ExecutionTime": 0.1172,
"Success": true,
- "ExecutionTime": 0.1063,
- "ExecutionId": "eeca4bed-1612-4e9b-92fc-511f5392aeea",
- "Command": "registry.getStatistics"
- }
+ "Command": "registry.getStatistics",
+ "ExecutionId": "77906bdb-fd99-41d6-b737-05ca4650b587"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_5d6d9528",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.751"
}
]
diff --git a/events.json b/events.json
index 6896178..5478fbb 100644
--- a/events.json
+++ b/events.json
@@ -1,307 +1,307 @@
[
{
- "id": "ps_20250801_003739_aa415b26",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.registered",
- "timestamp": "2025-08-01T00:37:39.153",
"data": {
+ "Command": "test.updateState",
"Module": "test",
- "Description": "Test command for state updates",
- "Command": "test.updateState"
- }
+ "Description": "Test command for state updates"
+ },
+ "priority": "Normal",
+ "type": "command.registered",
+ "id": "ps_20251112_210425_fed835b3",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:25.983"
},
{
- "id": "ps_20250801_003739_676a80fd",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandRegistered",
- "timestamp": "2025-08-01T00:37:39.154",
"data": {
+ "RegistrationTime": "2025-11-12T21:04:25.9844755+00:00",
"CommandName": "test.updateState",
- "RegistrationTime": "2025-08-01T00:37:39.1543466+01:00",
"Category": null,
"Module": "test"
- }
+ },
+ "priority": "Normal",
+ "type": "system.commandRegistered",
+ "id": "ps_20251112_210425_a6814643",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:25.984"
},
{
- "id": "ps_20250801_003739_143b9112",
- "priority": "Normal",
- "source": "powershell",
- "type": "state.changed",
- "timestamp": "2025-08-01T00:37:39.158",
"data": {
- "timestamp": "2025-08-01T00:37:39.1583299+01:00",
+ "entityId": "test-entity-123",
"changeType": "update",
- "entityId": "test-entity-123"
- }
- },
- {
- "id": "ps_20250801_003739_d6c2c046",
+ "timestamp": "2025-11-12T21:04:25.9927858+00:00"
+ },
"priority": "Normal",
+ "type": "state.changed",
+ "id": "ps_20251112_210425_f87bf4a1",
"source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.164",
+ "timestamp": "2025-11-12T21:04:25.992"
+ },
+ {
"data": {
+ "ExecutionTime": 7.1641,
"Success": true,
- "ExecutionTime": 6.239,
- "ExecutionId": "19490904-d491-4aaf-8ba4-bf5fd9ee0798",
- "Command": "test.updateState"
- }
+ "Command": "test.updateState",
+ "ExecutionId": "fde66c2e-4be0-49bb-9ea9-aa58f3daa90d"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210425_6629aad7",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:25.997"
},
{
- "id": "ps_20250801_003739_122f2a1f",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.166",
"data": {
- "ExecutionTimeMs": 9.0065,
- "CommandName": "test.updateState",
+ "ExecutionTime": "2025-11-12T21:04:26.0018082+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.1662946+01:00",
- "ExecutionId": "d38cdd87"
- }
+ "CommandName": "test.updateState",
+ "ExecutionTimeMs": 12.4322,
+ "ExecutionId": "4749a959"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_2e3d742c",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.001"
},
{
- "id": "ps_20250801_003739_144d06d4",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.registered",
- "timestamp": "2025-08-01T00:37:39.242",
"data": {
+ "Command": "test.errorCommand",
"Module": "test",
- "Description": "Command that intentionally throws an error",
- "Command": "test.errorCommand"
- }
+ "Description": "Command that intentionally throws an error"
+ },
+ "priority": "Normal",
+ "type": "command.registered",
+ "id": "ps_20251112_210426_cc7acaa8",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.090"
},
{
- "id": "ps_20250801_003739_19bbbd1f",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandRegistered",
- "timestamp": "2025-08-01T00:37:39.243",
"data": {
+ "RegistrationTime": "2025-11-12T21:04:26.0933098+00:00",
"CommandName": "test.errorCommand",
- "RegistrationTime": "2025-08-01T00:37:39.2434871+01:00",
"Category": null,
"Module": "test"
- }
+ },
+ "priority": "Normal",
+ "type": "system.commandRegistered",
+ "id": "ps_20251112_210426_21cac303",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.093"
},
{
- "id": "ps_20250801_003739_88e42d90",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.error",
- "timestamp": "2025-08-01T00:37:39.247",
"data": {
- "ExecutionTime": 0.3703,
+ "ExecutionTime": 5.0664,
+ "Command": "test.errorCommand",
"Error": "Intentional test error",
- "ExecutionId": "084a19b6-c480-4141-8024-2ba88cd8393c",
- "Command": "test.errorCommand"
- }
+ "ExecutionId": "b65b9cf7-313f-4aea-93d2-33a20b47b081"
+ },
+ "priority": "Normal",
+ "type": "command.error",
+ "id": "ps_20251112_210426_11080f68",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.106"
},
{
- "id": "ps_20250801_003739_3ff56d86",
- "priority": "High",
- "source": "CommandRegistry",
- "type": "system.commandExecutionFailed",
- "timestamp": "2025-08-01T00:37:39.252",
"data": {
- "ExecutionTimeMs": 3.0574,
+ "ExecutionTime": "2025-11-12T21:04:26.1185103+00:00",
"CommandName": "test.errorCommand",
- "ExecutionTime": "2025-08-01T00:37:39.2524548+01:00",
"Error": "Intentional test error",
- "ExecutionId": "561eb816"
- }
+ "ExecutionTimeMs": 10.3137,
+ "ExecutionId": "d3009033"
+ },
+ "priority": "High",
+ "type": "system.commandExecutionFailed",
+ "id": "ps_20251112_210426_c1177a9a",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.118"
},
{
- "id": "ps_20250801_003739_286a925f",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.256",
"data": {
+ "ExecutionTime": 0.3518,
"Success": true,
- "ExecutionTime": 0.2019,
- "ExecutionId": "70792fbe-9d7c-443f-b0a2-37f91008cda7",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "ae9629b4-5121-4976-929a-bfda38dd1ab0"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_19a14a93",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.125"
},
{
- "id": "ps_20250801_003739_420fc72b",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.259",
"data": {
- "ExecutionTimeMs": 3.0934,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.1319551+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.259321+01:00",
- "ExecutionId": "fb7ad3d0"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 7.4111,
+ "ExecutionId": "cb86fe38"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_e6f8ade4",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.132"
},
{
- "id": "ps_20250801_003739_5d11dcd7",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.375",
"data": {
+ "ExecutionTime": 0.2854,
"Success": true,
- "ExecutionTime": 0.2444,
- "ExecutionId": "51be9fa5-02a2-4f9b-874c-7929af4883ff",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "b7d020b1-c46c-473e-843b-68c37ebb2ffd"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_a486ad7e",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.258"
},
{
- "id": "ps_20250801_003739_5f3f0176",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.377",
"data": {
- "ExecutionTimeMs": 2.9553,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.2608146+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.3772941+01:00",
- "ExecutionId": "489b9360"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.53,
+ "ExecutionId": "82076ae0"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_90eac360",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.260"
},
{
- "id": "ps_20250801_003739_312cd0d2",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.498",
"data": {
+ "ExecutionTime": 0.2586,
"Success": true,
- "ExecutionTime": 0.2055,
- "ExecutionId": "ba4362ae-f159-4dd9-bbad-0e3dec1e8404",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "99c59785-a042-4b46-bc80-3099b63bc212"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_8d4d2921",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.382"
},
{
- "id": "ps_20250801_003739_416d256d",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.502",
"data": {
- "ExecutionTimeMs": 4.4071,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.3863813+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.502326+01:00",
- "ExecutionId": "1463c9ed"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.8771,
+ "ExecutionId": "d0627246"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_0c317298",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.386"
},
{
- "id": "ps_20250801_003739_67810e6f",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.621",
"data": {
+ "ExecutionTime": 0.2244,
"Success": true,
- "ExecutionTime": 0.2191,
- "ExecutionId": "83cffc64-2a67-45fe-88d8-a4ac8c48b804",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "727b7016-d900-4bce-9537-620f0d3e73c6"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_2ef6d88a",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.506"
},
{
- "id": "ps_20250801_003739_cddd1fec",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.623",
"data": {
- "ExecutionTimeMs": 2.7398,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.508997+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.6232161+01:00",
- "ExecutionId": "fb23a660"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 3.4571,
+ "ExecutionId": "cff9712a"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_a2a5cfe2",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.509"
},
{
- "id": "ps_20250801_003739_25f19d01",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.728",
"data": {
+ "ExecutionTime": 0.219,
"Success": true,
- "ExecutionTime": 0.2079,
- "ExecutionId": "cc866787-b020-45c2-9f22-014b616723ed",
- "Command": "registry.listCommands"
- }
+ "Command": "registry.listCommands",
+ "ExecutionId": "62ffa132-4980-43b5-ba91-0184d7561763"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_68581e6e",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.629"
},
{
- "id": "ps_20250801_003739_ac2788e2",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.730",
"data": {
- "ExecutionTimeMs": 2.6571,
- "CommandName": "registry.listCommands",
+ "ExecutionTime": "2025-11-12T21:04:26.6323813+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.7304159+01:00",
- "ExecutionId": "cb8a5108"
- }
+ "CommandName": "registry.listCommands",
+ "ExecutionTimeMs": 5.1186,
+ "ExecutionId": "d0e62638"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_b174f19c",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.632"
},
{
- "id": "ps_20250801_003739_f5cd7892",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.executed",
- "timestamp": "2025-08-01T00:37:39.836",
"data": {
+ "ExecutionTime": 0.1172,
"Success": true,
- "ExecutionTime": 0.1063,
- "ExecutionId": "eeca4bed-1612-4e9b-92fc-511f5392aeea",
- "Command": "registry.getStatistics"
- }
+ "Command": "registry.getStatistics",
+ "ExecutionId": "77906bdb-fd99-41d6-b737-05ca4650b587"
+ },
+ "priority": "Normal",
+ "type": "command.executed",
+ "id": "ps_20251112_210426_5d6d9528",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.751"
},
{
- "id": "ps_20250801_003739_e1a1f2d7",
- "priority": "Normal",
- "source": "CommandRegistry",
- "type": "system.commandExecuted",
- "timestamp": "2025-08-01T00:37:39.840",
"data": {
- "ExecutionTimeMs": 4.769,
- "CommandName": "registry.getStatistics",
+ "ExecutionTime": "2025-11-12T21:04:26.7545737+00:00",
"Success": true,
- "ExecutionTime": "2025-08-01T00:37:39.8402804+01:00",
- "ExecutionId": "976a842a"
- }
+ "CommandName": "registry.getStatistics",
+ "ExecutionTimeMs": 3.9372,
+ "ExecutionId": "c604adbf"
+ },
+ "priority": "Normal",
+ "type": "system.commandExecuted",
+ "id": "ps_20251112_210426_b3089e69",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.754"
},
{
- "id": "ps_20250801_003739_787fe6eb",
- "priority": "Normal",
- "source": "powershell",
- "type": "command.error",
- "timestamp": "2025-08-01T00:37:39.844",
"data": {
- "ExecutionTime": 0.7192,
+ "ExecutionTime": 2.5601,
+ "Command": "registry.getPerformanceMetrics",
"Error": "Method invocation failed because [CommandRegistry] does not contain a method named 'GetPerformanceMetrics'.",
- "ExecutionId": "81558295-35df-48a7-b8fc-a3951672c966",
- "Command": "registry.getPerformanceMetrics"
- }
+ "ExecutionId": "3e643115-220b-48b0-b9dc-bdd88cf3a832"
+ },
+ "priority": "Normal",
+ "type": "command.error",
+ "id": "ps_20251112_210426_b3ac2b23",
+ "source": "powershell",
+ "timestamp": "2025-11-12T21:04:26.763"
},
{
- "id": "ps_20250801_003739_c74cc809",
- "priority": "High",
- "source": "CommandRegistry",
- "type": "system.commandExecutionFailed",
- "timestamp": "2025-08-01T00:37:39.847",
"data": {
- "ExecutionTimeMs": 3.5532,
+ "ExecutionTime": "2025-11-12T21:04:26.7673404+00:00",
"CommandName": "registry.getPerformanceMetrics",
- "ExecutionTime": "2025-08-01T00:37:39.8469989+01:00",
"Error": "Method invocation failed because [CommandRegistry] does not contain a method named 'GetPerformanceMetrics'.",
- "ExecutionId": "cc0d380b"
- }
+ "ExecutionTimeMs": 6.8813,
+ "ExecutionId": "c4cbe0b9"
+ },
+ "priority": "High",
+ "type": "system.commandExecutionFailed",
+ "id": "ps_20251112_210426_3df992d6",
+ "source": "CommandRegistry",
+ "timestamp": "2025-11-12T21:04:26.767"
}
]
diff --git a/gamedata.json b/gamedata.json
index 675f44a..062a91f 100644
--- a/gamedata.json
+++ b/gamedata.json
@@ -1,210 +1,272 @@
{
+ "generatedAt": "2025-11-12T21:18:47",
+ "metadata": {
+ "generator": "PowerShell Game Data Generator",
+ "scriptVersion": "1.0",
+ "totalLocations": 20
+ },
+ "version": "1.0",
"locations": [
{
"discovered": false,
- "items": "map_upgrade",
- "type": "shop",
- "lng": -73.841411,
- "experience": 24.0,
- "lat": 40.673765,
+ "name": "Market Square #1",
"description": "Useful items and supplies available.",
- "timestamp": "2025-07-27T22:06:28",
+ "type": "shop",
"id": "location_1",
- "name": "Merchant's Post #1",
- "points": 47
+ "lng": 0.086879,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.595174,
+ "points": 38,
+ "items": "tool",
+ "experience": 19.0
},
{
"discovered": false,
- "items": "mysterious_clue",
- "type": "mystery",
- "lng": -74.139136,
- "experience": 54.0,
- "lat": 40.759112,
- "description": "Something strange happens here...",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Famous Building #2",
+ "description": "A famous site worth visiting.",
+ "type": "landmark",
"id": "location_2",
- "name": "Unexplained Site #2",
- "points": 108
+ "lng": 0.212042,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.559297,
+ "points": 70,
+ "items": "historical_fact",
+ "experience": 35.0
},
{
"discovered": false,
- "items": "mysterious_clue",
- "type": "mystery",
- "lng": -73.711616,
- "experience": 49.0,
- "lat": 40.855756,
- "description": "An unexplained phenomenon occurs.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Cultural Site #3",
+ "description": "A famous site worth visiting.",
+ "type": "landmark",
"id": "location_3",
- "name": "Enigmatic Location #3",
- "points": 98
+ "lng": -0.099876,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.566291,
+ "points": 58,
+ "items": "historical_fact",
+ "experience": 29.0
},
{
"discovered": false,
- "items": "health_potion",
- "type": "shop",
- "lng": -73.902721,
- "experience": 16.0,
- "lat": 40.610387,
- "description": "A place to trade and resupply.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Hidden Cache #4",
+ "description": "A hidden treasure awaits discovery!",
+ "type": "treasure",
"id": "location_4",
- "name": "Merchant's Post #4",
- "points": 32
+ "lng": -0.004711,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.484769,
+ "points": 64,
+ "items": "golden_coin",
+ "experience": 32.0
},
{
"discovered": false,
- "items": "precious_gem",
- "type": "treasure",
- "lng": -73.781775,
- "experience": 59.0,
- "lat": 40.888888,
- "description": "Ancient wealth sleeps in this location.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Strange Phenomenon #5",
+ "description": "Mysteries abound in this location.",
+ "type": "mystery",
"id": "location_5",
- "name": "Forgotten Vault #5",
- "points": 118
+ "lng": 0.077907,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.604289,
+ "points": 86,
+ "items": "riddle_piece",
+ "experience": 43.0
},
{
"discovered": false,
- "items": "mysterious_clue",
- "type": "mystery",
- "lng": -74.244926,
- "experience": 44.0,
- "lat": 40.560898,
- "description": "Mysteries abound in this location.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Mystical Portal #6",
+ "description": "Brave adventurers are needed here.",
+ "type": "quest",
"id": "location_6",
- "name": "Enigmatic Location #6",
- "points": 87
+ "lng": 0.24994,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.458756,
+ "points": 145,
+ "items": "quest_item",
+ "experience": 72.0
},
{
"discovered": false,
- "items": "tourist_info",
- "type": "landmark",
- "lng": -73.802999,
- "experience": 30.0,
- "lat": 40.68742,
- "description": "A famous site worth visiting.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Guardian's Keep #7",
+ "description": "Brave adventurers are needed here.",
+ "type": "quest",
"id": "location_7",
- "name": "Notable Plaza #7",
- "points": 59
+ "lng": -0.003394,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.551649,
+ "points": 187,
+ "items": "magic_scroll",
+ "experience": 94.0
},
{
"discovered": false,
- "items": "riddle_piece",
- "type": "mystery",
- "lng": -74.250157,
- "experience": 60.0,
- "lat": 40.712341,
- "description": "Something strange happens here...",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Famous Building #8",
+ "description": "An important cultural location.",
+ "type": "landmark",
"id": "location_8",
- "name": "Strange Phenomenon #8",
- "points": 121
+ "lng": -0.195551,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.289656,
+ "points": 70,
+ "items": "historical_fact",
+ "experience": 35.0
},
{
"discovered": false,
- "items": "tool",
- "type": "shop",
- "lng": -74.02957,
- "experience": 19.0,
- "lat": 40.650474,
- "description": "A place to trade and resupply.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Mystical Portal #9",
+ "description": "Brave adventurers are needed here.",
+ "type": "quest",
"id": "location_9",
- "name": "Merchant's Post #9",
- "points": 38
+ "lng": 0.183301,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.295324,
+ "points": 119,
+ "items": "quest_item",
+ "experience": 60.0
},
{
"discovered": false,
- "items": "special_key",
- "type": "quest",
- "lng": -74.114418,
- "experience": 56.0,
- "lat": 40.801907,
- "description": "A challenging quest begins here.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Hidden Cache #10",
+ "description": "Riches beyond imagination lie here.",
+ "type": "treasure",
"id": "location_10",
- "name": "Sacred Grove #10",
- "points": 113
+ "lng": -0.200828,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.444887,
+ "points": 50,
+ "items": "golden_coin",
+ "experience": 25.0
},
{
"discovered": false,
- "items": "mysterious_clue",
- "type": "mystery",
- "lng": -73.923634,
- "experience": 39.0,
- "lat": 40.55639,
- "description": "Mysteries abound in this location.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Cultural Site #11",
+ "description": "A place of historical significance.",
+ "type": "landmark",
"id": "location_11",
- "name": "Enigmatic Location #11",
- "points": 78
+ "lng": -0.287791,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.646205,
+ "points": 33,
+ "items": "tourist_info",
+ "experience": 16.0
},
{
"discovered": false,
- "items": "riddle_piece",
+ "name": "Unexplained Site #12",
+ "description": "An unexplained phenomenon occurs.",
"type": "mystery",
- "lng": -74.002267,
- "experience": 57.0,
- "lat": 40.779111,
- "description": "Mysteries abound in this location.",
- "timestamp": "2025-07-27T22:06:28",
"id": "location_12",
- "name": "Curious Spot #12",
- "points": 114
+ "lng": -0.268404,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.47805,
+ "points": 86,
+ "items": "riddle_piece",
+ "experience": 43.0
},
{
"discovered": false,
- "items": [
- "golden_coin",
- "ancient_artifact"
- ],
- "type": "treasure",
- "lng": -73.994437,
- "experience": 34.0,
- "lat": 40.566051,
- "description": "Ancient wealth sleeps in this location.",
- "timestamp": "2025-07-27T22:06:28",
+ "name": "Curious Spot #13",
+ "description": "Something strange happens here...",
+ "type": "mystery",
"id": "location_13",
- "name": "Hidden Cache #13",
- "points": 68
+ "lng": 0.192393,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.350444,
+ "points": 96,
+ "items": "mysterious_clue",
+ "experience": 48.0
},
{
"discovered": false,
- "items": "riddle_piece",
+ "name": "Unexplained Site #14",
+ "description": "Something strange happens here...",
"type": "mystery",
- "lng": -73.976366,
- "experience": 47.0,
- "lat": 40.521679,
- "description": "Mysteries abound in this location.",
- "timestamp": "2025-07-27T22:06:28",
"id": "location_14",
- "name": "Enigmatic Location #14",
- "points": 94
+ "lng": -0.451025,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.592733,
+ "points": 84,
+ "items": "mysterious_clue",
+ "experience": 42.0
},
{
"discovered": false,
- "items": "riddle_piece",
+ "name": "Curious Spot #15",
+ "description": "An unexplained phenomenon occurs.",
"type": "mystery",
- "lng": -73.850524,
- "experience": 58.0,
- "lat": 40.844733,
- "description": "Mysteries abound in this location.",
- "timestamp": "2025-07-27T22:06:28",
"id": "location_15",
- "name": "Enigmatic Location #15",
- "points": 117
+ "lng": -0.033635,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.687592,
+ "points": 90,
+ "items": "riddle_piece",
+ "experience": 45.0
+ },
+ {
+ "discovered": false,
+ "name": "Buried Treasure #16",
+ "description": "A hidden treasure awaits discovery!",
+ "type": "treasure",
+ "id": "location_16",
+ "lng": -0.330912,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.625231,
+ "points": 108,
+ "items": "golden_coin",
+ "experience": 54.0
+ },
+ {
+ "discovered": false,
+ "name": "Notable Plaza #17",
+ "description": "A place of historical significance.",
+ "type": "landmark",
+ "id": "location_17",
+ "lng": -0.171752,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.474754,
+ "points": 41,
+ "items": "historical_fact",
+ "experience": 20.0
+ },
+ {
+ "discovered": false,
+ "name": "Ancient Temple #18",
+ "description": "Brave adventurers are needed here.",
+ "type": "quest",
+ "id": "location_18",
+ "lng": -0.274617,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.497812,
+ "points": 137,
+ "items": "quest_item",
+ "experience": 68.0
+ },
+ {
+ "discovered": false,
+ "name": "Forgotten Vault #19",
+ "description": "A hidden treasure awaits discovery!",
+ "type": "treasure",
+ "id": "location_19",
+ "lng": 0.149555,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.347635,
+ "points": 131,
+ "items": "precious_gem",
+ "experience": 66.0
+ },
+ {
+ "discovered": false,
+ "name": "Guardian's Keep #20",
+ "description": "A challenging quest begins here.",
+ "type": "quest",
+ "id": "location_20",
+ "lng": -0.114968,
+ "timestamp": "2025-11-12T21:18:47",
+ "lat": 51.341212,
+ "points": 158,
+ "items": "quest_item",
+ "experience": 79.0
}
],
- "version": "1.0",
- "metadata": {
- "scriptVersion": "1.0",
- "generator": "PowerShell Game Data Generator",
- "totalLocations": 15
- },
- "city": "New York",
- "generatedAt": "2025-07-27T22:06:28"
+ "city": "London"
}
diff --git a/js/app.js b/js/app.js
index 7bee91d..78b08a9 100644
--- a/js/app.js
+++ b/js/app.js
@@ -37,6 +37,41 @@ class PwshLeafmapGame {
});
console.log('PowerShell Leafmap Game initialized with Event System!');
+
+ // Auto-load gamedata.json if it exists
+ this.autoLoadGameData();
+ }
+
+ async autoLoadGameData() {
+ try {
+ console.log('Attempting to load gamedata.json...');
+ const response = await fetch('gamedata.json');
+ if (response.ok) {
+ const data = await response.json();
+ console.log('Game data received:', data);
+ if (data && data.locations && data.locations.length > 0) {
+ this.gameData = data;
+ console.log(`Loading ${data.locations.length} locations onto map...`);
+ this.gameMap.loadLocations(data.locations);
+ this.updateGameInfo(`š® Game ready! ${data.locations.length} locations in ${data.city}. Click markers to explore!`);
+ console.log('ā Game data loaded successfully');
+
+ this.eventManager.emit('system.dataLoaded', {
+ locations: data.locations,
+ source: 'file'
+ });
+ } else {
+ console.warn('Game data loaded but no locations found');
+ this.updateGameInfo('No locations found in game data');
+ }
+ } else {
+ console.log('No gamedata.json found (HTTP', response.status, ')');
+ this.updateGameInfo('Click "Load Game Data" to start your adventure!');
+ }
+ } catch (error) {
+ console.error('Error auto-loading game data:', error);
+ this.updateGameInfo('Click "Load Game Data" to start!');
+ }
}
async loadGameData() {
@@ -124,30 +159,37 @@ class PwshLeafmapGame {
}
visitLocation(location) {
- console.log(`Visiting location: ${location.name}`);
-
- // Emit location visit event
- this.eventManager.emit('location.visited', {
- location: location,
- playerId: 'player1', // This would be dynamic in a real game
- timestamp: new Date().toISOString()
- });
+ try {
+ console.log(`Visiting location: ${location.name}`);
- // Add items to inventory
- if (location.items) {
- const items = Array.isArray(location.items) ? location.items : [location.items];
- items.forEach(item => {
- this.addToInventory(item);
+ // Emit location visit event
+ this.eventManager.emit('location.visited', {
+ location: location,
+ playerId: 'player1', // This would be dynamic in a real game
+ timestamp: new Date().toISOString()
});
- }
- // Add points
- if (location.points) {
- this.addScore(location.points);
- }
+ // Add items to inventory
+ if (location.items) {
+ const items = Array.isArray(location.items) ? location.items : [location.items];
+ items.forEach(item => {
+ this.addToInventory(item);
+ });
+ }
- // Update game info
- this.updateGameInfo(`Visited: ${location.name}. ${location.description}`);
+ // Add points
+ if (location.points) {
+ this.addScore(location.points);
+ }
+
+ // Update game info
+ this.updateGameInfo(`Visited: ${location.name}. ${location.description}`);
+
+ console.log('ā Location visit completed successfully');
+ } catch (error) {
+ console.error('Error visiting location:', error);
+ this.updateGameInfo(`Error: ${error.message}`);
+ }
}
addToInventory(item) {
diff --git a/js/communicationBridge.js b/js/communicationBridge.js
new file mode 100644
index 0000000..e69de29
diff --git a/js/events.js b/js/events.js
index 8737fee..e2e3029 100644
--- a/js/events.js
+++ b/js/events.js
@@ -135,11 +135,14 @@ class EventManager {
}
} catch (error) {
console.error(`Error processing event ${event.type}:`, error);
- this.emit('system.error', {
- message: error.message,
- eventType: event.type,
- handlerId: handlerInfo.id
- });
+ // Prevent infinite loop by not emitting system.error for system.error events
+ if (event.type !== 'system.error') {
+ this.emit('system.error', {
+ message: error.message,
+ eventType: event.type,
+ handlerId: handlerInfo.id
+ });
+ }
}
}
}
@@ -198,9 +201,14 @@ class EventManager {
* Start polling for PowerShell events
*/
startPowerShellPolling() {
+ // Disable polling for now - it can cause browser hangs
+ // Uncomment to enable PowerShell bridge functionality
+ /*
setInterval(() => {
this.checkPowerShellEvents();
}, this.pollInterval);
+ */
+ console.log('PowerShell polling disabled (use Load Game Data button for PowerShell integration)');
}
/**
diff --git a/js/map.js b/js/map.js
index 351b69c..945a3b1 100644
--- a/js/map.js
+++ b/js/map.js
@@ -45,14 +45,26 @@ class GameMap {
const marker = L.marker([location.lat, location.lng], { icon })
.addTo(this.map);
- // Create popup content
- const popupContent = this.createPopupContent(location);
+ // Store location data on marker for later access
+ marker.locationData = location;
+
+ // Create popup content with unique ID
+ const markerId = this.markers.length;
+ const popupContent = this.createPopupContent(location, markerId);
marker.bindPopup(popupContent);
- // Add click event
+ // Add click event to marker to set up button handler after popup opens
marker.on('click', () => {
- this.game.visitLocation(location);
- this.updateMarkerAfterVisit(marker, location);
+ // Set up button click handler after popup opens
+ setTimeout(() => {
+ const button = document.getElementById(`visit-btn-${markerId}`);
+ if (button) {
+ button.onclick = () => {
+ this.game.visitLocation(marker.locationData);
+ this.updateMarkerAfterVisit(marker, marker.locationData);
+ };
+ }
+ }, 100);
});
// Store reference
@@ -104,15 +116,19 @@ class GameMap {
});
}
- createPopupContent(location) {
+ createPopupContent(location, markerId) {
+ // Handle items as string or array
let itemsList = '';
- if (location.items && location.items.length > 0) {
- itemsList = `
-
Items:
-
- ${location.items.map(item => `- ${item.replace('_', ' ')}
`).join('')}
-
- `;
+ if (location.items) {
+ const items = Array.isArray(location.items) ? location.items : [location.items];
+ if (items.length > 0) {
+ itemsList = `
+ Items:
+
+ ${items.map(item => `- ${String(item).replace(/_/g, ' ')}
`).join('')}
+
+ `;
+ }
}
let pointsInfo = '';
@@ -126,7 +142,7 @@ class GameMap {
${location.description}
${pointsInfo}
${itemsList}
-