fixed moderation parser variables

This commit is contained in:
Dank074 2021-06-06 21:30:32 -05:00
parent 10e6e8ed7c
commit a7182c863b
8 changed files with 321 additions and 322 deletions

View File

@ -1,11 +1,10 @@
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
import { ModeratorInitData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData';
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
import { CallForHelpCategoryData } from './utils/CallForHelpCategoryData';
import { _Str_5018 } from './utils/_Str_5018';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ModtoolMainParser implements IMessageParser
{
private _data: _Str_5018 = null;
private _data: ModeratorInitData = null;
public flush(): boolean
{
this._data = null;
@ -14,11 +13,11 @@ export class ModtoolMainParser implements IMessageParser
public parse(wrapper: IMessageDataWrapper): boolean
{
this._data = new _Str_5018(wrapper);
this._data = new ModeratorInitData(wrapper);
return true;
}
public get data(): _Str_5018
public get data(): ModeratorInitData
{
return this._data;
}

View File

@ -1,21 +1,21 @@
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
import { _Str_2484 } from './_Str_2484';
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { _Str_8176 } from './_Str_8176';
import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser';
import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData';
import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData';
export class _Str_5460 implements IMessageParser
export class IssueInfoMessageParser implements IMessageParser
{
private _Str_13730:_Str_2484;
private _issueData:IssueMessageData;
public get _Str_22192():_Str_2484
public get issueData():IssueMessageData
{
return this._Str_13730;
return this._issueData;
}
public flush():boolean
{
this._Str_13730 = null;
this._issueData = null;
return true;
}
@ -37,14 +37,14 @@ export class _Str_5460 implements IMessageParser
const _local_15:string = k.readString();
const _local_16:number = k.readInt();
const _local_17:number = k.readInt();
const _local_18:_Str_8176[] = [];
const _local_18:PatternMatchData[] = [];
let _local_19 = 0;
while(_local_19 < _local_17)
{
_local_18.push(new _Str_8176(k));
_local_18.push(new PatternMatchData(k));
_local_19++;
}
this._Str_13730 = new _Str_2484(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15, _local_16, _local_18);
this._issueData = new IssueMessageData(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15, _local_16, _local_18);
return true;
}
}

View File

@ -0,0 +1,159 @@
import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData';
export class IssueMessageData
{
public static STATE_OPEN: number = 1;
public static STATE_PICKED: number = 2;
public static STATE_CLOSED: number = 3;
private _issueId: number;
private _state: number;
private _categoryId: number;
private _reportedCategoryId: number;
private _issueAgeInMilliseconds: number;
private _priority: number;
private _groupingId: number;
private _reporterUserId: number;
private _reporterUserName: string;
private _reportedUserId: number;
private _reportedUserName: string;
private _pickerUserId: number;
private _pickerUserName: string;
private _message: string;
private _chatRecordId: number;
private _patterns: PatternMatchData[];
private _disposed: boolean = false;
private _creationTimeInMilliseconds: number;
constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: string, _arg_10: number, _arg_11: string, _arg_12: number, _arg_13: string, _arg_14: string, _arg_15: number, _arg_16:PatternMatchData[])
{
this._issueId = k;
this._state = _arg_2;
this._categoryId = _arg_3;
this._reportedCategoryId = _arg_4;
this._issueAgeInMilliseconds = _arg_5;
this._priority = _arg_6;
this._groupingId = _arg_7;
this._reporterUserId = _arg_8;
this._reporterUserName = _arg_9;
this._reportedUserId = _arg_10;
this._reportedUserName = _arg_11;
this._pickerUserId = _arg_12;
this._pickerUserName = _arg_13;
this._message = _arg_14;
this._chatRecordId = _arg_15;
this._patterns = _arg_16;
this._creationTimeInMilliseconds = 0; //getTimer();
}
public get issueId(): number
{
return this._issueId;
}
public get state(): number
{
return this._state;
}
public get categoryId(): number
{
return this._categoryId;
}
public get reportedCategoryId(): number
{
return this._reportedCategoryId;
}
public get issueAgeInMilliseconds(): number
{
return this._issueAgeInMilliseconds;
}
public get priority(): number
{
return this._priority;
}
public get groupingId(): number
{
return this._groupingId;
}
public get reporterUserId(): number
{
return this._reporterUserId;
}
public get reporterUserName(): string
{
return this._reporterUserName;
}
public get reportedUserId(): number
{
return this._reportedUserId;
}
public get reportedUserName(): string
{
return this._reportedUserName;
}
public get pickerUserId(): number
{
return this._pickerUserId;
}
public get pickerUserName(): string
{
return this._pickerUserName;
}
public get message(): string
{
return this._message;
}
public get chatRecordId(): number
{
return this._chatRecordId;
}
public get patterns(): PatternMatchData[]
{
return this._patterns;
}
public dispose(): void
{
if(this.disposed)
{
return;
}
for(const k of this._patterns)
{
k.dispose();
}
this._patterns = [];
this._disposed = true;
}
public get disposed(): boolean
{
return this._disposed;
}
public getOpenTime(k: number): string
{
const _local_2: number = (((this._issueAgeInMilliseconds + k) - this._creationTimeInMilliseconds) / 1000);
const _local_3: number = (_local_2 / 60);
const _local_4: number = (_local_3 % 60);
const _local_5: number = (_local_3 / 60);
const _local_6: string = (((_local_4 < 10) ? '0' : '') + _local_4);
const _local_7: string = (((_local_5 < 10) ? '0' : '') + _local_5);
return (_local_7 + ':') + _local_6;
}
}

View File

@ -0,0 +1,138 @@
import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper';
import { IssueInfoMessageParser } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser';
import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData';
export class ModeratorInitData
{
private _messageTemplates:string[];
private _roomMessageTemplates:string[];
private _issues:IssueMessageData[];
private _cfhPermission:boolean;
private _chatlogsPermission:boolean;
private _alertPermission:boolean;
private _kickPermission:boolean;
private _banPermission:boolean;
private _roomAlertPermission:boolean;
private _roomKickPermission:boolean;
private _disposed: boolean = false;
constructor(wrapper: IMessageDataWrapper)
{
const local2 = new IssueInfoMessageParser();
this._issues = [];
this._messageTemplates = [];
this._roomMessageTemplates= [];
let local3 = wrapper.readInt();
let i = 0;
while(i < local3)
{
if(local2.parse(wrapper))
{
this._issues.push(local2.issueData);
}
i++;
}
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
this._messageTemplates.push(wrapper.readString());
i++;
}
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
wrapper.readString();
i++;
}
this._cfhPermission = wrapper.readBoolean();
this._chatlogsPermission = wrapper.readBoolean();
this._alertPermission = wrapper.readBoolean();
this._kickPermission = wrapper.readBoolean();
this._banPermission = wrapper.readBoolean();
this._roomAlertPermission = wrapper.readBoolean();
this._roomKickPermission = wrapper.readBoolean();
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
this._roomMessageTemplates.push(wrapper.readString());
i++;
}
}
public dispose():void
{
if(this._disposed)
{
return;
}
this._disposed = true;
this._messageTemplates = null;
this._roomMessageTemplates = null;
this._issues = null;
}
public get disposed():boolean
{
return this._disposed;
}
public get messageTemplates():string[]
{
return this._messageTemplates;
}
public get roomMessageTemplates():string[]
{
return this._roomMessageTemplates;
}
public get issues():IssueMessageData[]
{
return this._issues;
}
public get cfhPermission():boolean
{
return this._cfhPermission;
}
public get chatlogsPermission():boolean
{
return this._chatlogsPermission;
}
public get alertPermission():boolean
{
return this._alertPermission;
}
public get kickPermission():boolean
{
return this._kickPermission;
}
public get banPermission():boolean
{
return this._banPermission;
}
public get roomAlertPermission():boolean
{
return this._roomAlertPermission;
}
public get roomKickPermission():boolean
{
return this._roomKickPermission;
}
}

