This is a Javascript client project for Nadron library. An example html which can connect to a locally running Nadron is located at test/nadclient.html.
Click on Start War! button after loading jetclient.html in a websocket compatible browser to start the game. Assumption is that Nadron server is running and nadclient.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 Nadron server,configobject and acallbackfunction which will receive thesessionobject after successful login to remote Nadron server. - Add necessary handlers to the session using
addHandlerfunction. The default events are provided thenadclass for e.gnad.lOG_IN. At the very least you would want to add a handler for thenad.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!!