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 }