简体   繁体   English

Nextpeer onReceiveTournamentCustomMessage错误Android

[英]Nextpeer onReceiveTournamentCustomMessage Error Android

I'd like to start by saying that nextpeer's customer support has been top-notch and very responsive. 首先,我要说,nextpeer的客户支持一直是一流的,并且响应迅速。 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. 我正在将libgdx插件与nextpeer一起使用,除消息外,其他所有东西都运行良好。 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. 我有一个与superjumper示例几乎相同的实现,并且消息正在与该示例一起工作,但是在我的项目中,如果我尝试在onReceiveTournamentCustomMessage()方法上重写它,则只会收到“必须实现或重写超类型方法”错误。我的AndroidTournaments类,但是如果我不重写它,它将永远不会被调用,并且会发出警告,表明它永远不会在本地使用,这是没有意义的,因为已确认NextpeerListener已处理同步事件,并且我正在使用超级跳跃者示例nextpeer集成。 Has anybody run into this before with a nextpeer integration? 之前有人进行过nextpeer集成吗? 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. 当前的Nextpeer libGDX插件在不同的程序包中有2个名为NextpeerTournamentCustomMessage的类。 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). 1)com.nextpeer.android.NextpeerTournamentCustomMessage 2)com.nextpeer.libgdx.NextpeerTournamentCustomMessage确保导入正确的一个(com.nextpeer.android.NextpeerTournamentCustomMessage)。

Go Nextpeer :) 去Nextpeer :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM