-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONST.py
109 lines (88 loc) · 3.19 KB
/
CONST.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
98
99
100
101
102
103
104
105
106
class CARD_COLOR:
RED = 'R'
BLUE = 'B'
YELLOW = 'Y'
GREEN = 'G'
UNIVERSAL = 'U'
class CARD_CONTENT:
N_0 = '0'
N_1 = '1'
N_2 = '2'
N_3 = '3'
N_4 = '4'
N_5 = '5'
N_6 = '6'
N_7 = '7'
N_8 = '8'
N_9 = '9'
BLOCK = '10'
REVERSE = '11'
ADD2 = '12'
CHANGE = '13'
ADD4 = '14'
class CARD_CODE:
# 获取卡牌的编号(颜色, 内容)
@staticmethod
def get_card_code(color, content):
return color, content
# from util import return_the_full_deck
# # 用来初始化牌堆的完整牌堆
# FULL_DECK = return_the_full_deck()
FULL_DECK = [('R', '0'), ('R', '1'), ('R', '2'), ('R', '3'), ('R', '4'), ('R', '5'), ('R', '6'), ('R', '7'), ('R', '8'),
('R', '9'), ('R', '10'), ('R', '11'), ('R', '12'), ('R', '1'), ('R', '2'), ('R', '3'), ('R', '4'),
('R', '5'), ('R', '6'), ('R', '7'), ('R', '8'), ('R', '9'), ('R', '10'), ('R', '11'), ('R', '12'),
('B', '0'), ('B', '1'), ('B', '2'), ('B', '3'), ('B', '4'), ('B', '5'), ('B', '6'), ('B', '7'), ('B', '8'),
('B', '9'), ('B', '10'), ('B', '11'), ('B', '12'), ('B', '1'), ('B', '2'), ('B', '3'), ('B', '4'),
('B', '5'), ('B', '6'), ('B', '7'), ('B', '8'), ('B', '9'), ('B', '10'), ('B', '11'), ('B', '12'),
('Y', '0'), ('Y', '1'), ('Y', '2'), ('Y', '3'), ('Y', '4'), ('Y', '5'), ('Y', '6'), ('Y', '7'), ('Y', '8'),
('Y', '9'), ('Y', '10'), ('Y', '11'), ('Y', '12'), ('Y', '1'), ('Y', '2'), ('Y', '3'), ('Y', '4'),
('Y', '5'), ('Y', '6'), ('Y', '7'), ('Y', '8'), ('Y', '9'), ('Y', '10'), ('Y', '11'), ('Y', '12'),
('G', '0'), ('G', '1'), ('G', '2'), ('G', '3'), ('G', '4'), ('G', '5'), ('G', '6'), ('G', '7'), ('G', '8'),
('G', '9'), ('G', '10'), ('G', '11'), ('G', '12'), ('G', '1'), ('G', '2'), ('G', '3'), ('G', '4'),
('G', '5'), ('G', '6'), ('G', '7'), ('G', '8'), ('G', '9'), ('G', '10'), ('G', '11'), ('G', '12'),
('U', '13'), ('U', '14'), ('U', '13'), ('U', '14'), ('U', '13'), ('U', '14'), ('U', '13'), ('U', '14')]
# QUANTITY
DATA_PACK_MAX_SIZE = 2048
# MD5 SALT
PREFIX_SALT = 'prefix_salt'
SUFFIX_SALT = 'suffix_salt'
# SERVER
MATCH_SERVER_ADDR = '127.0.0.1'
MATCH_SERVER_PORT = 20000
GAME_SERVER_ADDR = '127.0.0.1'
GAME_SERVER_PORT_MIN = 21000
GAME_SERVER_PORT_MAX = 22000
# Client
CLIENT_DEFAULT_PORT = 23000
CLIENT_PUBLIC_KEY_INDEX = 0
CLIENT_PRIVATE_KEY_INDEX = 1
CLIENT_ADDR_INDEX = 0
CLIENT_PORT_INDEX = 1
# DATABASE
NOT_FOUND = 'NOT_FOUND_INFO'
# ENCODE
RSA = 'rsa'
# RSA DEPOSITORY
RSA_DEPOSITORY_LOCATION = './rsa_depository/'
# HOW TO PLAY
BEGINNING_HAND_CARD_NUM = 7
# JSON KEY
J_USERNAME = 'username'
J_PASSWORD = 'password'
J_CLIENT_ADDR = 'client_addr'
J_CLIENT_PORT = 'client_port'
J_PLAYER_NUM = 'player_num'
J_DIRECTION = 'direction'
J_PLAYERS_LIST = 'players_list'
J_HAND_CARD_NUM_LIST = 'hand_card_num_list'
J_HAND_CARD = 'hand_card'
J_CARD_CODE = 'card_code'
J_GUIDE_COLOR = 'guide_color'
J_ERROR_CARD_CODE = 'error_card_code'
J_ALLOW_TO_DISCARD = 'allow_to_discard'
J_THE_FIRST_GUIDE = 'the_first_guide'
J_RSA_PUBLIC_KEY = 'rsa_public_key'
J_RSA_PRIVATE_KEY = 'rsa_private_key'
# CARD
CARD_COLOR_INDEX = 0
CARD_CONTENT_INDEX = 1