-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.rules.json
177 lines (167 loc) · 5.48 KB
/
database.rules.json
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{
"rules": {
"gameInfos": {
".read": true,
".write": true,
"$game_id": {
"id": { ".validate": "newData.isNumber()" },
"name": { ".validate": "newData.isString() && newData.val().length <= 100" },
"turn": { ".validate": "newData.isNumber()" },
"round": { ".validate": "newData.isNumber()" },
"lastUpdate": { ".validate": "newData.isNumber()" },
"$others": { ".validate": false }
}
},
"games": {
"$game_id": {
".read": true,
".write": true,
"gameId": { ".validate": "newData.isNumber()" },
"rules": {
"useTeams": { ".validate": "newData.isBoolean()" },
"boardSize": { ".validate": "newData.isNumber()" },
"numberOfPlayers": { ".validate": "newData.isNumber()" },
"useDiscardRule": { ".validate": "newData.isBoolean()" },
"playerOrderAntiClockwise": { ".validate": "newData.isBoolean()" },
"numberOfPieces": { ".validate": "newData.isNumber()" },
"$others": { ".validate": false }
},
"turn": { ".validate": "newData.isNumber()" },
"round": { ".validate": "newData.isNumber()" },
"hasDiscarded": { ".validate": "newData.isBoolean()" },
"winnerId": { ".validate": "newData.isNumber()" },
"continuePlaying": { ".validate": "newData.isBoolean()" },
"cards": {
"$index": {
"id": { ".validate": "newData.isNumber()" },
"basic": { ".validate": "newData.isBoolean()" },
"color": { ".validate": "newData.isString() && newData.val().length <= 20" },
"symbol": { ".validate": "newData.isString() && newData.val().length <= 5" },
"quantity": { ".validate": "newData.isNumber()" },
"actions": {
"$index": {
"value": { ".validate": "newData.isNumber()" },
"startable": { ".validate": "newData.isBoolean()" },
"special": { ".validate": "newData.isString() && newData.val().length <= 10" },
"text": { ".validate": "newData.isString() && newData.val().length <= 20" },
"values": {
"$value_index": {
".validate": "newData.isNumber()",
"$others": { ".validate": false }
}
},
"$others": { ".validate": false }
}
},
"$others": { ".validate": false }
}
},
"flatPlayers": {
"$player_index": {
"id": { ".validate": "newData.isNumber()" },
"color": { ".validate": "newData.isString() && newData.val().length <= 20"},
"name": { ".validate": "newData.isString() && newData.val().length <= 30"},
"onlineStatus": { ".validate": "newData.isString() && newData.val().length <= 20"},
"host": { ".validate": "newData.isBoolean()" },
"goalSpaceIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"handCardIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"homePieceIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"pieceIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"spaceIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"swapPlayerId": { ".validate": "newData.isNumber()" },
"swapCardId": { ".validate": "newData.isNumber() || newData.val() === null" },
"$others": { ".validate": false }
}
},
"flatSpaces": {
"$index": {
"id": { ".validate": "newData.isNumber()" },
"isGoal": { ".validate": "newData.isBoolean()" },
"isStart": { ".validate": "newData.isBoolean()" },
"pieceId": { ".validate": "newData.isNumber() || newData.val() === null" },
"playerId": { ".validate": "newData.isNumber()" },
"$others": { ".validate": false }
}
},
"flatPieces": {
"$index": {
"id": { ".validate": "newData.isNumber()" },
"color": { ".validate": "newData.isString() && newData.val().length <= 20" },
"playerId": { ".validate": "newData.isNumber()" },
"spaceId": { ".validate": "newData.isNumber() || newData.val() === null" },
"$others": { ".validate": false }
}
},
"deckCardIds": {
"$index": {
".validate": "newData.isNumber()",
"$others": { ".validate": false }
}
},
"discardCardIds": {
"$index": {
".validate": "newData.isNumber()",
"$others": { ".validate": false }
}
},
"gameLog": {
"$log_id": {
"playerId": { ".validate": "newData.isNumber()" },
"action": { ".validate": "newData.isString() && newData.val().length <= 20" },
"cardAction": {
"$index": {
"value": { ".validate": "newData.isNumber()" },
"startable": { ".validate": "newData.isBoolean()" },
"special": { ".validate": "newData.isString() && newData.val().length <= 10" },
"text": { ".validate": "newData.isString() && newData.val().length <= 20" },
"values": {
"$value_index": {
".validate": "newData.isNumber()",
"$others": { ".validate": false }
}
},
"$others": { ".validate": false }
}
},
"cardId": { ".validate": "newData.isNumber()" },
"moveSet": {
"$index": {
"pieceId": { ".validate": "newData.isNumber()" },
"spaceId": { ".validate": "newData.isNumber()" },
"$others": { ".validate": false }
}
},
"cardIds": {
"$index": {
".validate": "newData.isNumber()"
}
},
"$others": { ".validate": false }
}
},
"$others": { ".validate": false }
}
},
"$others": { ".validate": false }
}
}