"Title: " for a mission parameter, or "" when the mission has no such parameter. Falls back to the numeric value when no label matches.
| 520 | if (_state >= NGSPrepareSide) |
| 521 | { |
| 522 | mission = _missionHeader.name; |
| 523 | } |
| 524 | _server->UpdateSessionDescription(_state, mission); |
| 525 | } |
| 526 | |
| 527 | static bool service_registration_callback(MasterServerServiceRegistration& out, void* userdata) |
| 528 | { |
| 529 | return ((NetworkServer*)userdata)->FillMasterServerServiceRegistration(out); |
| 530 | } |
| 531 | |
| 532 | // Null-safe RString -> std::string (an empty RString may cast to nullptr). |
| 533 | static std::string ToStdString(const RString& value) |
| 534 | { |
| 535 | return value.GetLength() > 0 ? std::string((const char*)value) : std::string(); |
| 536 | } |
| 537 | |
| 538 | // "Title: <selected value's label>" for a mission parameter, or "" when the mission |
| 539 | // has no such parameter. Falls back to the numeric value when no label matches. |
| 540 | static std::string FormatMissionParam(const RString& title, const AutoArray<float>& values, |
| 541 | const AutoArray<RString>& texts, float selected) |
| 542 | { |
| 543 | if (title.GetLength() <= 0) |
| 544 | { |
| 545 | return std::string(); |
| 546 | } |
no test coverage detected