Class ClajNetProvider

java.lang.Object
com.xpdustry.claj.client.ClajNetProvider
All Implemented Interfaces:
mindustry.net.Net.NetProvider

public class ClajNetProvider extends Object implements mindustry.net.Net.NetProvider
Modified Net.NetProvider that handles CLaJ broadcast system.
  • Field Details

    • provider

      public final mindustry.net.Net.NetProvider provider
    • client

      public final arc.net.Client client
    • server

      public final arc.net.Server server
  • Constructor Details

    • ClajNetProvider

      public ClajNetProvider(mindustry.net.Net.NetProvider provider, arc.net.Client client, arc.net.Server server)
  • Method Details

    • getProxy

      public MindustryClajProxy getProxy()
    • broadcast

      public void broadcast(Iterable<mindustry.net.NetConnection> connections, mindustry.net.NetConnection except, Object object, boolean reliable)
    • sendAllServer

      public void sendAllServer(Object object, Iterable<mindustry.net.NetConnection> connections, boolean reliable)
      Specified by:
      sendAllServer in interface mindustry.net.Net.NetProvider
    • sendAllServer

      public void sendAllServer(Object object, boolean reliable)
      Specified by:
      sendAllServer in interface mindustry.net.Net.NetProvider
    • sendExceptServer

      public void sendExceptServer(mindustry.net.NetConnection except, Object object, boolean reliable)
      Specified by:
      sendExceptServer in interface mindustry.net.Net.NetProvider
    • connectClient

      public void connectClient(String ip, int port, Runnable success) throws IOException
      Specified by:
      connectClient in interface mindustry.net.Net.NetProvider
      Throws:
      IOException
    • sendClient

      public void sendClient(Object object, boolean reliable)
      Specified by:
      sendClient in interface mindustry.net.Net.NetProvider
    • disconnectClient

      public void disconnectClient()
      Specified by:
      disconnectClient in interface mindustry.net.Net.NetProvider
    • discoverServers

      public void discoverServers(arc.func.Cons<mindustry.net.Host> callback, Runnable done)
      Specified by:
      discoverServers in interface mindustry.net.Net.NetProvider
    • pingHost

      public void pingHost(String address, int port, arc.func.Cons<mindustry.net.Host> valid, arc.func.Cons<Exception> failed)
      Specified by:
      pingHost in interface mindustry.net.Net.NetProvider
    • hostServer

      public void hostServer(int port) throws IOException
      Specified by:
      hostServer in interface mindustry.net.Net.NetProvider
      Throws:
      IOException
    • getConnections

      public Iterable<? extends mindustry.net.NetConnection> getConnections()
      Specified by:
      getConnections in interface mindustry.net.Net.NetProvider
    • closeServer

      public void closeServer()
      Specified by:
      closeServer in interface mindustry.net.Net.NetProvider
    • dispose

      public void dispose()
      Specified by:
      dispose in interface mindustry.net.Net.NetProvider
    • setConnectFilter

      public void setConnectFilter(arc.net.Server.ServerConnectFilter connectFilter)
      Specified by:
      setConnectFilter in interface mindustry.net.Net.NetProvider
    • getConnectFilter

      public arc.net.Server.ServerConnectFilter getConnectFilter()
      Specified by:
      getConnectFilter in interface mindustry.net.Net.NetProvider