Search the Community
Showing results for tags 'Module'.
-
Hello! Asynchronous Javascript Communication is a module to allow easy communication between server, client and CEF/browser. This module lets you call server handlers from clients (and vice versa) without dealing with adding and managing custom event handlers. You can easily call a handler and get your callback called as soon as everything is returned from the handler in a promise like way! Let's see how it works in action: // server side const ajcom = require("./ajcom") ajcom.register("getServerName", hCtx => { return mp.config.name }) // client side const ajcom = require("./[package name]/ajcom.js") mp.events.add("guiReady", () => { ajcom.callServer("getServerName").then((ctx, serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) }) That's all! Not convinced yet? See how the above code is done without ajcom: // server side mp.events.add("getServerName", (player) => { player.call("gotServerName", [mp.config.name]) }) // client side mp.events.add("gotServerName", (serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) mp.events.add("guiReady", () => { mp.events.callRemote("getServerName") }) See? It eases the event handling mess. But there's a lot more to ajcom. You can easily handle errors happening on handler's side or any of the callbacks, set delays and other stuff. The full documentation is available here and you can grab the module from here Github repo Changelog v1.9.6 (2018/3/7) added jsdocs for constructors added separate enums and classes for types used as parameters added noPostback flag added flags for handlers added special handlers (hooks) for server side handlers getting called added the ability to broadcast a call to all or specific clients added cef support added cross side logging fixed calling a handler with triggerDelay not being called fixed data.source and data.target having wrong values change the namespace so that users can use enums and classes v1.1.3 (2018/2/25) added jsdocs changed event handling codes fixed client > client call fixed some possible crashes (fake client calling server) v1.0.0 (2018/2/15): Initial release!
-
How to make the implementation of auto indicators in C #?
-
Version 1.9.6
84 downloads
This library is discontinued and lacks some features. I'm working on a new remote call library which is faster and more secure Asynchronous Javascript Communication is a module to allow easy communication between server, client and CEF/browser. This module lets you call server handlers from clients (and vice versa) without dealing with adding and managing custom event handlers. You can easily call a handler and get your callback called as soon as everything is returned from the handler in a promise like way! Let's see how it works in action: // server side const ajcom = require("./ajcom") ajcom.register("getServerName", hCtx => { return mp.config.name }) // client side const ajcom = require("./[package name]/ajcom.js") mp.events.add("guiReady", () => { ajcom.callServer("getServerName").then((ctx, serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) }) That's all! Not convinced yet? See how the above code is done without ajcom: // server side mp.events.add("getServerName", (player) => { player.call("gotServerName", [mp.config.name]) }) // client side mp.events.add("gotServerName", (serverName) => { mp.gui.chat.push(`Welcome to ${serverName} ragemp server!`) }) mp.events.add("guiReady", () => { mp.events.callRemote("getServerName") }) See? It eases the event handling mess. But there's a lot more to ajcom. You can easily handle errors happening on handler's side or any of the callbacks, set delays and other stuff. The full documentation is available here Please post your questions and issues to the forum post Github repo- 1 comment
- 2 reviews
-
- 5
-
-
- module
- communication
-
(and 1 more)
Tagged with:
-
Hi guys, i have following problem: Every time im trying to load a Downloaded gamemode i get a message that it cant load the module (Find below) as i am not stupid and scripted before for a other MP i did everything people said on the Readme (or tried to google a solution). I never had any problem like this before and im going crazy as i just wanna script some stuff. I would really appreciate help. I tried everything in the cmd with like "NPM Install" "NPM install -g {the folder}" , but it just wont load even tho the node_Module folder gets installed.3 I tried different gamemodes i downloaded and they all give me this "Cannot find module" thing, so i guess i do something wrong but i do not know what i do wrong.