summaryrefslogtreecommitdiff
path: root/NET/worlds/network/sessionInitCmd.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/network/sessionInitCmd.java')
-rw-r--r--NET/worlds/network/sessionInitCmd.java199
1 files changed, 199 insertions, 0 deletions
diff --git a/NET/worlds/network/sessionInitCmd.java b/NET/worlds/network/sessionInitCmd.java
new file mode 100644
index 0000000..1bdaeab
--- /dev/null
+++ b/NET/worlds/network/sessionInitCmd.java
@@ -0,0 +1,199 @@
+/* */ package NET.worlds.network;
+/* */
+/* */ import NET.worlds.console.Console;
+/* */ import java.io.PrintStream;
+/* */ import java.util.Enumeration;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class sessionInitCmd
+/* */ extends propCmd
+/* */ {
+/* */ public static final byte SESSIONINITCMD = 6;
+/* */
+/* */ public sessionInitCmd()
+/* */ {
+/* 75 */ this._commandType = 6;
+/* */ }
+/* */
+/* */
+/* */ public sessionInitCmd(String user, String pass, String proto, String avatars, String ver)
+/* */ {
+/* 81 */ this._commandType = 6;
+/* */
+/* 83 */ assert (user != null);
+/* 84 */ this._propList.addProperty(new netProperty(2, user));
+/* 85 */ if (pass != null)
+/* 86 */ this._propList.addProperty(new netProperty(6, pass));
+/* 87 */ this._propList.addProperty(new netProperty(3, proto));
+/* 88 */ this._propList.addProperty(new netProperty(7, avatars));
+/* 89 */ this._propList.addProperty(new netProperty(9, ver));
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public sessionInitCmd(OldPropertyList props)
+/* */ {
+/* 99 */ this._commandType = 6;
+/* 100 */ this._propList = props;
+/* */ }
+/* */
+/* */ void process(WorldServer serv) throws Exception
+/* */ {
+/* 105 */ if (serv.getState() != 8) {
+/* 106 */ return;
+/* */ }
+/* */
+/* 109 */ for (int i = 0; i < this._propList.size(); i++) {
+/* 110 */ netProperty tmpProp = this._propList.elementAt(i);
+/* 111 */ switch (tmpProp.property()) {
+/* */ case 4:
+/* */ try {
+/* 114 */ int errorval = Integer.parseInt(tmpProp.value());
+/* 115 */ if (errorval != 0)
+/* 116 */ throw new VarErrorException(errorval);
+/* */ } catch (NumberFormatException e) {
+/* 118 */ System.err.println("sessionInitCmd: couldn't parse VAR_ERROR = " +
+/* 119 */ tmpProp.value());
+/* */ }
+/* */
+/* */ case 1:
+/* */ case 3:
+/* */ case 13:
+/* */ case 15:
+/* */ break;
+/* */
+/* */ case 8:
+/* */ break;
+/* */
+/* */ case 10:
+/* 132 */ serv.getGalaxy().setSerialNum(tmpProp.value());
+/* 133 */ break;
+/* */ case 2:
+/* 135 */ serv.setUsername(tmpProp.value());
+/* */
+/* */
+/* */
+/* */
+/* 140 */ serv.getGalaxy().setNewChatname(null);
+/* 141 */ break;
+/* */ case 6:
+/* 143 */ serv.getGalaxy().setPassword(tmpProp.value());
+/* */
+/* 145 */ serv.getGalaxy().setNewPassword(null);
+/* 146 */ break;
+/* */
+/* */ case 5:
+/* 149 */ serv.getGalaxy().setChannel(tmpProp.value());
+/* 150 */ break;
+/* */ case 22:
+/* */ try {
+/* 153 */ int priv = Integer.parseInt(tmpProp.value());
+/* */
+/* */
+/* */
+/* 157 */ Enumeration<NetworkObject> list = serv.getGalaxy().getConsoles();
+/* 158 */ while (list.hasMoreElements()) {
+/* 159 */ Console c = (Console)list.nextElement();
+/* 160 */ c.setVIP((priv & 0x8) != 0);
+/* 161 */ c.setFullVIP((priv & 0x10) != 0);
+/* 162 */ c.setSpecialGuest((priv & 0x40) != 0);
+/* */ }
+/* */
+/* 165 */ list = serv.getGalaxy().getConsoles();
+/* 166 */ while (list.hasMoreElements()) {
+/* 167 */ Console c = (Console)list.nextElement();
+/* 168 */ c.enableBroadcast((priv & 0x2) != 0);
+/* */ }
+/* */ } catch (NumberFormatException localNumberFormatException1) {}
+/* */ case 7: case 9: case 11: case 12:
+/* */ case 14: case 16: case 17: case 18:
+/* */ case 19: case 20: case 21: default:
+/* 174 */ System.out.println("sessionInitCmd: received unknown property: " +
+/* 175 */ tmpProp.property());
+/* 176 */ if (!$assertionsDisabled) { throw new AssertionError();
+/* */ }
+/* */ break;
+/* */ }
+/* */
+/* */ }
+/* 182 */ if (serv.getVersion() < 18) {
+/* 183 */ serv.setState(9);
+/* */ } else {
+/* 185 */ serv.setState(11);
+/* */ }
+/* */ }
+/* */
+/* */ public String toString(WorldServer serv)
+/* */ {
+/* 191 */ return "SESSINIT " + this._propList;
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\sessionInitCmd.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file