irrNetLite 2.1 [BETA]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Re: irrNetLite 2.1 [BETA]

Postby selujtje » Fri Mar 01, 2013 4:36 pm

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:
cpp 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);
selujtje
 
Posts: 4
Joined: Thu Aug 18, 2011 11:10 am

Re: irrNetLite 2.1 [BETA]

Postby zerochen » Fri Mar 01, 2013 5:11 pm

i guess you use it incorrectly^^
but hard to say without any snippet
zerochen
 
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrNetLite 2.1 [BETA]

Postby serengeor » Fri Mar 01, 2013 7:05 pm

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).
User avatar
serengeor
 
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrNetLite 2.1 [BETA]

Postby zerochen » Mon Mar 11, 2013 4:57 pm

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

viewtopic.php?p=229761#p229761
zerochen
 
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrNetLite 2.1 [BETA]

Postby user-r3 » Sat Jun 01, 2013 9:12 am

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

Re: irrNetLite 2.1 [BETA]

Postby Brainsaw » Sun Jun 02, 2013 6:01 pm

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

Re: irrNetLite 2.1 [BETA]

Postby user-r3 » Sun Jun 02, 2013 6:27 pm

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

Re: irrNetLite 2.1 [BETA]

Postby Brainsaw » Mon Jun 03, 2013 5:21 am

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

Re: irrNetLite 2.1 [BETA]

Postby user-r3 » Mon Jun 03, 2013 2:47 pm

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

Re: irrNetLite 2.1 [BETA]

Postby Brainsaw » Tue Jun 04, 2013 9:47 am

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

Re: irrNetLite 2.1 [BETA]

Postby user-r3 » Sat Jul 27, 2013 2:54 pm

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:

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

Re: irrNetLite 2.1 [BETA]

Postby Oster200 » Wed Jul 31, 2013 3:16 am

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

Re: irrNetLite 2.1 [BETA]

Postby zerochen » Wed Jul 31, 2013 10:26 am

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

Re: irrNetLite 2.1 [BETA]

Postby Oster200 » Wed Jul 31, 2013 3:07 pm

How do i make this work for in C::B that is my only question right now?
Oster200
 
Posts: 60
Joined: Sun May 06, 2012 6:13 pm

Re: irrNetLite 2.1 [BETA]

Postby serengeor » Wed Jul 31, 2013 4:39 pm

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).
User avatar
serengeor
 
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron