Parcourir la source

Allow singleplayer cheats when the server doesn't accept scores

Clément Wolf il y a 3 semaines
Parent
commit
903ba352b6
4 fichiers modifiés avec 7 ajouts et 2 suppressions
  1. 1 1
      src/App/Osu/Bancho.cpp
  2. 1 1
      src/App/Osu/Osu.cpp
  3. 1 0
      src/App/Osu/OsuChangelog.cpp
  4. 4 0
      src/App/Osu/OsuRoom.cpp

+ 1 - 1
src/App/Osu/Bancho.cpp

@@ -194,7 +194,7 @@ void handle_packet(Packet *packet) {
             bancho.osu->m_optionsMenu->logInButton->setColor(0xffff0000);
             bancho.osu->m_optionsMenu->logInButton->is_loading = false;
             convar->getConVarByName("mp_autologin")->setValue(true);
-            ConVars::sv_cheats.setValue(false);
+            ConVars::sv_cheats.setValue(!bancho.submit_scores());
             print_new_channels = true;
 
             std::stringstream ss;

+ 1 - 1
src/App/Osu/Osu.cpp

@@ -2013,7 +2013,7 @@ void Osu::fireResolutionChanged() { onResolutionChanged(g_vInternalResolution);
 void Osu::onCheatsChange(UString oldValue, UString newValue) {
     (void)oldValue;
     (void)newValue;
-    if(bancho.is_online() && ConVars::sv_cheats.getBool()) {
+    if(bancho.is_online() && (bancho.submit_scores() || bancho.is_in_a_multi_room()) && ConVars::sv_cheats.getBool()) {
         ConVars::sv_cheats.setValue(false);
     }
 }

+ 1 - 0
src/App/Osu/OsuChangelog.cpp

@@ -39,6 +39,7 @@ OsuChangelog::OsuChangelog(Osu *osu) : OsuScreenBackable(osu) {
     latest.changes.push_back("- Renamed 'McOsu Multiplayer' to 'neosu'");
     latest.changes.push_back("- Added server logo to main menu button");
     latest.changes.push_back("- Added instant_replay_duration convar");
+    latest.changes.push_back("- Allowed singleplayer cheats when the server doesn't accept score submissions");
     latest.changes.push_back("- Changed default instant replay key to F2 to avoid conflicts with mod selector");
     latest.changes.push_back("- Fixed chat layout updating while chat was hidden");
     latest.changes.push_back("- Fixed pause button not working after cancelling database load");

+ 4 - 0
src/App/Osu/OsuRoom.cpp

@@ -494,6 +494,8 @@ void OsuRoom::ragequit() {
     m_osu->m_mainMenu->setVisible(true);
     m_osu->m_chat->removeChannel("#multiplayer");
     m_osu->m_chat->updateVisibility();
+
+    ConVars::sv_cheats.setValue(!bancho.submit_scores());
 }
 
 void OsuRoom::process_beatmapset_info_response(Packet packet) {
@@ -614,6 +616,8 @@ void OsuRoom::on_map_change(bool download) {
 }
 
 void OsuRoom::on_room_joined(Room room) {
+    ConVars::sv_cheats.setValue(false);
+
     bancho.room = room;
     debugLog("Joined room #%d\nPlayers:\n", room.id);
     for(int i = 0; i < 16; i++) {