Closed JayMontana36 closed 3 years ago
Great to see someone actually using the interfaces provided to write their own custom code and stuff :smile:
Anyways, yes. It seems that the internal server events were neglected when I moved the code base over to JS... Should be an easy fix, and it will definitely be one of the first things implemented when I get my setup back up and running.
If you can't wait that long or, want something you can quickly insert yourself, the following code block should be inserted inside the wrapper.js file on line 41.
on("livemap:internal_AddPlayerData", (id, k, d) => {
SocketController.AddPlayerData(id, k, d);
});
on("livemap:internal_UpdatePlayerData", (id, k, d) => {
SocketController.UpdatePlayerData(id, k, d);
});
on("livemap:internal_RemovePlayerData", (id, k) => {
SocketController.RemovePlayerData(id, k);
});
on("livemap:internal_RemovePlayer", (id) => {
SocketController.RemovePlayer(id);
});
Title states it all: The following events do not appear to exist at all in code and do not do anything at all when called server side:
livemap:internal_AddPlayerData
livemap:internal_UpdatePlayerData
livemap:internal_RemovePlayerData
Taking a look at this (server side events documented in the readme) and this (server side events documented on your docs site), with minor network/event optimization in mind, I thought why not just rewrite my script which used to trigger 6 (update) events every few seconds all at the same time to instead just trigger 1 single event with all of the data combined and then split up and distribute the data as needed server side between your live maps resource and my other scripts; the part with my scripts worked but not the part with live maps. Sample code below (cut down):
client.lua
:server.lua
Expected results from the code above: Client sends a set or pack of data to the server all at one time, server then distributes the received data to the respective events (live maps, and live maps displays the data)
What happens with the code above: Client sends a set or pack of data to the server all at one time, server then distributes the received data to the respective events (live maps), nothing happens (live maps does not print any error or react and displays nothing).