289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
uchar *p = start + 2;
bool serveriteminitdone = false;
if (toservermap.length > 0) // suggest server to change map
{ // do this exclusively as map change may invalidate rest of
// update
packet->flags = ENET_PACKET_FLAG_RELIABLE;
putint(p, SV_MAPCHANGE);
sendstring(toservermap.UTF8String, p);
toservermap = @"";
putint(p, nextmode);
} else {
putint(p, SV_POS);
putint(p, clientnum);
putint(
p, (int)(d->o.x *
|
|
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
uchar *p = start + 2;
bool serveriteminitdone = false;
if (toservermap.length > 0) // suggest server to change map
{ // do this exclusively as map change may invalidate rest of
// update
packet->flags = ENET_PACKET_FLAG_RELIABLE;
putint(p, SV_MAPCHANGE);
sendstring(toservermap, p);
toservermap = @"";
putint(p, nextmode);
} else {
putint(p, SV_POS);
putint(p, clientnum);
putint(
p, (int)(d->o.x *
|
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
serveriteminitdone = true;
}
if (ctext[0]) // player chat, not flood protected for
// now
{
packet->flags = ENET_PACKET_FLAG_RELIABLE;
putint(p, SV_TEXT);
sendstring(ctext, p);
ctext[0] = 0;
}
if (!c2sinit) // tell other clients who I am
{
packet->flags = ENET_PACKET_FLAG_RELIABLE;
c2sinit = true;
putint(p, SV_INITC2S);
sendstring(player1->name, p);
sendstring(player1->team, p);
putint(p, player1->lifesequence);
}
for (OFData *msg in messages) {
// send messages collected during the previous
// frames
if (*(int *)[msg itemAtIndex:1])
packet->flags =
|
|
|
|
|
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
serveriteminitdone = true;
}
if (ctext[0]) // player chat, not flood protected for
// now
{
packet->flags = ENET_PACKET_FLAG_RELIABLE;
putint(p, SV_TEXT);
sendstring(@(ctext), p);
ctext[0] = 0;
}
if (!c2sinit) // tell other clients who I am
{
packet->flags = ENET_PACKET_FLAG_RELIABLE;
c2sinit = true;
putint(p, SV_INITC2S);
sendstring(@(player1->name), p);
sendstring(@(player1->team), p);
putint(p, player1->lifesequence);
}
for (OFData *msg in messages) {
// send messages collected during the previous
// frames
if (*(int *)[msg itemAtIndex:1])
packet->flags =
|