diff options
Diffstat (limited to 'src/Net/Packets/HostListPacket.cpp')
-rw-r--r-- | src/Net/Packets/HostListPacket.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Net/Packets/HostListPacket.cpp b/src/Net/Packets/HostListPacket.cpp index 8c3d395..659b621 100644 --- a/src/Net/Packets/HostListPacket.cpp +++ b/src/Net/Packets/HostListPacket.cpp @@ -26,14 +26,10 @@ namespace Net { namespace Packets { void HostListPacket::assemblePacket() { - std::ostringstream stream; + std::string str; - for(std::vector<Common::HostInfo>::iterator host = hostList.begin(); host != hostList.end(); ++host) { - stream << host->getName() << std::endl; - stream << host->getIP() << std::endl; - } - - std::string str = stream.str(); + for(std::vector<Common::HostInfo>::iterator host = hostList.begin(); host != hostList.end(); ++host) + str += host->getName() + "\n" + host->getIP() + "\n"; setLength(sizeof(uint16_t) + sizeof(HostData)*hostList.size() + str.length()); |