Skip to content

Commit

Permalink
Add login fail troubleshoot article
Browse files Browse the repository at this point in the history
Many players are reporting inability to login due to many factors, but the most prevalent one that has been reported is ISP block. This is confusing for the player, so this is a quick addition to give the player something to troubleshoot.
  • Loading branch information
Rian8337 committed Jun 13, 2024
1 parent 0344580 commit efc034d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ru/nsu/ccfit/zuev/osu/online/OnlineManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public synchronized boolean logIn(String username, String password) throws Onlin
ArrayList<String> response = sendRequest(post, endpoint + "login.php");

if (response == null) {
failMessage = "Cannot connect to server";
return false;
}
if (response.size() < 2) {
Expand Down
20 changes: 20 additions & 0 deletions src/ru/nsu/ccfit/zuev/osu/online/OnlineScoring.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package ru.nsu.ccfit.zuev.osu.online;

import android.content.Intent;
import android.net.Uri;

import com.google.android.material.snackbar.Snackbar;
import com.reco1l.framework.lang.Execution;
import com.reco1l.legacy.ui.multiplayer.LobbyScene;
import com.reco1l.legacy.ui.multiplayer.RoomScene;
Expand All @@ -8,6 +12,7 @@
import java.io.File;
import java.util.ArrayList;

import ru.nsu.ccfit.zuev.osu.GlobalManager;
import ru.nsu.ccfit.zuev.osu.ToastLogger;
import ru.nsu.ccfit.zuev.osu.TrackInfo;
import ru.nsu.ccfit.zuev.osu.scoring.StatisticV2;
Expand All @@ -19,6 +24,9 @@ public class OnlineScoring {
private OnlinePanel panel = null;
private OnlinePanel secondPanel = null;
private boolean avatarLoaded = false;
private final Snackbar snackbar = Snackbar.make(
GlobalManager.getInstance().getMainActivity().getWindow().getDecorView(),
"", 10000);

public static OnlineScoring getInstance() {
if (instance == null)
Expand Down Expand Up @@ -108,6 +116,18 @@ public void login() {
} else {
setPanelMessage("Cannot log in", OnlineManager.getInstance().getFailMessage());
OnlineManager.getInstance().setStayOnline(false);

if (OnlineManager.getInstance().getFailMessage().equals("Cannot connect to server")) {
snackbar.setText("Cannot connect to server. Please check the following article for troubleshooting.");

snackbar.setAction("Check", (v) -> {
var intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://neroyuki.github.io/osudroid-guide/help/login_fail"));

GlobalManager.getInstance().getMainActivity().startActivity(intent);
});

snackbar.show();
}
}
}
});
Expand Down

0 comments on commit efc034d

Please sign in to comment.