Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenrys committed Mar 27, 2018
1 parent a450724 commit 180a4a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import winreg
from PyVDF import PyVDF
from sys import exit

os.system("title Discord Rich Presence: Counter-Strike: Global Offensive [Installer]")

Expand Down
12 changes: 11 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import win32gui, win32con, win32process, psutil
import argparse
from sys import exit



Expand All @@ -22,7 +23,14 @@

class CSGOGameStateServer(HTTPServer):
def __init__(self, *args, **kwargs):
self.rpc = rpc.DiscordIpcClient.for_platform(client_id)
self.rpc = None
while not self.rpc:
try:
self.rpc = rpc.DiscordIpcClient.for_platform(client_id)
break
except:
time.sleep(5)
pass
self.state = -1
HTTPServer.__init__(self, *args, **kwargs)

Expand Down Expand Up @@ -164,6 +172,8 @@ def enum_window_callback(hwnd, pid):
our_process = psutil.Process(our_pid)
if our_process.parent():
win32gui.EnumWindows(enum_window_callback, our_process.parent().pid)
if our_process.parent().parent():
win32gui.EnumWindows(enum_window_callback, our_process.parent().parent().pid) # fuck it, why not

server_address = ("127.0.0.1", port)
while True:
Expand Down

0 comments on commit 180a4a3

Please sign in to comment.