Sending packet, receiving a different one

I’m trying to send data from my client to the server. What I actually send is this class:



[java]

package de.skipnet.lib.network.messages;



import com.jme3.math.Vector3f;

import com.jme3.network.AbstractMessage;

import com.jme3.network.serializing.Serializable;



@Serializable

public class MovementAction extends AbstractMessage{

public int pid;

public Vector3f point;



public MovementAction() { }



public MovementAction(int pid, Vector3f point) {

this.pid = pid;

this.point = point;

}

}

[/java]



This packet is the only one that is sent. For debugging purposes, I disabled every other packet.

Now it gets weird: The server claims to receive a totally different packet:



[java]

package de.skipnet.lib.network.messages;



import com.jme3.network.AbstractMessage;

import com.jme3.network.serializing.Serializable;



@Serializable

public class RemoveClient extends AbstractMessage {

public int pid;



public RemoveClient() {}



public RemoveClient(int pid) {

this.pid = pid;

}

}

[/java]



When the MovementAction packet is sent, the server receives a RemoveClient packet … :frowning:

I really don’t know where this comes from, could be some spiderMonkey bug?



Greets

gabs



EDIT: Nevermind, it has randomly stopped working as it has randomly started to work again :slight_smile:

Sounds like you don’t register your message classes from a single shared static utility method… ie: that it’s possible for the client and server to register messages in a different order which is super-duper bad.



Either that, or you didn’t do a clean build sometime as you were playing with adding and removing them.