Move method checker to template file

This commit is contained in:
2026-03-21 13:44:13 +01:00
parent a57deec0fa
commit 7803054de9
2 changed files with 9 additions and 10 deletions
+1 -9
View File
@@ -1,5 +1,4 @@
import { NgZone } from '@angular/core';
import { getMethods } from 'ag-sockets/dist/browser';
import {
MapInfo, WorldState, PartyMember, PartyFlags, Action, NotificationFlags, Pony, LeaveReason,
SayData, MapState, defaultMapState, Apply, InfoFlags, PonyData, FriendStatusData, WorldMap
@@ -186,7 +185,7 @@ export class ClientActions extends ClientActionsTemplate {
DEVELOPMENT && !TESTS && console.error(`actionParam: Invalid action: ${action}`);
}
}
// @Method({ binary: [Bin.U8] })
// @Method({ binary: [Bin.U8] }>)
left(reason: LeaveReason) {
this.game.player = undefined;
this.game.map = createWorldMap();
@@ -292,10 +291,3 @@ export class ClientActions extends ClientActionsTemplate {
}
}
}
/* istanbul ignore next */
if (DEVELOPMENT) {
getMethods(ClientActions)
.filter(m => !m.options.binary)
.forEach(m => console.error(`Missing binary encoding for ClientActions.${m.name}()`));
}
+8 -1
View File
@@ -1,4 +1,4 @@
import { Method, SocketClient, Bin } from 'ag-sockets/dist/browser';
import { Method, SocketClient, Bin, getMethods } from 'ag-sockets/dist/browser';
import {
MapInfo, WorldState, PartyFlags, Action, NotificationFlags, LeaveReason,
SayData, MapState, PonyData, FriendStatusData} from './interfaces';
@@ -51,3 +51,10 @@ export class ClientActionsTemplate implements SocketClient {
@Method({ binary: [Bin.Obj] })
testPositions(_data: { frame: number; x: number | undefined; y: number | undefined; moved: boolean; }[]) {}
}
/* istanbul ignore next */
if (DEVELOPMENT) {
getMethods(ClientActionsTemplate)
.filter(m => !m.options.binary)
.forEach(m => console.error(`Missing binary encoding for ClientActions.${m.name}()`));
}