-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package alemiz.stargate.gate.packets; | ||
|
||
import alemiz.stargate.untils.gateprotocol.Convertor; | ||
|
||
public class ForwardPacket extends StarGatePacket { | ||
|
||
public String client; | ||
public String encodedPacket = ""; | ||
|
||
public ForwardPacket(){ | ||
super("FORWARD_PACKET", Packets.FORWARD_PACKET); | ||
} | ||
|
||
@Override | ||
public void decode() { | ||
isEncoded = false; | ||
|
||
String[] data = Convertor.getPacketStringData(encoded); | ||
client = data[1]; | ||
|
||
for (int i = 2; i < data.length; i++){ | ||
if (i == data.length - 1){ | ||
encodedPacket+= data[i]; | ||
continue; | ||
} | ||
encodedPacket+= data[i] + "!"; | ||
} | ||
} | ||
|
||
@Override | ||
public void encode() { | ||
Convertor convertor = new Convertor(getID()); | ||
convertor.putString(client); | ||
|
||
String[] forwardPacketData = Convertor.getPacketStringData(encodedPacket); | ||
for (String data : forwardPacketData){ | ||
convertor.putString(data); | ||
} | ||
|
||
this.encoded = convertor.getPacketString(); | ||
isEncoded = true; | ||
} | ||
|
||
@Override | ||
public StarGatePacket copy() throws CloneNotSupportedException { | ||
return null; | ||
} | ||
|
||
public String getClient() { | ||
return client; | ||
} | ||
|
||
public String getEncodedPacket() { | ||
return encodedPacket; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: "StarGate" | ||
version: 1.2.1 | ||
version: 1.2.3 | ||
author: "Alemiz" | ||
description: "StarGate is super Core plugin for WaterFall" | ||
main: alemiz.stargate.StarGate |