de.jadv.lib.events.toclient
Class NeedLevelEvent

java.lang.Object
  |
  +--de.jadv.lib.events.JAdvEvent
        |
        +--de.jadv.lib.events.toclient.NeedLevelEvent
All Implemented Interfaces:
java.io.Serializable

public class NeedLevelEvent
extends JAdvEvent

This Event can have different meanings:
1) The server can send it to the client, when the client should load another Level now (and not when the player entering it!)
2) The client sends it to the server to request the Level

Author:
neitzel
See Also:
Serialized Form

Field Summary
(package private)  int _build
           
(package private)  java.lang.String _LevelID
           
 
Fields inherited from class de.jadv.lib.events.JAdvEvent
BUFFERSIZE, CODE_AllPlayerStatsEvent, CODE_AttackEvent, CODE_AvailableRacesEvent, CODE_ErrorEvent, CODE_FightEvent, CODE_GetRacesEvent, CODE_InNewLevelEvent, CODE_IsLoggedInEvent, CODE_IsNotLoggedInEvent, CODE_JAdvEvent, CODE_LevelInformationEvent, CODE_LibVersionEvent, CODE_LoginEvent, CODE_MessageEvent, CODE_MoveObjectEvent, CODE_NeedLevelEvent, CODE_NewPlayerEvent, CODE_ObjectAttributesEvent, CODE_ObjectEvent, CODE_ObjectOutEvent, CODE_PlayerIDEvent, CODE_PlayerMoveEvent, CODE_QuitEvent, CODE_RequestLongEvent, CODE_RequestShortEvent, CODE_SendMessageEvent, CODE_ShortPlayerStatsEvent, CODE_SubObjectEvent, CODE_UnknownEvent, CODE_UseObjectEvent, debug, EVENT_CODER_VERSION
 
Constructor Summary
NeedLevelEvent(java.nio.ByteBuffer buf)
          Constructor, that reads this Event from the ByteBuffer
NeedLevelEvent(java.lang.String LevelID, int build)
          Constructor for NeedLevel.
 
Method Summary
 java.nio.ByteBuffer encodeEvent()
          Encodes this event to a ByteBuffer
 int getBuild()
          Get the Build of the Level
 java.lang.String getLevelID()
          Get the ID of the Level
 
Methods inherited from class de.jadv.lib.events.JAdvEvent
decodeEvent, encodeEvent, getCreateTime, isNewer, isOlder, readBackground, readString, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_LevelID

java.lang.String _LevelID

_build

int _build
Constructor Detail

NeedLevelEvent

public NeedLevelEvent(java.lang.String LevelID,
                      int build)
Constructor for NeedLevel.


NeedLevelEvent

public NeedLevelEvent(java.nio.ByteBuffer buf)
               throws java.io.IOException
Constructor, that reads this Event from the ByteBuffer

Parameters:
buf - - the ByteBuffer to read this Event from
Throws:
java.io.IOException - - Exception, if the event cannot be read
Method Detail

encodeEvent

public java.nio.ByteBuffer encodeEvent()
                                throws java.io.IOException
Encodes this event to a ByteBuffer

Specified by:
encodeEvent in class JAdvEvent
Returns:
ByteBuffer with Event
java.io.IOException

getLevelID

public java.lang.String getLevelID()
Get the ID of the Level

Returns:
the ID of the level

getBuild

public int getBuild()
Get the Build of the Level

Returns:
the build Number of the Level