finished moderation packets

This commit is contained in:
dank074 2021-10-20 19:25:57 -05:00
parent 909febebce
commit 51d91121af
12 changed files with 129 additions and 38 deletions

View File

@ -90,7 +90,7 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke
import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult';
import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent';
import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent';
import { CfhChatlogEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModtoolRoomChatlogEvent, ModtoolUserChatlogEvent, ModtoolUserInfoEvent, RoomVisitsEvent, UserBannedMessageEvent } from './messages/incoming/moderation'; import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation';
import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent';
import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent';
import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent';
@ -659,12 +659,16 @@ export class NitroMessages implements IMessageConfiguration
this._events.set(IncomingHeader.USER_BANNED, UserBannedMessageEvent); this._events.set(IncomingHeader.USER_BANNED, UserBannedMessageEvent);
this._events.set(IncomingHeader.MODERATION_CAUTION, ModeratorCautionEvent); this._events.set(IncomingHeader.MODERATION_CAUTION, ModeratorCautionEvent);
this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModeratorRoomInfoEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModeratorRoomInfoEvent);
this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, ModtoolUserChatlogEvent); this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, UserChatlogEvent);
this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, RoomChatlogEvent);
this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); this._events.set(IncomingHeader.MODERATION_USER_INFO, ModeratorUserInfoEvent);
this._events.set(IncomingHeader.MODERATION_TOOL, ModeratorInitMessageEvent); this._events.set(IncomingHeader.MODERATION_TOOL, ModeratorInitMessageEvent);
this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, RoomVisitsEvent); this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, RoomVisitsEvent);
this._events.set(IncomingHeader.CFH_CHATLOG, CfhChatlogEvent); this._events.set(IncomingHeader.CFH_CHATLOG, CfhChatlogEvent);
this._events.set(IncomingHeader.ISSUE_DELETED, IssueDeletedMessageEvent);
this._events.set(IncomingHeader.ISSUE_INFO, IssueInfoMessageEvent);
this._events.set(IncomingHeader.ISSUE_PICK_FAILED, IssuePickFailedMessageEvent);
this._events.set(IncomingHeader.MODERATOR_ACTION_RESULT, ModeratorActionResultMessageEvent);
// MYSTERY BOX // MYSTERY BOX
this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent);

View File

@ -215,6 +215,11 @@ export class IncomingHeader
public static MODTOOL_ROOM_INFO = 1333; public static MODTOOL_ROOM_INFO = 1333;
public static MODTOOL_USER_CHATLOG = 3377; public static MODTOOL_USER_CHATLOG = 3377;
public static MODTOOL_ROOM_CHATLOG = 3434; public static MODTOOL_ROOM_CHATLOG = 3434;
public static MODTOOL_VISITED_ROOMS_USER = 1752;
public static MODERATOR_ACTION_RESULT = 2335;
public static ISSUE_DELETED = 3192;
public static ISSUE_INFO = 3609;
public static ISSUE_PICK_FAILED = 3150;
public static CFH_CHATLOG = 607; public static CFH_CHATLOG = 607;
public static LOVELOCK_FURNI_START = 3753; public static LOVELOCK_FURNI_START = 3753;
public static LOVELOCK_FURNI_FRIEND_COMFIRMED = 382; public static LOVELOCK_FURNI_FRIEND_COMFIRMED = 382;
@ -230,7 +235,6 @@ export class IncomingHeader
public static CLUB_GIFT_INFO = 619; public static CLUB_GIFT_INFO = 619;
public static REDEEM_VOUCHER_ERROR = 714; public static REDEEM_VOUCHER_ERROR = 714;
public static REDEEM_VOUCHER_OK = 3336; public static REDEEM_VOUCHER_OK = 3336;
public static MODTOOL_VISITED_ROOMS_USER = 1752;
public static IN_CLIENT_LINK = 2023; public static IN_CLIENT_LINK = 2023;
public static BOT_COMMAND_CONFIGURATION = 1618; public static BOT_COMMAND_CONFIGURATION = 1618;
public static HAND_ITEM_RECEIVED = 354; public static HAND_ITEM_RECEIVED = 354;

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { IssueDeletedMessageParser } from '../../parser/moderation/IssueDeletedMessageParser';
export class IssueDeletedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, IssueDeletedMessageParser);
}
public getParser(): IssueDeletedMessageParser
{
return this.parser as IssueDeletedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { IssueInfoMessageParser } from '../../parser/moderation/IssueInfoMessageParser';
export class IssueInfoMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, IssueInfoMessageParser);
}
public getParser(): IssueInfoMessageParser
{
return this.parser as IssueInfoMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { IssuePickFailedMessageParser } from '../../parser/moderation/IssuePickFailedMessageParser';
export class IssuePickFailedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, IssuePickFailedMessageParser);
}
public getParser(): IssuePickFailedMessageParser
{
return this.parser as IssuePickFailedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ModeratorActionResultMessageParser } from '../../parser/moderation/ModeratorActionResultMessageParser';
export class ModeratorActionResultMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ModeratorActionResultMessageParser);
}
public getParser(): ModeratorActionResultMessageParser
{
return this.parser as ModeratorActionResultMessageParser;
}
}

