summaryrefslogtreecommitdiff
path: root/NET/worlds/console/Netscape.java
blob: 3e7cbdd1a72258809189c5e24037885210377ee3 (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
package NET.worlds.console;

import java.io.IOException;

public class Netscape implements MainCallback, MainTerminalCallback {
   private INetscapeRegistry _registry = null;
   private NSProtocolHandler _protocolHandler = null;

   public Netscape() {
      Main.register(this);
   }

   @Override
   public void mainCallback() {
      Main.unregister(this);

      try {
         this._registry = new INetscapeRegistry();
         if ((ActiveX.getDebugLevel() & 16) > 0) {
            System.out.println("OLEDEBUG: Netscape OLE found");
         }

         this._protocolHandler = new NSProtocolHandler();
         this._protocolHandler.activate();
         if ((ActiveX.getDebugLevel() & 16) > 0) {
            System.out.println("OLEDEBUG: NSProtocolHandler started");
         }

         this._protocolHandler.register();
         boolean reg = this._registry.RegisterProtocol("world", "Gamma.Protocol.1");
         if ((ActiveX.getDebugLevel() & 16) > 0) {
            System.out.println("OLEDEBUG: world: registered with Netscape");
         }
      } catch (IOException var10) {
         if ((ActiveX.getDebugLevel() & 16) > 0) {
            System.out.println("OLEDEBUG: No Netscape: " + var10.getMessage());
         }
      } finally {
         if (this._registry != null) {
            try {
               this._registry.Release();
            } catch (OLEInvalidObjectException var9) {
               var9.printStackTrace(System.out);
            }

            this._registry = null;
         }
      }
   }

   @Override
   public void terminalCallback() {
      Main.unregister(this);
   }
}