Differences From Artifact [95faadaf28]:
- File
src/server.m
— part of check-in
[75e920ae30]
at
2025-03-29 14:25:43
on branch trunk
— Switch from clang-format to manual formatting
clang-format does too many weird things. (user: js, size: 12474) [annotate] [blame] [check-ins using]
To Artifact [043bbacb23]:
- File src/server.m — part of check-in [c634a689e7] at 2025-03-29 17:13:40 on branch trunk — More style fixes (user: js, size: 12415) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
395 396 397 398 399 400 401 402 | mapend = lastsec + minremain * 60; interm = 0; } int nonlocalclients = 0; int lastconnect = 0; void | > > | < < | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | mapend = lastsec + minremain * 60; interm = 0; } int nonlocalclients = 0; int lastconnect = 0; // main server update, called from cube main loop in sp, or dedicated server // loop void serverslice(int seconds, unsigned int timeout) { // spawn entities when timer reached [sents enumerateObjectsUsingBlock: ^ (ServerEntity *e, size_t i, bool *stop) { if (e.spawnsecs && (e.spawnsecs -= seconds - lastsec) <= 0) { e.spawnsecs = 0; e.spawned = true; |
︙ | ︙ | |||
468 469 470 471 472 473 474 | case ENET_EVENT_TYPE_CONNECT: { Client *c = addclient(); c.type = ST_TCPIP; c.peer = event.peer; c.peer->data = (void *)(clients.count - 1); char hn[1024]; c.hostname = (enet_address_get_host( | | < | | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | case ENET_EVENT_TYPE_CONNECT: { Client *c = addclient(); c.type = ST_TCPIP; c.peer = event.peer; c.peer->data = (void *)(clients.count - 1); char hn[1024]; c.hostname = (enet_address_get_host( &c.peer->address, hn, sizeof(hn)) == 0 ? @(hn) : @"localhost"); [OFStdOut writeFormat: @"client connected (%@)\n", c.hostname]; send_welcome(lastconnect = clients.count - 1); break; } case ENET_EVENT_TYPE_RECEIVE: brec += event.packet->dataLength; |
︙ | ︙ |