Interface INetworkInstance


public interface INetworkInstance
To hold information about network

use this interface if you want to do something completely different

  • Method Details

    • getVersions

      Map<Byte,Byte> getVersions()
      Get the version from the other side. null if default the map doesn't have to contain information about every module. these will be added automatically.

      do HashMap#put(3, 0) to disable sound streaming. NBS can't be optimized and often very large

      Returns:
      maybe null
    • setVersions

      default void setVersions(Map<Byte,Byte> map)
      Receive (and save) versions from the other side
      Parameters:
      map - map
    • disconnect

      void disconnect()
      When the network instance disconnects...
    • sendMessage

      default void sendMessage(NetData data, boolean updateVersions)
    • sendMessage

      void sendMessage(EmotePacket.Builder builder, boolean updateVersions)
      The Proxy controller ask you to send the message, only if isActive() is true
      Parameters:
      builder - packet builder
    • createConfigurationPacket

      default EmotePacket.Builder createConfigurationPacket(boolean allowTracking)
      Client is sending config message to server. Vanilla clients will answer to the server configuration phase message. This might get invoked multiple times on the same network instance.
    • createConfigPacket

      static EmotePacket.Builder createConfigPacket(boolean isTrackingPlayState)
    • isActive

      boolean isActive()
      Is the other side is available your send won't be invoke if you return false
      Returns:
      is this channel working
    • isTrackingPlayState

      default boolean isTrackingPlayState()
      Does the other side track the emote play state of every player -> true The client has to resend the emote if a new player get close -> false
    • maxDataSize

      default int maxDataSize()
      Maximum size of the data what the instance can send

      Defaults to CommonData.MAX_PACKET_SIZE

      Returns:
      max size of bytes[]