I'm trying to send objects using Kryonet. For most objects it works fine, but for my own Vector implementation it crashes. The class is registered on both sides. It contains an empty constructor and all variables are decalred as public.
public strictfp class StrictVector2f implements StrictVector
{
public double x;
public double y;
public StrictVector2f()
{
}
public StrictVector2f(double x, double y)
{
this.x = x;
this.y = y;
}
public StrictVector2f(StrictVector2f src)
{
this.x = src.x;
this.y = src.y;
}
public StrictVector2f(Vector2f src)
{
this.x = src.x;
this.y = src.y;
}
public StrictVector2f add(StrictVector2f r)
{
return new StrictVector2f(this.x + r.x, this.y + r.y);
}
public StrictVector2f sub(StrictVector2f r)
{
return new StrictVector2f(this.x - r.x, this.y - r.y);
}
@Override
public String toString()
{
return "StrictVector2f: [" + x + "|" + y + "]";
}
}
No error is given when I set the log level to TRACE. The application just calls the disconnected(....) method. If I remove strictfp from the class definition it still doesn't work.
The problem only occurs when I reference a StrictVector2f in another object and try to send that one. Sending only a StrictVector2f works perfectly.