Skip to content

Commit 7f36e99

Browse files
committed
back to where we was! lol
1 parent 41c07af commit 7f36e99

6 files changed

Lines changed: 9 additions & 29 deletions

File tree

-512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

OASIS Omniverse/ODOOM/uzdoom_star_integration.cpp

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -278,16 +278,6 @@ static int ODOOM_GetRawKeyDown(int vk_or_ascii)
278278
#endif
279279
}
280280

281-
/** Return true if item name is in the cached inventory (avoids main-thread API call when cache is valid). */
282-
static bool ODOOM_CachedHasItem(const char* keyname) {
283-
if (!keyname || !g_odoom_cached_inventory) return false;
284-
for (size_t i = 0; i < g_odoom_cached_inventory->count; i++) {
285-
if (strcmp(g_odoom_cached_inventory->items[i].name, keyname) == 0)
286-
return true;
287-
}
288-
return false;
289-
}
290-
291281
/** Start background inventory sync if we have pending items and no sync in progress. */
292282
static void ODOOM_StartInventorySyncIfNeeded(void) {
293283
if (!g_star_initialized || star_sync_inventory_in_progress())
@@ -310,9 +300,9 @@ static void ODOOM_StartInventorySyncIfNeeded(void) {
310300
* star_sync uses background threads for auth and (in OQuake) inventory; direct star_api_* calls run on the calling thread. */
311301
static void ODOOM_STAR_PollAsyncAuth(void)
312302
{
313-
/* When not pending, only poll every 12th frame (~5 Hz) to reduce overhead; when pending, poll every frame. */
303+
/* When not pending, only poll every 6th frame (~10 Hz) to reduce overhead; when pending, poll every frame. */
314304
static int s_auth_poll_skip = 0;
315-
if (!g_star_async_auth_pending && (s_auth_poll_skip++ % 12 != 0))
305+
if (!g_star_async_auth_pending && (s_auth_poll_skip++ % 6 != 0))
316306
return;
317307
if (star_sync_auth_poll() != 1)
318308
return;
@@ -342,8 +332,6 @@ static void ODOOM_STAR_PollAsyncAuth(void)
342332
if (g_star_client_ready && !star_sync_inventory_in_progress())
343333
star_sync_inventory_start(nullptr, 0, "ODOOM", nullptr, nullptr);
344334
Printf(PRINT_NONOTIFY, "Beam-in successful. Cross-game features enabled.\n");
345-
if (!g_star_effective_avatar_id.empty())
346-
Printf(PRINT_NONOTIFY, "STAR: avatar_id set (use same login in OQuake for shared inventory).\n");
347335
} else {
348336
Printf(PRINT_NONOTIFY, "Beam-in failed: %s\n", error_buf[0] ? error_buf : star_api_get_last_error());
349337
}
@@ -353,15 +341,8 @@ void ODOOM_InventoryInputCaptureFrame(void)
353341
{
354342
ODOOM_STAR_PollAsyncAuth();
355343

356-
/* Poll async inventory (background thread); when idle poll less often to reduce lock contention. */
357-
static int s_inv_poll_skip = 0;
358-
int inv_poll = -1;
359-
if (g_odoom_in_flight_count > 0 || g_odoom_pending_sync_count > 0)
360-
inv_poll = star_sync_inventory_poll();
361-
else if (star_sync_inventory_in_progress())
362-
inv_poll = star_sync_inventory_poll();
363-
else if ((s_inv_poll_skip++ % 8) == 0)
364-
inv_poll = star_sync_inventory_poll();
344+
/* Poll async inventory (background thread); cache result and start next batch if pending. */
345+
int inv_poll = star_sync_inventory_poll();
365346
if (inv_poll == 1) {
366347
star_item_list_t* list = nullptr;
367348
star_api_result_t res = STAR_API_ERROR_API_ERROR;
@@ -1097,10 +1078,9 @@ int UZDoom_STAR_CheckDoorAccess(struct AActor* owner, int keynum, int remote) {
10971078
return 0;
10981079
}
10991080

1100-
/* 1) Check Doom keycard in cross-game inventory (use cache when available to avoid main-thread API call). */
1081+
/* 1) Check Doom keycard in cross-game inventory */
11011082
const char* keyname = GetKeycardName(keynum);
1102-
bool has_key = keyname && (ODOOM_CachedHasItem(keyname) || star_api_has_item(keyname));
1103-
if (has_key) {
1083+
if (keyname && star_api_has_item(keyname)) {
11041084
StarLogInfo("Door access granted via shared inventory key: %s", keyname);
11051085
bool used = star_api_use_item(keyname, "odoom_door");
11061086
if (!used) {

Scripts/.local_api_processes.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"startedAtUtc": "2026-02-22T17:05:18.0166633Z",
2+
"startedAtUtc": "2026-02-23T00:13:11.1131953Z",
33
"web4Url": "http://localhost:5555",
44
"web5Url": "http://localhost:5556",
55
"processes": [
66
{
7-
"pid": 8636,
7+
"pid": 10208,
88
"name": "WEB4_OASIS_API",
99
"project": "C:\\Source\\OASIS-master\\Scripts\\..\\ONODE\\NextGenSoftware.OASIS.API.ONODE.WebAPI\\NextGenSoftware.OASIS.API.ONODE.WebAPI.csproj"
1010
},
1111
{
12-
"pid": 6324,
12+
"pid": 9572,
1313
"name": "WEB5_STAR_API",
1414
"project": "C:\\Source\\OASIS-master\\Scripts\\..\\STAR ODK\\NextGenSoftware.OASIS.STAR.WebAPI\\NextGenSoftware.OASIS.STAR.WebAPI.csproj"
1515
}

0 commit comments

Comments
 (0)