forked from rnixik/durak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents_room.go
46 lines (39 loc) · 1.47 KB
/
events_room.go
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
package main
// RoomMemberInfo contains info about a client in the room
type RoomMemberInfo struct {
Id uint64 `json:"id"`
Nickname string `json:"nickname"`
WantToPlay bool `json:"wantToPlay"`
IsPlayer bool `json:"isPlayer"`
IsBot bool `json:"isBot"`
}
// RoomInfo contains info about room where client is.
type RoomInfo struct {
Id uint64 `json:"id"`
OwnerId uint64 `json:"ownerId"`
Name string `json:"name"`
GameStatus string `json:"gameStatus"`
Members []*RoomMemberInfo `json:"members"`
MaxPlayers int `json:"maxPlayers"`
}
// RoomJoinedEvent contains info about room where client is
type RoomJoinedEvent struct {
Room *RoomInfo `json:"room"`
}
// RoomUpdatedEvent contains info about updated room where client is
type RoomUpdatedEvent struct {
Room *RoomInfo `json:"room"`
}
// RoomMemberChangedStatusEvent contains info about room member when he changes his status
type RoomMemberChangedStatusEvent struct {
Room *RoomMemberInfo `json:"member"`
}
// RoomMemberChangedPlayerStatusEvent contains info about room member when his player status was changed by room owner
type RoomMemberChangedPlayerStatusEvent struct {
Room *RoomMemberInfo `json:"member"`
}
// RoomSetPlayerStatusCommandData represents data from room owner to set or unset player status of a member
type RoomSetPlayerStatusCommandData struct {
MemberId uint64 `json:"memberId"`
Status bool `json:"status"`
}