1

hello,
first, i know this is very simple and i think it is simple to use
this is a wrapper for bgt's networking capabilities, which help's you to work with networking feature in bgt
in the limitations page in bgt's refference manual, the only limitation was that
everything is in the readme, including documentation, etc
you can download this little wrapper from
here
if you have any suggestions, bugs to report, everything, feel free to tell me

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

Thumbs up

2

Congratulations on creating this class, it will really make it much easier to use the network in bgt! Very good.
I'm doing some experiments here, would you or anyone could help me with these two codes? They are very simple:
Here is the client code:

#include "net.bgt"
net n;
void main(){
n.connect("127.0.0.1",35535);
n.create_client(1,1);
while (true){
wait(10);
n.request();
show_game_window ("Test client");
if(n.is_disconnected()) alert ("ERROR","Not connected");
}
wait (10);
}

And this is the server code:

#include"net.bgt"
net n;
void main(){
n.set_port(35535);
if(n.create_server(1,1)) alert("ok","sercer created");
while(true){
show_game_window("Test server");
n.request();
if(n.is_connected()) alert("uau","Client is connected to the server");
}
wait (10);
}

As you can tell, in the server code, an alert would have to appear when a client connects to it. However, only the alert appears that the server is connected.
In the client, at least here, an alert should appear when it can not connect to the server, but this is not happening, even with the server inactive.
I'm doing the tests on my local machine myself and the first time the windows firewall appeared and I allowed
access.
What am I doing wrong?
Thank you!

Thumbs up

3

hello,
first you must create the client then connect to server
and, show_game_window must be called outside your while loop before it

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

Thumbs up

4

Well done, I love this rapper's ease of use. Thanks for making this.

Thumbs up