|
10 | 10 | use pocketmine\network\protocol\MoveEntityPacket; |
11 | 11 | use pocketmine\network\protocol\SetEntityMotionPacket; |
12 | 12 | use pocketmine\network\protocol\MovePlayerPacket; |
13 | | -use pocketmine\network\proxylib\ProxyServer; |
14 | | -use pocketmine\network\ProxyInterface; |
15 | 13 |
|
16 | 14 | class PacketMaker extends Thread { |
17 | 15 |
|
18 | 16 | protected $classLoader; |
19 | 17 | protected $shutdown; |
20 | 18 | protected $internalQueue; |
21 | 19 | protected $raklib; |
22 | | - protected $proxy; |
23 | 20 |
|
24 | | - public function __construct(\ClassLoader $loader, $raklib, $proxy) { |
| 21 | + public function __construct(\ClassLoader $loader, $raklib) { |
25 | 22 | $this->internalQueue = new \Threaded; |
26 | 23 | $this->shutdown = false; |
27 | 24 | $this->classLoader = $loader; |
28 | 25 | $this->raklib = $raklib; |
29 | | - $this->proxy = $proxy; |
30 | 26 | $this->start(PTHREADS_INHERIT_CONSTANTS); |
31 | 27 | } |
32 | 28 |
|
@@ -110,23 +106,17 @@ protected function checkPacket($data) { |
110 | 106 | } |
111 | 107 | if (!empty($moveStr)) { |
112 | 108 | $buffer = zlib_encode($moveStr, ZLIB_ENCODING_DEFLATE, 7); |
113 | | - $this->sendData($identifier, $buffer, $playerData); |
| 109 | + $this->sendData($identifier, $buffer); |
114 | 110 | } |
115 | 111 | } |
116 | 112 | } |
117 | 113 |
|
118 | | - protected function sendData($identifier, $buffer, $data) { |
119 | | - if (!is_null($this->proxy) && !empty($data['proxySessionId']) && !empty($data['proxyId'])) { |
120 | | - $infoData = pack('N', $data['proxySessionId']) . chr(ProxyInterface::STANDART_PACKET_ID) . $buffer; |
121 | | - $info = chr(strlen($data['proxyId'])) . $data['proxyId'] . $infoData; |
122 | | - $this->proxy->writeToProxyServer($info); |
123 | | - } elseif(!is_null($this->raklib)) { |
124 | | - $pk = new EncapsulatedPacket(); |
125 | | - $pk->buffer = $buffer; |
126 | | - $pk->reliability = 3; |
127 | | - $enBuffer = chr(RakLib::PACKET_ENCAPSULATED) . chr(strlen($identifier)) . $identifier . chr(RakLib::PRIORITY_NORMAL) . $pk->toBinary(true); |
128 | | - $this->raklib->pushMainToThreadPacket($enBuffer); |
129 | | - } |
| 114 | + protected function sendData($identifier, $buffer) { |
| 115 | + $pk = new EncapsulatedPacket(); |
| 116 | + $pk->buffer = $buffer; |
| 117 | + $pk->reliability = 3; |
| 118 | + $enBuffer = chr(RakLib::PACKET_ENCAPSULATED) . chr(strlen($identifier)) . $identifier . chr(RakLib::PRIORITY_NORMAL) . $pk->toBinary(true); |
| 119 | + $this->raklib->pushMainToThreadPacket($enBuffer); |
130 | 120 | } |
131 | 121 |
|
132 | 122 | } |
0 commit comments