From 923227885e53880b3617e583888807900aa0bec2 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Wed, 25 Jul 2018 12:23:46 -0400 Subject: [PATCH] alright that should do it --- net/audp.lua | 93 --------------------------------- net/init.lua | 3 +- rockspec/lua-net-3.0-0.rockspec | 24 +++++++++ 3 files changed, 26 insertions(+), 94 deletions(-) delete mode 100644 net/audp.lua create mode 100644 rockspec/lua-net-3.0-0.rockspec diff --git a/net/audp.lua b/net/audp.lua deleted file mode 100644 index a52a8ce..0000000 --- a/net/audp.lua +++ /dev/null @@ -1,93 +0,0 @@ -require("net") -function net:newUDPServer(port,servercode) - local c={} - c.hostip=net.getLocalIP() - c.port=port - c.bannedCIDs={} - c.bannedIPs={} - function c:setUpdateRate(n) - self.updater:setSkip(n or 0) - end - function c:banCID(cid) - -- - end - function c:banIP(ip) - -- - end - function c:broadcast(name) - -- - end - function c:send(ip,data,port,cid) - -- - end - function c:pollClientModules(ip,port) - -- - end - function c:CIDFrom(ip,port) - -- - end - function c:sendAll(data) - -- - end - function c:sendAllBut(data,cid) - -- - end - function c:clientRegistered(cid) - -- - end - function c:clientLoggedIn(cid) - -- - end - function c:update() - -- - end - c.Updater=multi:newUpdater(0) - c.Updater.link=c - c.updater:OnUpdate(function(self) - self.link:update() - end) - c.OnClientsModulesList=multi:newConnection(false) - c.OnDataRecieved=multi:newConnection(false) - c.OnClientClosed=multi:newConnection(false) - c.OnClientConnected=multi:newConnection(false) -end -function net:newUDPClient(host,port,servercode) - local c={} - c.host=host - c.port=port - function c:setUpdateRate(n) - self.updater:setSkip(n or 0) - end - function c:send(data) - -- - end - function c:sendRaw(data) - -- - end - function c:close() - -- - end - function c:getCID() - -- - end - function c:update() - -- - end - function c:reconnect() - -- - end - function c:IDAssigned() - -- - end - c.Updater=multi:newUpdater(0) - c.Updater.link=c - c.updater:OnUpdate(function(self) - self.link:update() - end) - c.OnDataRecieved=multi:newConnection(false) - c.OnClientReady=multi:newConnection(false) - c.OnClientDisconnected=multi:newConnection(false) - c.OnConnectionRegained=multi:newConnection(false) - c.OnPingRecieved=multi:newConnection(false) - c.OnServerNotAvailable=multi:newConnection(false) -end diff --git a/net/init.lua b/net/init.lua index 839b149..c57ebc4 100644 --- a/net/init.lua +++ b/net/init.lua @@ -40,13 +40,14 @@ for i = 97,122 do end local isHyphen = {[9]=1,[14]=1,[19]=1,[24]=1} math.randomseed(os.time()) +local multi = require("multi") local socket=require("socket") local http=require("socket.http") local mime=require("mime") --ssl=require("ssl") --https=require("ssl.https") local net={} -net.Version={2,0,1} -- This will probably stay this version for quite a while... The modules on the otherhand will be more inconsistant +net.Version={3,0,0} -- This will probably stay this version for quite a while... The modules on the otherhand will be more inconsistant net._VERSION="3.0.0" net.ClientCache = {} net.OnServerCreated=multi:newConnection() diff --git a/rockspec/lua-net-3.0-0.rockspec b/rockspec/lua-net-3.0-0.rockspec new file mode 100644 index 0000000..cc8070d --- /dev/null +++ b/rockspec/lua-net-3.0-0.rockspec @@ -0,0 +1,24 @@ +package = "lua-net" +version = "3.0-0" +source = { + url = "git://github.com/rayaman/net.git", + tag = "v3.0.0", +} +description = { + summary = "Lua networking library that wraps around lua-socket to make networking easy.", + detailed = [[ + This library uses the multi library. The new multitasking library and this one are now co-Dependant if using the networkManager integration for network parallelism. This has an event driven approach for networking which allows one to easily work async with the data. + ]], + homepage = "https://github.com/rayaman/net", + license = "MIT" +} +dependencies = { + "lua >= 5.1", + "multi" +} +build = { + type = "builtin", + modules = { + ["net.init"] = "net/init.lua", + } +} \ No newline at end of file