You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
feat(communication): housekeeping find-user-by-id composer
OutgoingHeader.HOUSEKEEPING_FIND_USER_BY_ID = 9101 with a one-int payload. The response side reuses HousekeepingUserDetailEvent (no new parser) — find-by-id and find-by-name converge on the same shape because the server has nothing different to say about a user found via numeric id vs. via username lookup. vitest 138/138, `yarn compile:fast` clean.
This commit is contained in:
@@ -7,7 +7,7 @@ import { ConfInvisStateMessageEvent } from './messages';
|
||||
import { HanditemBlockStateMessageEvent } from './messages';
|
||||
import { TranslationLanguagesEvent, TranslationLanguagesRequestComposer, TranslationResultEvent, TranslationTextRequestComposer } from './messages';
|
||||
import { YouTubeRoomBroadcastEvent, YouTubeRoomPlayComposer, YouTubeRoomSettingsComposer, YouTubeRoomSettingsEvent, YouTubeRoomWatchersEvent, YouTubeRoomWatchingComposer } from './messages';
|
||||
import { HousekeepingFindUserByNameComposer, HousekeepingUserDetailEvent } from './messages';
|
||||
import { HousekeepingFindUserByIdComposer, HousekeepingFindUserByNameComposer, HousekeepingUserDetailEvent } from './messages';
|
||||
export class NitroMessages implements IMessageConfiguration
|
||||
{
|
||||
private _events: Map<number, Function>;
|
||||
@@ -1262,6 +1262,7 @@ export class NitroMessages implements IMessageConfiguration
|
||||
|
||||
// Housekeeping (in-client admin panel)
|
||||
this._composers.set(OutgoingHeader.HOUSEKEEPING_FIND_USER_BY_NAME, HousekeepingFindUserByNameComposer);
|
||||
this._composers.set(OutgoingHeader.HOUSEKEEPING_FIND_USER_BY_ID, HousekeepingFindUserByIdComposer);
|
||||
}
|
||||
|
||||
public get events(): Map<number, Function>
|
||||
|
||||
@@ -525,4 +525,5 @@ export class OutgoingHeader
|
||||
|
||||
// Housekeeping (in-client admin panel) — IDs 9100..9199 reserved
|
||||
public static HOUSEKEEPING_FIND_USER_BY_NAME = 9100;
|
||||
public static HOUSEKEEPING_FIND_USER_BY_ID = 9101;
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class HousekeepingFindUserByIdComposer implements IMessageComposer<ConstructorParameters<typeof HousekeepingFindUserByIdComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof HousekeepingFindUserByIdComposer>;
|
||||
|
||||
constructor(userId: number)
|
||||
{
|
||||
this._data = [userId];
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
export * from './HousekeepingFindUserByIdComposer';
|
||||
export * from './HousekeepingFindUserByNameComposer';
|
||||
|
||||
Reference in New Issue
Block a user