Commit Graph
7 Commits
Author SHA1 Message Date
SirHumza 6be235b60f fix(discord): use unauthenticated /api/gateway endpoint, drop dead code
/api/gateway/bot requires a bot Authorization header; we authenticate
as a user OAuth2 token, so it always 401s. /api/gateway is public.
Remove a no-op ternary that selected the same resource either way.
2026-08-14 08:49:40 +02:00
SirHumza 7c6ea67e40 fix(ws): send TLS SNI via SSL_ctrl (SSL_set_tlsext_host_name)
libSceLibreSSL exports SSL_ctrl but not SSL_set_tls_host directly.
SNI is required for Discord's TLS termination to route the gateway
and token endpoints correctly; without it the handshake can be
rejected. Implemented via SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME=55,
TLSEXT_NAMETYPE_host_name=0, host) — stable across OpenSSL/LibreSSL.
2026-08-14 08:48:38 +02:00
SirHumza c5568ef702 fix(detect): use sceShellCoreUtilIsAppLaunched for reliable foreground detection
- Resolve ShellCoreUtil at runtime via dlopen/dlsym (no hard import;
  GoldHEN payload loader can't always statically bind it)
- IsAppLaunched returns 0 on the home screen -> presence now clears
  correctly when the user exits a game
- Fallback to sceUserServiceGetForegroundUser if ShellCoreUtil
  unavailable in the payload context
2026-08-14 08:48:02 +02:00
SirHumza f43665a25d docs: on-console deploy + Discord app setup guide (deploy/SETUP.md) 2026-08-14 08:44:12 +02:00
SirHumza 5a0de111fe fix(build): link libSceLibreSSL, export OO_PS4_TOOLCHAIN for fself; docs: real macOS build path 2026-08-14 08:43:56 +02:00
SirHumza 20c13f1ead feat: PS4RP daemon source + working PS4 build
Full daemon source (C, PS4 native):
- log/cfg/jsonlite/b64: logging, /data/PS4RP/config.json, JSON, base64
- http.c: OAuth2 token exchange via SceHttp (authorization_code + refresh)
- ws.c: WebSocket over SceNet + LibreSSL (SSLv23_client_method),
  DNS via sceNetResolverStartNtoa, OrbisNetSockaddr packing
- discord.c: gateway connect/identify/heartbeat/presence set+clear
- detect.c: foreground game via sceUserServiceGetForegroundUser
  + app.xml/app.db title-name resolution
- main.c: poll loop (config poll_interval_s)

Build verified on macOS (LLVM 21 + OpenOrbis toolchain v0.5.4):
- 9 objects compile, lld 21 links build/ps4rp.elf (169KB)
- create-fself produces valid SCE ASLR payload build/ps4rp.fself
- libSceLibreSSL exports the OpenSSL-style TLS API used by ws.c
2026-08-14 08:43:09 +02:00
SirHumza 1f659e16a8 chore: scaffold PS4RP repo with README, jsonlite, OpenOrbis Makefile
Public public repo for the on-console Discord Rich Presence daemon.
First commit: project layout + vendored JSON parser + toolchain-backed Makefile
mirroring the OpenOrbis net_http sample. Runtime stays fully on the PS4.
2026-08-13 08:43:10 +02:00