This commit is contained in:
Bill 2021-12-04 16:00:39 -05:00
commit b32d877462
86 changed files with 1796 additions and 61 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,10 +6,10 @@ import { Nitro } from '../../Nitro';
import { INitroCommunicationManager } from '../INitroCommunicationManager';
import { ClientPingEvent } from '../messages/incoming/client/ClientPingEvent';
import { AuthenticatedEvent } from '../messages/incoming/security/AuthenticatedEvent';
import { ClientPongComposer } from '../messages/outgoing/client/ClientPongComposer';
import { ClientReleaseVersionComposer } from '../messages/outgoing/client/ClientReleaseVersionComposer';
import { InfoRetrieveBaseMessageComposer } from '../messages/outgoing/handshake/InfoRetrieveBaseMessageComposer';
import { SecurityTicketComposer } from '../messages/outgoing/handshake/SecurityTicketComposer';
import { ClientHelloMessageComposer } from '../messages/outgoing/handshake/ClientHelloMessageComposer';
import { InfoRetrieveMessageComposer } from '../messages/outgoing/handshake/InfoRetrieveMessageComposer';
import { PongMessageComposer } from '../messages/outgoing/handshake/PongMessageComposer';
import { SSOTicketMessageComposer } from '../messages/outgoing/handshake/SSOTicketMessageComposer';
import { NitroCommunicationDemoEvent } from './NitroCommunicationDemoEvent';
export class NitroCommunicationDemo extends NitroManager
@ -88,7 +88,7 @@ export class NitroCommunicationDemo extends NitroManager
this.startHandshake(connection);
connection.send(new ClientReleaseVersionComposer(null, null, null, null));
connection.send(new ClientHelloMessageComposer(null, null, null, null));
this.tryAuthentication(connection);
}
@ -129,7 +129,7 @@ export class NitroCommunicationDemo extends NitroManager
return;
}
connection.send(new SecurityTicketComposer(this._sso, Nitro.instance.time));
connection.send(new SSOTicketMessageComposer(this._sso, Nitro.instance.time));
}
private onClientPingEvent(event: ClientPingEvent): void
@ -149,7 +149,7 @@ export class NitroCommunicationDemo extends NitroManager
//event.connection.send(new UserHomeRoomComposer(555));
event.connection.send(new InfoRetrieveBaseMessageComposer());
event.connection.send(new InfoRetrieveMessageComposer());
}
public setSSO(sso: string): void
@ -195,7 +195,7 @@ export class NitroCommunicationDemo extends NitroManager
if(!connection) return;
connection.send(new ClientPongComposer());
connection.send(new PongMessageComposer());
}
private dispatchCommunicationDemoEvent(type: string, connection: IConnection): void

View File

