Пример #1
0
 /**
  * Helper method; gets the id of a packet from its name.
  *
  * @param name The name of the packet.
  * @return The id of the packet or <code>-1</code> if no packet exists by the provided name.
  */
 public int getId(String name) {
   PacketMetaData data = get(name);
   if (data == null) {
     return -1;
   }
   return data.getId();
 }
Пример #2
0
 /**
  * Adds a packet to the meta data list.
  *
  * @param data The packet meta data.
  */
 public void add(PacketMetaData data) {
   meta.put(data.getId(), data);
 }