Class NetClient

java.lang.Object
mindustry.core.NetClient
All Implemented Interfaces:
ApplicationListener

public class NetClient extends Object implements ApplicationListener
  • Constructor Details

    • NetClient

      public NetClient()
  • Method Details

    • addPacketHandler

      public void addPacketHandler(String type, Cons<String> handler)
    • getPacketHandlers

      public Seq<Cons<String>> getPacketHandlers(String type)
    • clientPacketReliable

      public static void clientPacketReliable(String type, String contents)
    • clientPacketUnreliable

      public static void clientPacketUnreliable(String type, String contents)
    • sound

      public static void sound(Sound sound, float volume, float pitch, float pan)
    • soundAt

      public static void soundAt(Sound sound, float x, float y, float volume, float pitch)
    • effect

      public static void effect(Effect effect, float x, float y, float rotation, Color color)
    • effect

      public static void effect(Effect effect, float x, float y, float rotation, Color color, Object data)
    • effectReliable

      public static void effectReliable(Effect effect, float x, float y, float rotation, Color color)
    • sendMessage

      public static void sendMessage(String message, @Nullable String unformatted, @Nullable mindustry.gen.Player playersender)
    • sendMessage

      public static void sendMessage(String message)
    • sendChatMessage

      public static void sendChatMessage(mindustry.gen.Player player, String message)
    • connect

      public static void connect(String ip, int port)
    • ping

      public static void ping(mindustry.gen.Player player, long time)
    • pingResponse

      public static void pingResponse(long time)
    • traceInfo

      public static void traceInfo(mindustry.gen.Player player, Administration.TraceInfo info)
    • kick

      public static void kick(Packets.KickReason reason)
    • kick

      public static void kick(String reason)
    • setRules

      public static void setRules(Rules rules)
    • setObjectives

      public static void setObjectives(MapObjectives executor)
    • objectiveCompleted

      public static void objectiveCompleted(String[] flagsRemoved, String[] flagsAdded)
    • worldDataBegin

      public static void worldDataBegin()
    • setPosition

      public static void setPosition(float x, float y)
    • setCameraPosition

      public static void setCameraPosition(float x, float y)
    • playerDisconnect

      public static void playerDisconnect(int playerid)
    • readSyncEntity

      public static void readSyncEntity(DataInputStream input, Reads read) throws IOException
      Throws:
      IOException
    • entitySnapshot

      public static void entitySnapshot(short amount, byte[] data)
    • hiddenSnapshot

      public static void hiddenSnapshot(IntSeq ids)
    • blockSnapshot

      public static void blockSnapshot(short amount, byte[] data)
    • stateSnapshot

      public static void stateSnapshot(float waveTime, int wave, int enemies, boolean paused, boolean gameOver, int timeData, byte tps, long rand0, long rand1, byte[] coreData)
    • update

      public void update()
      Description copied from interface: ApplicationListener
      Called when the Application should update itself.
      Specified by:
      update in interface ApplicationListener
    • resetTimeout

      public void resetTimeout()
      Resets the world data timeout counter.
    • isConnecting

      public boolean isConnecting()
    • getPing

      public int getPing()
    • beginConnecting

      public void beginConnecting()
    • disconnectQuietly

      public void disconnectQuietly()
      Disconnects, resetting state to the menu.
    • disconnectNoReset

      public void disconnectNoReset()
      Disconnects, causing no further changes or reset.
    • setQuiet

      public void setQuiet()
      When set, any disconnects will be ignored and no dialogs will be shown.
    • clearRemovedEntity

      public void clearRemovedEntity(int id)
    • addRemovedEntity

      public void addRemovedEntity(int id)
    • isEntityUsed

      public boolean isEntityUsed(int id)