diff --git a/bootstrap.sh b/bootstrap.sh index 26e306d..701f47b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -16,7 +16,7 @@ if [[ $? != 0 ]]; then exit fi -echo "Performing install" +echo "TTRTS: Performing install" sudo make install if [[ $? != 0 ]]; then echo "TTRTS: Install failed, check output" diff --git a/source/client/client.cpp b/source/client/client.cpp index 8619898..f052ad2 100644 --- a/source/client/client.cpp +++ b/source/client/client.cpp @@ -50,14 +50,12 @@ int runClient(int argc, char* argv[]) if (sockfd < 0) fatal_perror("ERROR opening socket"); - std::cout<<"Opened socket on "<= 0 ) { - std::cout<<"Waiting for gamestate"< @@ -95,10 +96,7 @@ CTTRTSGame GetGameFromFile( const std::string& filename ) // If still not good if( access( gamefile.c_str(), F_OK ) == -1 ) - { - std::cerr<<"Error: "<< gamefile <<" file not found"<(file)),std::istreambuf_iterator()); if( gameDescriptor.size() == 0 ) - { - std::cerr<<"Error: failed to read in any information from "<>input; if( !input.size() || std::tolower(input[0]) != 'y' ) - { - std::cerr<<"Aborting..."<= 0) break; - std::cout<<"Binding failed on try "< &myClients, CTTRTSGame &ga void SendGamestateToClients(std::vector &myClients, const CTTRTSGame &game, std::mutex &gameMutex); // Tries to bind to a socket, will attempt 10 times with longer waits between -void TryBindSocket(int sockfd, sockaddr_in &serv_addr); +void TryBindSocket(int sockfd, const sockaddr_in &serv_addr); // Perform the server side handshake with a client -void PerformServerHandshake(const ClientInfo &client, const CTTRTSGame &game); +void PerformServerHandshake(const ClientInfo &client, const std::string &game); // Perform the client side handshake with the server void PerformClientHandshake(int sockfd, unsigned int &player, std::string &gameNameString); diff --git a/source/client/server.cpp b/source/client/server.cpp index f5ff5e0..b54a541 100644 --- a/source/client/server.cpp +++ b/source/client/server.cpp @@ -16,39 +16,13 @@ void RunServerForGame(CTTRTSGame &game) { - std::cout<<"Setting up server on port "< players = game.GetPlayers(); @@ -61,59 +35,40 @@ void RunServerForGame(CTTRTSGame &game) // Set of clients std::vector myClients; - std::cout<<"Waiting for clients"<< std::endl; + std::cout<<"TTRTS: Waiting for "<