42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
sents[i].spawnsecs = 0;
};
};
int interm = 0, minremain = 0, mapend = 0;
bool mapreload = false;
char *serverpassword = "";
bool isdedicated;
ENetHost *serverhost = NULL;
int bsend = 0, brec = 0, laststatus = 0, lastsec = 0;
#define MAXOBUF 100000
|
|
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
sents[i].spawnsecs = 0;
};
};
int interm = 0, minremain = 0, mapend = 0;
bool mapreload = false;
static OFString *serverpassword = @"";
bool isdedicated;
ENetHost *serverhost = NULL;
int bsend = 0, brec = 0, laststatus = 0, lastsec = 0;
#define MAXOBUF 100000
|
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE);
uchar *start = packet->data;
uchar *p = start + 2;
putint(p, SV_INITS2C);
putint(p, n);
putint(p, PROTOCOL_VERSION);
putint(p, smapname[0]);
sendstring(serverpassword, p);
putint(p, clients.length() > maxclients);
if (smapname[0]) {
putint(p, SV_MAPCHANGE);
sendstring(smapname, p);
putint(p, mode);
putint(p, SV_ITEMLIST);
loopv(sents) if (sents[i].spawned) putint(p, i);
|
|
|
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE);
uchar *start = packet->data;
uchar *p = start + 2;
putint(p, SV_INITS2C);
putint(p, n);
putint(p, PROTOCOL_VERSION);
putint(p, smapname[0]);
sendstring(serverpassword.UTF8String, p);
putint(p, clients.length() > maxclients);
if (smapname[0]) {
putint(p, SV_MAPCHANGE);
sendstring(smapname, p);
putint(p, mode);
putint(p, SV_ITEMLIST);
loopv(sents) if (sents[i].spawned) putint(p, i);
|
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
client &c = addclient();
c.type = ST_LOCAL;
strcpy_s(c.hostname, "local");
send_welcome(&c - &clients[0]);
};
void
initserver(bool dedicated, int uprate, char *sdesc, char *ip, char *master,
char *passwd, int maxcl)
{
serverpassword = passwd;
maxclients = maxcl;
servermsinit(master ? master : "wouter.fov120.com/cube/masterserver/",
sdesc, dedicated);
if (isdedicated = dedicated) {
|
|
|
|
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
client &c = addclient();
c.type = ST_LOCAL;
strcpy_s(c.hostname, "local");
send_welcome(&c - &clients[0]);
};
void
initserver(bool dedicated, int uprate, const char *sdesc, const char *ip,
const char *master, OFString *passwd, int maxcl)
{
serverpassword = passwd;
maxclients = maxcl;
servermsinit(master ? master : "wouter.fov120.com/cube/masterserver/",
sdesc, dedicated);
if (isdedicated = dedicated) {
|