irrNetLite 2.1 [BETA]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
selujtje
Posts: 4
Joined: Thu Aug 18, 2011 11:10 am

Re: irrNetLite 2.1 [BETA]

Post 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);
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrNetLite 2.1 [BETA]

Post by zerochen »

i guess you use it incorrectly^^
but hard to say without any snippet
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrNetLite 2.1 [BETA]

Post 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:
Working on game: Marrbles (Currently stopped).
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrNetLite 2.1 [BETA]

Post 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
user-r3
Posts: 70
Joined: Tue Dec 07, 2010 4:09 pm

Re: irrNetLite 2.1 [BETA]

Post 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
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: irrNetLite 2.1 [BETA]

Post 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).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
user-r3
Posts: 70
Joined: Tue Dec 07, 2010 4:09 pm

Re: irrNetLite 2.1 [BETA]

Post 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
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: irrNetLite 2.1 [BETA]

Post 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.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
user-r3
Posts: 70
Joined: Tue Dec 07, 2010 4:09 pm

Re: irrNetLite 2.1 [BETA]

Post 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
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: irrNetLite 2.1 [BETA]

Post 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.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
user-r3
Posts: 70
Joined: Tue Dec 07, 2010 4:09 pm

Re: irrNetLite 2.1 [BETA]

Post 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!
Oster200
Posts: 60
Joined: Sun May 06, 2012 6:13 pm

Re: irrNetLite 2.1 [BETA]

Post 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?
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrNetLite 2.1 [BETA]

Post 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
Oster200
Posts: 60
Joined: Sun May 06, 2012 6:13 pm

Re: irrNetLite 2.1 [BETA]

Post by Oster200 »

How do i make this work for in C::B that is my only question right now?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrNetLite 2.1 [BETA]

Post 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.
Working on game: Marrbles (Currently stopped).
Post Reply