1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-12-25 17:58:07 +11:00

set RPC client environment variable

This commit is contained in:
Izaya 2023-11-13 14:51:29 +10:00
parent 3a6cad78b5
commit f30cdef8c0

View File

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