Closed RoiEXLab closed 7 years ago
Just some concluding words, summing up my own opinion: After hearing your concerns, we should IMO opinion go for a WebSockets API and send JSON back and forth. Ideally this JSON should be gzip/deflate compressed, depending on browser support, in order to send less data overall. I'd like to have a consistent JSON scheme to make overall reading much simpler e.g. have all JSON look like this:
{
"id": "packet_name",
"version": 1,// In order to be able to maintain backwards compatibility when changing any data
"data": {
//The packet-specific data
}
}
I'm not sure on wether it's a good idea to use gson or some similar object-to-json serialization framework to encode the data object, because this again limits us to our object class structure, while if we would encode the objects manually, we could easily refactor code without having ro worry about breaking anything + we can make sure no unnecessary data is being sent. Thoughts?
I think we're on the same page. The exact JSON structure used is an interesting thing to consider, a number of different ways to do that. Though, I do think we have at least made a few steps forward. We may want to track this initiative as a project so we can relate the different ideas/PRs as they come up
I just looked into the net code, and this is going to be a similar huge project as the JavaFX project...
TL;DR: I'm not going to have more than 1 giant project active at the same time: I'm not going to work on this until JavaFX is reaching it's final state, not going to happen soon (although I will continue working on it soon) But if anyone wants to work on the net-code, feel free to do so, I'd very much appreciate it.
No worries @RoiEXLab , this has been on the radar for some time, we all really would like something that we can update with compile time checks, and let the devs and game players worry far less about versioning.
@DanVanAtta @ssoloff @ron-murhammer Found this: http://docs.oracle.com/javase/9/rmi/toc.htm We might should consider using a security manager for the server side...
Note that some of those recommendations may not be implementable as described at the link. We don't actually use RMI™ but a custom network protocol written by Sean that was heavily influenced by RMI™. From IRemoteMessenger.java
:
/**
* Very similar to RMI
*
@ssoloff We actually do: https://github.com/triplea-game/triplea/blob/master/src/main/java/games/strategy/net/GUID.java
@RoiEXLab Using a type from the java.rmi
package doesn't equate to using the RMI™ protocol. :smile:
If you say so... ^^
As you may or may not know, tripleA uses the Java RMI system, which stands for Remote Method Invocation for it's internet communication... I have a more or less concrete idea on how to implement a Network-Communication-System using Java Sockets, but I'm here to discuss the details with you since this is going to be a huge project... I have a Packet System in mind - see my current implementation for more details. This Packet systems uses IDs for every action. Currently I have:
Is there anything missing? How are we going to restart the lobby without killing the java process?