fix: add debug logging for dungeon_map sends, guard COM exceptions
- Log dungeon_map payload size and send success/failure - Guard early COM calls (CharacterFilter, Actions.Heading) with try/catch to prevent RPC_E_SERVERFAULT during state transitions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8402d7aa5b
commit
08f2d57e08
2 changed files with 27 additions and 5 deletions
|
|
@ -104,8 +104,21 @@ namespace MosswartMassacre
|
|||
var dungeonMap = _dungeonMapReader.ReadDungeonMap(landcell, characterName);
|
||||
if (dungeonMap != null)
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(dungeonMap);
|
||||
await WebSocket.SendDungeonMapAsync(json);
|
||||
try
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(dungeonMap);
|
||||
_logger?.Log($"[Radar] Sending dungeon_map ({json.Length} bytes) for 0x{landblock:X8}");
|
||||
await WebSocket.SendDungeonMapAsync(json);
|
||||
_logger?.Log($"[Radar] dungeon_map sent successfully");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger?.Log($"[Radar] dungeon_map send failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger?.Log($"[Radar] ReadDungeonMap returned null for 0x{landblock:X8} (already cached or not a dungeon)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -114,11 +127,20 @@ namespace MosswartMassacre
|
|||
{
|
||||
try
|
||||
{
|
||||
// Guard against COM exceptions during state transitions
|
||||
string characterName;
|
||||
int playerId;
|
||||
double playerHeading;
|
||||
try
|
||||
{
|
||||
characterName = CoreManager.Current.CharacterFilter.Name;
|
||||
playerId = CoreManager.Current.CharacterFilter.Id;
|
||||
playerHeading = CoreManager.Current.Actions.Heading;
|
||||
}
|
||||
catch { return null; }
|
||||
|
||||
var playerCoords = Coordinates.Me;
|
||||
var playerRawPos = Utils.GetPlayerPosition();
|
||||
double playerHeading = CoreManager.Current.Actions.Heading;
|
||||
string characterName = CoreManager.Current.CharacterFilter.Name;
|
||||
int playerId = CoreManager.Current.CharacterFilter.Id;
|
||||
uint landcell = Utils.GetPlayerLandcell();
|
||||
uint landblock = landcell & 0xFFFF0000;
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue