changeset 6210 | 717cc12ac0a9 |
parent 5915 | a39082f82ea2 |
child 6268 | 4b5241e5dd10 |
6209:2505d5d90992 | 6210:717cc12ac0a9 |
---|---|
6 #include "openttd.h" |
6 #include "openttd.h" |
7 #include "console.h" |
7 #include "console.h" |
8 #include "debug.h" |
8 #include "debug.h" |
9 #include "functions.h" |
9 #include "functions.h" |
10 #include "string.h" |
10 #include "string.h" |
11 #include "network/core/core.h" |
|
12 |
|
13 #if defined(ENABLE_NETWORK) |
|
14 SOCKET _debug_socket = INVALID_SOCKET; |
|
15 #endif /* ENABLE_NETWORK */ |
|
11 |
16 |
12 int _debug_ai_level; |
17 int _debug_ai_level; |
13 int _debug_driver_level; |
18 int _debug_driver_level; |
14 int _debug_grf_level; |
19 int _debug_grf_level; |
15 int _debug_map_level; |
20 int _debug_map_level; |
76 char buf[1024]; |
81 char buf[1024]; |
77 |
82 |
78 s = va_arg(va, const char*); |
83 s = va_arg(va, const char*); |
79 vsnprintf(buf, lengthof(buf), s, va); |
84 vsnprintf(buf, lengthof(buf), s, va); |
80 va_end(va); |
85 va_end(va); |
81 fprintf(stderr, "dbg: [%s] %s\n", dbg, buf); |
86 #if defined(ENABLE_NETWORK) |
82 IConsoleDebug(dbg, buf); |
87 if (_debug_socket != INVALID_SOCKET) { |
88 char buf2[lengthof(buf) + 32]; |
|
89 |
|
90 snprintf(buf2, lengthof(buf2), "dbg: [%s] %s\n", dbg, buf); |
|
91 send(_debug_socket, buf2, strlen(buf2), 0); |
|
92 } else |
|
93 #endif /* ENABLE_NETWORK */ |
|
94 { |
|
95 fprintf(stderr, "dbg: [%s] %s\n", dbg, buf); |
|
96 IConsoleDebug(dbg, buf); |
|
97 } |
|
83 } |
98 } |
84 } |
99 } |
85 #endif /* NO_DEBUG_MESSAGES */ |
100 #endif /* NO_DEBUG_MESSAGES */ |
86 |
101 |
87 void SetDebugString(const char *s) |
102 void SetDebugString(const char *s) |