|
@@ -23,6 +23,7 @@ struct ServerConsumer {
|
|
int8 data7 = 0;
|
|
int8 data7 = 0;
|
|
int16 data8 = 0;
|
|
int16 data8 = 0;
|
|
int32 data9 = 0;
|
|
int32 data9 = 0;
|
|
|
|
+ StringBuffer<20> data10;
|
|
|
|
|
|
void onConnection(Server::Client& client) {
|
|
void onConnection(Server::Client& client) {
|
|
(void)client;
|
|
(void)client;
|
|
@@ -45,6 +46,7 @@ struct ServerConsumer {
|
|
in.readS8(data7);
|
|
in.readS8(data7);
|
|
in.readS16(data8);
|
|
in.readS16(data8);
|
|
in.readS32(data9);
|
|
in.readS32(data9);
|
|
|
|
+ in.readString(data10);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -78,7 +80,7 @@ static void testConnect(Test& test) {
|
|
client.consumeEvents(clientConsumer);
|
|
client.consumeEvents(clientConsumer);
|
|
}
|
|
}
|
|
|
|
|
|
- OutPacket out(21, 0);
|
|
|
|
|
|
+ OutPacket out(50, 0);
|
|
out.writeU8(0xF1);
|
|
out.writeU8(0xF1);
|
|
out.writeU16(0xF123);
|
|
out.writeU16(0xF123);
|
|
out.writeU32(0xF1234567);
|
|
out.writeU32(0xF1234567);
|
|
@@ -88,6 +90,8 @@ static void testConnect(Test& test) {
|
|
out.writeS8(0x71);
|
|
out.writeS8(0x71);
|
|
out.writeS16(0x7123);
|
|
out.writeS16(0x7123);
|
|
out.writeS32(0x71234567);
|
|
out.writeS32(0x71234567);
|
|
|
|
+ StringBuffer<20> s("Hi there");
|
|
|
|
+ out.writeString(s);
|
|
client.send(out);
|
|
client.send(out);
|
|
|
|
|
|
for(int i = 0; i < 100; i++) {
|
|
for(int i = 0; i < 100; i++) {
|
|
@@ -114,6 +118,7 @@ static void testConnect(Test& test) {
|
|
"correct value is sent 8");
|
|
"correct value is sent 8");
|
|
test.checkEqual(0x71234567, serverConsumer.data9,
|
|
test.checkEqual(0x71234567, serverConsumer.data9,
|
|
"correct value is sent 9");
|
|
"correct value is sent 9");
|
|
|
|
+ test.checkEqual(s, serverConsumer.data10, "correct value is sent 10");
|
|
|
|
|
|
client.disconnect();
|
|
client.disconnect();
|
|
sleep(100);
|
|
sleep(100);
|