online-game/client/connections.cpp

21 lines
361 B
C++

#include "lib/socket/socket.h"
#include <cstdlib>
client_tcp *client;
void connections_init(int argc, char const* argv[])
{
// Get the port
int port = PORT_DEFAULT;
// Did the user specify a port
if(argc > 2)
{
// Set the port to the specified one
port = atoi(argv[2]);
}
// Create a client
client = new client_tcp(argv[1], port);
}