LabyMod / LabyMod/labymod4-server-api
An integrated GeoIP for inexperienced programmers
Open
Nobody has claimed this yet.
enhancement
pending
- Dominant language
- Java
- Stars
- 12
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
General Troubleshooting
- I am using the latest version of the LabyMod 4 Server API.
- I have checked for similar issues on the Issue-tracker.
- I have checked for Pull Requests that might already address this issue.
Feature Request
So that even inexperienced programmers can query the country of a player and then set the flag for it in a simplified manner.
Example Use-Case
public static String getCountryCode(String ip) {
String apiUrl = "http://ip-api.com/json/" + ip;
try {
URL url = new URL(apiUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
Map<String, Object> json = new Gson().fromJson(reader, Map.class);
reader.close();
return json.containsKey("countryCode") ? (String) json.get("countryCode") : "Unknown";
} catch (Exception e) {
e.printStackTrace();
return "Error";
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a repository file, test, or entry point; begin by reviewing the Java server API structure and the supplied GeoIP example. Clarify the supported lookup and flag-setting interface, then verify that a programmer can query a player's country through the API without implementing the external request themselves.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100