EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.81k stars 415 forks source link

Lack of error messages #123

Open crehop opened 7 years ago

crehop commented 7 years ago

When sending custom packets, if you don't have a default constructor for one of the registered classes and attempt to send, no error message is displayed on client or server, yet the packet is not received. additionally if the packet isn't received for other reasons, no error is thrown either.. you're left just guessing whats wrong.. please add error messages to these types of events. Thank you.

crehop commented 7 years ago

Example

public class Packet2QueueMessage { public Packet2QueueMessage(int i){ } }

would not be recognized,would not be sent, and no error message would be thrown.

public class Packet2QueueMessage { public Packet2QueueMessage(){} public Packet2QueueMessage(int i){ } }

would be recognized and sent

crehop commented 7 years ago

Additionally if your classes don't match exactly, they wont send, and don't throw error messages.

Example

Server

  public enum Reminder{
      DAILY_UNTIL_SIGNED("DAILY"),
      WEEKLY_UNTIL_SIGNED("WEEKLY"),
      NONE_SET("");
      private String value;

      Reminder(String value) {
        this.value = value;
      }
}

Client

 public enum Reminder{
      DAILY_UNTIL_SIGNED("DAILY"),
      WEEKLY_UNTIL_SIGNED("WEEKLY"),
      private String value;

      Reminder(String value) {
        this.value = value;
      }
}

Packet will work as normal as long as NONE_SET isn't chosen, in which case no error will be thrown and the packet just wont send.