PixelToast 5 Posted April 7, 2014 Share Posted April 7, 2014 https://github.com/P-T-/TCPNet This API allows for infinite cross range, cross server communication with the internet card. It uses a external Lua server which requires luasocket (should work on both 5.1 and 5.2)on ubuntu/debian you can use apt get install luarocks and then luarocks install luasocketon windows: https://code.google.com/p/luaforwindows/downloads/listothers you will have to find/compile binaries once you have a server set up and forwarded you can access it in OC with your computer's external IP (or localhost if you changed the tcp blacklist) API local handle=tcpnet.new([ip[,port]]) connects to the server, ip defaults to localhost and port defaults to 25476handle:receive([timeout[,port]]) returns port,dataor just data if the port parameter is givenhandle:send(port,data) sends data to porthandle:open(...) opens portshandle:close(...) closes portsevent "tcpnet_message",port,data Protocolevery message and response is a table serializedports can be strings or numbersit does serialize the data, but because computer.pushSignal doesnt support tables, my api wont allow thembut it is really easy to write your own api{"send",port=port,data=data} sends data to everyone listening on port{"open",ports={[port]=true,[port]=false}} open/close ports{"message",port=port,data=data} you receive this when you get a message Quote Link to post Share on other sites
Wobbo 8 Posted April 7, 2014 Share Posted April 7, 2014 About luasocket, I know that you can install luarocks on OS X with both homebrew and macports, so you can run the server from OS X as well. Also, I don't really get what you mean with protocol. Is that what is returned by event.pull? Quote Link to post Share on other sites
PixelToast 5 Posted April 8, 2014 Author Share Posted April 8, 2014 no, thats the socket protocol Quote Link to post Share on other sites
Cat 3 Posted November 14, 2014 Share Posted November 14, 2014 Nice! I'll take a look at the Pure Lua server and also take a look at cross-server communications becauseThat is just simply Fun!Might have to make a multiplayer game for OC now... hm. Quote Link to post Share on other sites