View File

@ -1,7 +1,7 @@
import { IDisposable } from '../../../../../../core/common/disposable/IDisposable';
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IDisposable } from 'nitro-renderer/src/core/common/disposable/IDisposable';
import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper';
export class _Str_8176 implements IDisposable
export class PatternMatchData implements IDisposable
{
private _pattern:string;
private _startIndex:number;

View File

@ -1,159 +0,0 @@
import { _Str_8176 } from './_Str_8176';
export class _Str_2484
{
public static _Str_5035: number = 1;
public static _Str_8056: number = 2;
public static _Str_17136: number = 3;
private _Str_6036: number;
private _state: number;
private _Str_2629: number;
private _Str_21044: number;
private _issueAgeInMilliseconds: number;
private _priority: number;
private _Str_9559: number;
private _Str_21130: number;
private _Str_19722: string;
private _Str_2797: number;
private _Str_5502: string;
private _Str_9859: number;
private _Str_21393: string;
private _message: string;
private _Str_10679: number;
private _Str_15205: _Str_8176[];
private _disposed: boolean = false;
private _Str_19084: number;
constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: string, _arg_10: number, _arg_11: string, _arg_12: number, _arg_13: string, _arg_14: string, _arg_15: number, _arg_16:_Str_8176[])
{
this._Str_6036 = k;
this._state = _arg_2;
this._Str_2629 = _arg_3;
this._Str_21044 = _arg_4;
this._issueAgeInMilliseconds = _arg_5;
this._priority = _arg_6;
this._Str_9559 = _arg_7;
this._Str_21130 = _arg_8;
this._Str_19722 = _arg_9;
this._Str_2797 = _arg_10;
this._Str_5502 = _arg_11;
this._Str_9859 = _arg_12;
this._Str_21393 = _arg_13;
this._message = _arg_14;
this._Str_10679 = _arg_15;
this._Str_15205 = _arg_16;
this._Str_19084 = 0; //getTimer();
}
public get _Str_2869(): number
{
return this._Str_6036;
}
public get state(): number
{
return this._state;
}
public get _Str_2712(): number
{
return this._Str_2629;
}
public get _Str_7437(): number
{
return this._Str_21044;
}
public get issueAgeInMilliseconds(): number
{
return this._issueAgeInMilliseconds;
}
public get priority(): number
{
return this._priority;
}
public get _Str_16842(): number
{
return this._Str_9559;
}
public get _Str_19929(): number
{
return this._Str_21130;
}
public get _Str_19615(): string
{
return this._Str_19722;
}
public get _Str_2662(): number
{
return this._Str_2797;
}
public get _Str_5842(): string
{
return this._Str_5502;
}
public get _Str_5547(): number
{
return this._Str_9859;
}
public get _Str_22164(): string
{
return this._Str_21393;
}
public get message(): string
{
return this._message;
}
public get _Str_20325(): number
{
return this._Str_10679;
}
public get _Str_26050(): _Str_8176[]
{
return this._Str_15205;
}
public dispose(): void
{
if(this.disposed)
{
return;
}
for(const k of this._Str_15205)
{
k.dispose();
}
this._Str_15205 = [];
this._disposed = true;
}
public get disposed(): boolean
{
return this._disposed;
}
public _Str_15885(k: number): string
{
const _local_2: number = (((this._issueAgeInMilliseconds + k) - this._Str_19084) / 1000);
const _local_3: number = (_local_2 / 60);
const _local_4: number = (_local_3 % 60);
const _local_5: number = (_local_3 / 60);
const _local_6: string = (((_local_4 < 10) ? '0' : '') + _local_4);
const _local_7: string = (((_local_5 < 10) ? '0' : '') + _local_5);
return (_local_7 + ':') + _local_6;
}
}

