{"action":"created","issue":{"url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/64","repository_url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT","labels_url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/64/comments","events_url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/64/events","html_url":"https://github.com/JamesWilko/Payday-2-BLT/issues/64","id":186052371,"number":64,"title":"Is there a way to use BLT to call native methods?","user":{"login":"polarathene","id":5098581,"avatar_url":"https://avatars.githubusercontent.com/u/5098581?v=3","gravatar_id":"","url":"https://api.github.com/users/polarathene","html_url":"https://github.com/polarathene","followers_url":"https://api.github.com/users/polarathene/followers","following_url":"https://api.github.com/users/polarathene/following{/other_user}","gists_url":"https://api.github.com/users/polarathene/gists{/gist_id}","starred_url":"https://api.github.com/users/polarathene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polarathene/subscriptions","organizations_url":"https://api.github.com/users/polarathene/orgs","repos_url":"https://api.github.com/users/polarathene/repos","events_url":"https://api.github.com/users/polarathene/events{/privacy}","received_events_url":"https://api.github.com/users/polarathene/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-29T01:40:55Z","updated_at":"2016-10-29T03:00:59Z","closed_at":null,"body":"**TL;DR:** I'm looking into calling some native methods via exposed C API. I'd like to provide a library/dll file that I can call into from Lua. Would the BLT hook be a way to go about this? \r\n\r\n---\r\n\r\nThe existing FFI solutions I've glazed over is difficult to tell if I can release binaries that users don't have to compile/install beyond drag/drop to PD2 directory.\r\n\r\nBesides those two options, I guess I could also do a local web server to redirect to my native code, but if I can't automate that running when PD2 is it's probably inconvenient for users too.\r\n\r\nI'm wanting to reduce maintenance of my BigLobby project by avoiding the pdmod which breaks with most game updates. I've looked into how PD2 is handling network packets which is UDP via SteamWorks, packets are identified by an id incremented by message elements in the network.network_settings XML which I currently patch, so a proxy server that manipulates the packets isn't going to work either.\r\n\r\nI did try BLTs network message feature early on in my project but it proved unreliable at delivering messages effectively from memory. Does the way BLT work with it's hook make it possible to call native code from another library easily if that's also provided as a DLL(either through BLT or using the same technique)?"},"comment":{"url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/comments/257067020","html_url":"https://github.com/JamesWilko/Payday-2-BLT/issues/64#issuecomment-257067020","issue_url":"https://api.github.com/repos/JamesWilko/Payday-2-BLT/issues/64","id":257067020,"user":{"login":"RomanHargrave","id":6024227,"avatar_url":"https://avatars.githubusercontent.com/u/6024227?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanHargrave","html_url":"https://github.com/RomanHargrave","followers_url":"https://api.github.com/users/RomanHargrave/followers","following_url":"https://api.github.com/users/RomanHargrave/following{/other_user}","gists_url":"https://api.github.com/users/RomanHargrave/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanHargrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanHargrave/subscriptions","organizations_url":"https://api.github.com/users/RomanHargrave/orgs","repos_url":"https://api.github.com/users/RomanHargrave/repos","events_url":"https://api.github.com/users/RomanHargrave/events{/privacy}","received_events_url":"https://api.github.com/users/RomanHargrave/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T03:00:59Z","updated_at":"2016-10-29T03:00:59Z","body":"Perhaps if it were more generally implemented as a P2P RPC system, it would be useful for other mods. Since that's pretty much what you described, generalising it and adding it to BLT's responsibilities would be far more in scope."}}
{"actor":{"display_login":"RomanHargrave"}}