Clean up console output functions

FossilOrigin-Name: 003b06901f169b5d97cbbaa313ad31a2493d2a56b295cffda136500ecc5d4f05
This commit is contained in:
Jonathan Schleifer 2025-03-05 21:55:28 +00:00
parent ab582d3745
commit cac7cebba0
16 changed files with 108 additions and 105 deletions

View file

@ -85,29 +85,29 @@ writeclientinfo(FILE *f)
void
connects(OFString *servername)
{
@autoreleasepool {
disconnect(1); // reset state
addserver(servername);
disconnect(1); // reset state
addserver(servername);
conoutf(@"attempting to connect to %s", servername.UTF8String);
ENetAddress address = {ENET_HOST_ANY, CUBE_SERVER_PORT};
conoutf(@"attempting to connect to %@", servername);
ENetAddress address = {ENET_HOST_ANY, CUBE_SERVER_PORT};
@autoreleasepool {
if (enet_address_set_host(&address, servername.UTF8String) <
0) {
conoutf(@"could not resolve server %s", servername);
conoutf(@"could not resolve server %@", servername);
return;
}
}
clienthost = enet_host_create(NULL, 1, rate, rate);
clienthost = enet_host_create(NULL, 1, rate, rate);
if (clienthost) {
enet_host_connect(clienthost, &address, 1);
enet_host_flush(clienthost);
connecting = lastmillis;
connattempts = 0;
} else {
conoutf(@"could not connect to server");
disconnect();
}
if (clienthost) {
enet_host_connect(clienthost, &address, 1);
enet_host_flush(clienthost);
connecting = lastmillis;
connattempts = 0;
} else {
conoutf(@"could not connect to server");
disconnect();
}
}