View File

@ -1,138 +0,0 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { _Str_5460 } from './_Str_5460';
import { _Str_2484 } from './_Str_2484';
export class _Str_5018
{
private _Str_12818:string[];
private _Str_14428:string[];
private _issues:_Str_2484[];
private _Str_21327:boolean;
private _Str_20034:boolean;
private _Str_21542:boolean;
private _Str_22205:boolean;
private _Str_22169:boolean;
private _Str_19231:boolean;
private _Str_19156:boolean;
private _disposed: boolean = false;
constructor(wrapper: IMessageDataWrapper)
{
const local2 = new _Str_5460();
this._issues = [];
this._Str_12818 = [];
this._Str_14428= [];
let local3 = wrapper.readInt();
let i = 0;
while(i < local3)
{
if(local2.parse(wrapper))
{
this._issues.push(local2._Str_22192);
}
i++;
}
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
this._Str_12818.push(wrapper.readString());
i++;
}
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
wrapper.readString();
i++;
}
this._Str_21327 = wrapper.readBoolean();
this._Str_20034 = wrapper.readBoolean();
this._Str_21542 = wrapper.readBoolean();
this._Str_22205 = wrapper.readBoolean();
this._Str_22169 = wrapper.readBoolean();
this._Str_19231 = wrapper.readBoolean();
this._Str_19156 = wrapper.readBoolean();
local3 = wrapper.readInt();
i = 0;
while(i < local3)
{
this._Str_14428.push(wrapper.readString());
i++;
}
}
public dispose():void
{
if(this._disposed)
{
return;
}
this._disposed = true;
this._Str_12818 = null;
this._Str_14428 = null;
this._issues = null;
}
public get disposed():boolean
{
return this._disposed;
}
public get _Str_15690():string[]
{
return this._Str_12818;
}
public get _Str_18336():string[]
{
return this._Str_14428;
}
public get issues():_Str_2484[]
{
return this._issues;
}
public get _Str_24070():boolean
{
return this._Str_21327;
}
public get _Str_12765():boolean
{
return this._Str_20034;
}
public get _Str_18465():boolean
{
return this._Str_21542;
}
public get _Str_20397():boolean
{
return this._Str_22205;
}
public get _Str_21242():boolean
{
return this._Str_22169;
}
public get _Str_24851():boolean
{
return this._Str_19231;
}
public get _Str_24333():boolean
{
return this._Str_19156;
}
}

View File

@ -1,12 +1,12 @@
export * from './CallForHelpCategoryData';
export * from './IChatlog';
export * from './IssueInfoMessageParser';
export * from './IssueMessageData';
export * from './ModeratorInitData';
export * from './ModeratorUserInfoData';
export * from './ModtoolRoomChatlogLine';
export * from './ModtoolRoomVisitedData';
export * from './ModtoolUserChatlogParserChatlog';
export * from './ModtoolUserChatlogParserVisit';
export * from './ModtoolUserVisitedRoomsRoom';
export * from './_Str_2484';
export * from './_Str_5018';
export * from './_Str_5460';
export * from './_Str_8176';
export * from './PatternMatchData';