@ -14,7 +14,7 @@ export class IncomingHeader
public static PRODUCT_OFFER = 3388;
public static LIMITED_SOLD_OUT = 377;
public static CATALOG_PUBLISHED = 1866;
public static CFH_RESULT_MESSAGE = 934;
public static CFH_RESULT_MESSAGE = 3635;
public static CLIENT_LATENCY = 10;
public static CLIENT_PING = 3928;
public static DESKTOP_CAMPAIGN = 1745;
@ -337,4 +337,30 @@ export class IncomingHeader
public static POLL_OFFER = 3785;
public static QUESTION_ANSWERED = 2589;
public static QUESTION_FINISHED = 1066;
public static CFH_PENDING_CALLS = 1121;
public static GUIDE_ON_DUTY_STATUS = 1548;
public static GUIDE_SESSION_ATTACHED = 1591;
public static GUIDE_SESSION_DETACHED = 138;
public static GUIDE_SESSION_ENDED = 1456;
public static GUIDE_SESSION_ERROR = 673;
public static GUIDE_SESSION_INVITED_TO_GUIDE_ROOM = 219;
public static GUIDE_SESSION_MESSAGE = 841;
public static GUIDE_SESSION_PARTNER_IS_TYPING = 1016;
public static GUIDE_SESSION_REQUESTER_ROOM = 1847;
public static GUIDE_SESSION_STARTED = 3209;
public static GUIDE_TICKET_CREATION_RESULT = 3285;
public static GUIDE_TICKET_RESOLUTION = 2674;
public static GUIDE_REPORTING_STATUS = 3463;
public static HOTEL_MERGE_NAME_CHANGE = 1663;
public static ISSUE_CLOSE_NOTIFICATION = 934;
public static QUIZ_DATA = 2927;
public static QUIZ_RESULTS = 2772;
public static CFH_PENDING_CALLS_DELETED = 77;
public static CFH_REPLY = 3796;
public static CHAT_REVIEW_SESSION_DETACHED = 30;
public static CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE = 735;
public static CHAT_REVIEW_SESSION_RESULTS = 3276;
public static CHAT_REVIEW_SESSION_STARTED = 143;
public static CHAT_REVIEW_SESSION_VOTING_STATUS = 1829;
public static SCR_SEND_KICKBACK_INFO = 3277;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,2 +1,26 @@
export * from './CallForHelpDisabledNotifyMessageEvent';
export * from './CallForHelpPendingCallsDeletedMessageEvent';
export * from './CallForHelpPendingCallsMessageEvent';
export * from './CallForHelpReplyMessageEvent';
export * from './CallForHelpResultMessageEvent';
export * from './ChatReviewSessionDetachedMessageEvent';
export * from './ChatReviewSessionOfferedToGuideMessageEvent';
export * from './ChatReviewSessionResultsMessageEvent';
export * from './ChatReviewSessionStartedMessageEvent';
export * from './ChatReviewSessionVotingStatusMessageEvent';
export * from './GuideOnDutyStatusMessageEvent';
export * from './GuideSessionAttachedMessageEvent';
export * from './GuideSessionDetachedMessageEvent';
export * from './GuideSessionEndedMessageEvent';
export * from './GuideSessionErrorMessageEvent';
export * from './GuideSessionInvitedToGuideRoomMessageEvent';
export * from './GuideSessionMessageMessageEvent';
export * from './GuideSessionPartnerIsTypingMessageEvent';
export * from './GuideSessionRequesterRoomMessageEvent';
export * from './GuideSessionStartedMessageEvent';
export * from './GuideTicketCreationResultMessageEvent';
export * from './GuideTicketResolutionMessageEvent';
export * from './HotelMergeNameChangeEvent';
export * from './IssueCloseNotificationMessageEvent';
export * from './QuizDataMessageEvent';
export * from './QuizResultsMessageEvent';

View File

@ -29,6 +29,7 @@ export * from './moderation';
export * from './mysterybox';
export * from './navigator';
export * from './notifications';
export * from './perk';
export * from './poll';
export * from './quest';
export * from './room';

View File

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

View File

@ -0,0 +1 @@
export * from './PerkAllowancesMessageEvent';

View File

@ -0,0 +1,72 @@
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
export class ScrKickbackData
{
private _currentHcStreak:number;
private _firstSubscriptionDate:string;
private _kickbackPercentage:number;
private _totalCreditsMissed:number;
private _totalCreditsRewarded:number;
private _totalCreditsSpent:number;
private _creditRewardForStreakBonus:number;
private _creditRewardForMonthlySpent:number;
private _timeUntilPayday:number;
constructor(k: IMessageDataWrapper)
{
this._currentHcStreak = k.readInt();
this._firstSubscriptionDate = k.readString();
this._kickbackPercentage = parseFloat(k.readString());
this._totalCreditsMissed = k.readInt();
this._totalCreditsRewarded = k.readInt();
this._totalCreditsSpent = k.readInt();
this._creditRewardForStreakBonus = k.readInt();
this._creditRewardForMonthlySpent = k.readInt();
this._timeUntilPayday = k.readInt();
}
public get currentHcStreak():number
{
return this._currentHcStreak;
}
public get firstSubscriptionDate():string
{
return this._firstSubscriptionDate;
}
public get kickbackPercentage():number
{
return this._kickbackPercentage;
}
public get totalCreditsMissed():number
{
return this._totalCreditsMissed;
}
public get totalCreditsRewarded():number
{
return this._totalCreditsRewarded;
}
public get totalCreditsSpent():number
{
return this._totalCreditsSpent;
}
public get creditRewardForStreakBonus():number
{
return this._creditRewardForStreakBonus;
}
public get creditRewardForMonthlySpent():number
{
return this._creditRewardForMonthlySpent;
}
public get timeUntilPayday():number
{
return this._timeUntilPayday;
}
}

