diff --git a/scc/cemuhook_server.c b/scc/cemuhook_server.c index c2950781..eadda372 100644 --- a/scc/cemuhook_server.c +++ b/scc/cemuhook_server.c @@ -346,8 +346,12 @@ bool sccd_cemuhook_socket_enable() { memset(&server_addr, 0, sizeof(struct sockaddr_in)); server_addr.sin_family = AF_INET; server_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); - server_addr.sin_port = htons(26760); - + if (const char* custom_port = getenv("SCC_SERVER_PORT")) { + server_addr.sin_port = atoi(custom_port); + } else { + server_addr.sin_port = htons(26760); + } + #ifdef _WIN32 WSADATA wsaData; int err = WSAStartup(MAKEWORD(2, 2), &wsaData); diff --git a/scc/cemuhook_server.py b/scc/cemuhook_server.py index 9c4a0c5d..0f906202 100644 --- a/scc/cemuhook_server.py +++ b/scc/cemuhook_server.py @@ -10,7 +10,7 @@ from scc.lib.enum import IntEnum from ctypes import c_uint32, c_int, c_bool, c_char_p, c_size_t, c_float from ctypes import create_string_buffer -import logging, socket +import logging, os, socket from threading import Thread from time import sleep from datetime import datetime, timedelta @@ -52,7 +52,8 @@ def __init__(self, daemon): poller = daemon.get_poller() daemon.poller.register(self.socket.fileno(), poller.POLLIN, self.on_data_recieved) - self.socket.bind(('127.0.0.1', 26760)) + server_port = os.getenv('SCC_SERVER_PORT') or PORT; + self.socket.bind(('127.0.0.1', server_port)) log.info("Created CemuHookUDP Motion Provider") Thread(target=self._keepalive).start() diff --git a/scc/device_monitor.py b/scc/device_monitor.py index 69e4d546..67c86d6a 100644 --- a/scc/device_monitor.py +++ b/scc/device_monitor.py @@ -128,8 +128,13 @@ def _dev_for_hci(self, syspath): node_addr = str.upper(node_addr) except IOError: continue - if node_addr == addr: - return node + try: + # SteamOS 3 "Holo" return caps + if node_addr.lower() == addr.lower(): + return node + # None + except AttributeError: + pass return None