Updated Server and Client constructor calls
This commit is contained in:
@@ -30,7 +30,7 @@ GameType check_server(char* ip_text, char* port_text) {
|
|||||||
std::string code = connect_code::encode(addr, std::to_string(port));
|
std::string code = connect_code::encode(addr, std::to_string(port));
|
||||||
|
|
||||||
/* Create server socket and wait for client to connect */
|
/* Create server socket and wait for client to connect */
|
||||||
Server* server = new Server(check_ip_ver(addr.data()), ES_UDP, addr.data(), port);
|
Server* server = new Server(ES_UDP, addr.data(), port);
|
||||||
server->create_socket();
|
server->create_socket();
|
||||||
display_text_centered("Your code is " + code + "\nWaiting for connection...");
|
display_text_centered("Your code is " + code + "\nWaiting for connection...");
|
||||||
std::string response = "";
|
std::string response = "";
|
||||||
@@ -58,7 +58,7 @@ GameType check_client(char* code_text) {
|
|||||||
std::string connect_code = std::string(code_text); /* The connect code is a special string, that contains the server address and port. It is given by the server. */
|
std::string connect_code = std::string(code_text); /* The connect code is a special string, that contains the server address and port. It is given by the server. */
|
||||||
try {
|
try {
|
||||||
addr_port = connect_code::decode(connect_code);
|
addr_port = connect_code::decode(connect_code);
|
||||||
Client* client = new Client(4, ES_UDP, addr_port[0].data(), std::stoi(addr_port[1]));
|
Client* client = new Client(ES_UDP, addr_port[0].data(), std::stoi(addr_port[1]));
|
||||||
client->create_socket();
|
client->create_socket();
|
||||||
/* Send a specific message to the server, and wait for the appropriate response, to know that the server is ready */
|
/* Send a specific message to the server, and wait for the appropriate response, to know that the server is ready */
|
||||||
client->sendAll("GG");
|
client->sendAll("GG");
|
||||||
|
Reference in New Issue
Block a user