online-game/client/connections.cpp

21 lines
361 B
C++
Raw Permalink Normal View History

#include "lib/socket/socket.h"
#include <cstdlib>
2019-03-20 14:13:25 +11:00
client_tcp *client;
void connections_init(int argc, char const* argv[])
2019-03-20 14:13:25 +11:00
{
// 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);
2019-03-20 14:13:25 +11:00
}