Hi All,
I’ve had a thought and just wondered if anyone would have any suggestions?
I’ve started designing a system to execute Lua code on an internet connected server in order to provide multiplayer functionality to games from the community.
I have some ideas for backend functionality but I just wanted to run the initial interface by you all:
function setup()
-- Create Echo server
local server = Server([==[
function setup()
print("Hello World")
end
-- Called in a loop as fast as possible
function update()
end
-- Message handler
function onMessage(msg, client)
print(msg)
client:send(msg)
end
-- Called when a client connects
function onClientConnected(client)
end
-- Called when a client disconnects
function onClientDisconnected(client)
end
]==], true)
-- Connect to the server
local client = server:connect()
-- Set message handler
client.onMessage = function(msg)
print("Server:", msg)
end
-- Send a message
client:send("Ping")
-- Print the server's output log
print(server:debugLog())
end
Thanks everyone!
Steppers
o7