-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_schema.fbs
102 lines (79 loc) · 1.66 KB
/
game_schema.fbs
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
namespace GameplayFBData;
table JoinGameRequest {
player_uuid: string;
jwt_token: string;
}
table BetRequest {
bet_amount: uint64;
}
table CrashOutRequest {}
union RequestMessages { JoinGameRequest, BetRequest, CrashOutRequest }
table GameRequestEvent {
msg: RequestMessages;
}
table JoinGameResponse {
game_state: uint8;
betting_time_left: uint32;
round_time_elapsed: uint32;
multiplier: uint32;
display_name: string;
balance: uint64;
}
table BettingTimerStarted {
betting_time_left: uint32;
round_id: uint32;
server_seed_hash: string;
next_round_server_seed_hash: string;
}
table BettingTimerUpdate {
betting_time_left: uint32;
}
table RemotePlayerJoined {
display_name: string;
players_online: uint32;
}
table RemotePlayerLeft {
display_name: string;
players_online: uint32;
}
table RemotePlayerBetsPlaced {
display_name: string;
bet_amount: uint64;
}
table RemotePlayerCrashOut {
display_name: string;
win_amount: uint64;
}
table CrashOutResponse {
win_amount: uint64;
/// final multiplier
multiplier: uint32;
balance: uint64;
}
table CrashOutError {
code: uint8;
}
table BetResponse {
balance: uint64;
}
table BetError {
code: uint8;
}
table GameStarted {}
table GameUpdate {
multiplier: uint32;
}
table GameFinished {}
table GameError {}
union ResponseMessage {
JoinGameResponse,
BettingTimerStarted, BettingTimerUpdate,
BetResponse, BetError,
GameStarted, GameUpdate, GameFinished, GameError,
CrashOutResponse, CrashOutError,
RemotePlayerJoined, RemotePlayerLeft, RemotePlayerBetsPlaced, RemotePlayerCrashOut
}
table GameResponseEvent {
msg: ResponseMessage;
}
root_type GameRequestEvent;