How are you using the filesystem interface? Have you hooked it in any
way, or does the server plugin interface come with a filesystem
interface already?
Just that you shouldn't get a privileged instruction error just because
of the stuff you pass to AddSearchPath.
You could try using:
const char *test_addon = "CitSkins"; // Citizen Skins
instead of:
const char test_addon[50] = "CitSkins"; // Citizen Skins
but also remember that clients won't run this code, so as a server
plugin you won't get very far if the client doesn't have this content in
their game folders, and if you forced a client to download the whole of
counter-strike content im sure they wouldn't be very happy :P
Olivier Hamel wrote:
> I've been working on expanding a serverplugin that'll load other
> directories as content directories. (If you've played Garrysmod then I'm
> trying to recreate an addon system.)
> I've gotten the interfaces sorted out but I keep hitting this notorious
> (to me at least) exception 'Privileged instruction'. Currently I'm
> trying to mount folders in this structure:
> <steam username>\half-life 2 episode two\Addons\<actual folders to mount>
>
> My (relevant) code:
>
> void MountAddon(const char *AddonPath)
> {
> filesystem->AddSearchPath(AddonPath, "GAME"); // I'm assuming that
> "GAME" refers to the directory where the hl2.exe file is located
> }
>
> I've called it with this test addon/code (the directory exists):
>
> const char test_addon[50] = "CitSkins"; // Citizen Skins
>
> void TestMountAddon()
> {
> char buffer[150];
> sprintf(buffer, "Addons\\%s", test_addon);
>
> MountAddon(buffer)
> }
>
> I've looked up 'Privileged Instruction' and found this:
>
> 'Now Privileged Instruction -
>
> Win32-based applications that call inp(), outp(), and so forth can be
> successfully compiled and linked. However, these applications will
> generate the privileged instruction exception because the port I/O
> functions cannot be called from code running in user mode.
>
> Do not call the following functions from within a Win32-based
> application executing in user mode:
>
> _inp()
> _inpw()
> _inpd()
> _outp()
> _outpw()
> _outpd()'
>
> Which seems to be in accord with what I've found on MSDN (if with more
> functions that are marked 'privileged').
>
> I'm stumped: Why does calling AddSearchPath cause a privileged
> instruction error? (Perhaps I'm just being stupid and missing the
> obvious right now...)
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders