summaryrefslogtreecommitdiff
path: root/NET/worlds/network/AutoServer.java
blob: a51970637045890480e6efcd305083cd21f97598 (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
/*     */ package NET.worlds.network;
/*     */ 
/*     */ import NET.worlds.console.Console;
/*     */ import java.io.PrintStream;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class AutoServer
/*     */   extends WorldServer
/*     */ {
/*  36 */   private static int counter = 0;
/*     */   
/*     */ 
/*     */ 
/*     */   public AutoServer()
/*     */   {
/*  42 */     if (counter++ > 0) {
/*  43 */       System.out.println("DEBUG: Created second AutoServer class.");
/*  44 */       Galaxy.printDebugging();
/*  45 */       new Exception().printStackTrace(System.out);
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */   public synchronized void incRefCnt(Object referrer)
/*     */   {
/*  52 */     super.incRefCnt(referrer);
/*  53 */     startConnect();
/*     */   }
/*     */   
/*     */   protected void state_Authprompt()
/*     */   {
/*  58 */     this._state.setState(3);
/*     */   }
/*     */   
/*     */   protected void state_XMIT_SI()
/*     */   {
/*  63 */     WorldServer newServer = null;
/*     */     
/*     */ 
/*  66 */     int servType = getServerType();
/*     */     
/*  68 */     if ((getDebugLevel() & 0x20) > 0) {
/*  69 */       System.out.println(this + ": AutoServer detected server type " + 
/*  70 */         servType);
/*     */     }
/*     */     
/*  73 */     switch (servType) {
/*     */     case 1: 
/*  75 */       newServer = new UserServer();
/*  76 */       break;
/*     */     case 2: 
/*  78 */       newServer = new AnonUserServer();
/*  79 */       break;
/*     */     case 3: 
/*  81 */       Console.println(this + Console.message("Error-in-server"));
/*  82 */       Console.println(this + Console.message("Error-user-server"));
/*  83 */       newServer = null;
/*  84 */       break;
/*     */     case 4: 
/*  86 */       newServer = new AnonRoomServer();
/*  87 */       break;
/*     */     default: 
/*  89 */       if (!$assertionsDisabled) throw new AssertionError();
/*     */       break;
/*     */     }
/*  92 */     if (newServer != null) {
/*  93 */       newServer.reuseConnection(this);
/*  94 */       newServer.initInstance(this._galaxy, this._serverURL);
/*  95 */       newServer.propertyUpdate(this._propList);
/*     */     }
/*     */     
/*  98 */     this._galaxy.killServer(this);
/*     */     
/*     */ 
/* 101 */     this._galaxy.swapServer(this, newServer);
/*     */     
/*     */ 
/* 104 */     this._galaxy.setGalaxyType(servType);
/*     */     
/*     */ 
/*     */ 
/* 108 */     if (this._refCnt - this._tmpRefCnt != 0) {
/* 109 */       System.out.println(this + 
/* 110 */         ": bad reference counts.  DEBUG INFO:");
/* 111 */       System.out.println("\t_refCnt = " + this._refCnt);
/* 112 */       System.out.println("\t_tmpRefCnt = " + this._tmpRefCnt);
/* 113 */       printReferrers();
/*     */     }
/*     */     
/* 116 */     assert (this._refCnt - this._tmpRefCnt == 0);
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 124 */     this._state.setState(17);
/*     */   }
/*     */   
/*     */   public String toString()
/*     */   {
/* 129 */     return "AutoServer(" + super.toString() + ")";
/*     */   }
/*     */   
/*     */   void goOnline()
/*     */   {
/* 134 */     super.goOnline();
/*     */     
/* 136 */     System.out.println("DEBUG: AutoServer going online!");
/* 137 */     new Exception().printStackTrace(System.out);
/*     */   }
/*     */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\AutoServer.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */