Skip to content

Commit

Permalink
feat: WIP add websocket for remote connections
Browse files Browse the repository at this point in the history
this currently uses the websocket for all connections.
  • Loading branch information
lart2150 committed Dec 31, 2023
1 parent 06613aa commit 779c607
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 231 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/rc_images
/dist
/release
/bin
/.gradle
/.settings
/config.ini
/css
/cdata.*
/*.jar
Binary file added lib/Java-WebSocket-1.5.5.jar
Binary file not shown.
16 changes: 12 additions & 4 deletions src/com/tivo/kmttg/main/config.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Stack;

import com.tivo.kmttg.rpc.Remote;
import com.tivo.kmttg.rpc.TiVoRPCWS;
import com.tivo.kmttg.util.*;
import com.tivo.kmttg.gui.gui;
import com.tivo.kmttg.httpserver.kmttgServer;
Expand Down Expand Up @@ -248,6 +249,8 @@ public class config {
public static Hashtable<String,Boolean> autoskip_ServiceItems = new Hashtable<String,Boolean>();
public static Boolean visualDetect_running = false;

private static Hashtable<String,Remote> remoteTivos = new Hashtable<String,Remote>();

public static Stack<String> parse() {
debug.print("");
String result;
Expand Down Expand Up @@ -630,13 +633,18 @@ public static void twpDeleteEnabledSet(Boolean state) {
}

public static Remote initRemote(String tivoName) {
Remote r = remoteTivos.get(tivoName);
if (r != null && r.isConnected()) {
return r;
}

if (rpcEnabled(tivoName)) {
Remote r = new Remote(tivoName);
return(r);
r = new Remote(tivoName);
} else {
Remote r = new Remote(tivoName, true);
return(r);
r = new Remote(tivoName, true);
}
remoteTivos.put(tivoName, r);
return(r);
}

public static String getTivoUsername() {
Expand Down
Loading

0 comments on commit 779c607

Please sign in to comment.