PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
UserToRakLibThreadMessageProtocol.php
1<?php
2
3/*
4 * RakLib network library
5 *
6 *
7 * This project is not affiliated with Jenkins Software LLC nor RakNet.
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 */
15
16declare(strict_types=1);
17
18namespace raklib\server\ipc;
19
25
26 private function __construct(){
27 //NOOP
28 }
29
30 /*
31 * Internal Packet:
32 * byte (packet ID)
33 * byte[] (payload)
34 */
35
36 /*
37 * ENCAPSULATED payload:
38 * int32 (internal session ID)
39 * byte (flags, last 3 bits, priority)
40 * byte (reliability)
41 * int32 (ack identifier)
42 * byte? (order channel, only when sequenced or ordered reliability)
43 * byte[] (user packet payload)
44 */
45 public const PACKET_ENCAPSULATED = 0x01;
46
47 public const ENCAPSULATED_FLAG_NEED_ACK = 1 << 0;
48 public const ENCAPSULATED_FLAG_IMMEDIATE = 1 << 1;
49
50 /*
51 * CLOSE_SESSION payload:
52 * int32 (internal session ID)
53 */
54 public const PACKET_CLOSE_SESSION = 0x02;
55
56 /*
57 * RAW payload:
58 * byte (address length)
59 * byte[] (address from/to)
60 * short (port)
61 * byte[] (payload)
62 */
63 public const PACKET_RAW = 0x04;
64
65 /*
66 * BLOCK_ADDRESS payload:
67 * byte (address length)
68 * byte[] (address)
69 * int (timeout)
70 */
71 public const PACKET_BLOCK_ADDRESS = 0x05;
72
73 /*
74 * UNBLOCK_ADDRESS payload:
75 * byte (address length)
76 * byte[] (address)
77 */
78 public const PACKET_UNBLOCK_ADDRESS = 0x06;
79
80 /*
81 * RAW_FILTER payload:
82 * byte[] (pattern)
83 */
84 public const PACKET_RAW_FILTER = 0x07;
85
86 /*
87 * SET_NAME payload:
88 * byte[] (name)
89 */
90 public const PACKET_SET_NAME = 0x08;
91
92 /* No payload */
93 public const PACKET_ENABLE_PORT_CHECK = 0x09;
94
95 /* No payload */
96 public const PACKET_DISABLE_PORT_CHECK = 0x10;
97
98 /*
99 * PACKETS_PER_TICK_LIMIT payload:
100 * int64 (limit)
101 */
102 public const PACKET_SET_PACKETS_PER_TICK_LIMIT = 0x11;
103}