summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-08-11 04:09:45 +0200
committerKahrl <kahrl@gmx.net>2013-08-14 21:03:33 +0200
commit4e1f50035e860a00636ca5d804c267119df99601 (patch)
treec6cab522305ef2a5b9cfdb3685340d57590f1ff1 /src/socket.cpp
parent6228d634fb31d1ce925d1fdc2dac022629a007ef (diff)
downloadminetest-4e1f50035e860a00636ca5d804c267119df99601.tar.gz
minetest-4e1f50035e860a00636ca5d804c267119df99601.tar.bz2
minetest-4e1f50035e860a00636ca5d804c267119df99601.zip
Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 8505b24f7..1c07c44d5 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -56,6 +56,7 @@ typedef int socket_t;
#include <string.h>
#include <errno.h>
#include <sstream>
+#include <iomanip>
#include "util/string.h"
#include "util/numeric.h"
@@ -392,9 +393,10 @@ void UDPSocket::Send(const Address & destination, const void * data, int size)
for(int i = 0; i < size && i < 20; i++)
{
if(i % 2 == 0)
- DEBUGPRINT(" ");
+ dstream << " ";
unsigned int a = ((const unsigned char *) data)[i];
- DEBUGPRINT("%.2X", a);
+ dstream << std::hex << std::setw(2) << std::setfill('0')
+ << a;
}
if(size > 20)
@@ -494,9 +496,10 @@ int UDPSocket::Receive(Address & sender, void * data, int size)
for(int i = 0; i < received && i < 20; i++)
{
if(i % 2 == 0)
- DEBUGPRINT(" ");
+ dstream << " ";
unsigned int a = ((const unsigned char *) data)[i];
- DEBUGPRINT("%.2X", a);
+ dstream << std::hex << std::setw(2) << std::setfill('0')
+ << a;
}
if(received > 20)
dstream << "...";