1 /*
2  * This file has been automatically generated by Soupply and released under the MIT license.
3  * Generated from data/java393.xml
4  */
5 module soupply.java393.protocol.status;
6 
7 static import std.conv;
8 import std.typetuple : TypeTuple;
9 import packetmaker;
10 
11 import soupply.util;
12 import soupply.java393.metadata : Metadata;
13 import soupply.java393.packet : Java393Packet;
14 
15 static import soupply.java393.types;
16 
17 alias Packets = TypeTuple!(Handshake, Request, Response, Latency);
18 
19 class Handshake : Java393Packet
20 {
21 
22     enum uint ID = 0;
23 
24     enum bool CLIENTBOUND = false;
25     enum bool SERVERBOUND = true;
26 
27     // next
28     enum uint STATUS = 1;
29     enum uint LOGIN = 2;
30 
31     enum string[] __fields = ["protocol", "serverAddress", "serverPort", "next"];
32 
33     @Var uint protocol = 393;
34     string serverAddress;
35     ushort serverPort;
36     @Var uint next;
37 
38     this() pure nothrow @safe @nogc {}
39 
40     this(uint protocol, string serverAddress=string.init, ushort serverPort=ushort.init, uint next=uint.init) pure nothrow @safe @nogc
41     {
42         this.protocol = protocol;
43         this.serverAddress = serverAddress;
44         this.serverPort = serverPort;
45         this.next = next;
46     }
47 
48     mixin Make;
49 
50     public static typeof(this) fromBuffer(ubyte[] buffer)
51     {
52         Handshake ret = new Handshake();
53         ret.autoDecode(buffer);
54         return ret;
55     }
56 
57     override string toString()
58     {
59         return "Handshake(protocol: " ~ std.conv.to!string(this.protocol) ~ ", serverAddress: " ~ std.conv.to!string(this.serverAddress) ~ ", serverPort: " ~ std.conv.to!string(this.serverPort) ~ ", next: " ~ std.conv.to!string(this.next) ~ ")";
60     }
61 
62 }
63 
64 class Request : Java393Packet
65 {
66 
67     enum uint ID = 0;
68 
69     enum bool CLIENTBOUND = false;
70     enum bool SERVERBOUND = true;
71 
72     enum string[] __fields = [];
73 
74     mixin Make;
75 
76     public static typeof(this) fromBuffer(ubyte[] buffer)
77     {
78         Request ret = new Request();
79         ret.autoDecode(buffer);
80         return ret;
81     }
82 
83     override string toString()
84     {
85         return "Request()";
86     }
87 
88 }
89 
90 class Response : Java393Packet
91 {
92 
93     enum uint ID = 0;
94 
95     enum bool CLIENTBOUND = true;
96     enum bool SERVERBOUND = false;
97 
98     enum string[] __fields = ["json"];
99 
100     string json;
101 
102     this() pure nothrow @safe @nogc {}
103 
104     this(string json) pure nothrow @safe @nogc
105     {
106         this.json = json;
107     }
108 
109     mixin Make;
110 
111     public static typeof(this) fromBuffer(ubyte[] buffer)
112     {
113         Response ret = new Response();
114         ret.autoDecode(buffer);
115         return ret;
116     }
117 
118     override string toString()
119     {
120         return "Response(json: " ~ std.conv.to!string(this.json) ~ ")";
121     }
122 
123 }
124 
125 class Latency : Java393Packet
126 {
127 
128     enum uint ID = 1;
129 
130     enum bool CLIENTBOUND = true;
131     enum bool SERVERBOUND = true;
132 
133     enum string[] __fields = ["id"];
134 
135     long id;
136 
137     this() pure nothrow @safe @nogc {}
138 
139     this(long id) pure nothrow @safe @nogc
140     {
141         this.id = id;
142     }
143 
144     mixin Make;
145 
146     public static typeof(this) fromBuffer(ubyte[] buffer)
147     {
148         Latency ret = new Latency();
149         ret.autoDecode(buffer);
150         return ret;
151     }
152 
153     override string toString()
154     {
155         return "Latency(id: " ~ std.conv.to!string(this.id) ~ ")";
156     }
157 
158 }