warzone2100 icon indicating copy to clipboard operation
warzone2100 copied to clipboard

Broken JS API function syncRequest and bad event eventSyncRequest

Open KJeff01 opened this issue 1 year ago • 1 comments

Describe the bug Bad function and event probably from not ever being used. It is likely these never worked correctly. syncRequest eventSyncRequest

To Reproduce Attempt to use syncRequest to sync a scripted event in the mp rules script for example (either for a legit multiplayer mod that does crazy stuff or to not break skirmish replays if an AI wants to do something that affects game state).

syncRequest(123, ...)

function eventSyncRequest(req_id, x, y, obj_id, obj_id2) { ... } - Here req_id = player where sync request came from, and x = req_id from the syncRequest(), or 123 in this example, so everything is shifted over one. Also the optional objects are not optional and can't be null or undefined... and it would appear object IDs in the event are weird cause it doesn't map to a real object in the game when I passed a truck from one player with enumDroid() to syncRequest() and checking the ID with debug mode on. So everything is all messed up here.

Expected behavior Arguments should line up with parameters in the event, and possibly the coordinates and objects should be all be truly optional. As well as allowing the objects to be null (if obj1 is null then so must be obj2).

Your System:

  • OS: All
  • Game version: 4.3.4

KJeff01 avatar Apr 10 '23 18:04 KJeff01

Not too sure... but might be fixed as per? https://forums.wz2100.net/viewtopic.php?p=150024#p150024

Chewbakka-Wakka avatar Apr 14 '24 20:04 Chewbakka-Wakka