1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 02:28:05 +11:00

don't execute the function twice. oops.

This commit is contained in:
Izaya 2023-11-10 17:37:20 +10:00
parent 012b32a4a9
commit b3787b2df8

View File

@ -66,7 +66,6 @@ function rpc.register(name,fn)
if port == rpc.port then if port == rpc.port then
local rpcrq = serial.unserialize(data) local rpcrq = serial.unserialize(data)
if rpcf[rpcrq[1]] and isPermitted(from,rpcrq[1]) then if rpcf[rpcrq[1]] and isPermitted(from,rpcrq[1]) then
local rt = {pcall(rpcf[rpcrq[1]],table.unpack(rpcrq))}
minitel.send(from,port,serial.serialize({rpcrq[2],pcall(rpcf[rpcrq[1]],table.unpack(rpcrq,3))})) minitel.send(from,port,serial.serialize({rpcrq[2],pcall(rpcf[rpcrq[1]],table.unpack(rpcrq,3))}))
elseif type(rpcrq[2]) == "string" then elseif type(rpcrq[2]) == "string" then
minitel.send(from,port,serial.serialize({rpcrq[2],false,"function unavailable"})) minitel.send(from,port,serial.serialize({rpcrq[2],false,"function unavailable"}))