mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
check for NPAPI version at startup
This commit is contained in:
parent
fbb5c7ce0d
commit
d2bccefad8
@ -164,6 +164,21 @@ NP_Initialize(NPNetscapeFuncs *browserFuncs,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int browser_major = HIBYTE(browser->version);
|
||||||
|
int browser_minor = LOBYTE(browser->version);
|
||||||
|
nout << "Browser version " << browser_major << "." << browser_minor << "\n";
|
||||||
|
|
||||||
|
int expected_major = NP_VERSION_MAJOR;
|
||||||
|
int expected_minor = NP_VERSION_MINOR;
|
||||||
|
|
||||||
|
nout << "Expected version " << expected_major << "." << expected_minor
|
||||||
|
<< "\n";
|
||||||
|
if (browser_major < expected_major ||
|
||||||
|
(browser_major == expected_major && browser_minor < expected_minor)) {
|
||||||
|
nout << "Cannot run: unsupported version of NPAPI detected.\n";
|
||||||
|
return NPERR_GENERIC_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
// Seed the lame random number generator in rand(); we use it to
|
// Seed the lame random number generator in rand(); we use it to
|
||||||
// select a mirror for downloading.
|
// select a mirror for downloading.
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user