diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-21 16:07:50 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-05-21 16:07:50 +0200 |
commit | 305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36 (patch) | |
tree | 53fb36abafba8712c66a23829a95e84b85c98c50 /src/network/Network.cpp | |
parent | 2017-05-18 (diff) | |
download | AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.gz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.bz2 AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.lz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.xz AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.tar.zst AltCraft-305efbfdc5fb5c05c9b72aa0bee6a3ae1983de36.zip |
Diffstat (limited to 'src/network/Network.cpp')
-rw-r--r-- | src/network/Network.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/network/Network.cpp b/src/network/Network.cpp index a3023ff..03ee6c6 100644 --- a/src/network/Network.cpp +++ b/src/network/Network.cpp @@ -3,24 +3,23 @@ #include "../packet/PacketBuilder.hpp" Network::Network(std::string address, unsigned short port) : m_address(address), m_port(port) { - std::cout << "Connecting to server " << m_address << ":" << m_port << std::endl; + LOG(INFO) << "Connecting to server " << m_address << ":" << m_port; sf::Socket::Status status = m_socket.connect(sf::IpAddress(m_address), m_port); m_socket.setBlocking(true); if (status != sf::Socket::Done) { if (status == sf::Socket::Error) { - std::cerr << "Can't connect to remote server" << std::endl; - throw 14; + LOG(ERROR) << "Can't connect to remote server"; } else { - std::cerr << "Connection failed with unknown reason" << std::endl; + LOG(ERROR) << "Connection failed with unknown reason"; throw 13; } } - std::cout << "Connected." << std::endl; + LOG(INFO) << "Connected to server"; } Network::~Network() { - std::cout << "Disconnecting..." << std::endl; m_socket.disconnect(); + LOG(INFO) << "Disconnected"; } void Network::SendHandshake(std::string username) { |