Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFreezeGameActive.java

84 lines
2.2 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.items.interactions.wired.conditions;
import com.eu.habbo.habbohotel.games.Game;
2019-03-18 02:22:00 +01:00
import com.eu.habbo.habbohotel.games.GameState;
2018-07-06 15:30:00 +02:00
import com.eu.habbo.habbohotel.games.freeze.FreezeGame;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.wired.WiredConditionType;
import com.eu.habbo.messages.ClientMessage;
import com.eu.habbo.messages.ServerMessage;
import java.sql.ResultSet;
import java.sql.SQLException;
public class WiredConditionNotFreezeGameActive extends InteractionWiredCondition
{
public static final WiredConditionType type = WiredConditionType.NOT_ACTOR_IN_GROUP;
public WiredConditionNotFreezeGameActive(ResultSet set, Item baseItem) throws SQLException
{
super(set, baseItem);
}
public WiredConditionNotFreezeGameActive(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells)
{
super(id, userId, item, extradata, limitedStack, limitedSells);
}
@Override
public WiredConditionType getType()
{
return type;
}
@Override
public void serializeWiredData(ServerMessage message, Room room)
{
message.appendBoolean(false);
message.appendInt(5);
message.appendInt(0);
message.appendInt(this.getBaseItem().getSpriteId());
message.appendInt(this.getId());
message.appendString("");
message.appendInt(0);
message.appendInt(0);
message.appendInt(this.getType().code);
message.appendInt(0);
message.appendInt(0);
}
@Override
public boolean saveData(ClientMessage packet)
{
return true;
}
@Override
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff)
{
Game game = room.getGame(FreezeGame.class);
2019-03-18 02:22:00 +01:00
return game == null || !game.state.equals(GameState.RUNNING);
2018-07-06 15:30:00 +02:00
}
@Override
2019-03-18 02:22:00 +01:00
public String getWiredData()
2018-07-06 15:30:00 +02:00
{
return "";
}
@Override
public void loadWiredData(ResultSet set, Room room) throws SQLException
{
}
@Override
public void onPickUp()
{
}
}