This commit is contained in:
micah 2019-03-09 17:22:57 -05:00
parent 7c9fe21a44
commit 0fc8eeae89
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "rage-rpc", "name": "rage-rpc",
"version": "0.2.0", "version": "0.2.1",
"description": "An asynchronous RPC implementation for RAGE Multiplayer", "description": "An asynchronous RPC implementation for RAGE Multiplayer",
"main": "dist/rage-rpc.min.js", "main": "dist/rage-rpc.min.js",
"types": "dist/rage-rpc.d.ts", "types": "dist/rage-rpc.d.ts",

View File

@ -104,7 +104,7 @@ if(!glob[PROCESS_EVENT]){
} }
function passEventToBrowser(browser: Browser, data: Event, ignoreNotFound: boolean): void { function passEventToBrowser(browser: Browser, data: Event, ignoreNotFound: boolean): void {
const raw = util.stringifyData(data) const raw = util.stringifyData(data);
browser.execute(`var process = window["${PROCESS_EVENT}"]; if(process){ process(${JSON.stringify(raw)}); }else{ ${ignoreNotFound ? '' : `mp.trigger("${PROCESS_EVENT}", '{"ret":1,"id":"${data.id}","err":"${ERR_NOT_FOUND}","env":"cef"}');`} }`); browser.execute(`var process = window["${PROCESS_EVENT}"]; if(process){ process(${JSON.stringify(raw)}); }else{ ${ignoreNotFound ? '' : `mp.trigger("${PROCESS_EVENT}", '{"ret":1,"id":"${data.id}","err":"${ERR_NOT_FOUND}","env":"cef"}');`} }`);
} }