Page 3 of 16

Posted: Thu Jan 25, 2007 1:00 am
by BlindSide
Thx for showing interest, so there is hope yet! :lol:

PS, I am curious, what sort of features should I implement here? I feel like there is not much more I can add (Except optimizing rotation, getcustomvars and adding rotation acceleration maybe...) Oh yes and maybe chat feature...

...

Posted: Thu Jan 25, 2007 8:54 pm
by xhrit
BlindSide, before you add anymore features you need to write documentation. Not only on existing features, but planned features, design principals, and data structures as well.

Posted: Thu Jan 25, 2007 9:40 pm
by BlindSide
Hey xhrit :D

Haha your the guy with the eyeball, ive seen that thing around :P
Anyway your right about all that. I think Ive managed to squeeze some of the overall picture in the individual function documentation, but it does lack an actual overall design thing like you said. Ill get that done sometime...

Posted: Sun Jan 28, 2007 9:36 pm
by monkeycracks
http://www.ultimate-ownage.com/irrNet.zip

It's the newest version of IrrNet with an IrrNet.A and a bit of modified source code to work with Dev-Cpp in case anyone was having problems.

Posted: Tue Feb 06, 2007 4:22 pm
by Midnight
how do I handle char correctly?

I'm getting strange errors tried char, char*, const wchar_t.

nothing seems to work you have examples of every type of packet except those.

please help.

EDIT: nvm I got a basic packet sending now think I can manage.

Posted: Tue Feb 06, 2007 9:33 pm
by Halan
(question edited)

is the a precompiled .lib (for msvc)?

greets,
halan

Posted: Tue Feb 06, 2007 10:49 pm
by Midnight
don't think so...can't you make one?

Posted: Wed Feb 07, 2007 1:41 pm
by Halan
if you tell me where i can find the enet sdk i can ;)

edit: okay compiled it but ive still one question. is this code causing memory leaks?

Code: Select all

    //Setup the Network Stuff
    netmgr->setUpClient();
    if(!netmgr->getEstablished())
    {
        isServer = true;
        netmgr->setUpServer();
    }
greets,
halan

Posted: Thu Feb 08, 2007 5:37 am
by BlindSide
Hey there,

@Midnight, what IDE are you using? Try the custom linux version as it works for stuff like Dev-C++. If you mean everything is working but you cannot handle your own "char" packets, I think the custom packet handler supports standard string input, Ill have to double check. Look at the API documentation for more info about setting up a custom packet handler.

@Halan, ONLY set up client OR server. Not both. A server is already a client that hosts for all the other clients too, so you dont need to set up a client seperately. Cheers.

Please look at examples for suggestions thanks.

Also "getEstablished" will not be true until a few frames later. Because it requires several connection packets to be exchanged. Testing it right away will almost always yeild false. (Also "getEstablished" is only useful for clients, a server is technically always "established" (Or maybe established is true for server when the first client connects, Ill have to check this too))

About the precompiled lib, you most likely don't need one. Just add the enet files and irrNet files to your project, make sure all the headers are in your include path, and define WIN32 (or UNIX) in your precompiler definitions. This is all explained in the docs if you need more info.

Cheers guys, keep the questions comin im happy to help anyone out as much as they need.

- BSide :)

Posted: Thu Feb 08, 2007 5:19 pm
by Halan
well thing is i want to make a client and check if a game is allready running if not i want to make the client server...

greets,
halan

Posted: Fri Feb 09, 2007 4:33 am
by Midnight
Halan wrote:well thing is i want to make a client and check if a game is allready running if not i want to make the client server...

greets,
halan
only way is to feed it a single ip thats intended to be server and they have to run it first to ensure that a connection is made otherwise a server is setup instead.

EDIT: after further testing this code I realised that the client doesn't initialize properly.. figuare it out from here if ya want.

anyways here is how...

change...
// Comment/Uncomment this to define if this is a client or server.
#define CLIENT

to...

Code: Select all

bool isServer = false;
next change the first set of define checks into

Code: Select all

	netmgr->setUpClient();
	if(!netmgr->getEstablished())
	{
		netmgr->setUpServer();
		isServer = true;
	}
and finally to update

Code: Select all

			if(isServer)
			{
				netmgr->updateClient();
			}
			else
			{
				netmgr->updateServer();
			}

edit whoa I just wrote yer code without knowing it lol
great minds think alike i suppose.

BTW I tested this while monitoring my ram IDK if that constitutes as a memory leak test but it seemed to work perfectly to me.

Posted: Sat Feb 10, 2007 1:10 am
by BlindSide
Halan wrote:well thing is i want to make a client and check if a game is allready running if not i want to make the client server...

greets,
halan
Ok then I recommend using a different instance of netmgr, using the same one as a client AND server is not recommended. Make a client, wait a few seconds for it then check if its established. If its not then delete that netmgr and make a new one with a server.

@MidNight, yeah changing it to a bool would be ok, but like I said you need a new netmgr for the server. I originally used bools but I figured a DEFINE would look cleaner and also use less resources while running. But for his purpose its required.

Posted: Sat Feb 10, 2007 2:22 am
by Midnight
actually it makes the server fine.

only reason for a bool is the "if statement"

problem is it won't make a client... maybe cause I didn't wait long enough for it to connect.

personally I'm working on two thing with irrnet atm

first a chat system which with the only function an "char" and all of irrlicht being designed using "wchar_t" I'm having one hell of a time making that possible so I suggest you remedy that for me.

and next I'm working on a server that doesn't actually render... a dedicated server model to increase efficiancy and reduce load on a dedicated server system... same thing as dedicated game servers I just want a renderless server to track and only clients to connect I feel it's a better overall server client model.. more fair considering a server is the only person with direct control of the updated statistics...

a good example would be like the reason a gas station attendent can not buy lottery tickets from his own store. difference being its the lag that kills you here and not the mob.

Posted: Sun Feb 11, 2007 1:27 am
by Halan
it would be cool if some kind of lan broadcast were implented andd so you dont have to know the ip of the server :)

Posted: Sun Feb 11, 2007 11:07 am
by BlindSide
Thats true, I will look into making a lan broadcast...

@Midnight, im sure using a (wchat_t*) typecast would work in most cases. Also sticking an "L" just before pushing a paremeter works eg. message(L"My char value"); So im gessing message(L(mychararray[100])); should work too..but probably not :lol:

About the dedicated server, this *could* possibly be used using that new feature with the X11 independant rendering. For windows maybe a null device works? Or for a really hacky option a software driver with a 1x1 display area lol... A chat program is the easiest thing to make using a network lib, look into the Enet api maybe that will help, probably not though because all network packets are actually char arrays, this is because a char is not just a list of characters, but actually a general block of memory. If typecasting doesnt work ill look into implementing wchar sending...

I recommend just not displaying anything manually somehow and using the irrlicht window to display stats/output info about the server.