atavism.server.engine
Class EventServer
java.lang.Object
atavism.server.engine.EventServer
public class EventServer
- extends java.lang.Object
Method Summary |
java.lang.Class |
getEventClass(int id)
|
int |
getEventID(java.lang.Class eventClass)
returns the id that was registered for the passed in class |
int |
getEventID(java.lang.String className)
|
java.lang.Object |
parseAnyBytes(AOByteBuffer buf)
finds the correct event based on the id, parses the message
and returns an event |
Event |
parseBytes(AOByteBuffer buf,
ClientConnection con)
|
void |
registerEventId(int id,
java.lang.String className)
registers an event id number with the event class
so that when the server gets an event over the network
it knows which event class to dispatch it to for
de-serialization |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventServer
public EventServer()
parseBytes
public Event parseBytes(AOByteBuffer buf,
ClientConnection con)
parseAnyBytes
public java.lang.Object parseAnyBytes(AOByteBuffer buf)
- finds the correct event based on the id, parses the message
and returns an event
registerEventId
public void registerEventId(int id,
java.lang.String className)
- registers an event id number with the event class
so that when the server gets an event over the network
it knows which event class to dispatch it to for
de-serialization
getEventClass
public java.lang.Class getEventClass(int id)
getEventID
public int getEventID(java.lang.Class eventClass)
- returns the id that was registered for the passed in class
getEventID
public int getEventID(java.lang.String className)