Cuberite Forum

Full Version: Network API
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hi, I'm gonna try to draft an API for UDP support. I think the last related discussion here was on page 6

(01-14-2015, 11:12 PM)xoft Wrote: [ -> ]The code can't be split without exposing cNetworkSingleton - most of the implementation relies on its internals. And I don't want to expose it, since it has libevent stuff in it, so we'd need to put libevent dependencies in the header.

I don't think the Network stuff is gonna grow much more. It's pretty much complete on the TCP side, and the UDP side can have a separate file of its own - after all, libevent doesn't have such a high level support for it anyway.

Any updates/pointers on what I should do? Otherwise I'll get back when I have something working and ask for feedback (probably will need a lot of changesTongue )
I think a better course of actions would be to try to describe the API first - what would the functions be, what names and params for the callbacks etc. You don't want to end up rewriting the thing three times over Smile
Makes sense, I'll get back hopefully soon when I get a chance to look and think through it carefully (test tomorrow)Big Grin

Update: been really busy this week. Hopefully will get some progress and results next week
Tell me what you think about the cNetwork et al Lua API documentation, is it sufficient?
http://mc-server.xoft.cz/LuaAPI/cNetwork.html
(02-08-2015, 03:05 AM)xoft Wrote: [ -> ]Tell me what you think about the cNetwork et al Lua API documentation, is it sufficient?
http://mc-server.xoft.cz/LuaAPI/cNetwork.html

I miss a byte buffer Sad
I need to read var ints / shorts / ...
What do you need VarInts for? I can understand the fixed length types but VarInts seemed like a Minecraft specific encoding. Lack of helpers for buffering and reading values is an issue. I can agree that exposing the non-Minecraft protocol spercific parts of cByteBuffer is probably now a good idea.
(02-08-2015, 04:17 AM)worktycho Wrote: [ -> ]What do you need VarInts for? I can understand the fixed length types but VarInts seemed like a Minecraft specific encoding. Lack of helpers for buffering and reading values is an issue. I can agree that exposing the non-Minecraft protocol spercific parts of cByteBuffer is probably now a good idea.

I will ping a minecraft server.
Network API can do a client TLS on a TCP link now: cTCPLink:StartTLSClient()
So what's our first network plugin going to be? Smile I was looking into hooking into Cleverbot, but I didn't find an API.
The first network plugin is already present at the base repo - the NetworkTest plugin Smile
But yes, it's not something anyone would want to install on their server, so let's ask about the first "useful" plugin instead.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15