de.jadv.lib.events
Class JAdvEvent

java.lang.Object
  |
  +--de.jadv.lib.events.JAdvEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AllPlayerStatsEvent, AttackEvent, AvailableRacesEvent, ErrorEvent, GetRacesEvent, InNewLevelEvent, IsLoggedInEvent, LevelInformationEvent, LibVersionEvent, LoginEvent, MessageEvent, MoveObjectEvent, NeedLevelEvent, NewPlayerEvent, ObjectAttributesEvent, ObjectEvent, ObjectOutOfSightEvent, PlayerIDEvent, PlayerMoveEvent, QuitEvent, RequestLongEvent, RequestShortEvent, SendMessageEvent, ShortPlayerStatsEvent, SubObjectEvent, UnknownEvent, UseObjectEvent

public abstract class JAdvEvent
extends java.lang.Object
implements java.io.Serializable

Main Event, that can be sent between Server and Client!

Author:
neitzel
See Also:
Serialized Form

Field Summary
static int BUFFERSIZE
           
static byte CODE_AllPlayerStatsEvent
           
static byte CODE_AttackEvent
           
static byte CODE_AvailableRacesEvent
           
static byte CODE_ErrorEvent
           
static byte CODE_FightEvent
           
static byte CODE_GetRacesEvent
           
static byte CODE_InNewLevelEvent
           
static byte CODE_IsLoggedInEvent
           
static byte CODE_IsNotLoggedInEvent
           
static byte CODE_JAdvEvent
          All Events with theire codes
static byte CODE_LevelInformationEvent
           
static byte CODE_LibVersionEvent
           
static byte CODE_LoginEvent
           
static byte CODE_MessageEvent
           
static byte CODE_MoveObjectEvent
           
static byte CODE_NeedLevelEvent
           
static byte CODE_NewPlayerEvent
           
static byte CODE_ObjectAttributesEvent
           
static byte CODE_ObjectEvent
           
static byte CODE_ObjectOutEvent
           
static byte CODE_PlayerIDEvent
           
static byte CODE_PlayerMoveEvent
           
static byte CODE_QuitEvent
           
static byte CODE_RequestLongEvent
           
static byte CODE_RequestShortEvent
           
static byte CODE_SendMessageEvent
           
static byte CODE_ShortPlayerStatsEvent
           
static byte CODE_SubObjectEvent
           
static byte CODE_UnknownEvent
           
static byte CODE_UseObjectEvent
           
(package private)  java.util.Date createTime
          createTime is for internal use of the Server.
static boolean debug
          Enable the Debugging of Events.
static int EVENT_CODER_VERSION
          Version of coding of Events.
 
Constructor Summary
JAdvEvent()
           
 
Method Summary
static JAdvEvent decodeEvent(java.nio.ByteBuffer buf)
           
abstract  java.nio.ByteBuffer encodeEvent()
           
static java.nio.ByteBuffer encodeEvent(JAdvEvent event)
           
 java.util.Date getCreateTime()
           
 boolean isNewer(java.util.Date date)
          Checks, if the event is newer than the given time
 boolean isOlder(java.util.Date date)
          Checks, if the event is older than the given time
static DataLevelBackground readBackground(java.nio.ByteBuffer buf)
           
static java.lang.String readString(java.nio.ByteBuffer buf)
           
static void write(java.nio.ByteBuffer buf, DataLevelBackground backgr)
           
