[Network] Use linebreaks as separators

This commit is contained in:
momo5502 2017-01-31 22:02:08 +01:00
parent 29b3acfacb
commit 7954330418
3 changed files with 5 additions and 3 deletions

View File

@ -178,10 +178,11 @@ namespace Components
void Network::SendCommand(Game::netsrc_t type, Network::Address target, std::string command, std::string data)
{
// Use space as separator (possible separators are '\n', ' ').
// Though, our handler only needs exactly 1 char as separator and doesn't care which char it is
// Though, our handler only needs exactly 1 char as separator and doesn't care which char it is.
// EDIT: Most 3rd party tools expect a line break, so let's use that instead!
std::string packet;
packet.append(command);
packet.append(" ", 1);
packet.append("\n", 1);
packet.append(data);
Network::Send(type, target, packet);

View File

@ -119,7 +119,7 @@ namespace Components
Logger::PipeOutput(nullptr);
Network::Send(address, "print\n" + outputBuffer);
Network::SendCommand(address, "print", outputBuffer);
outputBuffer.clear();
}
else

View File

@ -83,6 +83,7 @@ namespace Utils
std::vector<Slot<T>> slots;
};
// TODO: Replace with std::optional, once C++17 is fully available!
template <typename T>
class Value
{