CEngelbrecht / Launch-Control

Python Implementation of SDSU Rocket Project Launch Control
0 stars 0 forks source link

Ping Admin Issues on Windows #4

Open SDSURocketProject opened 7 years ago

SDSURocketProject commented 7 years ago

Currently, the ping server button requires admin privileges when on Windows. This can be circumvented if the script is run with Admin Privileges, but I'd like a built in solution. This doesn't affect the connection, but a negative ping result indicated the server is unavailable, which isn't necessarily true.

Kheirlb commented 7 years ago

What ideas do you have to create a built in solution?

On Thu, Jan 19, 2017 at 3:44 PM, SDSURocketProject <notifications@github.com

wrote:

Currently, the ping server button requires admin privileges when on Windows. This can be circumvented if the script is run with Admin Privileges, but I'd like a built in solution. This doesn't affect the connection, but a negative ping result indicated the server is unavailable, which isn't necessarily true.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CEngelbrecht/Launch-Control/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AV7_43eg8nMN70yRWM7dHdshRmLjJAfbks5rT_VNgaJpZM4Lov8q .

-- SDSU Rocket Project Design Lead SDSU AESC VP of Programming SDSU REO Residential Advisor Aerospace Engineering Major Computer Science Minor San Diego State University (530) 526-7030 | kheirlbparks@gmail.com

CEngelbrecht commented 7 years ago
from platform import system
if system().lower() in ['linux','linux2']:
    response  = subprocess.call(["ping", server_IP,"-c1", "-W1","-q"])
elif system().lower() in ['windows','win32']:
    msg = tkMessageBox.showwarning('Warning','Behaviour is uncertain in Windows. Make sure client is running as administrator')
    response = subprocess.call("ping {} -n 1 -w 1".format(server_IP))

Here's an idea. Just throw up a warning, then when it doesn't work in windows the user will either run as admin or try to make a connection anyway.