Browse Source

TTREngine: "unable to open 'onscreen' window" fixed

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Starting game
Warning: pandac.PandaModules is deprecated, import from panda3d.core instead
ToontownStart: loading settings module
sys.path =  []
os.environ["TTR_GAMESERVER"] = 192.241.177.224
os.environ["TTR_PLAYCOOKIE"] = ***
ToontownStart: Starting the game.
ToontownStart: setting default font
TTLocalizer: Running in language: english
from toontown.toonbase.TTLocalizerEnglish import *
OTPLocalizer: Running in language: english
from otp.otpbase.OTPLocalizerEnglish import *
:DisplayOptions: settingsFullScreen = False, embedded = False width=800 height=600
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
No protocol specified
:display:x11display(error): Could not open display ":0.0".
:ToonBase: Default graphics pipe is glxGraphicsPipe (OpenGL).
:ToonBase(warning): Unable to open 'onscreen' window.
Traceback (most recent call last):
  File "<compiled '__voltorbmain__'>", line 0, in <module>
  File "<compiled 'toontown.vlt7a797a90.vlt1a24f552'>", line 0, in <module>
  File "<compiled 'toontown.vlt7a797a90.vlta17db5f5'>", line 0, in <module>
  File "<compiled 'toontown.vlt7a797a90.vltac459d5c'>", line 0, in __init__
  File "<compiled 'vltbd267964.vlt8d79c425.vlt10bb7731'>", line 0, in __init__
  File "<compiled 'direct.vlt8f63e471.ShowBase'>", line 0, in __init__
  File "<compiled 'direct.vlt8f63e471.ShowBase'>", line 0, in vlt70856536
  File "<compiled 'toontown.vlt7a797a90.vltac459d5c'>", line 0, in vltfe22fbfb
  File "<compiled 'vltbd267964.vlt8d79c425.vlt10bb7731'>", line 0, in vltfe22fbfb
  File "<compiled 'direct.vlt8f63e471.ShowBase'>", line 0, in vltfe22fbfb
  File "<compiled 'direct.vlt8f63e471.ShowBase'>", line 0, in vltf05fd21b
Exception: Could not open window.
Fabian Peter Hammerle 7 years ago
parent
commit
9643a58e2e
2 changed files with 15 additions and 2 deletions
  1. 2 2
      setup.py
  2. 13 0
      tooncher/__init__.py

+ 2 - 2
setup.py

@@ -7,12 +7,12 @@ import glob
 setup(
     name = 'tooncher',
     packages = ['tooncher'],
-    version = '0.3.0',
+    version = '0.3.1',
     description = "automates toontown rewritten's login process",
     author = 'Fabian Peter Hammerle',
     author_email = 'fabian.hammerle@gmail.com',
     url = 'https://github.com/fphammerle/tooncher',
-    download_url = 'https://github.com/fphammerle/tooncher/tarball/0.2.0',
+    download_url = 'https://github.com/fphammerle/tooncher/tarball/0.3.1',
     keywords = ['game', 'launcher', 'toontown rewritten', 'ttr'],
     classifiers = [],
     scripts = glob.glob('scripts/*'),

+ 13 - 0
tooncher/__init__.py

@@ -44,6 +44,19 @@ def start_engine(engine_path, gameserver, playcookie, **kwargs):
             TOONTOWN_LIBRARY_PATH,
             'Frameworks',
         )
+    elif sys.platform == 'linux' and 'XAUTHORITY' in os.environ:
+        """ 
+        Fix for TTREngine reporting:
+        > :display:x11display(error): Could not open display ":0.0".
+        > :ToonBase: Default graphics pipe is glxGraphicsPipe (OpenGL).
+        > :ToonBase(warning): Unable to open 'onscreen' window.
+        > Traceback (most recent call last):
+        >   File "<compiled '__voltorbmain__'>", line 0, in <module>
+        >   [...]
+        >   File "<compiled 'direct.vlt8f63e471.ShowBase'>", line 0, in vltf05fd21b
+        > Exception: Could not open window.
+        """
+        env['XAUTHORITY'] = os.environ['XAUTHORITY']
     return subprocess.Popen(
         args=[engine_path],
         cwd=os.path.dirname(engine_path),