IrrNet - Irrlicht Network Framework 0.36 (Now Windows/Linux)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

I have a non-irrlicht related, but enet related question.

lets say i made a class SendablePackage, it has several types of information (whether it updates model pos, rot, scale, is a chat update etc.) all under string type
and then i have a value for a message, and 4 int values.

how could i send this using enet_packet_create, since the first parameter only seems to be accepting chars.... do i have to make my own conversion setup, or is there native support in enet for sending other types?
___________________________
For all of your 3D/2D resource needs:
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

lostclimategames wrote:I have a non-irrlicht related, but enet related question.

lets say i made a class SendablePackage, it has several types of information (whether it updates model pos, rot, scale, is a chat update etc.) all under string type
and then i have a value for a message, and 4 int values.

how could i send this using enet_packet_create, since the first parameter only seems to be accepting chars.... do i have to make my own conversion setup, or is there native support in enet for sending other types?
You might be interested in irrNetLite (It doesn't require Irrlicht to run, just include irrTypes.h and vector3d.h)

And please don't send stuff like position as a string.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

im not sending the values as a string, im sending a word that is relates what type of package it is, so it knows what values to read.
___________________________
For all of your 3D/2D resource needs:
Image
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

why a word?

why not a number that represents your actions?
seems more efficiant.. maybe use an enum to corrospond.

just came back to irrnet after a long spell myself..
I have dedicated servers with switchable camera views and everything and now for some odd reason all the executables are broken and the code is riddled with errors..

a lot must have changed in a short time.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

lostclimategames wrote:im not sending the values as a string, im sending a word that is relates what type of package it is, so it knows what values to read.
Thanks for ignoring the first half of my post :P
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

sorry, didnt mean to ignore it, just wasnt feeling well yesterday, so i was trying to check my email, forums, and then sleep :/ .......

anyways, ill have a look into irrNetLite


as far as what you asked midnight, the reason im sending a string is because i want to test it with several variable types, once i've done testing enet, i'd probably us an enumerated type.
___________________________
For all of your 3D/2D resource needs:
Image
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

oh.
Midnight wrote:anyone have any idea why my example 4 would throw an error about the event reciever not being able to instintiate for being abstract?

also the fix i made a few pages ago the texture1 textures[0] thing.. thats throwing an error both ways now...

wtf happened to irrlicht even when i tried this with.. poop hmm maybe I know what this is.. going to try something any tips welcome this is killing me.
EDIT: Sweet I think I solved the problem heres a tip for anyone having strange problems. with msvc 9 aka 2008 express.. you can't import old 2005 aka msvc 8 files correctly you have to start with a new empty project.. that and a slight mistake revealed the issue.

it's irrlicht's animation thats been changed I think or mesh files in general when the animator files weren't included I didn't get receiver errors and maybe thats why because it's full of animation code.

I'll post a new example when I work it all out here.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

is this project dead?

i need to setup some networking test programs for irrlicht real soon, in fact i'm setting up the project files at the moment.
Image
cheeks
Posts: 5
Joined: Sun Aug 03, 2008 3:50 pm

Post by cheeks »

hello, I guess this is pretty trivial but here goes:

I am using irrnet to create a server in my computer and would have a friend connect to this server. I tried to setup my ip address like

Code: Select all

netmgr->setCustomAddress("93.102.65.201",1234);
but I am not sure about the port and he also can't connect either. If i open two projects in my localhost one as server and the other as client I can connect. I am completely new to this networking stuff so I think i must be missing something really basic...

Thanks in advance.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

not pretty sure, but if you can connect it on localhost but cant through the net, probably blocked by firewall.
cheeks
Posts: 5
Joined: Sun Aug 03, 2008 3:50 pm

Post by cheeks »

yeah i tried some stuff like tracing and pinging and it all worked both ways. Neither him or I am running firewalls and while he pinged me it showed the action on a sniffer, when he tried to connect it showed nothing. I am just wondering is there a default port he should connect to?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

1234 is a bit low, low numbered ports are often used by common operating system processes and applications. I tend to be a bit pedantic and pick high port numbers, for instance 45000. That aside, the fact that you can already connect on localhost probably means it's some network configuration issue, you may need to do port-forwarding or the like.

In regards to the irrNet project in general, I recommend people create their own networking implementations using a more flexible solution such as irrNetLite (Wait a bit for the new release to be out, it will feature some nice low level features and a much much cleaner code base.). Also you will get much better support from me on irrNetLite as irrNet is a very old and unmaintained project.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
cheeks
Posts: 5
Joined: Sun Aug 03, 2008 3:50 pm

Post by cheeks »

oh cool thanks for the reply. I didn't know that was the case, any estimated time for the new release of IrrnetLite then?

I'll have a look when I'm at home and btw, is it ok to post questions in here or is there some more adequate place for that?

thanks again.
Xeander
Posts: 5
Joined: Wed Sep 03, 2008 2:58 pm
Location: right here

Post by Xeander »

cheeks wrote:hello, I guess this is pretty trivial but here goes:

I am using irrnet to create a server in my computer and would have a friend connect to this server. I tried to setup my ip address like

Code: Select all

netmgr->setCustomAddress("93.102.65.201",1234);
but I am not sure about the port and he also can't connect either. If i open two projects in my localhost one as server and the other as client I can connect. I am completely new to this networking stuff so I think i must be missing something really basic...

Thanks in advance.
Your solution is simple:
the usual problems are this
you are connected to the internet thru a gateway
and your Lan address is 192.168.x.x
this is not a valid IP for others to access you on.

Problem your IP is shared by NAT thru the gateway.
For outgoing packets the return path is supplied
Ports that time out rapidily (temps)

So even if you have a valid IP every LAN on the network
will have the ports at the same incoming untranslated path

On your server Install a Hamachi network client
Log into LogMeIn and setup the network admin account
then you can add your workstation and co-developers outside
your physical network (the other side of gateway)
to your Hamachi network.

By supplying the 5.x.x.x Server Hamachi IP :Port
you can access the server itself from anywhere

I am able to run both a 2003 R2 server
and a IIS 6 server at same gateway on port 80
with this method.

Using Hamachi LogMeIn as a final game server access solution
IS NOT recommended.

but for developing and testing prior to a closed alpha or beta
it can save you alot of expenses and provides a nice chat path
for the developing team members as well.

it will even work for a SVN repository

side benefits: allows members of the same Hamachi network
to play NETWORK TCP/IP or IPX/SPX netbios multiplayer games

how does it work?? the 5.x.x.x IP is a virtual LAN
that maps to your network LAN 192.168.x.x IP
and physical MAC address

its a tunnel... and there is light at the end.
Likort
Posts: 8
Joined: Wed Mar 28, 2007 9:28 pm

Post by Likort »

My attempt at getting irrNet 0.36 SVN to run with irrLicht 1.5 under DevCpp.

(If your response would be "use irrNet 2", well I got issues there too.)


Get IrrLicht + Devcpp to work:
New...Project -> Empty -> "Name"
Project -> Project Options -> Directories -> Include Directories: select irrlicht-1.5\include
-> Parameters -> Linker: select irrlicht-1.5/lib/Win32-gcc/libIrrlicht.a

Get example1.cpp to compile

Add example1.cpp to Project, Compile - Error: irrNet.h missing
Include Directories: select irrNet V036\irrNet
Include Directories: select irrNet V036\irrNet\enet\include

Compile - Error: NULLRANGE
Edit NetManager.h: replace "static const SFrameRange NULLRANGE;" with "static const SFrameRange NULLRANGE = {};"
(don't have this error with the SVN version but with the 0.36 zipped download)

Compile - Errors:
1. MyEventReceiver issue ... virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)
2. swprintf_s undeclared

1. replace virtual bool OnEvent(SEvent event) with virtual bool OnEvent(const SEvent &event)
2. remove "_s", remove ", 1024"

Now the code compiles but I am getting Linker errors.

Linker error: INetManager ... -> add NetManager.cpp to the project

Compiler errors trying to compile NetManager.cpp:

Code: Select all

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::updateClient()':
../../irrnet svn/irrnet/base/NetManager.cpp:198: error: invalid conversion from `const void*' to `void*'

../../irrnet svn/irrnet/base/NetManager.cpp:584: error: invalid conversion from `irr::c8' to `char*'
../../irrnet svn/irrnet/base/NetManager.cpp:584: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

../../irrnet svn/irrnet/base/NetManager.cpp:585: error: invalid conversion from `irr::c8' to `char*'
../../irrnet svn/irrnet/base/NetManager.cpp:585: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'
../../irrnet svn/irrnet/base/NetManager.cpp:625: error: invalid conversion from `irr::u32' to `char*'
../../irrnet svn/irrnet/base/NetManager.cpp:625: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'
../../irrnet svn/irrnet/base/NetManager.cpp:651: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::updateServer()':
../../irrnet svn/irrnet/base/NetManager.cpp:862: warning: cast to pointer from integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:911: warning: cast from pointer to integer of different size
../../irrnet svn/irrnet/base/NetManager.cpp:911: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:1141: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:1256: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:1293: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:1330: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp:1428: error: invalid conversion from `irr::u32' to `char*'
../../irrnet svn/irrnet/base/NetManager.cpp:1428: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

../../irrnet svn/irrnet/base/NetManager.cpp:1458: warning: cast from pointer to integer of different size
../../irrnet svn/irrnet/base/NetManager.cpp:1492: warning: cast from pointer to integer of different size
../../irrnet svn/irrnet/base/NetManager.cpp:1493: warning: cast from pointer to integer of different size
../../irrnet svn/irrnet/base/NetManager.cpp:1505: warning: cast from pointer to integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `irr::u16 irr::net::INetManager::setNetId(irr::scene::ISceneNode*, irr::u16, bool)':
../../irrnet svn/irrnet/base/NetManager.cpp:1627: error: cannot allocate an object of type `irr::net::AutoAnim'

../../irrnet svn/irrnet/base/NetManager.cpp:1627: error:   because the following virtual functions are abstract:
E:/Coding/irrLicht Engine/irrlicht-1.5/include/ISceneNodeAnimator.h:46: error:  virtual irr::scene::ISceneNodeAnimator* irr::scene::ISceneNodeAnimator::createClone(irr::scene::ISceneNode*, irr::scene::ISceneManager*)

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::sendFrame(irr::scene::IAnimatedMeshSceneNode*, bool)':
../../irrnet svn/irrnet/base/NetManager.cpp:1796: warning: converting to `irr::u32' from `irr::f32'

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `ENetPeer* irr::net::INetManager::getPlayerById(irr::u16)':
../../irrnet svn/irrnet/base/NetManager.cpp:1819: warning: cast to pointer from integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::sendOutPacket(irr::net::OutPacket*, irr::u16)':
../../irrnet svn/irrnet/base/NetManager.cpp:2327: warning: cast to pointer from integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::sendOutPacketUnreliable(irr::net::OutPacket*, irr::u16)':
../../irrnet svn/irrnet/base/NetManager.cpp:2348: warning: cast to pointer from integer of different size

../../irrnet svn/irrnet/base/NetManager.cpp: In member function `void irr::net::INetManager::sendFile(irr::c8*, irr::c8*, irr::u16)':
../../irrnet svn/irrnet/base/NetManager.cpp:2433: error: call of overloaded `addData(long int)' is ambiguous
../../irrnet svn/irrnet/base/Packets.h:30: note: candidates are: void irr::net::OutPacket::addData(irr::c8)
../../irrnet svn/irrnet/base/Packets.h:32: note:                 void irr::net::OutPacket::addData(irr::u16)

../../irrnet svn/irrnet/base/Packets.h:34: note:                 void irr::net::OutPacket::addData(irr::u32)
../../irrnet svn/irrnet/base/Packets.h:36: note:                 void irr::net::OutPacket::addData(irr::s8)
../../irrnet svn/irrnet/base/Packets.h:38: note:                 void irr::net::OutPacket::addData(irr::s16)
../../irrnet svn/irrnet/base/Packets.h:40: note:                 void irr::net::OutPacket::addData(irr::s32)
../../irrnet svn/irrnet/base/Packets.h:42: note:                 void irr::net::OutPacket::addData(irr::f32)
../../irrnet svn/irrnet/base/Packets.h:44: note:                 void irr::net::OutPacket::addData(irr::f64)
../../irrnet svn/irrnet/base/Packets.h:50: note:                 void irr::net::OutPacket::addData(const char*) <near match>
Are these errors easy to fix, and how, and should the warnings be ignored or can they be easily fixed as well?
Post Reply