summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ConsoleLoader.java
blob: 5bb2fd8c3c6db2368c1daa8fb649ef072e1849fa (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
package NET.worlds.console;

import NET.worlds.network.URL;
import NET.worlds.scape.LoadedURLSelf;
import NET.worlds.scape.URLSelf;
import NET.worlds.scape.URLSelfLoader;

class ConsoleLoader implements LoadedURLSelf {
   private LoadedURLSelf callback;

   public ConsoleLoader(URL url, LoadedURLSelf callback) {
      this.callback = callback;
      URLSelfLoader.load(url, this, true);
   }

   @Override
   public void loadedURLSelf(URLSelf o, URL url, String err) {
      Console c = (Console)o;
      if (err == null && c.pilot == null) {
         if (c.disableSingleUserAccess) {
            c.callbacks.addElement(this.callback);
         } else {
            c.initPilot(url, this.callback);
         }
      } else {
         this.callback.loadedURLSelf(o, url, err);
      }
   }
}