… | |
… | |
45 | * replaced with this, just using black as the color. |
45 | * replaced with this, just using black as the color. |
46 | */ |
46 | */ |
47 | static void |
47 | static void |
48 | esrv_print_msg (NewSocket * ns, int color, const char *str) |
48 | esrv_print_msg (NewSocket * ns, int color, const char *str) |
49 | { |
49 | { |
50 | char buf[HUGE_BUF]; |
50 | SockList sl (MAXSOCKBUF); |
51 | |
51 | |
52 | if (ns->status == Ns_Old) |
52 | if (ns->status == Ns_Old) |
53 | { |
53 | sl.printf ("%s\n", str); |
54 | snprintf (buf, HUGE_BUF, "%s\n", str); |
|
|
55 | } |
|
|
56 | else |
54 | else |
57 | { |
|
|
58 | snprintf (buf, HUGE_BUF, "drawinfo %d %s", color, str); |
55 | sl.printf ("drawinfo %d %s", color, str); |
59 | } |
|
|
60 | |
56 | |
61 | /* LOG(llevDebug,"sending %s to socket, len=%d\n", buf, strlen(buf));*/ |
57 | ns->send_packet (sl); |
62 | Write_String_To_Socket (ns, buf, strlen (buf)); |
58 | sl.free (); |
63 | } |
59 | } |
64 | |
60 | |
65 | /** |
61 | /** |
66 | * Draws an extended message on the client. |
62 | * Draws an extended message on the client. |
67 | * ns the socket to send message to |
63 | * ns the socket to send message to |
… | |
… | |
72 | * message The main message |
68 | * message The main message |
73 | */ |
69 | */ |
74 | static void |
70 | static void |
75 | esrv_print_ext_msg (NewSocket * ns, int color, uint8 type, uint8 subtype, const char *message) |
71 | esrv_print_ext_msg (NewSocket * ns, int color, uint8 type, uint8 subtype, const char *message) |
76 | { |
72 | { |
77 | char buf[HUGE_BUF]; |
73 | SockList sl (MAXSOCKBUF); |
78 | |
74 | |
79 | snprintf (buf, HUGE_BUF, "drawextinfo %d %hhu %hhu %s", color, type, subtype, message); |
75 | sl.printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); |
80 | Write_String_To_Socket (ns, buf, strlen (buf)); |
76 | ns->send_packet (sl); |
81 | |
77 | sl.free (); |
82 | /* LOG(llevDebug,"sending %s to socket, len=%d", buf, strlen(buf));*/ |
|
|
83 | |
|
|
84 | } |
78 | } |
85 | |
79 | |
86 | /** |
80 | /** |
87 | * Frontend for esrv_print_msg |
81 | * Frontend for esrv_print_msg |
88 | * \param colr message color |
82 | * \param colr message color |