mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-21 12:02:36 +01:00
Add group forum packets
This commit is contained in:
parent
e6084ac3ea
commit
a66ce60a30
@ -50,6 +50,7 @@ import { GroupMembersEvent } from './messages/incoming/group/GroupMembersEvent';
|
|||||||
import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEvent';
|
import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEvent';
|
||||||
import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent';
|
import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent';
|
||||||
import { HabboGroupDeactivatedMessageEvent } from './messages/incoming/group/HabboGroupDeactivatedMessageEvent';
|
import { HabboGroupDeactivatedMessageEvent } from './messages/incoming/group/HabboGroupDeactivatedMessageEvent';
|
||||||
|
import { ForumDataMessageEvent, ForumsListMessageEvent, GuildForumThreadsEvent, PostMessageMessageEvent, PostThreadMessageEvent, ThreadMessagesMessageEvent, UnreadForumsCountMessageEvent, UpdateMessageMessageEvent, UpdateThreadMessageEvent } from './messages/incoming/groupforums';
|
||||||
import { NoobnessLevelMessageEvent } from './messages/incoming/handshake/NoobnessLevelMessageEvent';
|
import { NoobnessLevelMessageEvent } from './messages/incoming/handshake/NoobnessLevelMessageEvent';
|
||||||
import { CallForHelpDisabledNotifyMessageEvent } from './messages/incoming/help/CallForHelpDisabledNotifyMessageEvent';
|
import { CallForHelpDisabledNotifyMessageEvent } from './messages/incoming/help/CallForHelpDisabledNotifyMessageEvent';
|
||||||
import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent';
|
import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent';
|
||||||
@ -615,6 +616,17 @@ export class NitroMessages implements IMessageConfiguration
|
|||||||
this._events.set(IncomingHeader.GROUP_BADGES, HabboGroupBadgesMessageEvent);
|
this._events.set(IncomingHeader.GROUP_BADGES, HabboGroupBadgesMessageEvent);
|
||||||
this._events.set(IncomingHeader.GROUP_DEACTIVATE, HabboGroupDeactivatedMessageEvent);
|
this._events.set(IncomingHeader.GROUP_DEACTIVATE, HabboGroupDeactivatedMessageEvent);
|
||||||
|
|
||||||
|
// GROUP FORUMS
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_DATA, ForumDataMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_LIST, ForumsListMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_THREADS, GuildForumThreadsEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_POST, PostMessageMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_POST_THREAD, PostThreadMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_THREAD_MESSAGES, ThreadMessagesMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_UNREAD_COUNT, UnreadForumsCountMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_UPDATE_MESSAGE, UpdateMessageMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.GROUP_FORUM_UPDATE_THREAD, UpdateThreadMessageEvent);
|
||||||
|
|
||||||
// HELP
|
// HELP
|
||||||
this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent);
|
this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent);
|
||||||
this._events.set(IncomingHeader.CFH_PENDING_CALLS_DELETED, CallForHelpPendingCallsDeletedMessageEvent);
|
this._events.set(IncomingHeader.CFH_PENDING_CALLS_DELETED, CallForHelpPendingCallsDeletedMessageEvent);
|
||||||
|
@ -41,9 +41,15 @@ export class IncomingHeader
|
|||||||
public static GIFT_WRAPPER_CONFIG = 2234;
|
public static GIFT_WRAPPER_CONFIG = 2234;
|
||||||
public static GROUP_BADGES = 2402;
|
public static GROUP_BADGES = 2402;
|
||||||
public static GROUP_CREATE_OPTIONS = 2159;
|
public static GROUP_CREATE_OPTIONS = 2159;
|
||||||
public static GROUP_FORUM_INFO = 3011;
|
public static GROUP_FORUM_DATA = 3011;
|
||||||
public static GROUP_FORUM_LIST = 3001;
|
public static GROUP_FORUM_LIST = 3001;
|
||||||
public static GROUP_FORUM_THREADS = 1073;
|
public static GROUP_FORUM_THREADS = 1073;
|
||||||
|
public static GROUP_FORUM_POST = 2049;
|
||||||
|
public static GROUP_FORUM_POST_THREAD = 1862;
|
||||||
|
public static GROUP_FORUM_THREAD_MESSAGES = 509;
|
||||||
|
public static GROUP_FORUM_UNREAD_COUNT = 2379;
|
||||||
|
public static GROUP_FORUM_UPDATE_MESSAGE = 324;
|
||||||
|
public static GROUP_FORUM_UPDATE_THREAD = 2528;
|
||||||
public static GROUP_INFO = 1702;
|
public static GROUP_INFO = 1702;
|
||||||
public static GROUP_LIST = 420;
|
public static GROUP_LIST = 420;
|
||||||
public static GROUP_MEMBER = 265;
|
public static GROUP_MEMBER = 265;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { ForumDataMessageParser } from '../../parser/groupforums/ForumDataMessageParser';
|
||||||
|
|
||||||
|
export class ForumDataMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, ForumDataMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): ForumDataMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as ForumDataMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { GetForumsListMessageParser } from '../../parser/groupforums/GetForumsListMessageParser';
|
||||||
|
|
||||||
|
export class ForumsListMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, GetForumsListMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): GetForumsListMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as GetForumsListMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { GuildForumThreadsParser } from '../../parser/groupforums/GuildForumThreadsParser';
|
||||||
|
|
||||||
|
export class GuildForumThreadsEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, GuildForumThreadsParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): GuildForumThreadsParser
|
||||||
|
{
|
||||||
|
return this.parser as GuildForumThreadsParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { PostMessageMessageParser } from '../../parser/groupforums/PostMessageMessageParser';
|
||||||
|
|
||||||
|
export class PostMessageMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, PostMessageMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): PostMessageMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as PostMessageMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { PostThreadMessageParser } from '../../parser/groupforums/PostThreadMessageParser';
|
||||||
|
|
||||||
|
export class PostThreadMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, PostThreadMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): PostThreadMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as PostThreadMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { ThreadMessagesMessageParser } from '../../parser/groupforums/ThreadMessagesMessageParser';
|
||||||
|
|
||||||
|
export class ThreadMessagesMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, ThreadMessagesMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): ThreadMessagesMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as ThreadMessagesMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { UnreadForumsCountMessageParser } from '../../parser/groupforums/UnreadForumsCountMessageParser';
|
||||||
|
|
||||||
|
export class UnreadForumsCountMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, UnreadForumsCountMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): UnreadForumsCountMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as UnreadForumsCountMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { UpdateMessageMessageParser } from '../../parser/groupforums/UpdateMessageMessageParser';
|
||||||
|
|
||||||
|
export class UpdateMessageMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, UpdateMessageMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): UpdateMessageMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as UpdateMessageMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { UpdateThreadMessageParser } from '../../parser/groupforums/UpdateThreadMessageParser';
|
||||||
|
|
||||||
|
export class UpdateThreadMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, UpdateThreadMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): UpdateThreadMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as UpdateThreadMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
export * from './ForumDataMessageEvent';
|
||||||
|
export * from './ForumsListMessageEvent';
|
||||||
|
export * from './GuildForumThreadsEvent';
|
||||||
|
export * from './PostMessageMessageEvent';
|
||||||
|
export * from './PostThreadMessageEvent';
|
||||||
|
export * from './ThreadMessagesMessageEvent';
|
||||||
|
export * from './UnreadForumsCountMessageEvent';
|
||||||
|
export * from './UpdateMessageMessageEvent';
|
||||||
|
export * from './UpdateThreadMessageEvent';
|
@ -0,0 +1,118 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
import { ForumData } from './ForumData';
|
||||||
|
|
||||||
|
export class ExtendedForumData extends ForumData
|
||||||
|
{
|
||||||
|
private _readPermissions: number;
|
||||||
|
private _postMessagePermissions: number;
|
||||||
|
private _postThreadPermissions: number;
|
||||||
|
private _moderatePermissions: number;
|
||||||
|
private _readPermissionError: string;
|
||||||
|
private _postMessagePermissionError: string;
|
||||||
|
private _postThreadPermissionError: string;
|
||||||
|
private _moderatePermissionError: string;
|
||||||
|
private _reportPermissionError: string;
|
||||||
|
private _canChangeSettings: boolean;
|
||||||
|
private _isStaff: boolean;
|
||||||
|
|
||||||
|
public static parse(wrapper: IMessageDataWrapper):ExtendedForumData
|
||||||
|
{
|
||||||
|
const extendedForumData:ExtendedForumData = new ExtendedForumData();
|
||||||
|
|
||||||
|
ForumData.fillFromMessage(extendedForumData, wrapper);
|
||||||
|
|
||||||
|
extendedForumData._readPermissions = wrapper.readInt();
|
||||||
|
extendedForumData._postMessagePermissions = wrapper.readInt();
|
||||||
|
extendedForumData._postThreadPermissions = wrapper.readInt();
|
||||||
|
extendedForumData._moderatePermissions = wrapper.readInt();
|
||||||
|
extendedForumData._readPermissionError = wrapper.readString();
|
||||||
|
extendedForumData._postMessagePermissionError = wrapper.readString();
|
||||||
|
extendedForumData._postThreadPermissionError = wrapper.readString();
|
||||||
|
extendedForumData._moderatePermissionError = wrapper.readString();
|
||||||
|
extendedForumData._reportPermissionError = wrapper.readString();
|
||||||
|
extendedForumData._canChangeSettings = wrapper.readBoolean();
|
||||||
|
extendedForumData._isStaff = wrapper.readBoolean();
|
||||||
|
|
||||||
|
return extendedForumData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get readPermissions(): number
|
||||||
|
{
|
||||||
|
return this._readPermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get postMessagePermissions(): number
|
||||||
|
{
|
||||||
|
return this._postMessagePermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get postThreadPermissions(): number
|
||||||
|
{
|
||||||
|
return this._postThreadPermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get moderatePermissions(): number
|
||||||
|
{
|
||||||
|
return this._moderatePermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get hasReadPermissionError(): boolean
|
||||||
|
{
|
||||||
|
return (this._readPermissionError.length === 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get _Str_21331(): boolean
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get hasPostMessagePermissionError(): boolean
|
||||||
|
{
|
||||||
|
return (this._postMessagePermissionError.length === 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get hasPostThreadPermissionError(): boolean
|
||||||
|
{
|
||||||
|
return (this._postThreadPermissionError.length === 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get hasModeratePermissionError(): boolean
|
||||||
|
{
|
||||||
|
return (this._moderatePermissionError.length === 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get canChangeSettings(): boolean
|
||||||
|
{
|
||||||
|
return this._canChangeSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get isStaf(): boolean
|
||||||
|
{
|
||||||
|
return this._isStaff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get readPermissionError(): string
|
||||||
|
{
|
||||||
|
return this._readPermissionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get postMessagePermissionError(): string
|
||||||
|
{
|
||||||
|
return this._postMessagePermissionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get postThreadPermissionError(): string
|
||||||
|
{
|
||||||
|
return this._postThreadPermissionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get moderatePermissionError(): string
|
||||||
|
{
|
||||||
|
return this._moderatePermissionError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get reportPermissionError(): string
|
||||||
|
{
|
||||||
|
return this._reportPermissionError;
|
||||||
|
}
|
||||||
|
}
|
135
src/nitro/communication/messages/parser/groupforums/ForumData.ts
Normal file
135
src/nitro/communication/messages/parser/groupforums/ForumData.ts
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
import { GuildForumThread } from './GuildForumThread';
|
||||||
|
|
||||||
|
export class ForumData
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _name: string;
|
||||||
|
private _description: string;
|
||||||
|
private _icon: string;
|
||||||
|
private _totalThreads: number;
|
||||||
|
private _leaderboardScore: number;
|
||||||
|
private _totalMessages: number;
|
||||||
|
private _unreadMessages: number;
|
||||||
|
private _lastMessageId: number;
|
||||||
|
private _lastMessageAuthorId: number;
|
||||||
|
private _lastMessageAuthorName: string;
|
||||||
|
private _lastMessageTimeAsSecondsAgo: number;
|
||||||
|
|
||||||
|
public static parse(wrapper: IMessageDataWrapper): ForumData
|
||||||
|
{
|
||||||
|
return this.fillFromMessage(new ForumData(), wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static fillFromMessage(data: ForumData, wrapper: IMessageDataWrapper):ForumData
|
||||||
|
{
|
||||||
|
data._groupId = wrapper.readInt();
|
||||||
|
data._name = wrapper.readString();
|
||||||
|
data._description = wrapper.readString();
|
||||||
|
data._icon = wrapper.readString();
|
||||||
|
data._totalThreads = wrapper.readInt();
|
||||||
|
data._leaderboardScore = wrapper.readInt();
|
||||||
|
data._totalMessages = wrapper.readInt();
|
||||||
|
data._unreadMessages = wrapper.readInt();
|
||||||
|
data._lastMessageId = wrapper.readInt();
|
||||||
|
data._lastMessageAuthorId = wrapper.readInt();
|
||||||
|
data._lastMessageAuthorName = wrapper.readString();
|
||||||
|
data._lastMessageTimeAsSecondsAgo = wrapper.readInt();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get name(): string
|
||||||
|
{
|
||||||
|
return this._name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get description(): string
|
||||||
|
{
|
||||||
|
return this._description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get icon(): string
|
||||||
|
{
|
||||||
|
return this._icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get totalThreads(): number
|
||||||
|
{
|
||||||
|
return this._totalThreads;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get leaderboardScore(): number
|
||||||
|
{
|
||||||
|
return this._leaderboardScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get totalMessages(): number
|
||||||
|
{
|
||||||
|
return this._totalMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get unreadMessages(): number
|
||||||
|
{
|
||||||
|
return this._unreadMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastMessageId(): number
|
||||||
|
{
|
||||||
|
return this._lastMessageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastMessageAuthorId(): number
|
||||||
|
{
|
||||||
|
return this._lastMessageAuthorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastMessageAuthorName(): string
|
||||||
|
{
|
||||||
|
return this._lastMessageAuthorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastMessageTimeAsSecondsAgo(): number
|
||||||
|
{
|
||||||
|
return this._lastMessageTimeAsSecondsAgo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public _Str_25309(forum: ForumData):void
|
||||||
|
{
|
||||||
|
this._totalThreads = forum._totalThreads;
|
||||||
|
this._totalMessages = forum._totalMessages;
|
||||||
|
this._unreadMessages = forum._unreadMessages;
|
||||||
|
this._lastMessageAuthorId = forum._lastMessageAuthorId;
|
||||||
|
this._lastMessageAuthorName = forum._lastMessageAuthorName;
|
||||||
|
this._lastMessageId = forum._lastMessageId;
|
||||||
|
this._lastMessageTimeAsSecondsAgo = forum._lastMessageTimeAsSecondsAgo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get _Str_12786(): number
|
||||||
|
{
|
||||||
|
return (this._totalMessages - this._unreadMessages);
|
||||||
|
}
|
||||||
|
|
||||||
|
public set _Str_12786(k: number)
|
||||||
|
{
|
||||||
|
this._unreadMessages = (this._totalMessages - k);
|
||||||
|
|
||||||
|
if(this._unreadMessages < 0) this._unreadMessages = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public _Str_23783(thread: GuildForumThread): void
|
||||||
|
{
|
||||||
|
this._lastMessageAuthorId = thread.lastUserId;
|
||||||
|
this._lastMessageAuthorName = thread.lastUserName;
|
||||||
|
this._lastMessageId = thread.lastMessageId;
|
||||||
|
this._lastMessageTimeAsSecondsAgo = thread.lastCommentTime;
|
||||||
|
this._totalThreads++;
|
||||||
|
this._totalMessages++;
|
||||||
|
this._unreadMessages = 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { ExtendedForumData } from './ExtendedForumData';
|
||||||
|
|
||||||
|
export class ForumDataMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _extendedForumData: ExtendedForumData;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._extendedForumData = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._extendedForumData = ExtendedForumData.parse(wrapper);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get extendedForumData(): ExtendedForumData
|
||||||
|
{
|
||||||
|
return this._extendedForumData;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { ForumData } from './ForumData';
|
||||||
|
|
||||||
|
export class GetForumsListMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _listCode: number;
|
||||||
|
private _totalAmount: number;
|
||||||
|
private _startIndex: number;
|
||||||
|
private _amount: number;
|
||||||
|
private _forums: ForumData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._listCode = -1;
|
||||||
|
this._totalAmount = 0;
|
||||||
|
this._startIndex = -1;
|
||||||
|
this._amount = 0;
|
||||||
|
this._forums = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._listCode = wrapper.readInt();
|
||||||
|
this._totalAmount = wrapper.readInt();
|
||||||
|
this._startIndex = wrapper.readInt();
|
||||||
|
this._amount = wrapper.readInt();
|
||||||
|
this._forums = [];
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
while(i < this._amount)
|
||||||
|
{
|
||||||
|
this._forums.push(ForumData.parse(wrapper));
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get listCode(): number
|
||||||
|
{
|
||||||
|
return this._listCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get totalAmount(): number
|
||||||
|
{
|
||||||
|
return this._totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get startIndex(): number
|
||||||
|
{
|
||||||
|
return this._startIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get amount(): number
|
||||||
|
{
|
||||||
|
return this._amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get forums(): ForumData[]
|
||||||
|
{
|
||||||
|
return this._forums;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,217 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
|
||||||
|
export class GuildForumThread
|
||||||
|
{
|
||||||
|
private _threadId: number;
|
||||||
|
private _authorId: number;
|
||||||
|
private _authorName: string;
|
||||||
|
private _creationTimeAsSecondsAgo: number;
|
||||||
|
private _header: string;
|
||||||
|
private _totalMessages: number;
|
||||||
|
private _unreadMessagesCount: number;
|
||||||
|
private _lastMessageId: number;
|
||||||
|
private _lastUserId: number;
|
||||||
|
private _lastUserName: string;
|
||||||
|
private _lastCommentTime: number;
|
||||||
|
private _state: number;
|
||||||
|
private _adminId: number;
|
||||||
|
private _adminName: string;
|
||||||
|
private _adminOperationTimeAsSecondsAgo: number;
|
||||||
|
private _isPinned: boolean;
|
||||||
|
private _isLocked: boolean;
|
||||||
|
|
||||||
|
public static parse(wrapper: IMessageDataWrapper):GuildForumThread
|
||||||
|
{
|
||||||
|
const thread = new GuildForumThread();
|
||||||
|
|
||||||
|
thread._threadId = wrapper.readInt();
|
||||||
|
thread._authorId = wrapper.readInt();
|
||||||
|
thread._authorName = wrapper.readString();
|
||||||
|
thread._header = wrapper.readString();
|
||||||
|
thread._isPinned = wrapper.readBoolean();
|
||||||
|
thread._isLocked = wrapper.readBoolean();
|
||||||
|
thread._creationTimeAsSecondsAgo = wrapper.readInt();
|
||||||
|
thread._totalMessages = wrapper.readInt();
|
||||||
|
thread._unreadMessagesCount = wrapper.readInt();
|
||||||
|
thread._lastMessageId = wrapper.readInt();
|
||||||
|
thread._lastUserId = wrapper.readInt();
|
||||||
|
thread._lastUserName = wrapper.readString();
|
||||||
|
thread._lastCommentTime = wrapper.readInt();
|
||||||
|
thread._state = wrapper.readByte();
|
||||||
|
thread._adminId = wrapper.readInt();
|
||||||
|
thread._adminName = wrapper.readString();
|
||||||
|
thread._adminOperationTimeAsSecondsAgo = wrapper.readInt();
|
||||||
|
|
||||||
|
return thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminOperationTimeAsSecondsAgo(): number
|
||||||
|
{
|
||||||
|
return this._adminOperationTimeAsSecondsAgo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminOperationTimeAsSecondsAgo(k: number)
|
||||||
|
{
|
||||||
|
this._adminOperationTimeAsSecondsAgo = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastCommentTime(): number
|
||||||
|
{
|
||||||
|
return this._lastCommentTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set lastCommentTime(time: number)
|
||||||
|
{
|
||||||
|
this._lastCommentTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threadId(): number
|
||||||
|
{
|
||||||
|
return this._threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set threadId(id: number)
|
||||||
|
{
|
||||||
|
this._threadId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorId(): number
|
||||||
|
{
|
||||||
|
return this._authorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorId(id: number)
|
||||||
|
{
|
||||||
|
this._authorId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorName(): string
|
||||||
|
{
|
||||||
|
return this._authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorName(name: string)
|
||||||
|
{
|
||||||
|
this._authorName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get creationTimeAsSecondsAgo(): number
|
||||||
|
{
|
||||||
|
return this._creationTimeAsSecondsAgo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set creationTimeAsSecondsAgo(time: number)
|
||||||
|
{
|
||||||
|
this._creationTimeAsSecondsAgo = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get header(): string
|
||||||
|
{
|
||||||
|
return this._header;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set header(header: string)
|
||||||
|
{
|
||||||
|
this._header = header;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastMessageId(): number
|
||||||
|
{
|
||||||
|
return this._lastMessageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set lastMessageId(id: number)
|
||||||
|
{
|
||||||
|
this._lastMessageId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastUserId(): number
|
||||||
|
{
|
||||||
|
return this._lastUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set lastUserId(id: number)
|
||||||
|
{
|
||||||
|
this._lastUserId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get lastUserName(): string
|
||||||
|
{
|
||||||
|
return this._lastUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set lastUserName(name: string)
|
||||||
|
{
|
||||||
|
this._lastUserName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get totalMessages(): number
|
||||||
|
{
|
||||||
|
return this._totalMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set totalMessages(total: number)
|
||||||
|
{
|
||||||
|
this._totalMessages = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get unreadMessagesCount(): number
|
||||||
|
{
|
||||||
|
return this._unreadMessagesCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set unreadMessagesCount(count: number)
|
||||||
|
{
|
||||||
|
this._unreadMessagesCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get state(): number
|
||||||
|
{
|
||||||
|
return this._state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set state(state: number)
|
||||||
|
{
|
||||||
|
this._state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminId(): number
|
||||||
|
{
|
||||||
|
return this._adminId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminId(id: number)
|
||||||
|
{
|
||||||
|
this._adminId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminName(): string
|
||||||
|
{
|
||||||
|
return this._adminName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminName(name: string)
|
||||||
|
{
|
||||||
|
this._adminName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get isPinned(): boolean
|
||||||
|
{
|
||||||
|
return this._isPinned;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set isPinned(k: boolean)
|
||||||
|
{
|
||||||
|
this._isPinned = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get isLocked(): boolean
|
||||||
|
{
|
||||||
|
return this._isLocked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set isLocked(flag: boolean)
|
||||||
|
{
|
||||||
|
this._isLocked = flag;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { GuildForumThread } from './GuildForumThread';
|
||||||
|
|
||||||
|
export class GuildForumThreadsParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _startIndex; number;
|
||||||
|
private _amount: number;
|
||||||
|
private _threads: GuildForumThread[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._startIndex = -1;
|
||||||
|
this._amount = 0;
|
||||||
|
this._threads = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._startIndex = wrapper.readInt();
|
||||||
|
this._amount = wrapper.readInt();
|
||||||
|
this._threads = [];
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
while(i < this._amount)
|
||||||
|
{
|
||||||
|
this._threads.push(GuildForumThread.parse(wrapper));
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get startIndex(): number
|
||||||
|
{
|
||||||
|
return this._startIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get amount(): number
|
||||||
|
{
|
||||||
|
return this._amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threads(): GuildForumThread[]
|
||||||
|
{
|
||||||
|
return this._threads;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,179 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
|
||||||
|
export class MessageData
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _messageId: number;
|
||||||
|
private _messageIndex: number;
|
||||||
|
private _authorId: number;
|
||||||
|
private _threadId: number;
|
||||||
|
private _creationTime: number;
|
||||||
|
private _messageText: string;
|
||||||
|
private _authorName: string;
|
||||||
|
private _authorFigure: string;
|
||||||
|
private _state: number;
|
||||||
|
private _adminId: number;
|
||||||
|
private _adminName: string;
|
||||||
|
private _adminOperationTimeAsSeccondsAgo: number;
|
||||||
|
private _authorPostCount: number;
|
||||||
|
|
||||||
|
public static _Str_4933(wrapper: IMessageDataWrapper):MessageData
|
||||||
|
{
|
||||||
|
const messageData = new MessageData();
|
||||||
|
|
||||||
|
messageData._messageId = wrapper.readInt();
|
||||||
|
messageData._messageIndex = wrapper.readInt();
|
||||||
|
messageData._authorId = wrapper.readInt();
|
||||||
|
messageData._authorName = wrapper.readString();
|
||||||
|
messageData._authorFigure = wrapper.readString();
|
||||||
|
messageData._creationTime = wrapper.readInt();
|
||||||
|
messageData._messageText = wrapper.readString();
|
||||||
|
messageData._state = wrapper.readByte();
|
||||||
|
messageData._adminId = wrapper.readInt();
|
||||||
|
messageData._adminName = wrapper.readString();
|
||||||
|
messageData._adminOperationTimeAsSeccondsAgo = wrapper.readInt();
|
||||||
|
messageData._authorPostCount = wrapper.readInt();
|
||||||
|
|
||||||
|
return messageData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get state(): number
|
||||||
|
{
|
||||||
|
return this._state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set state(state: number)
|
||||||
|
{
|
||||||
|
this._state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminId(): number
|
||||||
|
{
|
||||||
|
return this._adminId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminId(id: number)
|
||||||
|
{
|
||||||
|
this._adminId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminName(): string
|
||||||
|
{
|
||||||
|
return this._adminName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminName(name: string)
|
||||||
|
{
|
||||||
|
this._adminName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get adminOperationTimeAsSeccondsAgo(): number
|
||||||
|
{
|
||||||
|
return this._adminOperationTimeAsSeccondsAgo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set adminOperationTimeAsSeccondsAgo(time: number)
|
||||||
|
{
|
||||||
|
this._adminOperationTimeAsSeccondsAgo = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get messageId(): number
|
||||||
|
{
|
||||||
|
return this._messageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set messageId(id: number)
|
||||||
|
{
|
||||||
|
this._messageId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get creationTime(): number
|
||||||
|
{
|
||||||
|
return this._creationTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set creationTime(time: number)
|
||||||
|
{
|
||||||
|
this._creationTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorName(): string
|
||||||
|
{
|
||||||
|
return this._authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorName(name: string)
|
||||||
|
{
|
||||||
|
this._authorName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorFigure(): string
|
||||||
|
{
|
||||||
|
return this._authorFigure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorFigure(figure: string)
|
||||||
|
{
|
||||||
|
this._authorFigure = figure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threadId(): number
|
||||||
|
{
|
||||||
|
return this._threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set threadId(id: number)
|
||||||
|
{
|
||||||
|
this._threadId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get messageIndex(): number
|
||||||
|
{
|
||||||
|
return this._messageIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set messageIndex(index: number)
|
||||||
|
{
|
||||||
|
this._messageIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set groupID(id: number)
|
||||||
|
{
|
||||||
|
this._groupId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorId(): number
|
||||||
|
{
|
||||||
|
return this._authorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorId(id: number)
|
||||||
|
{
|
||||||
|
this._authorId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get messageText(): string
|
||||||
|
{
|
||||||
|
return this._messageText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set messageText(text: string)
|
||||||
|
{
|
||||||
|
this._messageText = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get authorPostCount(): number
|
||||||
|
{
|
||||||
|
return this._authorPostCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set authorPostCount(count: number)
|
||||||
|
{
|
||||||
|
this._authorPostCount = count;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { MessageData } from './MessageData';
|
||||||
|
|
||||||
|
export class PostMessageMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _threadId: number;
|
||||||
|
private _message: MessageData;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._threadId = -1;
|
||||||
|
this._message = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._threadId = wrapper.readInt();
|
||||||
|
this._message = MessageData._Str_4933(wrapper);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threadId(): number
|
||||||
|
{
|
||||||
|
return this._threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get message(): MessageData
|
||||||
|
{
|
||||||
|
return this._message;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { GuildForumThread } from './GuildForumThread';
|
||||||
|
|
||||||
|
export class PostThreadMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _thread: GuildForumThread;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._thread = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._thread = GuildForumThread.parse(wrapper);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get thread(): GuildForumThread
|
||||||
|
{
|
||||||
|
return this._thread;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { MessageData } from './MessageData';
|
||||||
|
|
||||||
|
export class ThreadMessagesMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _threadId: number;
|
||||||
|
private _startIndex: number;
|
||||||
|
private _amount: number;
|
||||||
|
private _messages: MessageData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._threadId = -1;
|
||||||
|
this._startIndex = -1;
|
||||||
|
this._amount = 0;
|
||||||
|
this._messages = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._threadId = wrapper.readInt();
|
||||||
|
this._startIndex = wrapper.readInt();
|
||||||
|
this._amount = wrapper.readInt();
|
||||||
|
this._messages = [];
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
while(i < this._amount)
|
||||||
|
{
|
||||||
|
const message = MessageData._Str_4933(wrapper);
|
||||||
|
|
||||||
|
message.groupID = this._groupId;
|
||||||
|
message.threadId = this._threadId;
|
||||||
|
|
||||||
|
this._messages.push(message);
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threadId(): number
|
||||||
|
{
|
||||||
|
return this._threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get startIndex(): number
|
||||||
|
{
|
||||||
|
return this._startIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get amount(): number
|
||||||
|
{
|
||||||
|
return this._amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get messages(): MessageData[]
|
||||||
|
{
|
||||||
|
return this._messages;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
|
||||||
|
export class UnreadForumsCountMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _count: number;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._count = 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._count = wrapper.readInt();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get count(): number
|
||||||
|
{
|
||||||
|
return this._count;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { MessageData } from './MessageData';
|
||||||
|
|
||||||
|
export class UpdateMessageMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _threadId: number;
|
||||||
|
private _message: MessageData;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._threadId = -1;
|
||||||
|
this._message = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._threadId = wrapper.readInt();
|
||||||
|
this._message = MessageData._Str_4933(wrapper);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get threadId(): number
|
||||||
|
{
|
||||||
|
return this._threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get message(): MessageData
|
||||||
|
{
|
||||||
|
return this._message;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
|
||||||
|
import { GuildForumThread } from './GuildForumThread';
|
||||||
|
|
||||||
|
export class UpdateThreadMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _groupId: number;
|
||||||
|
private _thread: GuildForumThread;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._groupId = -1;
|
||||||
|
this._thread = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._groupId = wrapper.readInt();
|
||||||
|
this._thread = GuildForumThread.parse(wrapper);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get groupId(): number
|
||||||
|
{
|
||||||
|
return this._groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get thread(): GuildForumThread
|
||||||
|
{
|
||||||
|
return this._thread;
|
||||||
|
}
|
||||||
|
}
|
13
src/nitro/communication/messages/parser/groupforums/index.ts
Normal file
13
src/nitro/communication/messages/parser/groupforums/index.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export * from './ExtendedForumData';
|
||||||
|
export * from './ForumData';
|
||||||
|
export * from './ForumDataMessageParser';
|
||||||
|
export * from './GetForumsListMessageParser';
|
||||||
|
export * from './GuildForumThread';
|
||||||
|
export * from './GuildForumThreadsParser';
|
||||||
|
export * from './MessageData';
|
||||||
|
export * from './PostMessageMessageParser';
|
||||||
|
export * from './PostThreadMessageParser';
|
||||||
|
export * from './ThreadMessagesMessageParser';
|
||||||
|
export * from './UnreadForumsCountMessageParser';
|
||||||
|
export * from './UpdateMessageMessageParser';
|
||||||
|
export * from './UpdateThreadMessageParser';
|
Loading…
x
Reference in New Issue
Block a user