added srckickback packet

This commit is contained in:
dank074 2021-12-04 13:53:44 -06:00
parent 3361a9b98e
commit 43fb43a2fa
7 changed files with 118 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -362,4 +362,5 @@ export class IncomingHeader
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,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

@ -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

@ -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

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