PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
RakLibToUserThreadMessageProtocol.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[] (user packet payload)
40 */
41 public const PACKET_ENCAPSULATED = 0x01;
42
43 /*
44 * OPEN_SESSION payload:
45 * int32 (internal session ID)
46 * byte (address length)
47 * byte[] (address)
48 * short (port)
49 * long (clientID)
50 */
51 public const PACKET_OPEN_SESSION = 0x02;
52
53 /*
54 * CLOSE_SESSION payload:
55 * int32 (internal session ID)
56 * byte (reason)
57 */
58 public const PACKET_CLOSE_SESSION = 0x03;
59
60 /*
61 * ACK_NOTIFICATION payload:
62 * int32 (internal session ID)
63 * int32 (identifierACK)
64 */
65 public const PACKET_ACK_NOTIFICATION = 0x04;
66
67 /*
68 * REPORT_BANDWIDTH_STATS payload:
69 * int64 (sent bytes diff)
70 * int64 (received bytes diff)
71 */
72 public const PACKET_REPORT_BANDWIDTH_STATS = 0x05;
73
74 /*
75 * RAW payload:
76 * byte (address length)
77 * byte[] (address from/to)
78 * short (port)
79 * byte[] (payload)
80 */
81 public const PACKET_RAW = 0x06;
82
83 /*
84 * REPORT_PING payload:
85 * int32 (internal session ID)
86 * int32 (measured latency in MS)
87 */
88 public const PACKET_REPORT_PING = 0x07;
89
90}