mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-09-19 22:44:17 +02:00
40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
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;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class UserCurrencyComposer extends MessageComposer {
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(UserCurrencyComposer.class);
|
|
|
|
private final Habbo habbo;
|
|
|
|
public UserCurrencyComposer(Habbo habbo) {
|
|
this.habbo = habbo;
|
|
}
|
|
|
|
@Override
|
|
public ServerMessage compose() {
|
|
this.response.init(Outgoing.UserCurrencyComposer);
|
|
String[] pointsTypes = Emulator.getConfig().getValue("seasonal.types").split(";");
|
|
this.response.appendInt(pointsTypes.length);
|
|
for (String s : pointsTypes) {
|
|
int type;
|
|
try {
|
|
type = Integer.valueOf(s);
|
|
} catch (Exception e) {
|
|
LOGGER.error("Caught exception", e);
|
|
return null;
|
|
}
|
|
|
|
this.response.appendInt(type);
|
|
this.response.appendInt(this.habbo.getHabboInfo().getCurrencyAmount(type));
|
|
}
|
|
return this.response;
|
|
}
|
|
}
|