summaryrefslogtreecommitdiff
path: root/NET/worlds/network/sessionInitCmd.java
blob: 1bdaeabe4f0b4de353ce2f82c02b38fe4394a2e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
 */