JR10 Posted September 18, 2015 Posted September 18, 2015 For MTA's web server: https://wiki.multitheftauto.com/wiki/Re ... Web_Access For CEF: https://wiki.multitheftauto.com/wiki/CE ... munication
SkittlesAreFalling Posted September 20, 2015 Author Posted September 20, 2015 For MTA's web server: https://wiki.multitheftauto.com/wiki/Re ... Web_AccessFor CEF: https://wiki.multitheftauto.com/wiki/CE ... munication I meant like: var HandleResourceStart = function(resource) { if(resource == getThisResource()) { print("Hello world from JavaScript!"); return; } return; } var HandlePlayerJoin = function() { var player = source; outputChatBox("This server is completely scripted in JavaScript instead of Lua!", player, 0, 128, 128, false); return; } addEventHandler("onResourceStart", getRootElement(), HandleResourceStart); addEventHandler("onPlayerJoin", getRootElement(), HandlePlayerJoin); I'm not sure if it's okay to link a link from the other multiplayer mod to show you an example.
JR10 Posted September 20, 2015 Posted September 20, 2015 Natively, MTA doesn't support other languages than Lua.
MTA Team botder Posted September 21, 2015 MTA Team Posted September 21, 2015 https://github.com/Jusonex/V8ForSA Don't ask me how to use it or even how to set it up. You should try to contact Jusonex.
SkittlesAreFalling Posted September 21, 2015 Author Posted September 21, 2015 https://github.com/Jusonex/V8ForSADon't ask me how to use it or even how to set it up. You should try to contact Jusonex. Thanks. I see how it works, I don't think it's fully developed.
Jusonex Posted September 24, 2015 Posted September 24, 2015 In theory it's possible using CEF on the client and a module on the server (as Necktrox suggested). I would not recommand it though due to the following reasons: It's very slow as the "call chain" on the client would be like: C++ event --> Lua --> CEF --> Lua --> C++ plus the communication between CEF and Lua through IPC (https://en.wikipedia.org/wiki/Inter-pro ... munication) which is additionally slow.It would work quite good for minor stuff though (but wrapping/forwarding events like onClientRender would be a pain) as a server module in contrast would reach a pretty good performance (assuming the step through Lua was eliminated) you could use Javascript on the server only alternatively. This is bad in terms of consistency though, because you are not able to share code between server and client then 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now