This is a Javascript client project for jetserver library. An example html which can connect to a locally running Jetserver is located at test/jetclient.html.
Click on Start War! button after loading jetclient.html in a websocket compatible browser to start the game. Assumption is that Jetserver is running and jetclient.html is using accurate hostname and port number.
The general usage steps could be as outlined below.
- Create a
configobject containing theuser,passwordandconnectionkeyto connect to game room. If you are using a different protocol, then add the appropriateCodeChain's also to theconfigobject. By defaultJSonencoding/decoding is used. - Create a
session(s) using theSessionFactoryby passing in aurlfor the remote jetserver,configobject and acallbackfunction which will receive thesessionobject after successful login to remote jeteserver. - Add necessary handlers to the session using
addHandlerfunction. The default events are provided thejetclass for e.gjet.lOG_IN. At the very least you would want to add a handler for thejet.SESSION_MESSAGEevent to receive incoming events from jetserver. - Event objects to be sent to server can be created using the
jet.neventfunction. - Data can be send to remote server using
session.sendfunction.
Happy Coding!!