Exemplo n.º 1
0
  @Override
  public void ParseIn(Connection Main, Server Environment) {
    Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom);

    if (Room == null) {
      return;
    }

    int index = Main.DecodeInt();
    TraxSong Song2 = Room.TraxPlaylist.PlaylistByIndex.get(index);
    Main.AddItem(Song2.ItemId, Integer.toString(Song2.SongId), Song2.BaseItem, true);
    Room.TraxPlaylist.PlaylistByIndex.remove(index);

    Environment.InitPacket(333, Main.ClientMessage);
    Environment.Append(Main.Data.SongInInventory.size(), Main.ClientMessage);
    for (int Key : Main.Data.SongInInventory.keySet()) {
      int Value = Main.Data.SongInInventory.get(Key);
      Environment.Append(Key, Main.ClientMessage);
      Environment.Append(Value, Main.ClientMessage);
    }
    Environment.EndPacket(Main.Socket, Main.ClientMessage);

    Environment.InitPacket(334, Main.ClientMessage);
    Environment.Append(0, Main.ClientMessage);
    Environment.Append(Room.TraxPlaylist.PlaylistByIndex.size(), Main.ClientMessage);
    int count = 0;
    for (TraxSong Song : Room.TraxPlaylist.PlaylistByIndex) {
      Environment.Append(count++, Main.ClientMessage);
      Environment.Append(Song.SongId, Main.ClientMessage);
    }
    Environment.EndPacket(Main.Socket, Main.ClientMessage);
  }
Exemplo n.º 2
0
  @Override
  public void ParseIn(Connection Main, Server Environment) {
    Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom);

    if (Room == null) {
      return;
    }

    Main.Data.BadgesSelected.clear();

    for (int i = 0; i < SLOTS; i++) {
      int Slot = Main.DecodeInt();

      Badge badge = Main.GetBadge(Main.DecodeString());
      if (badge != null) {
        badge.Slot = Slot;
        Main.Data.BadgesSelected.add(badge);
      }
    }

    ServerMessage Message = new ServerMessage();
    Environment.InitPacket(228, Message);
    Environment.Append(Main.Data.Id, Message);
    Environment.Append(Main.Data.BadgesSelected.size(), Message);
    for (Badge Badge : Main.Data.BadgesSelected) {
      Environment.Append(Badge.Slot, Message);
      Environment.Append(Badge.Code, Message);
    }
    Room.SendMessage(Message);
  }
Exemplo n.º 3
0
  @Override
  public void ParseIn(Connection Main, Server Environment) {
    int RoomId = Main.DecodeInt();

    Collection<Integer> l = new ArrayList<Integer>();
    l.add(RoomId);
    Main.Data.Favorite_Rooms.removeAll(l);

    Environment.InitPacket(459, Main.ClientMessage);
    Environment.Append(RoomId, Main.ClientMessage);
    Environment.Append(false, Main.ClientMessage);
    Environment.EndPacket(Main.Socket, Main.ClientMessage);
  }
Exemplo n.º 4
0
  @Override
  public void ParseIn(Connection Main, Server Environment) {
    if (!Main.Data.IsStaff()) {
      return;
    }

    int RoomId = Main.DecodeInt();

    Room Room = Environment.RoomManager.GetRoom(RoomId);
    if (Room == null) return;

    Environment.InitPacket(538, Main.ClientMessage);
    Environment.Append(Room.Id, Main.ClientMessage);
    Environment.Append(Room.UsersNow, Main.ClientMessage);

    boolean OwnerInRoom = false;
    Player Owner = Room.Environment.ClientManager.GetClient(Room.OwnerId);
    if (Owner != null) {
      if ((Owner.Flags & Server.plrOnline) == Server.plrOnline) // Is Online?
      {
        OwnerInRoom = (Owner.CurrentRoom == Room.Id);
      }
    }
    Environment.Append(OwnerInRoom, Main.ClientMessage);
    Environment.Append(Room.OwnerId, Main.ClientMessage);
    Environment.Append(Room.Owner, Main.ClientMessage);
    Environment.Append(Room.Id, Main.ClientMessage);
    Environment.Append(Room.Name, Main.ClientMessage);
    Environment.Append(Room.Description, Main.ClientMessage);
    Environment.Append(Room.Tags.size(), Main.ClientMessage);
    for (String Tag : Room.Tags) {
      Environment.Append(Tag, Main.ClientMessage);
    }
    if (Room.Event != null) {
      Environment.Append(true, Main.ClientMessage);
      Environment.Append(Room.Event.Name, Main.ClientMessage);
      Environment.Append(Room.Event.Description, Main.ClientMessage);
      Environment.Append(Room.Event.Tags.size(), Main.ClientMessage);
      for (String Tag : Room.Event.Tags) {
        Environment.Append(Tag, Main.ClientMessage);
      }
    } else {
      Environment.Append(false, Main.ClientMessage);
    }
    Environment.EndPacket(Main.Socket, Main.ClientMessage);
  }