diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/network/RoomServer.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/network/RoomServer.java')
| -rw-r--r-- | NET/worlds/network/RoomServer.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/NET/worlds/network/RoomServer.java b/NET/worlds/network/RoomServer.java new file mode 100644 index 0000000..02f80ea --- /dev/null +++ b/NET/worlds/network/RoomServer.java @@ -0,0 +1,68 @@ +package NET.worlds.network; + +import NET.worlds.core.IniFile; + +public class RoomServer extends AnonRoomServer { + @Override + public synchronized void incRefCnt(Object referrer) { + super.incRefCnt(referrer); + this.startConnect(); + } + + protected void state_Authprompt() { + this._state.setState(3); + } + + @Override + protected sessionInitCmd buildSessionInitCmd() { + OldPropertyList props = new OldPropertyList(); + String username = null; + props.addProperty(new netProperty(3, String.valueOf(this.getVersion()))); + props.addProperty(new netProperty(9, String.valueOf(this._clientVersion))); + this._firstLogon = this._galaxy.addPendingServer(this); + if (this._firstLogon) { + return null; + } else { + int avatars = IniFile.gamma().getIniInt("avatars", 24); + props.addProperty(new netProperty(7, Integer.toString(avatars))); + + assert this._galaxy.getChatname() != null; + + username = this._galaxy.getChatname(); + this.regShortID(1, username); + props.addProperty(new netProperty(2, username)); + if (this._galaxy.getLoginMode() != 3 && this._galaxy.getPassword() != null) { + props.addProperty(new netProperty(6, this._galaxy.getPassword())); + } + + if ((getDebugLevel() & 4) > 0) { + synchronized (System.out) { + System.out.println(this._serverURL.getHost() + ": sending sessionInit."); + + assert username != null; + + System.out.println(" username = \"" + username + "\""); + if (this._galaxy.getPassword() != null) { + System.out.println(" password = \"" + this._galaxy.getPassword() + "\""); + } + } + } + + return new sessionInitCmd(props); + } + } + + @Override + protected void state_Sleeping(int timeNow) { + if (this.getGalaxy().isActive()) { + super.state_Sleeping(timeNow); + } else { + this._state.setState(0); + } + } + + @Override + void goOnline() { + this._requestOffline = false; + } +} |