Arcturus-Community/src/main/java/com/eu/habbo/messages/outgoing/catalog/PurchaseOKComposer.java

44 lines
1.4 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.messages.outgoing.catalog;
import com.eu.habbo.habbohotel.catalog.CatalogItem;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
2019-05-26 20:14:53 +02:00
public class PurchaseOKComposer extends MessageComposer {
2018-07-06 15:30:00 +02:00
private final CatalogItem catalogItem;
2019-05-26 20:14:53 +02:00
public PurchaseOKComposer(CatalogItem catalogItem) {
2018-07-06 15:30:00 +02:00
this.catalogItem = catalogItem;
}
2019-05-26 20:14:53 +02:00
public PurchaseOKComposer() {
2018-07-06 15:30:00 +02:00
this.catalogItem = null;
}
@Override
2019-05-26 20:14:53 +02:00
public ServerMessage compose() {
2018-07-06 15:30:00 +02:00
this.response.init(Outgoing.PurchaseOKComposer);
2019-05-26 20:14:53 +02:00
if (this.catalogItem != null) {
2018-07-06 15:30:00 +02:00
this.catalogItem.serialize(this.response);
2019-05-26 20:14:53 +02:00
} else {
2018-07-06 15:30:00 +02:00
this.response.appendInt(0);
this.response.appendString("");
this.response.appendBoolean(false);
this.response.appendInt(0);
this.response.appendInt(0);
this.response.appendInt(0);
this.response.appendBoolean(true);
this.response.appendInt(1);
this.response.appendString("s");
this.response.appendInt(0);
this.response.appendString("");
this.response.appendInt(1);
this.response.appendInt(0);
this.response.appendString("");
this.response.appendInt(1);
}
return this.response;
}
}