ID:2881873
 
Resolved
Byondapi: Byond_CallProc() needed the verbified name of a proc to call it correctly. Although this is how things work internally with regular proc calls, call() actually uses a better method. This has been changed to work like call() instead, which is the intended behavior anyway.
BYOND Version:515.1610
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 115.0.0.0
Applies to:Dream Daemon
Status: Resolved (515.1611)

This issue has been resolved.
Descriptive Problem Summary:

Proc names are treated as verbs, thus trying to call procs with underscores in their names using byondapi results in unspecified behavior.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
DM:
/world/New()
call_thirdparty()

/obj/proc/proc_with_underscores()
world.log << "proc_with_underscores called"

/proc/call_thirdparty()
var/obj/O = new()

call_ext("byondapi_sample", "byond:callproc")(O)
world.log << "application exit"


C - Byondapi
...
CByondValue result;
ByondValue_Init(&result);
u4c strID = Byond_GetStrId("proc_with_underscores"); // Must be: 'proc with underscores'
printf("Byond_GetStrId = %d\n", strID);
Byond_CallProcByStrId(pSrc, strID, nullptr, 0, &result);
...


Expected Results:
Welcome BYOND! (5.0 Beta Version 515.1610)
Byond_GetStrId = 422
proc_with_underscores called
application exit

Actual Results:
Welcome BYOND! (5.0 Beta Version 515.1610)
Byond_GetStrId = 65535
application exit

When does the problem NOT occur?
Using verb names instead of literal names.

Workarounds:
Replace every underscores with spaces.
In addition to this, Byond_GetStrId symbol is not exposed, but can be loaded from GetProcAddress on WIN32 machines.
Lummox JR resolved issue with message:
Byondapi: Byond_CallProc() needed the verbified name of a proc to call it correctly. Although this is how things work internally with regular proc calls, call() actually uses a better method. This has been changed to work like call() instead, which is the intended behavior anyway.