Package mindustry.core
Class NetClient
java.lang.Object
mindustry.core.NetClient
- All Implemented Interfaces:
ApplicationListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPacketHandler
(String type, Cons<String> handler) void
addRemovedEntity
(int id) void
static void
blockSnapshot
(short amount, byte[] data) void
clearRemovedEntity
(int id) static void
clientPacketReliable
(String type, String contents) static void
clientPacketUnreliable
(String type, String contents) static void
void
Disconnects, causing no further changes or reset.void
Disconnects, resetting state to the menu.static void
static void
static void
effectReliable
(Effect effect, float x, float y, float rotation, Color color) static void
entitySnapshot
(short amount, byte[] data) getPacketHandlers
(String type) int
getPing()
static void
hiddenSnapshot
(IntSeq ids) boolean
boolean
isEntityUsed
(int id) static void
static void
kick
(Packets.KickReason reason) static void
objectiveCompleted
(String[] flagsRemoved, String[] flagsAdded) static void
ping
(mindustry.gen.Player player, long time) static void
pingResponse
(long time) static void
playerDisconnect
(int playerid) static void
readSyncEntity
(DataInputStream input, Reads read) void
Resets the world data timeout counter.static void
sendChatMessage
(mindustry.gen.Player player, String message) static void
sendMessage
(String message) static void
sendMessage
(String message, String unformatted, mindustry.gen.Player playersender) static void
setCameraPosition
(float x, float y) static void
setObjectives
(MapObjectives executor) static void
setPosition
(float x, float y) void
setQuiet()
When set, any disconnects will be ignored and no dialogs will be shown.static void
static void
static void
static void
stateSnapshot
(float waveTime, int wave, int enemies, boolean paused, boolean gameOver, int timeData, byte tps, long rand0, long rand1, byte[] coreData) static void
traceInfo
(mindustry.gen.Player player, Administration.TraceInfo info) void
update()
Called when theApplication
should update itself.static void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.ApplicationListener
dispose, exit, fileDropped, init, pause, resize, resume
-
Constructor Details
-
NetClient
public NetClient()
-
-
Method Details
-
addPacketHandler
-
getPacketHandlers
-
clientPacketReliable
-
clientPacketUnreliable
-
sound
-
soundAt
-
effect
-
effect
-
effectReliable
-
sendMessage
-
sendMessage
-
sendChatMessage
-
connect
-
ping
public static void ping(mindustry.gen.Player player, long time) -
pingResponse
public static void pingResponse(long time) -
traceInfo
-
kick
-
kick
-
setRules
-
setObjectives
-
objectiveCompleted
-
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
- Throws:
IOException
-
entitySnapshot
public static void entitySnapshot(short amount, byte[] data) -
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 theApplication
should update itself.- Specified by:
update
in interfaceApplicationListener
-
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)
-