diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index 710732fa2c..6a22433941 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -1774,8 +1774,6 @@ mark_p3d_trusted() { // Only call this once. assert(!_p3d_trusted); - _p3d_trusted = true; - // Extract the application desc file from the p3d file. stringstream sstream; if (!_mf_reader.extract_one(sstream, "p3d_info.xml")) { @@ -1805,9 +1803,16 @@ mark_p3d_trusted() { send_notify("onauth"); // Now that we're all set up, start downloading the required - // packages, and then start the instance itself if we're already - // fully downloaded. + // packages. add_packages(); + + // Until we've done all of the above processing, we haven't fully + // committed to setting the trusted flag. (Setting this flag down + // here instead of a few lines above avoids starting the instance in + // add_packages(), before we've had a chance to finish processing + // this method.) + _p3d_trusted = true; + if (get_packages_ready()) { mark_download_complete(); } @@ -2604,6 +2609,7 @@ set_button_image(ImageType image_type) { //////////////////////////////////////////////////////////////////// void P3DInstance:: report_package_info_ready(P3DPackage *package) { + nout << "report_package_info_ready: " << package->get_package_name() << "\n"; if (package == _image_package || package == _certlist_package || package == _p3dcert_package) { // A special case: these packages get immediately downloaded, @@ -2674,7 +2680,7 @@ ready_to_install() { _download_package_index = 0; _total_downloaded = 0; _download_begin = time(NULL); - + nout << "Beginning install of " << _downloading_packages.size() << " packages, total " << _total_download_size << " bytes required.\n"; diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index af0f1c6bbf..7895abbbbc 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -284,6 +284,18 @@ set_plugin_version(int major, int minor, int sequence, _plugin_distributor = distributor; _coreapi_host_url = coreapi_host_url; _coreapi_timestamp = coreapi_timestamp; + + nout << "Plugin version: " + << _plugin_major_version << "." + << _plugin_minor_version << "." + << _plugin_sequence_version; + if (!_plugin_official_version) { + nout << "c"; + } + nout << "\n"; + nout << "Plugin distributor: " << _plugin_distributor << "\n"; + nout << "Core API host URL: " << _coreapi_host_url << "\n"; + nout << "Core API date: " << ctime(&_coreapi_timestamp) << "\n"; } //////////////////////////////////////////////////////////////////// @@ -1303,7 +1315,7 @@ create_runtime_environment() { _temp_directory += "/"; } - nout << "_root_dir = " << _root_dir + nout << "\n_root_dir = " << _root_dir << ", _temp_directory = " << _temp_directory << ", platform = " << _platform << ", host_url = " << _host_url diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index db64c218e4..d4e5da9cb0 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -1080,6 +1080,9 @@ start_p3dpython(P3DInstance *inst) { return; } + nout << "Setting environment:\n"; + write_env(); + // Get the filename of the Panda3D multifile. We need to pass this // to p3dpython. _mf_filename = inst->_panda3d->get_archive_file_pathname(); @@ -1637,3 +1640,25 @@ p3dpython_thread_run() { nout << "Failure on startup.\n"; } } + +//////////////////////////////////////////////////////////////////// +// Function: P3DSession::write_env +// Access: Private +// Description: Writes _env, which is formatted as a string +// containing zero-byte-terminated environment +// defintions, to the nout stream, one definition per +// line. +//////////////////////////////////////////////////////////////////// +void P3DSession:: +write_env() const { + size_t p = 0; + size_t zero = _env.find('\0', p); + while (zero != string::npos) { + nout << " "; + nout.write(_env.data() + p, zero - p); + nout << "\n"; + p = zero + 1; + zero = _env.find('\0', p); + } +} + diff --git a/direct/src/plugin/p3dSession.h b/direct/src/plugin/p3dSession.h index a4e3029846..0a09bc7ca3 100644 --- a/direct/src/plugin/p3dSession.h +++ b/direct/src/plugin/p3dSession.h @@ -88,6 +88,8 @@ private: THREAD_CALLBACK_DECLARATION(P3DSession, p3dpython_thread_run); void p3dpython_thread_run(); + void write_env() const; + private: int _session_id; string _session_key;