Class MumbleLink.Context

java.lang.Object
com.github.gw2toolbelt.gw2ml.MumbleLink.Context
Enclosing class:
MumbleLink

public final class MumbleLink.Context
extends java.lang.Object
Since:
0.1.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int BYTES
    The number of bytes that are used to store the context in the underlying data.
  • Constructor Summary

    Constructors 
    Constructor Description
    Context()  
  • Method Summary

    Modifier and Type Method Description
    void copy​(byte[] dest)
    Shorthand for copy(0, dest, 0, BYTES).
    void copy​(int srcOffset, byte[] dest, int destOffset, int length)
    Copies the underlying data beginning at the specified offset, to the specified offset of the destination array.
    void copy​(int srcOffset, java.nio.ByteBuffer dest, int destOffset, int length)
    Copies the underlying data beginning at the specified offset, to the specified offset of the destination buffer.
    void copy​(java.nio.ByteBuffer dest)
    Shorthand for copy(0, dest, 0, BYTES).
    long getBuildID()
    Returns the ID of the game build that is currently running (as per Guild Wars 2 API).
    int getCompassHeight()
    Returns the height of the compass in pixels.
    float getCompassRotation()
    Returns the rotation of the compass in radians.
    int getCompassWidth()
    Returns the width of the compass in pixels.
    long getInstance()
    Returns the ID of the current game instance.
    float getMapCenterX()
    Returns the X-component of the position at the center of the map.
    float getMapCenterY()
    Returns the Y-component of the position at the center of the map.
    long getMapID()
    Returns the ID of the map the player is currently on (as per Guild Wars 2 API).
    float getMapScale()
    Returns the scale of the map.
    long getMapType()
    Returns information about the type of the map the player is currently on.
    byte getMountType()
    Returns information about the type of the mount the player is currently riding.
    float getPlayerX()
    Returns the X-component of the position of the player in continent coordinates.
    float getPlayerY()
    Returns the Y-component of the position of the player in continent coordinates.
    long getProcessID()
    Returns the ID of the process.
    java.net.InetSocketAddress getServerAddress()
    Returns the address of the map server that the game client is currently connected to.
    int getShardID()
    Returns a 32bit bitfield that contains various information about the current game shard.
    int getUIState()
    Returns a 32bit bitfield that contains various information about the current state of the game UI.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BYTES

      public static final int BYTES
      The number of bytes that are used to store the context in the underlying data.
      Since:
      0.1.0
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details

    • copy

      public void copy​(byte[] dest)
      Shorthand for copy(0, dest, 0, BYTES).

      See copy(int, byte[], int, int).

      Parameters:
      dest - the destination array
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      java.lang.IndexOutOfBoundsException - if any index is violated
      java.lang.NullPointerException - if dest is null
      Since:
      0.1.0
    • copy

      public void copy​(java.nio.ByteBuffer dest)
      Shorthand for copy(0, dest, 0, BYTES).

      See copy(int, ByteBuffer, int, int).

      Parameters:
      dest - the destination buffer
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      java.lang.IndexOutOfBoundsException - if any index is violated
      java.lang.NullPointerException - if dest is null
      Since:
      1.3.0
    • copy

      public void copy​(int srcOffset, byte[] dest, int destOffset, int length)
      Copies the underlying data beginning at the specified offset, to the specified offset of the destination array.

      If any of the following is true, an IndexOutOfBoundsException is thrown and the destination is not modified:

      • The srcOffset argument is negative.
      • The destOffset argument is negative.
      • The length argument is negative.
      • srcOffset + length is greater than BYTES, the length of the context
      • destOffset + length is greater than dest.length, the length of the destination array.
      Parameters:
      srcOffset - starting position in the context
      dest - the destination array
      destOffset - starting position in the destination data
      length - the number of bytes to be copied
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      java.lang.IndexOutOfBoundsException - if any index is violated
      java.lang.NullPointerException - if dest is null
      Since:
      0.1.0
    • copy

      public void copy​(int srcOffset, java.nio.ByteBuffer dest, int destOffset, int length)
      Copies the underlying data beginning at the specified offset, to the specified offset of the destination buffer.

      If any of the following is true, an IndexOutOfBoundsException is thrown and the destination is not modified:

      • The srcOffset argument is negative.
      • The destOffset argument is negative.
      • The length argument is negative.
      • srcOffset + length is greater than BYTES, the length of the context
      • destOffset + length is greater than dest.length, the length of the destination buffer.
      Parameters:
      srcOffset - starting position in the context
      dest - the destination buffer
      destOffset - starting position in the destination data
      length - the number of bytes to be copied
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      java.lang.IndexOutOfBoundsException - if any index is violated
      java.lang.NullPointerException - if dest is null
      Since:
      1.3.0
    • getServerAddress

      @Nullable public java.net.InetSocketAddress getServerAddress()
      Returns the address of the map server that the game client is currently connected to.
      Returns:
      the address of the map server that the game client is currently connected to
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getMapID

      public long getMapID()
      Returns the ID of the map the player is currently on (as per Guild Wars 2 API).
      Returns:
      the ID of the map the player is currently on
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getMapType

      public long getMapType()
      Returns information about the type of the map the player is currently on.

      The functionality provided by MapType may be used to interpret the value.

      Returns:
      information about the type of the map the player is currently on
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getShardID

      public int getShardID()
      Returns a 32bit bitfield that contains various information about the current game shard.
      Returns:
      a 32bit bitfield that contains various information about the current game shard
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      1.0.0
      API Note:
      This field has no known purpose for outside use.
    • getInstance

      public long getInstance()
      Returns the ID of the current game instance.
      Returns:
      the ID of the current game instance
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
      API Note:
      This field has no known purpose for outside use.
    • getBuildID

      public long getBuildID()
      Returns the ID of the game build that is currently running (as per Guild Wars 2 API).
      Returns:
      the ID of the game build that is currently running
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getUIState

      public int getUIState()
      Returns a 32bit bitfield that contains various information about the current state of the game UI.

      The functionality provided by UIState may be used to interpret the value of the bitfield.

      Returns:
      a 32bit bitfield that contains various information about the current state of the game UI.
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getCompassWidth

      public int getCompassWidth()
      Returns the width of the compass in pixels.
      Returns:
      the width of the compass in pixels
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getCompassHeight

      public int getCompassHeight()
      Returns the height of the compass in pixels.
      Returns:
      the height of the compass in pixels
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getCompassRotation

      public float getCompassRotation()
      Returns the rotation of the compass in radians.
      Returns:
      the rotation of the compass in radians
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getPlayerX

      public float getPlayerX()
      Returns the X-component of the position of the player in continent coordinates.
      Returns:
      the X-component of the position of the player in continent coordinates
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getPlayerY

      public float getPlayerY()
      Returns the Y-component of the position of the player in continent coordinates.
      Returns:
      the Y-component of the position of the player in continent coordinates
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getMapCenterX

      public float getMapCenterX()
      Returns the X-component of the position at the center of the map.
      Returns:
      the X-component of the position at the center of the map
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getMapCenterY

      public float getMapCenterY()
      Returns the Y-component of the position at the center of the map.
      Returns:
      the Y-component of the position at the center of the map
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getMapScale

      public float getMapScale()
      Returns the scale of the map.
      Returns:
      the scale of the map
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      0.1.0
    • getProcessID

      public long getProcessID()
      Returns the ID of the process.
      Returns:
      the ID of the process
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      1.4.0
    • getMountType

      public byte getMountType()
      Returns information about the type of the mount the player is currently riding.

      The functionality provided by MountType may be used to interpret the value.

      Returns:
      information about the type of the mount the player is currently riding
      Throws:
      java.lang.IllegalStateException - if this view was invalidated
      Since:
      1.5.0