-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
97 lines (79 loc) · 3.11 KB
/
config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import random
def save(value, number):
with open(server_path, 'r+') as f:
read_data = f.read()
f.truncate()
for data_line in read_data.split('\n')[:number]:
f.write(str(data_line))
f.write(str(value))
for data_line in read_data.split('\n')[number + 1:]:
f.write(str(data_line))
return value
def give_info():
return str({name_key: player_name})
#______________________________________________pathes__________________________________________
name_path = 'data/username.txt'
server_path = 'data/server_config.txt'
launch_path = 'data/launch_config.txt'
#_______________________________________dict's variables of keys_________________________________
connection_key = 'clientConnection'
address_key = 'ip'
name_key = 'name'
avatar_key = 'FacePictureThing'
disconect_message = 'He disconncted'
choicing_key = 'choicePlayer'
listener_key = 'listen'
sender_key = 'send'
room_key = ''
mafia_key = 'mafia'
doctor_key = 'doctor'
detective_key = 'detective'
inhabitants_key = 'inhabitants'
viewer_key = 'viewer'
#___________________________________________flags_for_game____________________________________
path = 'data/game_flags_config.txt'
with open(path, 'r+') as f:
read_data = f.read().split('\n')
voiting = (eval(read_data[0]), 0)
mini_games = (eval(read_data[1]), 1)
sleeping = (eval(read_data[2]), 2)
show_result = (eval(read_data[3]), 3)
player_choiced = (eval(read_data[4]), 4)
#____________________________________________game constans_____________________________________
classic_mode = 'classic'
configurate_mode = 'send_box'
game_mode = classic_mode
user_avatar = 'Sprites\Boi.jpg'
voiting_started = False
classic_order = {0: mafia_key, 1: doctor_key, 2: detective_key}
amount_mafia = 1
amount_doctors = 1
amount_detectives = 1
#____________________________________________nicknames___________________________________________
ExtraTHICCnames = ['ExtraAss228', 'Tom', 'Rapper № 1', 'Letov(Is he is fake one?)', 'CumCopter1488',
'CumBoi', 'Bo$$ of the Jimm', 'Cum',]
player_name = random.choice(ExtraTHICCnames)
#__________________________________________players roles___________________________________________
viewer = 'EyeInTheSky'
connected_user = 'user'
host_user = 'admin'
#_________________________________________players conditions_____________________________________
unplayable_condition = 'dead'
normal_condition = 'stay_awake'
condition_for_sleep = 'sleep'
#_________________________________________server's events_________________________________________
connected_event = 'connected'
dead_event = 'dead'
game_start_event = 'game_started'
message_sended = 'message_send'
vote_event = {mafia_key}
game_over = 'game_is_over'
#___________________________________________servers data__________________________________________
main_room_id = 798532664717606922
server_id = 798338351086043136
server_token = 'Nzk4MzQ4MDAyMjkyMDA2OTIy.X_zthA.kAR38rY_KbNJGU3VIY8PvPB1-dg'
with open(server_path, 'r+') as f:
read_data = f.read().split('\n')
print(type(read_data))
server = eval(read_data[0])
room_id = eval(read_data[1])