Repository navigation
Expand file tree
/
Copy pathmodels.py
More file actions
127 lines (109 loc) · 3.72 KB
/
Copy pathmodels.py
File metadata and controls
127 lines (109 loc) · 3.72 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
from tortoise import fields
from tortoise.models import Model
def game(game_mode=3, pin_mode=True, invisible_voting=False, only_check=False, bots=False, debug=False):
return {
"room_creator": 0,
"max_time_extension": 300,
"game_state": 0,
"game_stage": 1,
"stage_time": 0,
"conversation_message_id": 0,
"settings": {
"game_mode": game_mode,
"duration_day": 45,
"duration_night": 60,
"duration_lynching": 45,
"pin_mode": pin_mode,
"invisible_voting": invisible_voting,
"only_check": only_check,
"hardcore_doctor": False,
"bots": bots,
"debug": debug
},
"game": {
"day": 0,
"players_ids": [],
"players_starting_ids": {},
"players_dead_ids": [],
"last_word_ids": [], # последнее слово # кого нет в списке может сказать
"roles": {
"don": 0,
"doctor": 0,
"commissar": 0,
"mafia": [], # мб сделать дона в списке мафии
"killer": 0,
"suicide": 0,
"homeless": 0,
"whore": 0,
"sergeant": 0,
"hacker": 0,
"immortal": 0,
"lawyer": 0,
"kamikaze": 0,
"bodyguard": 0
},
"selections": {
"mafia_selection": [],
"doctor_selection": 0,
"past_doctor_selection": {},
"commissar_action": None,
"commissar_selection": 0,
"killer_selection": 0,
"homeless_selection": 0,
"whore_selection": 0,
"hacker_selection": 0,
"lawyer_selection": 0,
"bodyguard_selection": 0
},
"lynching": {
"lynch_stage": 0,
"voted_players": [],
"voted_players_in_the_lynch": [],
"players_selection": [],
"likes_ids": [],
"dislikes_ids": []
},
"starting_roles": {
"mafia": {},
"killer": {},
"suicide": {},
"kamikaze": {},
"civilians": {}
},
"kamikaze_win": False,
"suicide_win": False,
"winners_side": None,
"game_start_time": 0
}
}
user = {
"credits": 100,
"crystals": 1,
"games": {"wins": 0, "defeats": 0},
"items": {"shields": 0, "documents": 0, "active_role": 0, "dummy": 0, "pistol": 0, "dagger": 0},
"settings": {"shields_mode": 1, "documents_mode": 1, "active_role_mode": 1}
}
class ChatModel(Model):
id = fields.BigIntField(pk=True) # , index=False
creator = fields.BigIntField()
p_id = fields.BigIntField(unique=True)
name = fields.TextField(null=True)
properties = fields.JSONField(default=game)
registration = fields.BooleanField(default=False)
ban = fields.BooleanField(default=False)
class Meta:
table = 'chat'
class UserModel(Model):
id = fields.BigIntField(pk=True) # , index=False
u_id = fields.BigIntField(unique=True)
nickname = fields.TextField(null=True)
in_game = fields.BigIntField(default=0)
properties = fields.JSONField(default=user)
ban = fields.BooleanField(default=False)
class Meta:
table = 'user'
class CoreModel(Model):
games = fields.BigIntField(default=0)
check_duration = fields.BigIntField(default=150)
class Meta:
table = 'core'