irrNetLite 2.1 [BETA]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
wITTus
Posts: 167
Joined: Tue Jun 24, 2008 7:41 pm
Location: Germany

Post by wITTus »

BlindSide wrote:
ld warning: in /Users/Guillaume/Desktop/FirstNet/libenet.a, file is not of required architecture
It really seems the libs weren't built correctly, or on the same platform.
Well, you pre-compiled everything for x86-64.
It would be better IMO when you delete all linux binaries and simply preserve a makefile for them.

Then, the file encoding is a bit br0ken:

Code: Select all

CEncryption.h:   ASCII C++ program text, with CRLF line terminators
CNetManager.cpp: ASCII C program text, with CRLF, LF line terminators
CNetManager.h:   ASCII C program text, with CRLF, LF line terminators
Makefile:        ASCII make commands text, with CRLF, CR, LF line terminators
SPacket.cpp:     ASCII C program text, with CRLF, LF line terminators
I'm also wondering, why you made it Irrlicht independent :?:

Edit: Generated Documentation
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

If I wanted to do file sending through irrNetLite (files up to around a megabyte) should i send the file in chunks through multiple packets, or could I just lump the whole thing into a single packet? Would it be irresponsible to do so?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It would be best to send them in lumps of something like 20kb, but there's nothing stopping you from sending the whole file at once I suppose. There's no limit to the packet size. Also remember, you shouldn't send a string for that purpose as they use a 16-bit integer for storing the size, instead passing the data directly on the packet initialization is best.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
wITTus
Posts: 167
Joined: Tue Jun 24, 2008 7:41 pm
Location: Germany

Post by wITTus »

BlindSide, it would be cool if one could do:

Code: Select all

SOutPacket TempOP;
TempOP << <stuff>
TempOP << <stuff>
TempOP << <stuff>

SOutPacket OP;
OP << 3;
OP << TempOP;

<Send>
But there's no operator << (const SOutPacket&)
I had to do

Code: Select all

const c8* Data = TempOP.getData();
size_t    Size = TempOP.getSize();

for (size_t i=0; i<Size; ++i)
    OP << Data[i];
Instead :?
Generated Documentation for BlindSide's irrNetLite.
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

First UDP is not to intend to be used for filetransfer and enet neither. Second splitting packet is not needed because enet does by itselfs. But im not sure if enet will get stucked for some seconds if you try to send bigger packets.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

That's why I suggested splitting, because if you send 1 mb just like that it would halt the program for quite a while, also I already mentioned in my post that enet splits packets automatically.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hey,

im using IrrNetLite for the first time, looks great!

BUG:
When i try example 2 it fails to send strings with white space the server prints only the first word...
When i debug message it says bad pointer
Ban doesn't work in any case :-(

Greetings
Scarabol
wITTus
Posts: 167
Joined: Tue Jun 24, 2008 7:41 pm
Location: Germany

Post by wITTus »

Scarabol wrote:When i try example 2 it fails to send strings with white space the server prints only the first word...
Well, that's simply because of

Code: Select all

206                         // Take the input.
207                         std::string message;
208                         std::cin >> message;
better use std::getline(std::cin, message); for such things.
Generated Documentation for BlindSide's irrNetLite.
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Why does the server take such a long time to check, that the client is gone?
Is there any logout function?

Greetings
Scarabol
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

The server normally doesn't take a long time to check this, it's only if you use a console app like the demos and then close the console, then the client does not get a chance to disconnect properly. If the client deletes the net manager then it will properly severe the connection.

Not sure why ban is not working for you, can I see some source code that demonstrates this problem?

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

I'm sorry i forgot to delete this comment, everything works great, i think i could use it very well :-)

Bug?: If i connect to server the Ping is 400 and decrase slowly to about 7, could i speed up this decrase?

Maybe u could help me with this problem, it has indirectly to do with irrnetlite, because i don't know how to access classes and vars from main in my include???
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=33348

Greetings
Scarabol
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

How odd, that topic seems to have been moved or deleted. Anyway it seems you are lacking some basic C++ knowledge, I recommend reading through http://www.mindview.net/Books/TICPP/Thi ... CPP2e.html.

The problem with the ping is that it is averaged out over a few seconds, so it can take some time to stabilize, I doubt there is much you can do without modifying the Enet sources directly.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well esiest way is to send an own ping packet. But the measured ping may jump heavily.
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi,

how may i use long?

Code: Select all

long price; // very expensive ;-) so i need long definitely
packet >> price; // always produce error :-(
Is it possible to group some packets? Like:

Code: Select all

net::SOutPacket masterpacket;
net::SOutPacket packet;
packet << data;
masterpacket << packet;
packet.clearData();
packet << data2;
masterpacket << packet;
// masterpacket should now contain 2 packets and transmit them separated to the client
Greetings
Scarabol
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

That grouping thing was already mentioned, I guess I have to add it in to the next version.

About long, what compiler/arch are you using? Are you compiling for 64-bit systems?

"long" is a pretty ambigous type as alot of systems it's typical synonymous to an int but in this case I suppose it's a 64-bit int like "s64". If I'm not handling s64/u64 I'll have to add it in later but you can add it in yourself just copy the implementation for "f64" (double) and change all f64 to long, it should work pretty much the same if they are the same size. Just make sure of the size on your systems using sizeof(long), you may want to use less ambiguous types such as int64, etc because you'll run into trouble if you're communicating with a 32-bit system.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply