From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/network/AnonUserServer.java | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 NET/worlds/network/AnonUserServer.java (limited to 'NET/worlds/network/AnonUserServer.java') diff --git a/NET/worlds/network/AnonUserServer.java b/NET/worlds/network/AnonUserServer.java new file mode 100644 index 0000000..7a3d42b --- /dev/null +++ b/NET/worlds/network/AnonUserServer.java @@ -0,0 +1,75 @@ +package NET.worlds.network; + +public class AnonUserServer extends WorldServer { + protected sessionInitCmd buildSessionInitCmd() { + OldPropertyList props = new OldPropertyList(); + props.addProperty(new netProperty(3, String.valueOf(this.getVersion()))); + props.addProperty(new netProperty(9, String.valueOf(this._clientVersion))); + this._firstLogon = this._galaxy.addPendingServer(this); + + assert this._firstLogon; + + assert this._galaxy.getPassword() == null; + + assert this._galaxy.getLoginMode() != 1; + + assert this._galaxy.getLoginMode() != 4; + + assert this._galaxy.getSerialNum() == null; + + switch (this._galaxy.getLoginMode()) { + case 2: + assert this._galaxy.getChatname() != null; + + this.regShortID(1, this._galaxy.getChatname()); + props.addProperty(new netProperty(2, this._galaxy.getChatname())); + if (this._firstLogon) { + props.addProperty(new netProperty(12, "1")); + } + break; + case 3: + assert this._galaxy.getGuestExpiration() != null; + + props.addProperty(new netProperty(14, this._galaxy.getGuestExpiration())); + if (this._firstLogon) { + props.addProperty(new netProperty(12, "1")); + } + break; + default: + assert false; + } + + if ((getDebugLevel() & 4) > 0) { + synchronized (System.out) { + System.out.println(this._serverURL.getHost() + ": sending sessionInit."); + System.out.println(" username = \"" + this._galaxy.getChatname() + "\""); + if (this._galaxy.getPassword() != null) { + System.out.println(" password = " + this._galaxy.getPassword()); + } + + if (this._galaxy.getLoginMode() == 3) { + System.out.println(" VAR_GUEST"); + } + } + } + + return new sessionInitCmd(props); + } + + @Override + protected void state_XMIT_SI() { + if (this._requestOffline) { + this._state.setState(17); + } else { + sessionInitCmd SI = this.buildSessionInitCmd(); + + try { + this.sendNetMsg(SI); + } catch (PacketTooLargeException var3) { + assert false; + } + + this._state.setState(8); + } + } +} -- cgit v1.2.3