1

I have a multiplayer game server application written in Java which connects to player clients when they join the multiplayer game via a socket. The server application (a JAR running in the JVM) is listening to a port (e.g. 9999) for incoming connections from clients.

I want to add a website to minitor the entire project which contains information taken from the running game server(s). One way would be to open a socket from the site (a PHP socket for example) to the gameserver (Java) and implement a custom protocol for taking data from the server. But that method is time consuming as I need to add support for each type of datum I want to pass to the monitoring website.

I was thinking if there is a way to write the site in Java and simply communicate with my gameserver via a direct link. RMI would be a solution I assume since both my JAR and my WAR can communicate through it, but isn't there some better way to build both the web application and the gameserver application inside the same JAR file? So that when my gameserver runs, the web application runs too?

2 Answers 2

0

this looks to me as the fastest way to have an admin console. Just transform your server into a war application which contains both your game server with an open socket for clients and your administration pages. To start your server simply drop it into a tomcat.

A cleaner approach which does not require some self-created protocol would be to have your server use mbeans for all key objects which you would like to admin. But this needs some coding.

Cheers, Sven

0

You should have an embedded web server in your game server. Try Jetty (http://jetty.codehaus.org/jetty/). It's quite easy to embed in any java application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.