2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.messages.outgoing.users;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
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 UserCurrencyComposer extends MessageComposer {
|
2018-07-06 15:30:00 +02:00
|
|
|
private final Habbo habbo;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public UserCurrencyComposer(Habbo habbo) {
|
2018-07-06 15:30:00 +02:00
|
|
|
this.habbo = habbo;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 20:14:53 +02:00
|
|
|
public ServerMessage compose() {
|
2018-07-06 15:30:00 +02:00
|
|
|
this.response.init(Outgoing.UserCurrencyComposer);
|
|
|
|
String[] pointsTypes = Emulator.getConfig().getValue("seasonal.types").split(";");
|
|
|
|
this.response.appendInt(pointsTypes.length);
|
2019-05-26 20:14:53 +02:00
|
|
|
for (String s : pointsTypes) {
|
2019-03-18 02:22:00 +01:00
|
|
|
int type;
|
2019-05-26 20:14:53 +02:00
|
|
|
try {
|
2018-07-06 15:30:00 +02:00
|
|
|
type = Integer.valueOf(s);
|
2019-05-26 20:14:53 +02:00
|
|
|
} catch (Exception e) {
|
2018-07-06 15:30:00 +02:00
|
|
|
Emulator.getLogging().logErrorLine(e);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.response.appendInt(type);
|
|
|
|
this.response.appendInt(this.habbo.getHabboInfo().getCurrencyAmount(type));
|
|
|
|
}
|
|
|
|
return this.response;
|
|
|
|
}
|
|
|
|
}
|