Cuberite Forum
Is there a serverside socket library? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Is there a serverside socket library? (/thread-347.html)



Is there a serverside socket library? - ArghArgh200 - 02-19-2012

Heya,

Just downloaded/compiled/ran MCServer on my Linux box, works great, only crashes if I mess with redstone, but hey, I don't mind. I suck at redstone mechanics anyway.

I do have a question about socket libraries for this software: Are there any I can use in a plugin? If so, can I open a socket and connect to something with the library?

Thanks for the help!

-AA200


RE: Is there a serverside socket library? - xoft - 02-20-2012

The socket framework is not accessible from the plugins, though it may become. Can you elaborate on what API you'd like to have?


RE: Is there a serverside socket library? - NiLSPACE - 02-20-2012

(02-19-2012, 09:45 AM)ArghArgh200 Wrote: Heya,

Just downloaded/compiled/ran MCServer on my Linux box, works great, only crashes if I mess with redstone, but hey, I don't mind. I suck at redstone mechanics anyway.

I do have a question about socket libraries for this software: Are there any I can use in a plugin? If so, can I open a socket and connect to something with the library?

Thanks for the help!

-AA200

But i love redstoneBig Grin
And i am pretty good in it :p




RE: Is there a serverside socket library? - ArghArgh200 - 02-24-2012

(02-20-2012, 06:52 PM)xoft Wrote: The socket framework is not accessible from the plugins, though it may become. Can you elaborate on what API you'd like to have?

I just need the ability to split strings using a delimiter, open, read, close, and listen on sockets (last one optional) so that I can create an IRC relay link thing, I already have one for my Garry's Mod server I can easily adapt. Also, what version of Lua does this software use?

Thanks!


RE: Is there a serverside socket library? - FakeTruth - 02-24-2012

MCServer uses Lua 5.1.4 unmodified. Maybe we should update to 5.2

I think I'm gonna install this http://w3.impa.br/~diego/software/luasocket/home.html instead of writing our own socket library for Lua. It seems to only have blocking sockets though, so this might not be optimal.. hmm


RE: Is there a serverside socket library? - xoft - 02-25-2012

I'd prefer if the Lua socket interface could use our cSocketThreads class, since it's much beter suited at server usage. That would mean, however, that someone would need to write a Lua wrapper class and that the interface would need to be callback-based, at least in the receiving direction.


RE: Is there a serverside socket library? - ArghArgh200 - 02-25-2012

Lua 5.1.4 is what my Garry's Mod IRC link thing uses, so it'd probably be less of a hassle for me to jump versions and make sure that everything I use in it didn't break/explode/annihilate an innocent family in 5.2

Do you think I can just take the libraries from there and put them in the same directory?


RE: Is there a serverside socket library? - FakeTruth - 02-25-2012

(02-25-2012, 12:21 AM)xoft Wrote: I'd prefer if the Lua socket interface could use our cSocketThreads class, since it's much beter suited at server usage. That would mean, however, that someone would need to write a Lua wrapper class and that the interface would need to be callback-based, at least in the receiving direction.
True, but I saw that LuaSockets has support for easy HTTP, FTP and more stuff which I thought might be cool.

(02-25-2012, 03:26 AM)ArghArgh200 Wrote: Lua 5.1.4 is what my Garry's Mod IRC link thing uses, so it'd probably be less of a hassle for me to jump versions and make sure that everything I use in it didn't break/explode/annihilate an innocent family in 5.2

Do you think I can just take the libraries from there and put them in the same directory?
I don't know, I've never tried using external libraries in Lua but if I'd take a guess I think it'll work



RE: Is there a serverside socket library? - ArghArgh200 - 03-10-2012

Well, I tried it out, no luck.
I've got to go fix a few other things now, my GMod server appears to be broken again. <_<
Do you have an IRC channel that I could lurk in perchance?