1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-11-14 14:38:04 +11:00
Zorya-NEO/lib/net_minitel/microtel/microtel-5-core-mini.lua
2020-01-08 23:01:35 -05:00

28 lines
405 B
Lua

function net.socket(A,P,S)
local C,rb={},""
C.s,C.b,C.P,C.A="o","",tonumber(P),A
function C.r(self,l)
rb=self.buffer:sub(1,l)
self.buffer=self.buffer:sub(l+1)
return rb
end
function C.w(self,D)
net.lsend(self.A,self.P,D)
end
function C.c(s)
net.send(C.A,C.P,S)
end
function h(E,F,P,D)
if F==C.A and P==C.P then
if D==S then
net.hook[S]=nil
C.s="c"
return
end
C.b=C.b..D
end
end
net.hook[S]=h
return C
end