| 1017 | } |
| 1018 | |
| 1019 | bool ODClient::connect(const std::string& host, const int port, uint32_t timeout, const std::string& outputReplayFilename) |
| 1020 | { |
| 1021 | mIsPlayerConfig = false; |
| 1022 | // Start the server socket listener as well as the server socket thread |
| 1023 | if (ODClient::getSingleton().isConnected()) |
| 1024 | { |
| 1025 | OD_LOG_INF("Couldn't try to connect: The client is already connected"); |
| 1026 | return false; |
| 1027 | } |
| 1028 | |
| 1029 | if(!ODSocketClient::connect(host, port, timeout, outputReplayFilename)) |
| 1030 | return false; |
| 1031 | |
| 1032 | // Send a hello request to start the conversation with the server |
| 1033 | ODPacket packSend; |
| 1034 | packSend << ClientNotificationType::hello |
| 1035 | << std::string("OpenDungeons V ") + ODApplication::VERSION; |
| 1036 | send(packSend); |
| 1037 | |
| 1038 | return true; |
| 1039 | } |
| 1040 | |
| 1041 | bool ODClient::replay(const std::string& filename) |
| 1042 | { |
no test coverage detected