View File

@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ModeratorUserInfoMessageParser } from '../../parser/moderation/ModeratorUserInfoMessageParser'; import { ModeratorUserInfoMessageParser } from '../../parser/moderation/ModeratorUserInfoMessageParser';
export class ModtoolUserInfoEvent extends MessageEvent implements IMessageEvent export class ModeratorUserInfoEvent extends MessageEvent implements IMessageEvent
{ {
constructor(callBack: Function) constructor(callBack: Function)
{ {

View File

@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { RoomChatlogMessageParser } from '../../parser/moderation/RoomChatlogMessageParser'; import { RoomChatlogMessageParser } from '../../parser/moderation/RoomChatlogMessageParser';
export class ModtoolRoomChatlogEvent extends MessageEvent implements IMessageEvent export class RoomChatlogEvent extends MessageEvent implements IMessageEvent
{ {
constructor(callBack: Function) constructor(callBack: Function)
{ {

View File

@ -0,0 +1,35 @@
import { IMessageDataWrapper } from '../../../../..';
import { ChatRecordData } from './ChatRecordData';
export class UserChatlogData
{
private _userId: number;
private _username: string;
private _roomChatlogs: ChatRecordData[] = [];
constructor(wrapper: IMessageDataWrapper)
{
this._userId = wrapper.readInt();
this._username = wrapper.readString();
const size = wrapper.readInt();
for(let i = 0; i < size; i++)
{
this._roomChatlogs.push(new ChatRecordData(wrapper));
}
}
public get userId(): number
{
return this._userId;
}
public get username(): string
{
return this._username;
}
public get roomChatlogs(): ChatRecordData[]
{
return this._roomChatlogs;
}
}

View File

@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { UserChatlogMessageParser } from '../../parser/moderation/UserChatlogMessageParser'; import { UserChatlogMessageParser } from '../../parser/moderation/UserChatlogMessageParser';
export class ModtoolUserChatlogEvent extends MessageEvent implements IMessageEvent export class UserChatlogEvent extends MessageEvent implements IMessageEvent
{ {
constructor(callBack: Function) constructor(callBack: Function)
{ {

View File

@ -3,16 +3,21 @@ export * from './CfhChatlogEvent';
export * from './ChatlineData'; export * from './ChatlineData';
export * from './ChatRecordData'; export * from './ChatRecordData';
export * from './INamed'; export * from './INamed';
export * from './IssueDeletedMessageEvent';
export * from './IssueInfoMessageEvent';
export * from './IssuePickFailedMessageEvent';
export * from './ModeratorActionResultMessageEvent';
export * from './ModeratorCautionEvent'; export * from './ModeratorCautionEvent';
export * from './ModeratorInitMessageEvent'; export * from './ModeratorInitMessageEvent';
export * from './ModeratorRoomInfoEvent'; export * from './ModeratorRoomInfoEvent';
export * from './ModeratorUserInfoData'; export * from './ModeratorUserInfoData';
export * from './ModtoolRoomChatlogEvent'; export * from './ModeratorUserInfoEvent';
export * from './ModtoolUserChatlogEvent'; export * from './RoomChatlogEvent';
export * from './ModtoolUserInfoEvent';
export * from './RoomData'; export * from './RoomData';
export * from './RoomModerationData'; export * from './RoomModerationData';
export * from './RoomVisitData'; export * from './RoomVisitData';
export * from './RoomVisitsData'; export * from './RoomVisitsData';
export * from './RoomVisitsEvent'; export * from './RoomVisitsEvent';
export * from './UserBannedMessageEvent'; export * from './UserBannedMessageEvent';
export * from './UserChatlogData';
export * from './UserChatlogEvent';

View File

@ -1,17 +1,13 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { ChatRecordData } from '../../incoming/moderation/ChatRecordData'; import { UserChatlogData } from '../../incoming/moderation/UserChatlogData';
export class UserChatlogMessageParser implements IMessageParser export class UserChatlogMessageParser implements IMessageParser
{ {
private _userId: number; private _data:UserChatlogData;
private _username: string;
private _roomVisits: ChatRecordData[] = [];
public flush(): boolean public flush(): boolean
{ {
this._userId = null; this._data = null;
this._username = null;
this._roomVisits = [];
return true; return true;
} }
@ -20,30 +16,13 @@ export class UserChatlogMessageParser implements IMessageParser
{ {
if(!wrapper) return false; if(!wrapper) return false;
this._userId = wrapper.readInt(); this._data = new UserChatlogData(wrapper);
this._username = wrapper.readString();
const size = wrapper.readInt();
for(let i = 0; i < size; i++)
{
this._roomVisits.push(new ChatRecordData(wrapper));
}
return true; return true;
} }
public get userId(): number public get data():UserChatlogData
{ {
return this._userId; return this._data;
} }
public get username(): string
{
return this._username;
}
public get roomVisits(): ChatRecordData[]
{
return this._roomVisits;
}
} }