Feature - Rentable Spaces fix error packet (#102)

This commit is contained in:
object 2023-04-30 01:28:01 +02:00 committed by GitHub
parent 9efb90b930
commit becf87b668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -2,6 +2,17 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class RentableSpaceStatusMessageParser implements IMessageParser export class RentableSpaceStatusMessageParser implements IMessageParser
{ {
public static readonly SPACE_ALREADY_RENTED = 100;
public static readonly SPACE_EXTEND_NOT_RENTED = 101;
public static readonly SPACE_EXTEND_NOT_RENTED_BY_YOU = 102;
public static readonly CAN_RENT_ONLY_ONE_SPACE = 103;
public static readonly NOT_ENOUGH_CREDITS = 200;
public static readonly NOT_ENOUGH_PIXELS = 201;
public static readonly CANT_RENT_NO_PERMISSION = 202;
public static readonly CANT_RENT_NO_HABBO_CLUB = 203;
public static readonly CANT_RENT = 300;
public static readonly CANT_RENT_GENERIC = 400;
private _rented: boolean; private _rented: boolean;
private _renterId: number; private _renterId: number;
private _renterName: string; private _renterName: string;

View File

@ -1,4 +1,4 @@
import { AdvancedMap, RoomObjectVariable, RoomWidgetEnum } from '../../../../../api'; import { RoomObjectVariable, RoomWidgetEnum } from '../../../../../api';
import { RoomObjectDataRequestEvent } from '../../../../../events'; import { RoomObjectDataRequestEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic'; import { FurnitureLogic } from './FurnitureLogic';
@ -24,7 +24,7 @@ export class FurnitureRentableSpaceLogic extends FurnitureLogic
this.eventDispatcher.dispatchEvent(new RoomObjectDataRequestEvent(RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID, this.object)); this.eventDispatcher.dispatchEvent(new RoomObjectDataRequestEvent(RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID, this.object));
} }
const renterId = this.object.model.getValue<AdvancedMap<string, string>>(RoomObjectVariable.FURNITURE_DATA).getValue('renterId'); const renterId = this.object.model.getValue<string>(RoomObjectVariable.FURNITURE_DATA)['renterId'];
const userId = this.object.model.getValue<number>(RoomObjectVariable.SESSION_CURRENT_USER_ID); const userId = this.object.model.getValue<number>(RoomObjectVariable.SESSION_CURRENT_USER_ID);
if(renterId) if(renterId)