-
Notifications
You must be signed in to change notification settings - Fork 0
/
frayClient.py
48 lines (40 loc) · 1.19 KB
/
frayClient.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import socket
import feudNetworking
# for standard net connections, use feudNetworking lib
live = 1
def startup():
global username
global host
host = raw_input("Enter address of Feud Server: ")
loginOrNew = raw_input("New user?\n")
if loginOrNew == "yes" or "Yes" or "y" or "Y":
username = raw_input("Please enter desired username: ")
password = raw_input("Please enter desired [insecure] password: ")
new = 1
else:
username = raw_input("Please enter username: ")
password = raw_input("Please enter password: ")
new = 0
package = ('LOGI ' + username + password + new)
feudNetworking.cLient(package)
def logOut(reason):
package = ('LOGO ' + reason)
feudNetworking.cLient(package)
def printHelp():
print "---HELP---"
print "Available commands: "
print ' '
print "logout - exit game"
def main():
while live:
command = raw_input("FEUD:> ")
if command == "logout" or "log out" or "LOGOUT" or "LOGO":
logOut("MENU")
break
if command == "help" or "HELP" or "?":
printHelp()
def shutdown():
print "logging out"
startup()
main()
shutdown()