summaryrefslogtreecommitdiff
path: root/NET/worlds/console/GammaPhoneMonitor.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/GammaPhoneMonitor.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/console/GammaPhoneMonitor.java')
-rw-r--r--NET/worlds/console/GammaPhoneMonitor.java149
1 files changed, 149 insertions, 0 deletions
diff --git a/NET/worlds/console/GammaPhoneMonitor.java b/NET/worlds/console/GammaPhoneMonitor.java
new file mode 100644
index 0000000..b943d38
--- /dev/null
+++ b/NET/worlds/console/GammaPhoneMonitor.java
@@ -0,0 +1,149 @@
+package NET.worlds.console;
+
+import NET.worlds.scape.WavSoundPlayer;
+
+public class GammaPhoneMonitor extends Thread {
+ public static final int GA_FAILEDCONNECT = 100;
+ public static final int GPE_WHATEVER = 0;
+ public static final int GPE_OUT_OF_MEM = 1;
+ public static final int GPE_WEIRD = 2;
+ public static final int GPE_SOCKET = 3;
+ public static final int GPE_COMM = 4;
+ public static final int GPE_HOST = 5;
+ public static final int GPE_FILE = 6;
+ public static final int GPE_CRYPTO = 7;
+ public static final int GPE_MULTICAST = 8;
+ public static final int GPE_RECORD = 9;
+ public static final int GPE_WAVE_INPUT = 10;
+ public static final int GPE_PLAY = 11;
+ public static final int GPE_WAVE_OUTPUT = 12;
+ public static final int GPE_PORT = 13;
+ public static final int GPE_SOCKETS_VERSION = 14;
+ public static final int GPE_HALF_DUPLEX = 15;
+ public static final int GPE_USAGE = 16;
+ public static final int GPE_IS_HALF_DUPLEX = 17;
+ public static final int GPE_IS_FULL_DUPLEX = 18;
+ public static final int GPE_LWL = 19;
+ public static final int GPE_TIMEOUT = 20;
+ public static final int GPE_WAVE_IN_USE = 21;
+ public static final int GPE_CONNECTION_LOST = 22;
+ public static final int GPE_SUCCESS = 900;
+ public static final int GPE_STARTUP = 901;
+ public static final int GPE_SHUTDOWN = 902;
+ private VoiceChat _vc = null;
+
+ public GammaPhoneMonitor(VoiceChat v) {
+ this._vc = v;
+ }
+
+ private void release() {
+ this._vc.release();
+ }
+
+ @Override
+ public void run() {
+ int m = 0;
+ Window w = Window.getMainWindow();
+
+ try {
+ while (true) {
+ if (Window.getVoiceChatWParam() != 0) {
+ this.processMessage(Window.getVoiceChatWParam(), Window.getVoiceChatLParam());
+ Window.resetVoiceChatMsg();
+ }
+
+ Thread.sleep(1000L);
+ }
+ } catch (InterruptedException var4) {
+ this.stop();
+ }
+ }
+
+ private void processMessage(int wParam, int lParam) {
+ switch (wParam) {
+ case 0:
+ this._vc.inform(wParam, "whatever ");
+ break;
+ case 1:
+ this._vc.inform(wParam, "out of memory ");
+ break;
+ case 2:
+ this._vc.inform(wParam, "! ");
+ break;
+ case 3:
+ this._vc.inform(wParam, "An error occurred while setting up the socket for Voice Chat.");
+ break;
+ case 4:
+ this._vc.inform(wParam, "communications ");
+ break;
+ case 5:
+ this._vc.inform(wParam, "can't find host ");
+ break;
+ case 6:
+ this._vc.inform(wParam, "can't open/read/write file ");
+ break;
+ case 7:
+ this._vc.inform(wParam, "we don't even use this! ");
+ break;
+ case 8:
+ this._vc.inform(wParam, "we don't even use this! ");
+ break;
+ case 9:
+ this._vc.inform(wParam, "can't record at 8000 or 11200 samp/sec");
+ break;
+ case 10:
+ this._vc.inform(wParam, "error opening wave input device ");
+ break;
+ case 11:
+ this._vc.inform(wParam, "sound card can't play at 8000 or 11200");
+ break;
+ case 12:
+ this._vc.inform(wParam, "error opening wave output device ");
+ break;
+ case 13:
+ this._vc.inform(wParam, "invalid port number specified ");
+ break;
+ case 14:
+ this._vc.inform(wParam, "incompatible (old) sockets library ");
+ break;
+ case 15:
+ this._vc.inform(wParam, "sound drivers can't support full duplex");
+ break;
+ case 16:
+ this._vc.inform(wParam, "command line syntax error ");
+ break;
+ case 17:
+ this._vc.inform(wParam, "response to isFullDuplex command ");
+ break;
+ case 18:
+ this._vc.inform(wParam, "response to isFullDuplex command ");
+ break;
+ case 19:
+ this._vc.inform(wParam, " -Look Who's Listening- error, weird! ");
+ break;
+ case 20:
+ this._vc.inform(wParam, "Never heard back. ");
+ break;
+ case 21:
+ this._vc.inform(wParam, "VoiceChat failed because a wav device is in use.");
+ break;
+ case 22:
+ this._vc.inform(wParam, "VoiceChat has lost its connection.");
+ break;
+ case 100:
+ Console.println(Console.message("Voice-failed"));
+ break;
+ case 900:
+ this._vc.inform(wParam, "It worked o.k. ");
+ break;
+ case 901:
+ this._vc.registerProcess(lParam);
+ break;
+ case 902:
+ WavSoundPlayer.resumeSystem();
+ break;
+ default:
+ Console.println(Console.message("Unrec-message") + wParam);
+ }
+ }
+}