You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
880 B
45 lines
880 B
|
1 year ago
|
package game
|
||
|
|
|
||
|
|
import (
|
||
|
|
"server/pb"
|
||
|
|
|
||
|
|
"github.com/liangdas/mqant/gate"
|
||
|
|
)
|
||
|
|
|
||
|
|
func OnMillionBet(session gate.Session, req *pb.GameMsgBetReq) (string, error) {
|
||
|
|
p := FindPlayer(session)
|
||
|
|
if p == nil {
|
||
|
|
return "", nil
|
||
|
|
}
|
||
|
|
p.T.PutQueue("nf", func() {
|
||
|
|
p.MillionBet(req.Area, req.Amount)
|
||
|
|
})
|
||
|
|
return "", nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func OnHistory(session gate.Session, req *pb.GameCommonReq) (string, error) {
|
||
|
|
p := FindPlayer(session)
|
||
|
|
if p == nil {
|
||
|
|
return "", nil
|
||
|
|
}
|
||
|
|
p.T.PutQueue("nf", func() {
|
||
|
|
p.Send(int(pb.GameProtocol_HistoryResp), &pb.GameMsgHistoryResp{
|
||
|
|
Results: p.T.History,
|
||
|
|
})
|
||
|
|
})
|
||
|
|
return "", nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func OnBetList(session gate.Session, req *pb.GameCommonReq) (string, error) {
|
||
|
|
p := FindPlayer(session)
|
||
|
|
if p == nil {
|
||
|
|
return "", nil
|
||
|
|
}
|
||
|
|
p.T.PutQueue("nf", func() {
|
||
|
|
p.Send(int(pb.GameProtocol_BetListResp), &pb.GameMsgBetListResp{
|
||
|
|
List: p.T.BetPlayers,
|
||
|
|
})
|
||
|
|
})
|
||
|
|
return "", nil
|
||
|
|
}
|