Connection and payload quite done
This commit is contained in:
16
main.cpp
16
main.cpp
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user