static void write(java.nio.ByteBuffer buf, java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
Enable the Debugging of Events.

See Also:
Constant Field Values

EVENT_CODER_VERSION

public static final int EVENT_CODER_VERSION
Version of coding of Events. This is also used as the current version of the whole jadv-lib.jar file.

See Also:
Constant Field Values

BUFFERSIZE

public static final int BUFFERSIZE
See Also:
Constant Field Values

CODE_JAdvEvent

public static final byte CODE_JAdvEvent
All Events with theire codes

See Also:
Constant Field Values

CODE_AvailableRacesEvent

public static final byte CODE_AvailableRacesEvent
See Also:
Constant Field Values

CODE_InNewLevelEvent

public static final byte CODE_InNewLevelEvent
See Also:
Constant Field Values

CODE_IsLoggedInEvent

public static final byte CODE_IsLoggedInEvent
See Also:
Constant Field Values

CODE_IsNotLoggedInEvent

public static final byte CODE_IsNotLoggedInEvent
See Also:
Constant Field Values

CODE_ObjectEvent

public static final byte CODE_ObjectEvent
See Also:
Constant Field Values

CODE_ObjectOutEvent

public static final byte CODE_ObjectOutEvent
See Also:
Constant Field Values

CODE_QuitEvent

public static final byte CODE_QuitEvent
See Also:
Constant Field Values

CODE_ErrorEvent

public static final byte CODE_ErrorEvent
See Also:
Constant Field Values

CODE_NeedLevelEvent

public static final byte CODE_NeedLevelEvent
See Also:
Constant Field Values

CODE_LevelInformationEvent

public static final byte CODE_LevelInformationEvent
See Also:
Constant Field Values

CODE_LibVersionEvent

public static final byte CODE_LibVersionEvent
See Also:
Constant Field Values

CODE_UnknownEvent

public static final byte CODE_UnknownEvent
See Also:
Constant Field Values

CODE_MessageEvent

public static final byte CODE_MessageEvent
See Also:
Constant Field Values

CODE_PlayerIDEvent

public static final byte CODE_PlayerIDEvent
See Also:
Constant Field Values

CODE_SubObjectEvent

public static final byte CODE_SubObjectEvent
See Also:
Constant Field Values

CODE_ObjectAttributesEvent

public static final byte CODE_ObjectAttributesEvent
See Also:
Constant Field Values

CODE_ShortPlayerStatsEvent

public static final byte CODE_ShortPlayerStatsEvent
See Also:
Constant Field Values

CODE_AllPlayerStatsEvent

public static final byte CODE_AllPlayerStatsEvent
See Also:
Constant Field Values

CODE_GetRacesEvent

public static final byte CODE_GetRacesEvent
See Also:
Constant Field Values

CODE_LoginEvent

public static final byte CODE_LoginEvent
See Also:
Constant Field Values

CODE_NewPlayerEvent

public static final byte CODE_NewPlayerEvent
See Also:
Constant Field Values

CODE_PlayerMoveEvent

public static final byte CODE_PlayerMoveEvent
See Also:
Constant Field Values

CODE_SendMessageEvent

public static final byte CODE_SendMessageEvent
See Also:
Constant Field Values

CODE_MoveObjectEvent

public static final byte CODE_MoveObjectEvent
See Also:
Constant Field Values

CODE_UseObjectEvent

public static final byte CODE_UseObjectEvent
See Also:
Constant Field Values

CODE_AttackEvent

public static final byte CODE_AttackEvent
See Also:
Constant Field Values

CODE_RequestShortEvent

public static final byte CODE_RequestShortEvent
See Also:
Constant Field Values

CODE_RequestLongEvent

public static final byte CODE_RequestLongEvent
See Also:
Constant Field Values

CODE_FightEvent

public static final byte CODE_FightEvent
See Also:
Constant Field Values

createTime

transient java.util.Date createTime
createTime is for internal use of the Server. If only new Events should be transfered, you can use this to calculate the age!

Constructor Detail

JAdvEvent

public JAdvEvent()
Method Detail

getCreateTime

public java.util.Date getCreateTime()

isOlder

public boolean isOlder(java.util.Date date)
Checks, if the event is older than the given time


isNewer

public boolean isNewer(java.util.Date date)
Checks, if the event is newer than the given time


encodeEvent

public static java.nio.ByteBuffer encodeEvent(JAdvEvent event)
                                       throws java.io.IOException
java.io.IOException

decodeEvent

public static JAdvEvent decodeEvent(java.nio.ByteBuffer buf)

write

public static void write(java.nio.ByteBuffer buf,
                         java.lang.String text)
                  throws java.io.IOException
java.io.IOException

write

public static void write(java.nio.ByteBuffer buf,
                         DataLevelBackground backgr)
                  throws java.io.IOException
java.io.IOException

readString

public static java.lang.String readString(java.nio.ByteBuffer buf)
                                   throws java.io.IOException
java.io.IOException

readBackground

public static DataLevelBackground readBackground(java.nio.ByteBuffer buf)
                                          throws java.io.IOException
java.io.IOException

encodeEvent

public abstract java.nio.ByteBuffer encodeEvent()
                                         throws java.io.IOException
java.io.IOException