use global socket
This commit is contained in:
parent
bbb6afd684
commit
f18b3fae5f
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
-- External requirements
|
-- External requirements
|
||||||
socket = require("socket")
|
local socket = require("socket")
|
||||||
ffi = require("ffi")
|
local ffi = require("ffi")
|
||||||
|
|
||||||
-- Disallow access to undefined global variables (helps detect errors)
|
-- Disallow access to undefined global variables (helps detect errors)
|
||||||
assert(getmetatable(_G)==nil, "_G already has a metatable")
|
assert(getmetatable(_G)==nil, "_G already has a metatable")
|
||||||
@ -18,6 +18,7 @@ print("Save location set to \""..OPT_SAVE_DIR.."\"")
|
|||||||
-- Local includes
|
-- Local includes
|
||||||
dofile("iosafe.lua")
|
dofile("iosafe.lua")
|
||||||
FFI = ffi
|
FFI = ffi
|
||||||
|
Socket = socket
|
||||||
dofile("utility.lua")
|
dofile("utility.lua")
|
||||||
dofile("simulation.lua")
|
dofile("simulation.lua")
|
||||||
dofile("group.lua")
|
dofile("group.lua")
|
||||||
@ -28,6 +29,7 @@ dofile("gate.lua")
|
|||||||
dofile("save.lua")
|
dofile("save.lua")
|
||||||
dofile("network.lua")
|
dofile("network.lua")
|
||||||
FFI = nil
|
FFI = nil
|
||||||
|
Socket = nil
|
||||||
|
|
||||||
-- Default settings
|
-- Default settings
|
||||||
OPT_TICK_ENABLED = true
|
OPT_TICK_ENABLED = true
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
local socket = Socket or require("socket")
|
||||||
|
|
||||||
function network_send(data)
|
function network_send(data)
|
||||||
client:send(data)
|
client:send(data)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user