-
Notifications
You must be signed in to change notification settings - Fork 556
how to use flash client to send message to this java game sever? and how to config the server side ?
A flash client, coded in action script jetclient-as3 is available for JetServer.
Flash games can now use this client for connecting to JetServer. MessageBuffer protocol and an AMF3 Protocol are now implemented.
The client is a work in progress. Life cycle events like close, disconnect etc are not handled yet. If you are an AS3 kick-a** expert, do contribute!
##Session Creation The first step for the client is to create a session and connect it to remote Jetserver. For this, it uses a LoginHelper class and the SessionFactory. Example is available at [Main.as] (https://github.com/menacher/java-game-server/blob/master/jetclient-as3/src/main/flex/org/menacheri/Main.as)
var loginHelper:LoginHelper = new LoginHelper("user", "pass", "Zombie_ROOM_1_REF_KEY_1", "localhost", 18090); var sessionFactory:SessionFactory = new SessionFactory(loginHelper); var session:Session = sessionFactory.createAndConnectSession();
session.addEventListener(Events.SESSION_MESSAGE_EVENT, yourEventListenerFunction);
session.sendToServer(jetEvent);
The jet event can be created using Events class, as shown below.
var jetEvent:JetEvent = Events.event(Events.NETWORK_MESSAGE, somemessage);