Class NetworkManager

java.lang.Object
com.prineside.tdi2.Manager.ManagerAdapter
com.prineside.tdi2.managers.NetworkManager
All Implemented Interfaces:
Disposable, Manager

public class NetworkManager extends Manager.ManagerAdapter
  • Field Details

  • Constructor Details

    • NetworkManager

      public NetworkManager()
  • Method Details

    • setup

      public void setup()
      Description copied from interface: Manager
      Called when all manager objects are already created and can be accessed
      Specified by:
      setup in interface Manager
      Overrides:
      setup in class Manager.ManagerAdapter
    • objectToBytes

      public byte[] objectToBytes(Object o)
      Allows to serialize any kryo-registered object into bytes, to be used later with bytesToObject() Important: it may be not possible to deserialize an object from a different version of the game if its method of serialization is changed. Always check if deserialization still works in a newer version of the game. For a simple and version-independent serialization of various data, use com.prineside.kryo.FixedInput/Output.
    • bytesToObject

      public Object bytesToObject(byte[] bytes)
      Restore an object from bytes previously received from objectToBytes()
    • prepareMultiplayerKryo

      public void prepareMultiplayerKryo(Kryo kryo)
    • getFullKryo

      public NetworkManager.KryoForState getFullKryo()
    • prepareNetworkKryo

      public static void prepareNetworkKryo(NetworkManager.KryoForState kryo)
    • dispose

      public void dispose()
      Description copied from interface: com.badlogic.gdx.utils.Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable
      Overrides:
      dispose in class Manager.ManagerAdapter