I'd like to start by saying that nextpeer's customer support has been top-notch and very responsive. After a few days of trying to figure out what's going on, I am at a complete standstill. I am using the libgdx plugin with nextpeer and everything is working great except messages. For some reason I can receive synchronized events, start and stop events, but reliable or unreliable messages are just not working. I have a near identical implementation to the superjumper example and messages are working with the example, but in my project I am getting a "must implement or override a supertype method" error ONLY on the onReceiveTournamentCustomMessage() method if I try to override it in my AndroidTournaments class, but it never gets called if I don't override it and it gives a warning that it is never used locally, which makes no sense because the NextpeerListener is confirmed working with synchronized events and I am using an exact copy of the superjumper example nextpeer integration. Has anybody run into this before with a nextpeer integration? It has to be something simple, somebody get me on the right track... Thanks!
private NextpeerListener _listener = new NextpeerListener() {
//Works perfectly every time
public void onReceiveSynchronizedEvent(String name,
NextpeerSynchronizedEventFire fireReason) {
if (TextUtils.equals(name, "SYNC_EVENT")) {
System.out.println("RECEIVED_SYNC!!!");
// TODO: Start the game!
}
}
//Never gets called if not overriden and error if overriden??????????????????????????
//@Override
public void onReceiveTournamentCustomMessage(
NextpeerTournamentCustomMessage message) {
System.out.println("RECEIVED_MESSAGE");
}
@Override
public void onTournamentStart(NextpeerTournamentStartData startData) {
if (callback != null) {
callback.onTournamentStart(startData.tournamentRandomSeed);
}
}
@Override
public void onTournamentEnd(NextpeerTournamentEndData endData) {
if (callback != null) {
callback.onTournamentEnd();
}
}
};
The current Nextpeer libGDX plugin has 2 classes that called NextpeerTournamentCustomMessage in different packages. That's the reason you could not override that class. 1) com.nextpeer.android.NextpeerTournamentCustomMessage 2) com.nextpeer.libgdx.NextpeerTournamentCustomMessage Make sure to import the right one (com.nextpeer.android.NextpeerTournamentCustomMessage).
Go Nextpeer :)