Skip to content

Commit

Permalink
Don't make the server use ssl by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Jun 20, 2024
1 parent 02b96dc commit 9e90c52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ config.json
hotfix.json
*.mv
*.exe
*.p12
BuildConfig.java
Test.java
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
### Connecting with the client (Fiddler method)
1. **Log in with the client to an official server and Hoyoverse account at least once to download game data.**
2. Install and have [Fiddler Classic](https://www.telerik.com/fiddler) running.
3. Set fiddler to decrypt https traffic. (Tools -> Options -> HTTPS -> Decrypt HTTPS traffic) Make sure `ignore server certificate errors` is checked as well.
4. Copy and paste the following code into the Fiddlerscript tab of Fiddler Classic:
3. Copy and paste the following code into the Fiddlerscript tab of Fiddler Classic. Remember to save the fiddler script after you copy and paste it:

```
import System;
Expand All @@ -51,14 +50,15 @@ class Handlers
{
static function OnBeforeRequest(oS: Session) {
if (oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".mihoyo.com") || oS.host.EndsWith(".bhsr.com")) {
oS.oRequest.headers.UriScheme = "http";
oS.host = "localhost"; // This can also be replaced with another IP address.
}
}
};
```

5. If `autoCreateAccount` is set to true in the config, then you can skip this step. Otherwise, type `/account create [account name]` in the server console to create an account.
6. Login with your account name, the password field is ignored by the server and can be set to anything.
4. If `autoCreateAccount` is set to true in the config, then you can skip this step. Otherwise, type `/account create [account name]` in the server console to create an account.
5. Login with your account name, the password field is ignored by the server and can be set to anything.

### Server commands
Server commands can be run in the server console or in-game. There is a dummy user named "Server" in every player's friends list that you can message to use in-game commands.
Expand Down
Binary file removed keystore.p12
Binary file not shown.
6 changes: 3 additions & 3 deletions src/main/java/emu/lunarcore/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Config {

public KeystoreInfo keystore = new KeystoreInfo();

public HttpServerConfig httpServer = new HttpServerConfig(443);
public HttpServerConfig httpServer = new HttpServerConfig(80);
public GameServerConfig gameServer = new GameServerConfig(23301);

public ServerOptions serverOptions = new ServerOptions();
Expand Down Expand Up @@ -46,7 +46,7 @@ public static class InternalMongoInfo {
@Getter
public static class KeystoreInfo {
public String path = "./keystore.p12";
public String password = "lunar";
public String password = "";
}

@Getter
Expand Down Expand Up @@ -83,7 +83,7 @@ public int getPublicPort() {

@Getter
public static class HttpServerConfig extends ServerConfig {
public boolean useSSL = true;
public boolean useSSL = false;
public long regionListRefresh = 60_000; // Time in milliseconds to wait before refreshing region list cache again

public HttpServerConfig(int port) {
Expand Down

0 comments on commit 9e90c52

Please sign in to comment.