Page 14 of 16

Re: irrNetLite 2.1 [BETA]

Posted: Fri Mar 01, 2013 4:36 pm
by selujtje
Thanks zerochen!
I've got another problem :oops: , the function getPeerCount() returns 101 no matter how many clients are connected to the server. Is this because I'm using it incorrectly or because it hasn't been implemented(yet)?
the way I use it:

Code: Select all

cout << "Peercount: "<< netManager->getPeercount()<<endl;
//with netManager being "created" with the 2 following lines
//MyNetCallback* netCallback = new MyNetCallback();
//net::INetManager* netManager = net::createIrrNetServer(netCallback);

Re: irrNetLite 2.1 [BETA]

Posted: Fri Mar 01, 2013 5:11 pm
by zerochen
i guess you use it incorrectly^^
but hard to say without any snippet

Re: irrNetLite 2.1 [BETA]

Posted: Fri Mar 01, 2013 7:05 pm
by serengeor
selujtje wrote: I've got another problem :oops: , the function getPeerCount() returns 101 no matter how many clients are connected to the server. Is this because I'm using it incorrectly or because it hasn't been implemented(yet)?
I looked into the sources of IrrNetLite and ENet and it seams that this function returns maximum number of peers and not the number of peers currently connected to the server.
There probably is another function to get connected peer count or maybe you need to track them yourself :roll:

Re: irrNetLite 2.1 [BETA]

Posted: Mon Mar 11, 2013 4:57 pm
by zerochen
I looked into the sources of IrrNetLite and ENet and it seams that this function returns maximum number of peers and not the number of peers currently connected to the server.
ah I changed the code like Bate says. that's why it returns the right value

http://irrlicht.sourceforge.net/forum/v ... 61#p229761

Re: irrNetLite 2.1 [BETA]

Posted: Sat Jun 01, 2013 9:12 am
by user-r3
Ahoy!

I've been using this for quite some time now, to test LAN multiplayer in my game. However, online multiplayer would be rather important to have in my game, before I can release even a Beta...

Is irrNetLite capable of online multiplayer, or do I have to switch to something different?

Thanks in advance!

userrr3

Re: irrNetLite 2.1 [BETA]

Posted: Sun Jun 02, 2013 6:01 pm
by Brainsaw
I think it does work. It uses UDP. My game (Stunt Marble Racers) also uses IrrNetLite and, although I don't officially support it, I got a reply on the thread that someone tried it using VPN (because the client is also server, no standalone).

Re: irrNetLite 2.1 [BETA]

Posted: Sun Jun 02, 2013 6:27 pm
by user-r3
Thanks for the reply Brainsaw :)

However, for me as a networking noob this sounds rather complicated...

As you said, someone tried it with a VPN (and succeded I guess^^), but does this mean, you can theoretically implement it directly in the game?

Thanks again in advance
userrr3

Re: irrNetLite 2.1 [BETA]

Posted: Mon Jun 03, 2013 5:21 am
by Brainsaw
I think that to make a game for the internet you mainly need to create a standalone server. As I said before IrrNetLite uses UDP, so there should not be too much trouble for internet communication from that side. The problem is that your computer normally isn't directly visible to other computers in the internet, you are normally hidden behind a proxy, so you would need either a VPN or a dedicated server.

Re: irrNetLite 2.1 [BETA]

Posted: Mon Jun 03, 2013 2:47 pm
by user-r3
Thanks again for your reply :)

As I said, I am a complete networking noob, thus I don't really understand what to do (which I am sorry for :()

To let others connect to my server, you say, I need to make it a "dedicated server"...
My game already uses standalone servers (simple console applications serving as the server).
However, these are most likely run on the same computers, where a client runs...

Wikipedia told me, that a dedicated server is not used as a workstation, but only as a server... so would that be a problem? (I guess not, as "dedicated Servers" from several games I tend to play work, when I play on the same PC^^)

Sorry to bother you, but could you tell me, what you mean by making a dedicated server?

Thanks
userrr3

Re: irrNetLite 2.1 [BETA]

Posted: Tue Jun 04, 2013 9:47 am
by Brainsaw
With "dedicated server" I mean a program that acts as server for your game, and only as server for your game. A console application is nice (my current (non Irrlicht) project uses node.js for the server). The server can then run on any computer, either locally on the computer you play on or on any other computer, maybe on a server on the internet, so I guess you already have that.

Re: irrNetLite 2.1 [BETA]

Posted: Sat Jul 27, 2013 2:54 pm
by user-r3
Alright, thanks again and again.

Today I had the possibility to test it. It works great! The console application that I used as a server was able to receive a connection from both, a client on the same pc, and a client away, on a different computer, in a different network :D

All I had to do was open the firewall for those applications, which I did with a batch file run as admin:

Code: Select all

@ECHO OFF
netsh advfirewall firewall add rule name="MYGAMESNAME_Client" dir=in action=allow program="%~dp0MYGAMESNAME.exe" enable=yes
netsh advfirewall firewall add rule name="MYGAMESNAME_Server" dir=in action=allow program="%~dp0MYGAMESNAME_SERVER.exe" enable=yes
pause
@ECHO ON
and to close:

Code: Select all

@ECHO OFF
Netsh Advfirewall Firewall delete Rule Name ="MYGAMESNAME_Client" 
Netsh Advfirewall Firewall delete Rule Name ="MYGAMESNAME_Server" 
pause
@ECHO ON
Then everything worked fine. No lag, realistic ping (considering my PC is not ought to be a server a ping of 38ms from the same city seems ok :) )

Have a wonderfull day!

Re: irrNetLite 2.1 [BETA]

Posted: Wed Jul 31, 2013 3:16 am
by Oster200
Im new to all the networking part of a game and was wonder what all of it meant and how to do it.
I guess i will be using irrnetlite because im new and it seem to be stable enough.

So pretty much as a test and just getting started project all i would really need to have right now is how to get the players position and rotation, collision, physics etc. later i would like to implement something like cars moving. Does this work with irrNetLite or would i be better using enet by itself which would require research?

Re: irrNetLite 2.1 [BETA]

Posted: Wed Jul 31, 2013 10:26 am
by zerochen
hi,

sure it works.
look at irrnetlite tut example where a client sends the server something like that "help i stuck on a mountain at 30,40,20".

regards
zerochen

Re: irrNetLite 2.1 [BETA]

Posted: Wed Jul 31, 2013 3:07 pm
by Oster200
How do i make this work for in C::B that is my only question right now?

Re: irrNetLite 2.1 [BETA]

Posted: Wed Jul 31, 2013 4:39 pm
by serengeor
Oster200 wrote:How do i make this work for in C::B that is my only question right now?
Just like any other library. Recompile, link in correct order.