Könnte man eine Ping Anzeige (wie bei LoL) machen ? (ohne eine Sicherheitslücke auf zu machen)
Unterlass Spam wenn du nichts zu sagen hast.Quote:
Ich glaube du solltest dich mal auf hochbegabt testen lassen.
Du hast echt tolle Ideen.
import subprocess # execute the code and pipe the result to a string test = "ping xxx.xxx.xxx.xxx" process = subprocess.Popen(test, shell=True, stdout=subprocess.PIPE) # give it time to respond process.wait() # optional check (0 --> success) print process.returncode # read the result to a string result_str = process.stdout.read() # test it ... print result_str
Soweit ich weiß würde process.wait() den Clienten kurz einfrieren lassenQuote:
Falls subprocess.py fehlt: [Only registered and activated users can see links. Click Here To Register...]Code:import subprocess # execute the code and pipe the result to a string test = "ping xxx.xxx.xxx.xxx" process = subprocess.Popen(test, shell=True, stdout=subprocess.PIPE) # give it time to respond process.wait() # optional check (0 --> success) print process.returncode # read the result to a string result_str = process.stdout.read() # test it ... print result_str
Versuch es mal so, ist aus einem Python Forum.
Habs nicht getestet, liege noch im Bett.
Gruß
Wieso unnötig? Erstmal würde der Spieler wissen ob es sich z.B. lohnt zu Switchen (weil bei hohem Ping z.B. bei Serverangriffen alles überswitcht wird) und ausserdem könnte man neben der Ping anzeige evtl. in den Ingame-Switchbot einbauen dass die Switchzeit immer Ping + 100ms beträgt.Quote:
Unterlass Spam wenn du nichts zu sagen hast.
Rein theoretisch ist es möglich aber Metin2 braucht so etwas einfach nicht, da der Internetverbrauch auch deutlich niedriger ist.
Danke werde es testen :)Quote:
Falls subprocess.py fehlt: [Only registered and activated users can see links. Click Here To Register...]Code:import subprocess # execute the code and pipe the result to a string test = "ping xxx.xxx.xxx.xxx" process = subprocess.Popen(test, shell=True, stdout=subprocess.PIPE) # give it time to respond process.wait() # optional check (0 --> success) print process.returncode # read the result to a string result_str = process.stdout.read() # test it ... print result_str
Versuch es mal so, ist aus einem Python Forum.
Habs nicht getestet, liege noch im Bett.
Gruß