annotate findslot.c @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* $Id: findslot.c,v 1.1.1.1 1997/12/06 05:41:29 darius Exp $ */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 * findslot.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 * Kevin Smith 03/23/88
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #include "copyright2.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include <sys/types.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #include <errno.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include <pwd.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include <string.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #include <ctype.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 #ifdef __STDC__
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 #include <stdlib.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 #define WAITWIDTH 180
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 #define WAITHEIGHT 60
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 #define WAITTITLE 15 /* height of title for wait window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 #define WAITICONHEIGHT 50
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 #define WAITICONWIDTH 50
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 /* Prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 static void mapWaitCount P((W_Window countWin, unsigned int count));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 static void mapWaitQuit P((W_Window qwin));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 static void mapWaitWin P((W_Window waitWin));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 static void mapMotdButtonWin P((W_Window motdButtonWin));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 static void mapWaitIcon
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 P((W_Window waitIcon, unsigned int count,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 int *motdMapLater));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 extern int newMotdStuff; /* from newwin.c */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 int findslot()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 int oldcount = -1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 W_Window waitWin, qwin, countWin, motdButtonWin, waitIcon;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 W_Event event;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 int motdMapLater = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 /* Wait for some kind of indication about in/not in */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 while (queuePos == -1) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 socketPause(1, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 if (isServerDead()) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 printf("Augh! Ghostbusted!\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 EXIT(0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 readFromServer();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 if (me != NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 /* We are in! */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 printf("*** socket %d, player %d ( -s %d -G %d [-2] ) ***\n",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 nextSocket, me->p_no,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 nextSocket, me->p_no);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 return (me->p_no);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 /* We have to wait. Make appropriate windows, etc... */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 waitWin = W_MakeWindow("wait", 0, 0, WAITWIDTH, WAITHEIGHT, NULL, (char *) 0, 2, foreColor);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 countWin = W_MakeWindow("count", WAITWIDTH / 3, WAITTITLE, 2 * WAITWIDTH / 3,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 WAITHEIGHT - WAITTITLE, waitWin, (char *) 0, 1, foreColor);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 qwin = W_MakeWindow("waitquit", 0, WAITTITLE, WAITWIDTH / 3,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 WAITHEIGHT - WAITTITLE, waitWin, (char *) 0, 1, foreColor);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 motdButtonWin = W_MakeWindow("motd_select", 2 * WAITWIDTH / 3, WAITTITLE,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 WAITWIDTH, WAITHEIGHT - WAITTITLE, waitWin, (char *) 0, 1, foreColor);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 waitIcon = W_MakeWindow("wait_icon", 0, 0, WAITICONWIDTH, WAITICONHEIGHT,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 NULL, NULL, BORDER, foreColor);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 W_SetIconWindow(waitWin, waitIcon);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 /* showMotdWin(); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 #ifndef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 W_MapWindow(waitWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 W_MapWindow(countWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 W_MapWindow(qwin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 W_MapWindow(motdButtonWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 W_MapWindow(waitIcon);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 for (;;) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 socketPause(0, 10000);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 readFromServer();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 if (isServerDead()) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 printf("We've been ghostbusted!\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 EXIT(0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 if (newMotdStuff)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 showMotd(motdWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 while (W_EventsPending()) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98 W_NextEvent(&event);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 switch ((int) event.type) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 case W_EV_KEY:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 if (event.Window == motdWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 motdWinEvent(event.key);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 #ifdef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 else if (event.Window == waitIcon) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 switch (event.key) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 case 'q':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 case 'Q':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 printf("OK, bye!\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 EXIT(0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 case 'm':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 case 'M':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 showMotdWin();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 case W_EV_BUTTON: /* fall through */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 if (event.Window == qwin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 printf("OK, bye!\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 EXIT(0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 } else if (event.Window == motdButtonWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 showMotdWin();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 } else if (event.Window == waitIcon) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127 mapWaitIcon(waitIcon, queuePos, NULL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 case W_EV_EXPOSE:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131 if (event.Window == waitWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 if (motdMapLater) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 showMotd(motdWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 motdMapLater = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 mapWaitWin(waitWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 } else if (event.Window == qwin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138 mapWaitQuit(qwin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 } else if (event.Window == countWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 mapWaitCount(countWin, queuePos);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 } else if (event.Window == motdWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 showMotd(motdWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 } else if (event.Window == motdButtonWin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 mapMotdButtonWin(motdButtonWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145 } else if (event.Window == waitIcon) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146 mapWaitIcon(waitIcon, queuePos, &motdMapLater);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153 if (queuePos != oldcount) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 mapWaitCount(countWin, queuePos);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 mapWaitIcon(waitIcon, queuePos, NULL);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 oldcount = queuePos;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 if (me != NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 W_DestroyWindow(waitWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 #ifdef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161 W_DestroyWindow(waitIcon);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 printf("*** socket %d, player %d ( -s %d -G %d [-2] ) ***\n",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 nextSocket, me->p_no,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 nextSocket, me->p_no);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 return (me->p_no);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 mapWaitWin(waitWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 W_Window waitWin;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 char *s = "Netrek: Game is full.";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 W_WriteText(waitWin, 15, 5, textColor, s, strlen(s), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181 mapWaitQuit(qwin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 W_Window qwin;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 char *s = "Quit";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 W_WriteText(qwin, 15, 15, textColor, s, strlen(s), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 mapWaitCount(countWin, count)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 W_Window countWin;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 unsigned int count;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 char *s = "Wait";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195 char *t = "Queue";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 char buf[10];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 register int len;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199 W_WriteText(countWin, 15, 5, textColor, s, strlen(s), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 W_WriteText(countWin, 20, 15, textColor, t, strlen(t), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 sprintf(buf, "%d ", count);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 len = strlen(buf);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 if (count == -1)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204 strcpy(buf, "?");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 W_WriteText(countWin, WAITWIDTH / 6 - len * W_Textwidth / 2, 25, textColor, buf,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 len, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 mapMotdButtonWin(motdButtonWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211 W_Window motdButtonWin;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 char *s = "MOTD";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 W_WriteText(motdButtonWin, 15, 15, textColor, s, strlen(s), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219 mapWaitIcon(waitIcon, count, motdMapLater)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 W_Window waitIcon;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 unsigned int count;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 int *motdMapLater;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 char buf[5];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 int len;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 sprintf(buf, "%d", count);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 len = strlen(buf);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 #ifndef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 if (motdMapLater && W_IsMapped(motdWin)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 *motdMapLater = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 W_UnmapWindow(motdWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 W_WriteText(waitIcon, WAITICONWIDTH / 2 - 10, W_Textheight, textColor, buf, len,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 W_BigFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 W_WriteText(waitIcon, WAITICONWIDTH / 2 - 10, W_Textheight, textColor, buf, len,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240 /* using the iconWin in place of the 4 separate windows I get otherwise. -JR */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 W_WriteText(waitIcon, 0, 0, textColor, serverName, strlen(serverName), W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 W_WriteText(waitIcon, 0, 2 * W_Textheight, textColor, "Q to quit", 9, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243 W_WriteText(waitIcon, 0, 3 * W_Textheight, textColor, "M for Motd", 10, W_RegularFont);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 }