… | |
… | |
43 | * much the same thing as the draw_info above, but takes a color |
43 | * much the same thing as the draw_info above, but takes a color |
44 | * parameter. the esrv_drawinfo functions should probably be |
44 | * parameter. the esrv_drawinfo functions should probably be |
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 (client_socket * ns, int color, const char *str) |
48 | esrv_print_msg (client * ns, int color, const char *str) |
49 | { |
49 | { |
50 | packet sl; |
|
|
51 | |
|
|
52 | if (ns->status == Ns_Old) |
|
|
53 | sl.printf ("%s\n", str); |
|
|
54 | else |
|
|
55 | sl.printf ("drawinfo %d %s", color, str); |
50 | ns->send_packet_printf ("drawinfo %d %s", color, str); |
56 | |
|
|
57 | ns->send_packet (sl); |
|
|
58 | } |
51 | } |
59 | |
52 | |
60 | /** |
53 | /** |
61 | * Draws an extended message on the client. |
54 | * Draws an extended message on the client. |
62 | * ns the socket to send message to |
55 | * ns the socket to send message to |
… | |
… | |
65 | * subtype type and subtype of text message |
58 | * subtype type and subtype of text message |
66 | * intro Intro message to send with main message if client does not support the message type |
59 | * intro Intro message to send with main message if client does not support the message type |
67 | * message The main message |
60 | * message The main message |
68 | */ |
61 | */ |
69 | static void |
62 | static void |
70 | esrv_print_ext_msg (client_socket * ns, int color, uint8 type, uint8 subtype, const char *message) |
63 | esrv_print_ext_msg (client * ns, int color, uint8 type, uint8 subtype, const char *message) |
71 | { |
64 | { |
72 | packet sl; |
|
|
73 | |
|
|
74 | sl.printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); |
65 | ns->send_packet_printf ("drawextinfo %d %hhu %hhu %s", color, type, subtype, message); |
75 | ns->send_packet (sl); |
|
|
76 | } |
66 | } |
77 | |
67 | |
78 | /** |
68 | /** |
79 | * Frontend for esrv_print_msg |
69 | * Frontend for esrv_print_msg |
80 | * \param colr message color |
70 | * \param colr message color |
… | |
… | |
634 | |
624 | |
635 | for (int y = ymin; y <= ymax; y++) |
625 | for (int y = ymin; y <= ymax; y++) |
636 | for (int x = xmin; x <= xmax; x++) |
626 | for (int x = xmin; x <= xmax; x++) |
637 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
627 | sl << uint8 (map_mark[x + MAGIC_MAP_SIZE * y] & ~FACE_FLOOR); |
638 | |
628 | |
639 | Send_With_Handling (pl->contr->socket, &sl); |
629 | pl->contr->socket->send_packet (sl); |
640 | |
630 | |
641 | free (map_mark); |
631 | free (map_mark); |
642 | } |
632 | } |
643 | |
633 | |
644 | |
634 | |