Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packets are love, packets are life
- Loading branch information
Showing
8 changed files
with
84 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...va/com/denizenscript/depenizen/common/socket/client/packet/ClientPacketOutSendPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.denizenscript.depenizen.common.socket.client.packet; | ||
|
||
import com.denizenscript.depenizen.common.socket.DataSerializer; | ||
import com.denizenscript.depenizen.common.socket.Packet; | ||
|
||
public class ClientPacketOutSendPlayer extends Packet { | ||
|
||
private String player; | ||
private String destination; | ||
|
||
public ClientPacketOutSendPlayer(String player, String destination) { | ||
this.player = player; | ||
this.destination = destination; | ||
} | ||
|
||
@Override | ||
public void serialize(DataSerializer serializer) { | ||
serializer.writeUnsignedByte(ServerBound.SEND_PLAYER.getId()); | ||
serializer.writeString(player); | ||
serializer.writeString(destination); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ava/com/denizenscript/depenizen/common/socket/server/packet/ServerPacketInSendPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.denizenscript.depenizen.common.socket.server.packet; | ||
|
||
import com.denizenscript.depenizen.common.socket.DataDeserializer; | ||
import com.denizenscript.depenizen.common.socket.Packet; | ||
|
||
public class ServerPacketInSendPlayer extends Packet { | ||
|
||
private String player; | ||
private String destination; | ||
|
||
@Override | ||
public void deserialize(DataDeserializer deserializer) { | ||
player = deserializer.readString(); | ||
destination = deserializer.readString(); | ||
} | ||
|
||
public String getPlayer() { | ||
return player; | ||
} | ||
|
||
public String getDestination() { | ||
return destination; | ||
} | ||
} |