/
EnterGameRes.go
110 lines (95 loc) · 2.56 KB
/
EnterGameRes.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
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
package theater
import (
"github.com/OSHeroes/bfheroesFesl/inter/network"
"github.com/OSHeroes/bfheroesFesl/inter/network/codec"
"github.com/sirupsen/logrus"
)
type reqEGRQ struct {
reqEGAM
}
type ansEGRQ struct {
TID string `fesl:"TID"`
Name string `fesl:"NAME"`
UserID string `fesl:"UID"`
PlayerID string `fesl:"PID"`
Ticket string `fesl:"TICKET"`
IP string `fesl:"IP"`
Port string `fesl:"PORT"`
IntIP string `fesl:"INT-IP"`
IntPort string `fesl:"INT-PORT"`
Ptype string `fesl:"PTYPE"`
RUser string `fesl:"R-USER"`
RUid string `fesl:"R-UID"`
RUAccid string `fesl:"R-U-accid"`
RUElo string `fesl:"R-U-elo"`
Platform string `fesl:"PL"`
RUTeam string `fesl:"R-U-team"`
RUKit string `fesl:"R-U-kit"`
RULvl string `fesl:"R-U-lvl"`
RUDataCenter string `fesl:"R-U-dataCenter"`
RUExternalIP string `fesl:"R-U-externalIp"`
RUInternalIP string `fesl:"R-U-internalIp"`
RUCategory string `fesl:"R-U-category"`
RIntIP string `fesl:"R-INT-IP"`
RIntPort string `fesl:"R-INT-PORT"`
Xuid string `fesl:"XUID"`
RXuid string `fesl:"R-XUID"`
LobbyID string `fesl:"LID"`
GameID string `fesl:"GID"`
}
type reqEGRS struct {
// TID=6
TID int `fesl:"TID"`
// LID=1
LobbyID int `fesl:"LID"`
// GID=12
GameID int `fesl:"GID"`
// ALLOWED=1
// ALLOWED=0
Allow int `fesl:"ALLOWED"`
// PID=3
PlayerID int `fesl:"PID"`
// Reason is only sent when ALLOWED=0 and there is some kind of error
// REASON=-602
Reason string `fesl:"REASON,omitempty"`
}
type ansEGRS struct {
TID string `fesl:"TID"`
LID string `fesl:"LID"`
PID string `fesl:"PID"`
Allow string `fesl:"ALLOWED"`
}
// EGRS - Enter Game Host Response
func (tm *Theater) EGRS(event network.EvProcess) {
if event.Process.Msg["ALLOWED"] != "1" {
}
if event.Process.Msg["ALLOWED"] == "1" {
}
logrus.Println("======EGRS=====")
tm.db.stmtGameIncreaseJoining.Exec(event.Process.Msg["GID"])
event.Client.Answer(&codec.Packet{
Message: thtrEGRS,
Content: ansEGRS{
TID: event.Process.Msg["TID"],
PID: event.Process.Msg["PID"],
LID: event.Process.Msg["LID"],
Allow: "1",
},
})
}
// Lobbies Data
type ansGREM struct {
gameID string `fesl:"GID"`
LID string `fesl:"LID"`
}
// GREM - Enter Game Host Response
func (tm *Theater) GREM(event network.EvProcess) {
logrus.Println("======GREM=====")
event.Client.Answer(&codec.Packet{
Message: thtrGREM,
Content: ansGREM{
event.Process.Msg["GID"],
event.Process.Msg["LID"],
},
})
}