View File

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

View File

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

View File

@ -1,2 +1 @@
export * from './UserPerksEvent';
export * from './UserPermissionsEvent';

View File

@ -7,4 +7,6 @@ export * from './IgnoreResultEvent';
export * from './InClientLinkEvent';
export * from './inventory';
export * from './RespectReceivedEvent';
export * from './ScrKickbackData';
export * from './ScrSendKickbackInfoMessageEvent';
export * from './wardrobe';

View File

@ -376,4 +376,6 @@ export class OutgoingHeader
public static POLL_ANSWER = 3505;
public static POLL_REJECT = 1773;
public static POLL_START = 109;
public static DISCONNECT = 2445;
public static SCR_GET_KICKBACK_INFO = 869;
}

View File

@ -1,2 +0,0 @@
export * from './ClientPongComposer';
export * from './ClientReleaseVersionComposer';

View File

@ -3,9 +3,9 @@ import { ClientDeviceCategoryEnum } from '../../../../../core/communication/conn
import { ClientPlatformEnum } from '../../../../../core/communication/connections/enums/ClientPlatformEnum';
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class ClientReleaseVersionComposer implements IMessageComposer<ConstructorParameters<typeof ClientReleaseVersionComposer>>
export class ClientHelloMessageComposer implements IMessageComposer<ConstructorParameters<typeof ClientHelloMessageComposer>>
{
private _data: ConstructorParameters<typeof ClientReleaseVersionComposer>;
private _data: ConstructorParameters<typeof ClientHelloMessageComposer>;
constructor(releaseVersion: string, type: string, platform: number, category: number)
{

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../..';
export class DisconnectMessageComposer implements IMessageComposer<ConstructorParameters<typeof DisconnectMessageComposer>>
{
private _data: ConstructorParameters<typeof DisconnectMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -1,8 +1,8 @@
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class InfoRetrieveBaseMessageComposer implements IMessageComposer<ConstructorParameters<typeof InfoRetrieveBaseMessageComposer>>
export class InfoRetrieveMessageComposer implements IMessageComposer<ConstructorParameters<typeof InfoRetrieveMessageComposer>>
{
private _data: ConstructorParameters<typeof InfoRetrieveBaseMessageComposer>;
private _data: ConstructorParameters<typeof InfoRetrieveMessageComposer>;
constructor()
{

View File

@ -1,8 +1,8 @@
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class ClientPongComposer implements IMessageComposer<ConstructorParameters<typeof ClientPongComposer>>
export class PongMessageComposer implements IMessageComposer<ConstructorParameters<typeof PongMessageComposer>>
{
private _data: ConstructorParameters<typeof ClientPongComposer>;
private _data: ConstructorParameters<typeof PongMessageComposer>;
constructor()
{

View File

@ -1,8 +1,8 @@
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class SecurityTicketComposer implements IMessageComposer<ConstructorParameters<typeof SecurityTicketComposer>>
export class SSOTicketMessageComposer implements IMessageComposer<ConstructorParameters<typeof SSOTicketMessageComposer>>
{
private _data: ConstructorParameters<typeof SecurityTicketComposer>;
private _data: ConstructorParameters<typeof SSOTicketMessageComposer>;
constructor(ticket: string, time: number)
{

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../..';
export class UniqueIDMessageComposer implements IMessageComposer<ConstructorParameters<typeof UniqueIDMessageComposer>>
{
private _data: ConstructorParameters<typeof UniqueIDMessageComposer>;
constructor(machineId:string, fingerprint:string, flashVersion:string)
{
this._data = [ machineId, fingerprint, flashVersion ];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../..';
export class VersionCheckMessageComposer implements IMessageComposer<ConstructorParameters<typeof VersionCheckMessageComposer>>
{
private _data: ConstructorParameters<typeof VersionCheckMessageComposer>;
constructor(clientID:number, clientURL:string, externalVariablesURL:string)
{
this._data = [clientID, clientURL, externalVariablesURL];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -1,3 +1,8 @@
export * from './AuthenticationMessageComposer';
export * from './InfoRetrieveBaseMessageComposer';
export * from './SecurityTicketComposer';
export * from './ClientHelloMessageComposer';
export * from './DisconnectMessageComposer';
export * from './InfoRetrieveMessageComposer';
export * from './PongMessageComposer';
export * from './SSOTicketMessageComposer';
export * from './UniqueIDMessageComposer';
export * from './VersionCheckMessageComposer';

View File

@ -3,7 +3,6 @@ export * from './avatar';
export * from './camera';
export * from './campaign';
export * from './catalog';
export * from './client';
export * from './competition';
export * from './desktop';
export * from './friendfurni';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class ScrGetKickbackInfoMessageComposer implements IMessageComposer<ConstructorParameters<typeof ScrGetKickbackInfoMessageComposer>>
{
private _data: ConstructorParameters<typeof ScrGetKickbackInfoMessageComposer>;
constructor()
{
this._data = [];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -2,5 +2,6 @@ export * from './ApproveNameMessageComposer';
export * from './CatalogGroupsComposer';
export * from './data';
export * from './inventory';
export * from './ScrGetKickbackInfoMessageComposer';
export * from './settings';
export * from './UserRespectComposer';

View File

@ -0,0 +1,15 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class CallForHelpPendingCallsDeletedMessageParser implements IMessageParser
{
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
return true;
}
}

View File

@ -0,0 +1,47 @@
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class CallForHelpPendingCallsMessageParser implements IMessageParser
{
private _calls: ICall[];
flush(): boolean
{
this._calls = [];
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._calls = [];
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
const callId = wrapper.readString();
const timestamp = wrapper.readString();
const message = wrapper.readString();
this._calls.push({ callId: callId, timeStamp: timestamp, message: message });
}
return true;
}
public get pendingCalls(): ICall[]
{
return this._calls;
}
public get count(): number
{
return this._calls.length;
}
}
export interface ICall
{
callId: string;
timeStamp: string;
message: string;
}

View File

@ -0,0 +1,24 @@
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class CallForHelpReplyMessageParser implements IMessageParser
{
private _message: string;
flush(): boolean
{
this._message = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._message = wrapper.readString();
return true;
}
public get message(): string
{
return this._message;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionDetachedMessageParser implements IMessageParser
{
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
return true;
}
}

View File

@ -0,0 +1,24 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionOfferedToGuideMessageParser implements IMessageParser
{
private _acceptanceTimeout: number;
flush(): boolean
{
this._acceptanceTimeout = -1;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._acceptanceTimeout = wrapper.readInt();
return true;
}
public get acceptanceTimeout(): number
{
return this._acceptanceTimeout;
}
}

View File

@ -0,0 +1,48 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionResultsMessageParser implements IMessageParser
{
private _winningVoteCode: number;
private _ownVoteCode: number;
private _finalStatus: number[];
flush(): boolean
{
this._winningVoteCode = -1;
this._ownVoteCode = -1;
this._finalStatus = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._finalStatus = [];
this._winningVoteCode = wrapper.readInt();
this._ownVoteCode = wrapper.readInt();
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._finalStatus.push(wrapper.readInt());
}
return true;
}
public get winningVoteCode(): number
{
return this._winningVoteCode;
}
public get ownVoteCode(): number
{
return this._ownVoteCode;
}
public get finalStatus(): number[]
{
return this._finalStatus;
}
}

View File

@ -0,0 +1,30 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionStartedMessageParser implements IMessageParser
{
private _votingTimeout: number;
private _chatRecord: string;
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._votingTimeout = wrapper.readInt();
this._chatRecord = wrapper.readString();
return true;
}
public get votingTimeout(): number
{
return this._votingTimeout;
}
public get chatRecord(): string
{
return this._chatRecord;
}
}

View File

@ -0,0 +1,39 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionVotingStatusMessageParser implements IMessageParser
{
public static readonly AWAITING_VOTE = 0;
public static readonly VOTED_OK = 1;
public static readonly VOTED_BAD = 2;
public static readonly VOTED_VERY_BAD = 3;
public static readonly NO_VOTE = 4;
public static readonly FINDING_NEW_VOTER = 5;
private _status:number[];
flush(): boolean
{
this._status = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._status = [];
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._status.push(wrapper.readInt());
}
return true;
}
public get status(): number[]
{
return this._status;
}
}

View File

@ -0,0 +1,51 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideOnDutyStatusMessageParser implements IMessageParser
{
private _onDuty: boolean;
private _guidesOnDuty: number;
private _helpersOnDuty: number;
private _guardiansOnDuty: number;
public flush(): boolean
{
this._onDuty = false;
this._guidesOnDuty = 0;
this._helpersOnDuty = 0;
this._guardiansOnDuty = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._onDuty = wrapper.readBoolean();
this._guidesOnDuty = wrapper.readInt();
this._helpersOnDuty = wrapper.readInt();
this._guardiansOnDuty = wrapper.readInt();
return true;
}
public get onDuty(): boolean
{
return this._onDuty;
}
public get guidesOnDuty(): number
{
return this._guidesOnDuty;
}
public get helpersOnDuty(): number
{
return this._helpersOnDuty;
}
public get guardiansOnDuty(): number
{
return this._guardiansOnDuty;
}
}

View File

@ -0,0 +1,49 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { PendingGuideTicketData } from './common/PendingGuideTicketData';
export class GuideReportingStatusMessageParser implements IMessageParser
{
public static readonly GUIDE_REPORTING_STATUS_OK: number = 0;
public static readonly GUIDE_REPORTING_STATUS_PENDING_TICKET: number = 1;
public static readonly GUIDE_REPORTING_STATUS_ABUSIVE: number = 2;
public static readonly GUIDE_REPORTING_STATUS_REPORTING_TOO_QUICKLY: number = 3;
private _statusCode: number;
private _pendingTicket: PendingGuideTicketData;
public flush(): boolean
{
this._statusCode = 0;
this._pendingTicket = null;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._statusCode = wrapper.readInt();
this._pendingTicket = new PendingGuideTicketData(
wrapper.readInt(),
wrapper.readInt(),
wrapper.readBoolean(),
wrapper.readString(),
wrapper.readString(),
wrapper.readString(),
wrapper.readString()
);
return true;
}
public get statusCode(): number
{
return this._statusCode;
}
public get pendingTicket(): PendingGuideTicketData
{
return this._pendingTicket;
}
}

View File

@ -0,0 +1,51 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionAttachedMessageParser implements IMessageParser
{
private _asGuide: boolean;
private _helpRequestType: number;
private _helpRequestDescription: string;
private _roleSpecificWaitTime: number;
public flush(): boolean
{
this._asGuide = false;
this._helpRequestType = 0;
this._helpRequestDescription = null;
this._roleSpecificWaitTime = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._asGuide = wrapper.readBoolean();
this._helpRequestType = wrapper.readInt();
this._helpRequestDescription = wrapper.readString();
this._roleSpecificWaitTime = wrapper.readInt();
return true;
}
public get asGuide(): boolean
{
return this._asGuide;
}
public get helpRequestType(): number
{
return this._helpRequestType;
}
public get helpRequestDescription(): string
{
return this._helpRequestDescription;
}
public get roleSpecificWaitTime(): number
{
return this._roleSpecificWaitTime;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionDetachedMessageParser implements IMessageParser
{
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
return true;
}
}

View File

@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionEndedMessageParser implements IMessageParser
{
private _endReason: number;
public flush(): boolean
{
this._endReason = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._endReason = wrapper.readInt();
return true;
}
public get endReason(): number
{
return this._endReason;
}
}

View File

@ -0,0 +1,33 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionErrorMessageParser implements IMessageParser
{
public static readonly ERROR_GENERIC: number = 0;
public static readonly ERROR_GUIDES_REJECT: number = 1;
public static readonly ERROR_NOT_ENOUGH_GUIDES: number = 2;
public static readonly ERROR_NOT_ENOUGH_VOTES: number = 3;
public static readonly ERROR_NO_CHATLOG_FOUND: number = 4;
private _errorCode: number;
public flush(): boolean
{
this._errorCode = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._errorCode = wrapper.readInt();
return true;
}
public get errorCode(): number
{
return this._errorCode;
}
}

View File

@ -0,0 +1,35 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionInvitedToGuideRoomMessageParser implements IMessageParser
{
private _roomId: number;
private _roomName: string;
public flush(): boolean
{
this._roomId = 0;
this._roomName = null;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._roomId = wrapper.readInt();
this._roomName = wrapper.readString();
return true;
}
public get roomId(): number
{
return this._roomId;
}
public get roomName(): string
{
return this._roomName;
}
}

View File

@ -0,0 +1,35 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionMessageMessageParser implements IMessageParser
{
private _chatMessage: string;
private _senderId: number;
public flush(): boolean
{
this._chatMessage = null;
this._senderId = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._chatMessage = wrapper.readString();
this._senderId = wrapper.readInt();
return true;
}
public get chatMessage(): string
{
return this._chatMessage;
}
public get senderId(): number
{
return this._senderId;
}
}

View File

@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionPartnerIsTypingMessageParser implements IMessageParser
{
private _isTyping: boolean;
public flush(): boolean
{
this._isTyping = false;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._isTyping = wrapper.readBoolean();
return true;
}
public get isTyping(): boolean
{
return this._isTyping;
}
}

View File

@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionRequesterRoomMessageParser implements IMessageParser
{
private _requesterRoomId: number;
public flush(): boolean
{
this._requesterRoomId = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._requesterRoomId = wrapper.readInt();
return true;
}
public get requesterRoomId(): number
{
return this._requesterRoomId;
}
}

View File

@ -0,0 +1,67 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideSessionStartedMessageParser implements IMessageParser
{
private _requesterUserId: number;
private _requesterName: string;
private _requesterFigure: string;
private _guideUserId: number;
private _guideName: string;
private _guideFigure: string;
public flush(): boolean
{
this._requesterUserId = 0;
this._requesterName = null;
this._requesterFigure = null;
this._guideUserId = 0;
this._guideName = null;
this._guideFigure = null;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._requesterUserId = wrapper.readInt();
this._requesterName = wrapper.readString();
this._requesterFigure = wrapper.readString();
this._guideUserId = wrapper.readInt();
this._guideName = wrapper.readString();
this._guideFigure = wrapper.readString();
return true;
}
public get requesterUserId(): number
{
return this._requesterUserId;
}
public get requesterName(): string
{
return this._requesterName;
}
public get requesterFigure(): string
{
return this._requesterFigure;
}
public get guideUserId(): number
{
return this._guideUserId;
}
public get guideName(): string
{
return this._guideName;
}
public get guideFigure(): string
{
return this._guideFigure;
}
}

View File

@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideTicketCreationResultMessageParser implements IMessageParser
{
public static readonly CREATION_RESULT_OK: number = 0;
public static readonly CREATION_RESULT_UNABLE_TO_REPORT: number = 1;
public static readonly CREATION_RESULT_NO_CHATLOG_FOUND: number = 2;
public static readonly CREATION_RESULT_BULLY_ALREADY_REPORTED: number = 3;
private _result: number;
public flush(): boolean
{
this._result = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._result = wrapper.readInt();
return true;
}
public get result(): number
{
return this._result;
}
}

View File

@ -0,0 +1,31 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class GuideTicketResolutionMessageParser implements IMessageParser
{
public static readonly RESOLUTION_GUARDIANS_TOOK_ACTION: number = 0;
public static readonly RESOLUTION_FORWARDED_TO_MODERATORS: number = 1;
public static readonly RESOLUTION_REPORTER_IS_ABUSIVE: number = 2;
private _resolution: number;
public flush(): boolean
{
this._resolution = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._resolution = wrapper.readInt();
return true;
}
public get resolution(): number
{
return this._resolution;
}
}

View File

@ -1,6 +1,6 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../core';
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class UserPerksParser implements IMessageParser
export class HotelMergeNameChangeParser implements IMessageParser
{
public flush(): boolean
{

View File

@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class IssueCloseNotificationMessageParser implements IMessageParser
{
private _closeReason: number;
public flush(): boolean
{
this._closeReason = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._closeReason = wrapper.readInt();
return true;
}
public get closeReason(): number
{
return this._closeReason;
}
}

View File

@ -0,0 +1,40 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class QuizDataMessageParser implements IMessageParser
{
private _quizCode: string;
private _questionIds: number[];
public flush(): boolean
{
this._quizCode = null;
this._questionIds = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._quizCode = wrapper.readString();
const size = wrapper.readInt();
this._questionIds = [];
for(let i = 0; i < size; i++) this._questionIds.push(wrapper.readInt());
return true;
}
public get quizCode(): string
{
return this._quizCode;
}
public get questionIds(): number[]
{
return this._questionIds;
}
}

View File

@ -0,0 +1,40 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class QuizResultsMessageParser implements IMessageParser
{
private _quizCode: string;
private _questionIdsForWrongAnswers: number[];
public flush(): boolean
{
this._quizCode = null;
this._questionIdsForWrongAnswers = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._quizCode = wrapper.readString();
const size = wrapper.readInt();
this._questionIdsForWrongAnswers = [];
for(let i = 0; i < size; i++) this._questionIdsForWrongAnswers.push(wrapper.readInt());
return true;
}
public get quizCode(): string
{
return this._quizCode;
}
public get questionIdsForWrongAnswers(): number[]
{
return this._questionIdsForWrongAnswers;
}
}

View File

@ -0,0 +1,91 @@
export class PendingGuideTicketData
{
private _type: number;
private _secondsAgo: number;
private _isGuide: boolean;
private _otherPartyName: string;
private _otherPartyFigure: string;
private _description: string;
private _roomName: string;
constructor(type: number, secondsAgo: number, isGuide: boolean, otherPartyName: string, otherPartyFigure: string, description: string, roomName: string)
{
this._type = type;
this._secondsAgo = secondsAgo;
this._isGuide = isGuide;
this._otherPartyName = otherPartyName;
this._otherPartyFigure = otherPartyFigure;
this._description = description;
this._roomName = roomName;
}
public get type(): number
{
return this._type;
}
public set type(value: number)
{
this._type = value;
}
public get secondsAgo(): number
{
return this._secondsAgo;
}
public set secondsAgo(value: number)
{
this._secondsAgo = value;
}
public get isGuide(): boolean
{
return this._isGuide;
}
public set isGuide(value: boolean)
{
this._isGuide = value;
}
public get otherPartyName(): string
{
return this._otherPartyName;
}
public set otherPartyName(value: string)
{
this._otherPartyName = value;
}
public get otherPartyFigure(): string
{
return this._otherPartyFigure;
}
public set otherPartyFigure(value: string)
{
this._otherPartyFigure = value;
}
public get description(): string
{
return this._description;
}
public set description(value: string)
{
this._description = value;
}
public get roomName(): string
{
return this._roomName;
}
public set roomName(value: string)
{
this._roomName = value;
}
}

View File

@ -1,2 +1,27 @@
export * from './CallForHelpDisabledNotifyMessageParser';
export * from './CallForHelpPendingCallsDeletedMessageParser';
export * from './CallForHelpPendingCallsMessageParser';
export * from './CallForHelpReplyMessageParser';
export * from './CallForHelpResultMessageParser';
export * from './ChatReviewSessionDetachedMessageParser';
export * from './ChatReviewSessionOfferedToGuideMessageParser';
export * from './ChatReviewSessionResultsMessageParser';
export * from './ChatReviewSessionStartedMessageParser';
export * from './ChatReviewSessionVotingStatusMessageParser';
export * from './GuideOnDutyStatusMessageParser';
export * from './GuideReportingStatusMessageParser';
export * from './GuideSessionAttachedMessageParser';
export * from './GuideSessionDetachedMessageParser';
export * from './GuideSessionEndedMessageParser';
export * from './GuideSessionErrorMessageParser';
export * from './GuideSessionInvitedToGuideRoomMessageParser';
export * from './GuideSessionMessageMessageParser';
export * from './GuideSessionPartnerIsTypingMessageParser';
export * from './GuideSessionRequesterRoomMessageParser';
export * from './GuideSessionStartedMessageParser';
export * from './GuideTicketCreationResultMessageParser';
export * from './GuideTicketResolutionMessageParser';
export * from './HotelMergeNameChangeParser';
export * from './IssueCloseNotificationMessageParser';
export * from './QuizDataMessageParser';
export * from './QuizResultsMessageParser';

View File

@ -21,6 +21,7 @@ export * from './moderation';
export * from './mysterybox';
export * from './navigator';
export * from './notifications';
export * from './perk';
export * from './poll';
export * from './quest';
export * from './room';

View File

@ -0,0 +1,52 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { PerkData } from './common/PerkData';
export class PerkAllowancesMessageParser implements IMessageParser
{
private _perks: PerkData[];
public flush(): boolean
{
this._perks = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._perks = [];
const size: number = wrapper.readInt();
for(let i = 0; i < size; i++) this._perks.push(new PerkData(
wrapper.readString(),
wrapper.readString(),
wrapper.readBoolean()
));
return true;
}
public isAllowed(perkCode: string): boolean
{
let allowed = false;
for(const perk of this._perks)
{
if(perk.code === perkCode)
{
allowed = perk.isAllowed;
break;
}
}
return allowed;
}
public get perks(): PerkData[]
{
return this._perks;
}
}

View File

@ -0,0 +1,28 @@
export class PerkData
{
private _code: string;
private _errorMessage: string;
private _isAllowed: boolean;
constructor(code: string, errorMessage: string, isAllowed: boolean)
{
this._code = code;
this._errorMessage = errorMessage;
this._isAllowed = isAllowed;
}
public get code(): string
{
return this._code;
}
public get errorMessage(): string
{
return this._errorMessage;
}
public get isAllowed(): boolean
{
return this._isAllowed;
}
}

View File

@ -0,0 +1,15 @@
export class PerkEnum
{
public static USE_GUIDE_TOOL: string = 'USE_GUIDE_TOOL';
public static GIVE_GUIDE_TOUR: string = 'GIVE_GUIDE_TOUR';
public static JUDGE_CHAT_REVIEWS: string = 'JUDGE_CHAT_REVIEWS';
public static VOTE_IN_COMPETITIONS: string = 'VOTE_IN_COMPETITIONS';
public static CALL_ON_HELPERS: string = 'CALL_ON_HELPERS';
public static CITIZEN: string = 'CITIZEN';
public static TRADE: string = 'TRADE';
public static HEIGHTMAP_EDITOR_BETA: string = 'HEIGHTMAP_EDITOR_BETA';
public static BUILDER_AT_WORK: string = 'BUILDER_AT_WORK';
public static NAVIGATOR_ROOM_THUMBNAIL_CAMERA: string = 'NAVIGATOR_ROOM_THUMBNAIL_CAMERA';
public static CAMERA: string = 'CAMERA';
public static MOUSE_ZOOM: string = 'MOUSE_ZOOM';
}

View File

@ -0,0 +1,2 @@
export * from './PerkData';
export * from './PerkEnum';

View File

@ -0,0 +1,2 @@
export * from './common';
export * from './PerkAllowancesMessageParser';

View File

@ -0,0 +1,24 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
import { ScrKickbackData } from '../../incoming/user/ScrKickbackData';
export class ScrSendKickbackInfoMessageParser implements IMessageParser
{
private _data: ScrKickbackData;
flush(): boolean
{
this._data = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._data = new ScrKickbackData(wrapper);
return true;
}
public get data():ScrKickbackData
{
return this._data;
}
}

View File

@ -1,2 +1 @@
export * from './UserPerksParser';
export * from './UserPermissionsParser';

View File

@ -8,4 +8,5 @@ export * from './InClientLinkParser';
export * from './inventory';
export * from './RespectReceivedParser';
export * from './RoomEntryData';
export * from './ScrSendKickbackInfoMessageParser';
export * from './wardrobe';