network: renamed functions

This commit is contained in:
Unknown 2018-03-02 21:04:55 +03:00
parent 253ffe1619
commit a124f50421

View file

@ -115,20 +115,20 @@ end
-- ##### VMFMod ####################################################################################################### -- ##### VMFMod #######################################################################################################
-- #################################################################################################################### -- ####################################################################################################################
VMFMod.rpc_register = function (self, rpc_name, rpc_function) VMFMod.network_register = function (self, rpc_name, rpc_function)
if _NETWORK_MODULE_IS_INITIALIZED then if _NETWORK_MODULE_IS_INITIALIZED then
self:error("(rpc_register): you can't register new rpc after mod initialization") self:error("(network_register): you can't register new rpc after mod initialization")
return return
end end
if type(rpc_name) ~= "string" then if type(rpc_name) ~= "string" then
self:error("(rpc_register): rpc_name should be the string, not %s", type(rpc_name)) self:error("(network_register): rpc_name should be the string, not %s", type(rpc_name))
return return
end end
if type(rpc_function) ~= "function" then if type(rpc_function) ~= "function" then
self:error("(rpc_register): rpc_function should be the function, not %s", type(rpc_name)) self:error("(network_register): rpc_function should be the function, not %s", type(rpc_name))
return return
end end
@ -138,11 +138,11 @@ 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, rpc_name, recipient, ...) VMFMod.network_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
self:error("(rpc_send): attempt to send non-registered rpc") self:error("(network_send): attempt to send non-registered rpc")
return return
end end