summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-21 17:46:24 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-21 17:46:24 +0200
commitcbc4b9b666be0eb8747bbb301f3f43675193a104 (patch)
treed67c4e2d84e271e997bdf18d1649e3e465c39b7a
parentf55bb646dce93b36139bbaa7b1bccda10eda7f96 (diff)
parent83c23f0aebb72359a29dc4dca31be2622acdbcb6 (diff)
Merge branch 'master' into pathfinding
-rw-r--r--main.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/main.py b/main.py
index 5221ea1..a74f5b4 100644
--- a/main.py
+++ b/main.py
@@ -18,17 +18,24 @@ sub = DummySubscriber()
c = client.Client(sub)
stats = stats.Stats()
-# find out server and token to connect
-try:
- token = sys.argv[1]
- addr, *_ = utils.get_party_address(token)
-except:
- addr, token, *_ = utils.find_server()
-
-# connect
-c.connect(addr,token)
-c.send_facebook(
- 'g2gDYQFtAAAAEKO6L3c8C8/eXtbtbVJDGU5tAAAAUvOo7JuWAVSczT5Aj0eo0CvpeU8ijGzKy/gXBVCxhP5UO+ERH0jWjAo9bU1V7dU0GmwFr+SnzqWohx3qvG8Fg8RHlL17/y9ifVWpYUdweuODb9c=')
+for i in range(1,10): # 10 connection attempts
+ print("trying to connect, attempt "+str(i))
+ try:
+ # find out server and token to connect
+ try:
+ token = sys.argv[1]
+ addr, *_ = utils.get_party_address(token)
+ except:
+ addr, token, *_ = utils.find_server()
+
+ # connect
+ c.connect(addr,token)
+ c.send_facebook(
+ 'g2gDYQFtAAAAEKO6L3c8C8/eXtbtbVJDGU5tAAAAUvOo7JuWAVSczT5Aj0eo0CvpeU8ijGzKy/gXBVCxhP5UO+ERH0jWjAo9bU1V7dU0GmwFr+SnzqWohx3qvG8Fg8RHlL17/y9ifVWpYUdweuODb9c=')
+ break
+ except:
+ c.disconnect()
+
c.player.nick="test cell pls ignore"