Comment: | Use one autorelease pool per frame
This way, nowhere else autorelease pools need to be managed. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
489124a92fd2a7e6d543b58ce50e454f |
User & Date: | js on 2025-03-16 10:11:39 |
Other Links: | manifest | tags |
2025-03-20
| ||
10:52 | Fix projectiles check-in: be136b699f user: js tags: trunk | |
2025-03-16
| ||
10:11 | Use one autorelease pool per frame check-in: 489124a92f user: js tags: trunk | |
00:05 | Migrate vectors check-in: 853e760619 user: js tags: trunk | |
Modified src/Cube.mm from [e347edc067] to [fe88d055bb].
︙ | |||
17 18 19 20 21 22 23 | 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | + - - - - + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + - - + + + - - - - - - - - + + + + + + + + - - + + - + - - - + + + - - - + + + - - + + - - - + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + + - - - - + + + + - - + + + + + - + - - - - - - - + + + + + + + - - + + - - + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - | + (Cube *)sharedInstance { return (Cube *)OFApplication.sharedApplication.delegate; } - (void)applicationDidFinishLaunching:(OFNotification *)notification { @autoreleasepool { |
︙ | |||
319 320 321 322 323 324 325 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | - - + - - - - + + + - - - + + - | memcpy(dest, (char *)image->pixels + 3 * _width * (_height - 1 - idx), 3 * _width); endianswap(dest, 3, _width); } |
︙ |
Modified src/MD2.mm from [18fb7f56bd] to [4b55922953].
︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - - - - - - - - + + + + + + + + - - + + - - + + - - + - - + + - - - + + + - - - + + + - + - - + - - - + + + - - - - + + + + - - - - - + + + + + - + - - + + - + - | delete[] _glCommands; if (_frames) delete[] _frames; } - (bool)loadWithIRI:(OFIRI *)IRI { |
︙ |
Modified src/client.mm from [90c446262c] to [c63e414b28].
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | - - + - - + + - + - - - + - - + + - + - - - + - - - + + - | enet_peer_throttle_configure(clienthost->peers, throttle_interval * 1000, throttle_accel, throttle_decel); } void newname(OFString *name) { |
︙ | |||
283 284 285 286 287 288 289 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - | localclienttoserver((ENetPacket *)packet); } // send update to the server void c2sinfo(DynamicEntity *d) { |
︙ |
Modified src/clientextras.mm from [5e3b6ff5ad] to [364ff9cb88].
︙ | |||
103 104 105 106 107 108 109 | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - - - - - - - + + + + + + - - + + - + - + - - - - - - - - + + + + + + - - + + - - + + - | } static OFMutableArray<OFString *> *scoreLines; void renderscore(DynamicEntity *d) { |
︙ | |||
168 169 170 171 172 173 174 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - | if (!demoplayback) addteamscore(player1); OFMutableString *teamScores = [[OFMutableString alloc] init]; for (size_t j = 0; j < teamsUsed; j++) [teamScores appendFormat:@"[ %@: %d ]", teamName[j], teamScore[j]]; menumanual(0, scoreLines.count, @""); |
︙ |
Modified src/clients2c.mm from [ef18048f8b] to [1561f54e4a].
︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - - - - + + + - - - - + + + - | toservermap = @""; clientnum = cn; // we are now fully connected if (!getint(p)) // we are the first client on this server, set // map toservermap = getclientmap(); sgetstr(); |
︙ | |||
146 147 148 149 150 151 152 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - - + - | case SV_TEXT: sgetstr(); conoutf(@"%@:\f %s", d.name, text); break; case SV_MAPCHANGE: sgetstr(); |
︙ | |||
374 375 376 377 378 379 380 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | - - - - - + + + + - | break; case SV_RECVMAP: { sgetstr(); conoutf(@"received map \"%s\" from server, reloading..", text); int mapsize = getint(p); |
︙ |
Modified src/commands.mm from [d5247fc383] to [8783bcd63b].
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - - - + + - - - - - - + + + + + - | p--; conoutf(@"missing \"%c\"", right); return NULL; } } char *s = strndup(word, p - word - 1); if (left == '(') { |
︙ | |||
160 161 162 163 164 165 166 167 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | + - + - - + - - + - - - - + + + - | char *word = p; p += strcspn(p, "; \t\r\n\0"); if (p - word == 0) return NULL; return strndup(word, p - word); } // find value of ident referenced with $ in exp OFString * |
︙ | |||
230 231 232 233 234 235 236 | 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - + - - - - + + - - + + - - - - + + + + - - - - - - - + + + + + + + - - - + + - + - - + + - - - - - - - - - - + + + + + + + + - - + + - - - - - - - + + + + + - | return 0; } // all evaluation happens here, recursively int execute(OFString *string, bool isDown) { |
︙ | |||
414 415 416 417 418 419 420 | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | - - + - - - + - - - - + + + + - | // below the commands that implement a small imperative language. thanks to the // semantics of () and [] expressions, any control construct can be defined // trivially. void intset(OFString *name, int v) { |
︙ | |||
468 469 470 471 472 473 474 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | - - + - - + + - - - - + + + + - + - - - - - - - - + + + + + + - | { concat([s stringByReplacingOccurrencesOfString:@" " withString:@""]); } int listlen(OFString *a_) { |
︙ |
Modified src/console.mm from [6b830d51dc] to [c4ec2131b8].
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | - - - + + - - + + - + - - - - - - + + + + + + - | fflush(stdout); #endif } void conoutf(OFConstantString *format, ...) { |
︙ | |||
177 178 179 180 181 182 183 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - - - + + - - - + - | commandbuf = [init mutableCopy]; } COMMAND(saycommand, ARG_VARI) void mapmsg(OFString *s) { |
︙ | |||
258 259 260 261 262 263 264 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | - - - - - + + + + - - - - - + + + + + - - - + - | default: resetcomplete(); } } else { if (code == SDLK_RETURN) { if (commandbuf.length > 0) { |
︙ |
Modified src/editing.mm from [76cc8ec718] to [2700645c79].
︙ | |||
600 601 602 603 604 605 606 | 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | - - - - + + + - | loopselxy(s->tag = tag); } void newent(OFString *what, OFString *a1, OFString *a2, OFString *a3, OFString *a4) { EDITSEL; |
︙ |
Modified src/entities.mm from [0816ef168b] to [58180dec4d].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - - + - - + - - - - + + - | loopv(ents) { entity &e = ents[i]; if (e.type == MAPMODEL) { MapModelInfo *mmi = getmminfo(e.attr2); if (mmi == nil) continue; |
︙ |
Modified src/menus.mm from [8be4b9144c] to [e754271834].
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - - - - - + + + + - - + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - | } void refreshservers(); bool rendermenu() { |
︙ | |||
150 151 152 153 154 155 156 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - + - - + - - | menusel = n - 1; else if (menusel >= n) menusel = 0; menus[vmenu].menusel = menusel; } else { if (code == SDLK_RETURN || code == -2) { OFString *action = menus[vmenu].items[menusel].action; |
Modified src/renderextras.mm from [5d964620ef] to [87f5ac882b].
︙ | |||
199 200 201 202 203 204 205 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - - + - - + + - - + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + - + - | getvar(@"selxs"), getvar(@"selys")]; } } void loadsky(OFString *basename) { |
︙ | |||
363 364 365 366 367 368 369 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - - - + + - - - - - - + + + + + + - | dblend -= curtime / 3; if (dblend < 0) dblend = 0; } glEnable(GL_TEXTURE_2D); |
︙ |
Modified src/rendergl.mm from [e315f901d3] to [6d1422bea1].
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | - - - - - - - + + + + + - - - - + + + + - - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + - - - - - - + + + + + + - + - - - - - - - + + + + + + + - - - + + + - - + + - + - + - | if (qsphere) gluDeleteQuadric(qsphere); } bool installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp) { |
︙ | |||
193 194 195 196 197 198 199 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - - + - - + + - + - - - + + - | curtexnum = 0; } COMMAND(texturereset, ARG_NONE) void texture(OFString *aframe, OFString *name) { |
︙ | |||
239 240 241 242 243 244 245 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | - - - + + - - - - - - - - - - - + + + + + + + + + + + - | if (curtex == MAXTEX) fatal(@"loaded too many textures"); int tnum = curtex + FIRSTTEX; texname[curtex] = mapname[tex][frame]; |
︙ |
Modified src/rendermd2.mm from [08d6b30ba2] to [9b0441a720].
︙ | |||
12 13 14 15 16 17 18 | 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - - - - - + + + + - - - - + + + - - - - - + + + + - - - + - - - + + + - - - + + + - - - - - + - - + + - + - + - | static const int FIRSTMDL = 20; void delayedload(MD2 *m) { if (!m.loaded) { |
︙ |
Modified src/rendertext.mm from [d117eaf6b5] to [4a2a0ee6d3].
︙ | |||
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | - - - + + - - - - - - - + + + + + + + - - + + - - - - + + + + - - - + + + - - - + + + - + - - - - - - - - + + + + + + - - - - - + + + - - + + - - - + + + - - - - + + + + - - + + - - - - + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - | { 270, 448, 310, 512 }, //} { 310, 448, 363, 512 }, //~ }; int text_width(OFString *string) { |
︙ |
Modified src/savegamedemo.mm from [7c09343b90] to [b5a43a0cf0].
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + - - - - - - + + + + + - - - - - - - + + + + - | if (demorecording) stop(); } void savestate(OFIRI *IRI) { |
︙ | |||
282 283 284 285 286 287 288 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | - - - - - - - - - - - + + + + + + + + + - | return; } int cn = getclientnum(); if (cn < 0) return; |
︙ | |||
344 345 346 347 348 349 350 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - - - - - - - + + + + + - | // the network } } void demo(OFString *name) { |
︙ |
Modified src/server.mm from [7081fc19b8] to [bc477ab2a8].
︙ | |||
169 170 171 172 173 174 175 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - - + - - - - + + + - | no++; } } if (yes == 1 && no == 0) return true; // single player |
︙ | |||
211 212 213 214 215 216 217 | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - - + - - - - - + + + - - - + - | switch ((type = getint(p))) { case SV_TEXT: sgetstr(); break; case SV_INITC2S: sgetstr(); |
︙ | |||
280 281 282 283 284 285 286 | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | - - + - | loopi(size - 2) getint(p); break; } case SV_SENDMAP: { sgetstr(); int mapsize = getint(p); |
︙ | |||
325 326 327 328 329 330 331 | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - - + - | ENetPacket *packet = 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); |
︙ | |||
489 490 491 492 493 494 495 | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | - - - - - - + + + + - | switch (event.type) { 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]; |
︙ | |||
562 563 564 565 566 567 568 | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | - - - - + + + - + + - - - + + + + | serverpassword = passwd; maxclients = maxcl; servermsinit(master ? master : @"wouter.fov120.com/cube/masterserver/", sdesc, dedicated); if ((isdedicated = dedicated)) { ENetAddress address = { ENET_HOST_ANY, CUBE_SERVER_PORT }; |
Modified src/serverbrowser.mm from [fbd128e000] to [bb466005e7].
︙ | |||
176 177 178 179 180 181 182 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - - - - + + + - - + + - - + - | { return servers[n].name; } void addserver(OFString *servername) { |
︙ | |||
256 257 258 259 260 261 262 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | - - + - - - + - | si.protocol = getint(p); if (si.protocol != PROTOCOL_VERSION) si.ping = 9998; si.mode = getint(p); si.numplayers = getint(p); si.minremain = getint(p); sgetstr(); |
︙ | |||
302 303 304 305 306 307 308 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | - - - + + - | initWithFormat: (si.address.host != ENET_HOST_ANY ? @"%@ [waiting for server response]" : @"%@ [unknown host]\t"), si.name]; // cut off too long server descriptions |
︙ | |||
344 345 346 347 348 349 350 | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | - - + - - - - + + - | uchar buf[MAXUPD]; uchar *reply = retrieveservers(buf, MAXUPD); if (!*reply || strstr((char *)reply, "<html>") || strstr((char *)reply, "<HTML>")) conoutf(@"master server not replying"); else { [servers removeAllObjects]; |
Modified src/serverms.mm from [fcffeffeb7] to [4bb1ac1ee8].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + - | // all server side masterserver and pinging functionality #include "cube.h" static ENetSocket mssock = ENET_SOCKET_NULL; static void httpgetsend(ENetAddress &ad, OFString *hostname, OFString *req, OFString *ref, OFString *agent) { if (ad.host == ENET_HOST_ANY) { [OFStdOut writeFormat:@"looking up %@...\n", hostname]; |
︙ | |||
75 76 77 78 79 80 81 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - - - + + - - - + + - - - - - - + + + + - | static ENetBuffer masterb; static void updatemasterserver(int seconds) { // send alive signal to masterserver every hour of uptime if (seconds > updmaster) { |
︙ | |||
156 157 158 159 160 161 162 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | - - - - - - - - - + + + + + + + + - - + + - - - - - - - + + + + + + - | enet_socket_send(pongsock, &addr, &buf, 1); } } void servermsinit(OFString *master_, OFString *sdesc, bool listen) { |
Modified src/serverutil.mm from [26cbbdcb4f] to [0ddeef8a46].
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - - + - - + + - + - | } else return c; } void sendstring(OFString *t_, uchar *&p) { |
︙ |
Modified src/sound.mm from [7cef1841c0] to [285830fef5].
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | - - - - - - - + + + + + + - - + + - - - - + + + - - + + - - - - - - + + + + + - - - - - - - - + + + + + + + - - - + + - | void music(OFString *name) { if (nosound) return; stopsound(); if (soundvol && musicvol) { |
︙ |
Modified src/world.mm from [f38617a638] to [2ac8b85a8f].
︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | - - - + + - - + + - | return; settag(tag, type); if (!savegame && type != 3) playsound(S_RUMBLE); |
︙ | |||
302 303 304 305 306 307 308 | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | - - + - - - - - + + + - | { int e = closestent(); if (e < 0) { conoutf(@"no more entities"); return; } int t = ents[e].type; |
︙ |
Modified src/worldio.mm from [f3a87aa011] to [1dbc40dfe7].
︙ | |||
10 11 12 13 14 15 16 | 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 43 44 | - - - - - + + + + - - - - - - - + + + + + + + - - + + - - - - - - - + + + + + + - | } static OFString *cgzname, *bakname, *pcfname, *mcfname; static void setnames(OFString *name) { |
︙ | |||
156 157 158 159 160 161 162 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - | // run-length encoding and leaves out data for certain kinds of cubes, then zlib // removes the last bits of redundancy. Both passes contribute greatly to the // miniscule map sizes. void save_world(OFString *mname) { |