I have a multiplayer game with a Java server, and I’d like to switch over my clients to Unity. How do I write the server-side networking code to talk to the Unity clients? (I know of the networking capabilities built into Unity, but I need the server to be Java. Is the wire protocol specified somewhere? Are there Java server-side libraries for Unity?)
Unity uses RakNet as Network engine. It uses it’s own UDP protocol. I don’t think it’s worth to try to adapt this. You can simply use .Net-Sockets to communicate with any server you like. Keep in mind that if your client should be a webplayer, there are security restrictions. You can still use TCP connections as long as your server provides an additional socket policy server. You shouldn’t use UDP from a webplayer since every packet has to be verified by the policy server because UDP is a connectionless protocol.