irrNetLite 2.1 [BETA]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I hope I'll find some time during the next week or so to create a test application for that problem. Maybe I'll just modify one of the examples.

I think I didn't add "USE_IRRLICHT". Have to try 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
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well i got a little problem with the pre-set broadband. I dont know how to examinate the limit, so i cant set it to a resonable value. But the pre-set value is just to small.
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

Good evening!

I got a pretty strange runtime error with irrnetlite. That occurs when at the end of the scope the SOutPacket is automatically deallocated. More specifically, i get pointed to the destructor of core::array, which is one of its members - haven't yet figured out why it segfaults.

Has anyone had the same issue before? I am using irrlicht 1.6 and the (latest?) irrnetlite version - as offered in the very first post of this thread.

Thanks for any suggestions & cheers,
p.
beer->setMotivationCallback(this);
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

polylux wrote:Good evening!

I got a pretty strange runtime error with irrnetlite. That occurs when at the end of the scope the SOutPacket is automatically deallocated. More specifically, i get pointed to the destructor of core::array, which is one of its members - haven't yet figured out why it segfaults.

Has anyone had the same issue before? I am using irrlicht 1.6 and the (latest?) irrnetlite version - as offered in the very first post of this thread.

Thanks for any suggestions & cheers,
p.
Are you using the .lib version or including the files into the project manually?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

I built a static library with the included makefile. Plus I just found out that it behaves weird, like randomly sent/received data. Gotta have a look at that...
beer->setMotivationCallback(this);
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

polylux wrote:Good evening!

I got a pretty strange runtime error with irrnetlite. That occurs when at the end of the scope the SOutPacket is automatically deallocated. More specifically, i get pointed to the destructor of core::array, which is one of its members - haven't yet figured out why it segfaults.

Has anyone had the same issue before? I am using irrlicht 1.6 and the (latest?) irrnetlite version - as offered in the very first post of this thread.

Thanks for any suggestions & cheers,
p.
I had the same problem but didn't solve it. I created a workaround by exchanging the dynamic buffers (irr::array) by a static one (4k ... way more than I need). Works good ever since.
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
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

Yep, I just added the SOutPacket as a class member. Now I have to clearData() before I use it but that's fine when it works. And strangely - it does.
beer->setMotivationCallback(this);
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

polylux wrote:I built a static library with the included makefile. Plus I just found out that it behaves weird, like randomly sent/received data. Gotta have a look at that...
The problem may be that you built the static library with the irrArray.h that came with irrNetLite, but used it with Irrlicht with the irrArray.h that came with Irrlicht, similar to having the incorrect Irrlicht DLL/header files situation. You can try to rebuild irrNetLite with USE_IRRLICHT defined (Remember to include the Irrlicht headers and delete irrArray, string, etc that came with irrNetLite to be sure).

I hope that explains it a little better.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

That makes sense, gotta give it a try as soon as I get home - thanks BlindSide. :)
Having played around with it, I really have to say irrnetlite is a great addon to the engine.
beer->setMotivationCallback(this);
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Shame on me. I played around a little bit yesterday and it turned out that there were some pointers I didn't NULL out after deleting the objects, and therefore they were pointing at garbage. The debugger didn't really help me there :( . I can now re-start the server without problems, but as soon as I do a restart I am no longer able to connect to it.

I also tried that with one of the Examples and VC, same behaviour there. I added a key to the server that would simply delete the two objects that are also deleted before exiting the program and immediately re-create them. No crash on the server, but I couldn't connect to the server any more.
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
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Another question I have: is there a way to get the IP address of the server using irrnetlite or enet functions? I want to display the server's IP address on the "start net game" screen.
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
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

@Brainsaw this is hardly possible because a server can have multiple IPs. Dont know if enet supports it to query this infos.

Finally irrNetLite made it in the networklibsbenc test.
A new version (0.6) of this test: http://sourceforge.net/projects/networklibsbenc/
Some new testresults: http://sourceforge.net/apps/gallery/networklibsbenc/
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

Brainsaw wrote:is there a way to get the IP address of the server using irrnetlite or enet functions?
Something like this?

Code: Select all

char hostip[16];
enet_address_get_host_ip(&serverAddress, hostip, 16);
printf("%s\n", hostip);
@BlindSide: How does your SPacket class handle big endian to little endian connections (and vice-versa)?

I have a similar wrapper class to ENetPackets and my method for adding e.g. an integer to the packet is like this:

Code: Select all

void Message::addUnsignedInt(const unsigned int ui)
{
	const size_t tokenSize = sizeof(unsigned int);

	if (dynamicResize(tokenSize) < 0)
		return;

	unsigned int* const ui_ptr = (unsigned int* const)(&this->packet->data[this->read_write_head]);
	*ui_ptr = ENET_HOST_TO_NET_32(ui);

	this->read_write_head += tokenSize;
}
Note the ENET_HOST_TO_NET_32, which basically is htonl. For reading, ENET_NET_TO_HOST_32 is used.

Does either the irrlicht array or your operators take care of this?
"Whoops..."
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hmm .. I tried the suggestions yesterday, and I still got "0.0.0.0" as IP address of the server. Still ... I got my computers name ("Bebop" on my Desktop and "DarkStar" on my Notebook). I there a way in irrnetlite or enet to get the IP address from the computer name? Thanks for your help.
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
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

Brainsaw wrote:I still got "0.0.0.0" as IP address of the server.
Hm, CNetManager hides access to its member ENetAddress address. Don't know which address you used, but you need to add a getter for this first and use that address.
"Whoops..."
Post Reply