-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement script packet for backwards compatibility
- Loading branch information
Showing
14 changed files
with
261 additions
and
63 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
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
34 changes: 34 additions & 0 deletions
34
...in/java/com/denizenscript/depenizen/common/socket/client/packet/ClientPacketInScript.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,34 @@ | ||
package com.denizenscript.depenizen.common.socket.client.packet; | ||
|
||
import com.denizenscript.depenizen.common.socket.DataDeserializer; | ||
import com.denizenscript.depenizen.common.socket.Packet; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ClientPacketInScript extends Packet { | ||
|
||
private boolean shouldDebug; | ||
private Map<String, List<String>> scriptEntries; | ||
private Map<String, String> definitions; | ||
|
||
public boolean shouldDebug() { | ||
return shouldDebug; | ||
} | ||
|
||
public Map<String, List<String>> getScriptEntries() { | ||
return scriptEntries; | ||
} | ||
|
||
public Map<String, String> getDefinitions() { | ||
return definitions; | ||
} | ||
|
||
@Override | ||
public void deserialize(DataDeserializer deserializer) { | ||
DataDeserializer box = new DataDeserializer(deserializer.readByteArray()); | ||
shouldDebug = box.readBoolean(); | ||
scriptEntries = box.readStringListMap(); | ||
definitions = box.readStringMap(); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
...n/java/com/denizenscript/depenizen/common/socket/client/packet/ClientPacketOutScript.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,34 @@ | ||
package com.denizenscript.depenizen.common.socket.client.packet; | ||
|
||
import com.denizenscript.depenizen.common.socket.DataSerializer; | ||
import com.denizenscript.depenizen.common.socket.Packet; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ClientPacketOutScript extends Packet { | ||
|
||
private List<String> destinations; | ||
private boolean shouldDebug; | ||
private Map<String, List<String>> scriptEntries; | ||
private Map<String, String> definitions; | ||
|
||
public ClientPacketOutScript(List<String> destinations, boolean shouldDebug, Map<String, List<String>> scriptEntries, | ||
Map<String, String> definitions) { | ||
this.destinations = destinations; | ||
this.shouldDebug = shouldDebug; | ||
this.scriptEntries = scriptEntries; | ||
this.definitions = definitions; | ||
} | ||
|
||
@Override | ||
public void serialize(DataSerializer serializer) { | ||
serializer.writeUnsignedByte(ServerBound.SCRIPT.getId()); | ||
serializer.writeStringList(destinations); | ||
DataSerializer box = new DataSerializer(); | ||
box.writeBoolean(shouldDebug); | ||
box.writeStringListMap(scriptEntries); | ||
box.writeStringMap(definitions); | ||
serializer.writeByteArray(box.toByteArray()); | ||
} | ||
} |
Oops, something went wrong.