Merge branch 'bi'

This commit is contained in:
Unknown 2018-03-01 21:48:15 +03:00
commit fa04126faa
3 changed files with 13 additions and 8 deletions

View file

@ -6,11 +6,11 @@
set SOUCE_CODE_DIR=.\vmf_source set SOUCE_CODE_DIR=.\vmf_source
set TEMP_DIR=.\TEMP set TEMP_DIR=.\TEMP
set ORIGINAL_VMF_BUNDLE_FILE_NAME=98161451961848df set ORIGINAL_VMF_BUNDLE_FILE_NAME=98161451961848df
set NEW_VMF_BUNDLE_FILE_NAME=000_VMF_Main_Bundle set NEW_VMF_BUNDLE_FILE_NAME=VMF
:: manual setting pathes (in case this batch file won't be able to find steam installation folders) [you can change them :D] :: manual setting pathes (in case this batch file won't be able to find steam installation folders) [you can change them :D]
set MANUAL_MODS_DIR=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide\bundle\mods set MANUAL_MODS_DIR=C:\Program Files (x86)\Steam\steamapps\workshop\content\235540\1289946781
set MANUAL_STINGRAY_EXE=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide Mod Tools\bin\stingray_win64_dev_x64.exe set MANUAL_STINGRAY_EXE=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide Mod Tools\bin\stingray_win64_dev_x64.exe
:: find Vermintide folder :: find Vermintide folder
@ -19,7 +19,7 @@ set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Unins
set VALUE_NAME=InstallLocation set VALUE_NAME=InstallLocation
for /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do ( for /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do (
set MODS_DIR=%%C\bundle\mods set MODS_DIR=%%C\..\..\workshop\content\235540\1289946781
) )
:: find Stingray SDK folder :: find Stingray SDK folder

View file

@ -1,7 +1,12 @@
local vmf = get_mod("VMF") local vmf = get_mod("VMF")
HOOKED_FUNCTIONS = {} -- global, because 'loadstring' doesn't see local variables HOOKED_FUNCTIONS = {} -- global, because 'loadstring' doesn't see local variables
DELAYED_HOOKING_ENABLED = true
if type(DELAYED_HOOKING_ENABLED) == "boolean" then
DELAYED_HOOKING_ENABLED = DELAYED_HOOKING_ENABLED
else
DELAYED_HOOKING_ENABLED = true
end
local _DELAYED_HOOKS = {} -- _DELAYED_HOOKS[hook_name] = {{mod_name, hooked_function},{}} local _DELAYED_HOOKS = {} -- _DELAYED_HOOKS[hook_name] = {{mod_name, hooked_function},{}}

View file

@ -93,11 +93,11 @@ end
local function send_rpc_vmf_data_local(mod_name, rpc_name, ...) local function send_rpc_vmf_data_local(mod_name, rpc_name, ...)
local success, error_message = pcall(_RPC_CALLBACKS[mod_name][rpc_name], ...) local success, error_message = pcall(_RPC_CALLBACKS[mod_name][rpc_name], Network.peer_id(), ...)
if not success then if not success then
get_mod(mod_name):error("(local rpc) in rpc '%s': %s", rpc_name, error_message) get_mod(mod_name):error("(local rpc) in rpc '%s': %s", rpc_name, error_message)
else
local success, data = pcall(serialize_data, ...) -- @DEBUG: local success, data = pcall(serialize_data, ...) -- @DEBUG:
if success then -- @DEBUG: if success then -- @DEBUG:
vmf:info("[NETWORK][LOCAL RPC] '%s': %s", rpc_name, data) -- @DEBUG: vmf:info("[NETWORK][LOCAL RPC] '%s': %s", rpc_name, data) -- @DEBUG:
@ -138,7 +138,7 @@ VMFMod.rpc_register = function (self, rpc_name, rpc_function)
end end
-- recipient = "all", "local", "others", peer_id -- recipient = "all", "local", "others", peer_id
VMFMod.rpc_send = function (self, recipient, rpc_name, ...) VMFMod.rpc_send = function (self, rpc_name, recipient, ...)
if not is_rpc_registered(self:get_name(), rpc_name) then if not is_rpc_registered(self:get_name(), rpc_name) then
@ -231,7 +231,7 @@ vmf:hook("ChatManager.rpc_chat_message", function(func, self, sender, channel_id
vmf:info("[NETWORK][RECEIVED RPC] '%s.%s' [%s]: %s", mod_name, rpc_name, sender, message) -- @DEBUG: vmf:info("[NETWORK][RECEIVED RPC] '%s.%s' [%s]: %s", mod_name, rpc_name, sender, message) -- @DEBUG:
-- can be error in both callback_function() and deserialize_data() -- can be error in both callback_function() and deserialize_data()
local success, error_message = pcall(function() _RPC_CALLBACKS[mod_name][rpc_name](deserialize_data(localization_param)) end) local success, error_message = pcall(function() _RPC_CALLBACKS[mod_name][rpc_name](sender, deserialize_data(localization_param)) end)
if not success then if not success then
get_mod(mod_name):error("(network) in rpc function '%s': %s", rpc_name, tostring(error_message)) get_mod(mod_name):error("(network) in rpc function '%s': %s", rpc_name, tostring(error_message))
end end