package net.cobem.grizzly.communication.events.rooms;

import net.cobem.grizzly.communication.EventRequest;
import net.cobem.grizzly.communication.EventResponse;
import net.cobem.grizzly.communication.GameEvent;
import net.cobem.grizzly.communication.composers.rooms.SendRoomUserRightsComposer;
import net.cobem.grizzly.habbohotel.rooms.Room;
import net.cobem.grizzly.habbohotel.sessions.Session;

public class CustomizeRoomEvent implements GameEvent {
    @Override
    public void compose(Session Session, EventRequest Request) {
        Room Room = Session.getActor().CurrentRoom;

        EventResponse Message = new EventResponse();

        Message.Initialize(3975);
        /*
        this.GetResponse().AppendInt32(room.RoomId);
        this.GetResponse().AppendString(room.Name);
        this.GetResponse().AppendString(room.Description);
        this.GetResponse().AppendInt32(room.State);
        this.GetResponse().AppendInt32(room.Category);
        this.GetResponse().AppendInt32(room.UsersMax);
        this.GetResponse().AppendInt32(((room.RoomData.Model.MapSizeX * room.RoomData.Model.MapSizeY) > 100) ? 50 : 0x19);
        this.GetResponse().AppendInt32(room.TagCount); */

        Message.addInt(Room.ID);
        Message.addString(Room.Title);
        Message.addString(Room.Description);
        Message.addInt(Room.State);
        Message.addInt(0); //category
        Message.addInt(50); //user max
        Message.addInt(50); //???
        Message.addInt(0); //tag count
        Message.addInt(Room.getRightHolders().size());
        Message.addInt(1); //pets
        Message.addInt(0); //pets eating
        Message.addInt(0); //ghost
        Message.addInt(0); //hide wall
        Message.addInt(1);
        Message.addInt(1);

        Session.sendResponse(Message);

        Session.sendResponse(SendRoomUserRightsComposer.compose(Room));
    }
}
