Differences From Artifact [77aa772923]:
- File src/ServerInfo.m — part of check-in [7a98b92af9] at 2025-03-25 23:52:50 on branch trunk — Make use of OF_DIRECT (user: js, size: 795) [annotate] [blame] [check-ins using]
To Artifact [774d015eb0]:
- File
src/ServerInfo.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: 801) [annotate] [blame] [check-ins using]
1 2 3 4 5 | #import "ServerInfo.h" #include "cube.h" @implementation ServerInfo | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #import "ServerInfo.h" #include "cube.h" @implementation ServerInfo + (instancetype)infoWithName: (OFString *)name; { return [[self alloc] initWithName: name]; } - (instancetype)initWithName: (OFString *)name { self = [super init]; _name = [name copy]; _full = @""; _mode = 0; _numplayers = 0; _ping = 9999; _protocol = 0; _minremain = 0; _map = @""; _sdesc = @""; _address.host = ENET_HOST_ANY; _address.port = CUBE_SERVINFO_PORT; return self; } - (OFComparisonResult)compare: (ServerInfo *)otherObject { if (![otherObject isKindOfClass: ServerInfo.class]) @throw [OFInvalidArgumentException exception]; if (_ping > otherObject.ping) return OFOrderedDescending; if (_ping < otherObject.ping) return OFOrderedAscending; return [_name compare: otherObject.name]; } @end |