Connection and payload quite done

This commit is contained in:
2022-11-07 18:53:11 +01:00
parent 8bdf357e1a
commit 15bb2e874c
5 changed files with 53 additions and 19 deletions

View File

@ -1,8 +1,22 @@
#include "Connection.h"
#include "Payload.h"
#include <iostream>
int main(int argc, char *argv[])
{
Connection c("145.239.73.162", 25565);
Connection* c;
if(argc == 1){
c = new Connection("145.239.73.162", 25565);
}else{
c = new Connection(argv[1], atoi(argv[2]));
}
Payload p;
p.push_char(0xFE);
p.push_char(0x01);
p.push_char(0xFA);
c->send(p, true);
Payload response = c->recv();
std::cout << response.getData() << std::endl;
return 0;
}