anyone know a good DOCUMENTED network library?

BlitzMax Forums/BlitzMax Beginners Area/anyone know a good DOCUMENTED network library?

Xin(Posted 2012) [#1]
does anyone know a good library for making newtorked blitzmax applications that has some form of documentation. for example a readme.txt that lists all the functions, what they return and a short description of them? its getting frustrating because I've searched around and I have found a handful of network libraries but I cant seem to find any documentation for them. Its like trying to build a house without knowing how to use the tools. any suggestions or help would be GREATLY appreciated


Derron(Posted 2012) [#2]
gnet is documented ("F1"-able), documentation for the basement (enet) is also available around the whole internet.


bye
Ron


Captain Wicker (crazy hillbilly)(Posted 2012) [#3]
RakNet is the best

BlitzMax wrapper is here: http://repeatuntil.free.fr/raknet/

Last edited 2012


Xin(Posted 2012) [#4]
thanks for the reply guys. yeah i already knew about gnet, but with gnet there is no way to find the clients ip address, or not any way that i know of. i want to be able to block clients from connecting to the game by reading their ip address and check a "ban list" to see if the ip is located there. i was able to do this using just tcp sockets. but tcp is too slow for a realtime multiplayer platforming game. i tried using udp but most of it goes over my head lol. so the main requested features are being able to send a list of objects over a connection, and being able to read all connected clients ip addresses directly from the connection instead of sending it through a string, because transmitted string can be altered, making the client impossible to block. i will look into Enet and RakNet. thanks again


Derron(Posted 2012) [#5]
For raw thingies: bnetex is a nifty udp package for blitzmax.

Gnet: just work with the event of new "gnet objects"... you can get the IP of the peer and compare it to your blacklist.
If not on your list: remove the object and you wont "sync" with him.

Yes he will be able to spam you with data packets - but the engine itself will handle it ("new player-"events will be catched by your "comparison" and the rest will just fill your line as all flooding spammers would do).


bye
Ron


Xin(Posted 2012) [#6]
ok but how do you get the ip address of a client in gnet?


Derron(Posted 2012) [#7]
Each "Gnet Object" has the fields

Field _host:TGNetHost
Field _peer:TGNetPeer


- host is listening at all local adresses
-- host connect event knows ip of the target - connect(ip,port,timeout)
- peer: uses _enetpeer

so we have to look what enet does
pub.mod/enet.mod/enet.bmx

hey there is a command:
"Function enet_peer_address( peer:Byte Ptr,host_ip Var,host_port Var )"

It needs 3 params, the last 2 get set during execution

so:
local remoteIP:int = 0
local remotePort:short = 0
enet_peer_address( MyGnetPeer._enetpeer, remoteIP, remotePort)

print "intIP: "+remoteIP+" port:"+remotePort

will do.


bye
Ron