| 446 | } |
| 447 | return NMFHighPriority; |
| 448 | } |
| 449 | |
| 450 | void NetworkClient::SetParams(float param1, float param2) |
| 451 | { |
| 452 | _param1 = param1; |
| 453 | _param2 = param2; |
| 454 | |
| 455 | MissionParamsMessage msg; |
| 456 | msg._param1 = param1; |
| 457 | msg._param2 = param2; |
| 458 | SendMsg(&msg, NMFGuaranteed); |
| 459 | } |
| 460 | |
| 461 | void NetworkClient::OnSimulate() |
| 462 | { |
| 463 | // raw statistics |
| 464 | #if _ENABLE_CHEATS |
| 465 | // remove statistics info |
| 466 | static AutoArray<int> texts; |
| 467 | for (int i = 0; i < texts.Size(); i++) |
| 468 | { |
| 469 | if (texts[i] >= 0) |
| 470 | GEngine->RemoveText(texts[i]); |
| 471 | } |
| 472 | texts.Resize(0); |
| 473 | |
| 474 | if (outputDiags == 4) |
| 475 | { |
| 476 | NET_ERROR(_rawStatistics.Size() <= 1); |
| 477 | if (_rawStatistics.Size() > 0) |
| 478 | { |
| 479 | char output[1024]; |
| 480 | snprintf(output, sizeof(output), "Server: sent %d (%d), received %d (%d)", _rawStatistics[0].sizeSent, |
| 481 | _rawStatistics[0].msgSent, _rawStatistics[0].sizeReceived, _rawStatistics[0].msgReceived); |
| 482 | texts.Add(GEngine->ShowTextF(1000, 10, 15, output)); |
| 483 | } |
| 484 | } |
| 485 | #endif |
| 486 | |
| 487 | _connectionQuality = CQGood; |
| 488 | |
| 489 | #if _ENABLE_CHEATS |
| 490 | auto& input = InputSubsystem::Instance(); |
| 491 | if (input.GetCheat2ToDo(SDL_SCANCODE_COMMA)) |
| 492 | { |
| 493 | outputLogs = !outputLogs; |
| 494 | if (outputLogs) |
| 495 | GEngine->ShowMessage(500, "message logs on"); |
| 496 | else |
| 497 | GEngine->ShowMessage(500, "message logs off"); |
| 498 | } |
| 499 | if (input.GetCheat2ToDo(SDL_SCANCODE_SEMICOLON)) |
| 500 | { |
| 501 | outputDiags++; |
| 502 | if (outputDiags > nOutputDiags) |
| 503 | outputDiags = 0; |
| 504 | } |
| 505 | if (input.GetCheat2ToDo(SDL_SCANCODE_APOSTROPHE)) |
nothing calls this directly
no test coverage detected