Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个包含玩家(玩家)的 ArrayList 的游戏服务器。但是,据我所知,Kryonet 无法将带有构造函数的对象发送到客户端(播放器有),所以我需要找到另一种传输 ArrayList 的方法。
什么是实现这一目标的正确方法?
您可以使用 JMS 实现(在我的例子中是 ActiveMq)并发送一个对象消息。
您只需要使对象具有不带参数的默认构造函数。您仍然可以使用接受参数的构造函数创建对象。