logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
GetHasFile - For Clients?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Jan 13, 2011 15:40    Post subject: GetHasFile - For Clients? Reply with quote

This more a discussion about whether this is possible/feasible via nwnserver methods.


Basically, from my own understanding,
nwnserver contains a list of required hak's etc acquired from the module it has loaded.

At some point, it must send the list of hak's required, to the client, in order for the client to check whether or not they have the files.

What im wondering,
is it possible to hook onto this message/mechanism, and feed in our own filename, instead of a hak name, and thus, allow the server/server owner, to verify what files exist on the clients machine?


Now, this does somewhat sound dodgy, and most people would much rather just use haks, however, im thinking about moving to some optional custom content for my server, that may or may not crash a client, if they attempt to enter an area which contains content they are missing.

Ideally, I would like to refuse them entry to such areas, if they lack the content.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Jan 13, 2011 20:37    Post subject: Reply with quote

I know Higher Ground does this, and I'm fairly sure it's only possible on a Linux server at present. If I were you, I'd investigate the NWNeXalt plugins (nwnx_funcs, nwnx_defenses, nwnx_events, nwnx_weapons) and possibly nwnx_resman. If you can figure out a way using your own ingenuity, great. Otherwise, contact one of the HG guys and if you ask nicely they might tell you how they pulled off such a thing. Both FunkySwerve and acaos are registered on the nwnx forums - from what I can tell acaos is the mastermind behind it all, though Funky probably knows how it's done too.
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Fri Jan 14, 2011 9:00    Post subject: Reply with quote

Actually, I don't think we do this, though acaos is the one who set it up. To verify client versions of our haks, we maintain a list of custom vfx, played when they enter the area. Those vfx are blank, unless they need to update, in which case it generates a massive red vfx (all that is done simply with 2da edits so far as I know). Or was there something else we do that made you think we could do this? I'm pointing acaos to this thread, hopefully he'll find some time to answer.

Funky
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Jan 14, 2011 10:45    Post subject: Reply with quote

Well from what little I can remember, I thought there were some parts of the module not available without the haks, which would imply some kind of checking. Maybe I'm completely off the ball though.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jan 14, 2011 11:47    Post subject: Hi Funky Reply with quote

@ Funky - Do you think its possible to hook onto nwnserver's function that checks for existance of haks, and change the filename of the file its checking for?

I suspect it might be done via a server message, that gets sent to the client, and the client actually does the checking, etc


I just thought it might be interesting if it was possible to change the function, so instead of it being called with the default message of

Check player has CEP2_TOPv22.hak
that we could change it to
Check player has ./override/customcontent.file or something


(My custom content is downloaded into the override directory for the players, via a Resource Downloading app I made, the idea is that the content is Optional, Music, Sound and portraits etc are optional.

But ive been thinking about moving to custom vfx too, but those sorts of things, I think may cause the client to crash, if they dont have the content, so I was hoping it might be possible to make it so that if the player doesnt have the content, we can somehow prevent them from entering a specific area.

eg - onDoorTransition function checks for the content, if false = No Entry, if true = Enter
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jan 14, 2011 14:04    Post subject: Reply with quote

The server does not check the existence of any files on the client: it sends the list of necessary haks on login, and the client checks if these haks exist in hak folder. If any of the files is missing, the client disconnects and shows the error message.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jan 14, 2011 16:49    Post subject: Reply with quote

but what if the Server, was tricked into sending a message, of a customized hak list.

eg - Instead of looking for a hak, would it be possible to change the hak name to be "./override/myfile.txt" for example, and the client, being silly, would check for the file.

Granted, im unsure if there would be any return value from the client, to the server, but if it were possible to disconnect clients with a message - BootPCWithMsg for instance, it would be better than a crash from missing content.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jan 14, 2011 17:01    Post subject: Reply with quote

I'm not sure if directory changing trick is possible.
And if the file is not found, the client will disconnect and show an error message to the player. The server doesn't do the check and doesn't send the "hak missing" message. It's all done on the client side.
So yes, you can probably change the hak list dynamically to check files, but:
* not silently (as the client will show an error message, and you can't change that behavior or the error message text)
* the client will disconnect if any of the listed files are missing, and the server won't know which files are missing
* you don't get any return value, but you can check if the client has connected successfully. If not, it's probably missing some hak files.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Jan 14, 2011 19:22    Post subject: Reply with quote

Quote:

I'm not sure if directory changing trick is possible.

But admit it, your curious to find out. Lol
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jan 14, 2011 20:04    Post subject: Reply with quote

Considering other limitations I've described in the previous post, it doesn't seem useful even if it has no directory lock.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Fri Jan 14, 2011 23:39    Post subject: Reply with quote

This has been done for several servers...
They use a 'launcher' application on the client (that needs to be downloaded)
The files are checked before the launcher spawns NWN.

I've tinkered with the idea of adding a 'launch' feature into WorldGate. All the required files are checked (updated) then NWN starts.

Still nothing can be done at the server end.

Cheers
Gryphyn
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Sat Jan 15, 2011 0:27    Post subject: Reply with quote

Fireboar wrote:
Well from what little I can remember, I thought there were some parts of the module not available without the haks, which would imply some kind of checking. Maybe I'm completely off the ball though.

No. We were contemplating adding some areas using custom tilesets, but couldn't come up with a way to check that they had them, as best as I can recall. We have a great deal of content that is accessible only if you have our version of the cep_custom hak, and have done engine hacks to substitute in different graphics for people without that hack, but again, I think that's controlled only by whether or not the client has set the enhmode on via command. Of course, that IS checked via a custom hack:

Code:

int GetEnhancedMode (object oCreature) {
    return NWNXExaltZero(oCreature, "NWNX!EXALT!GETENHANCEDMODE");
}

So I could be wrong. But then, our 'no vfx' mode option is ALSO set via nwnx hack, so I suspect it's use in both cases is to indicate what information to send the client, and not in any way to read the contents of the client's files, which I seem to remember being impossible outside of what the engine already does, absent a clientside hack.

Hopefully that helps clear things up a little bit, until acaos is able to answer more definitively.

Funky
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Sat Jan 15, 2011 0:37    Post subject: Re: Hi Funky Reply with quote

Baaleos wrote:
@ Funky - Do you think its possible to hook onto nwnserver's function that checks for existance of haks, and change the filename of the file its checking for?

In my highly unprofessional, ignorant opinion, no, I don't think it's possible without a clientside engine hack, based on fuzzy recollections of conversations with acaos. Only he can elaborate on why, though it strikes me that the ability to get file information from a client's machine would be a pretty serious security threat.

Quote:

But ive been thinking about moving to custom vfx too, but those sorts of things, I think may cause the client to crash, if they dont have the content, so I was hoping it might be possible to make it so that if the player doesnt have the content, we can somehow prevent them from entering a specific area.

If it's just vfx, and the client doesn't have the vfx in question, I suspect it will simply not play, rather than crashing them. This is how it works for us, though it's possible acaos had to do a hack to prevent such a crash. Similarly, if they don't have an item property that appears on an item in their inventory, they see a BADSTRREF - acaos devised a hack to prevent them from seeing that, just showing a blank instead (we put props of this kind in descriptions as well, for those without our hak). No crash there, though, for certain. Again, I'm fairly sure none of that involves reaching into the client's folders and peeking about.

Funky
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group