Commit ff0bebfe authored by iamhujiebin's avatar iamhujiebin

SendFruitMachineToUser

parent 356dafc6
......@@ -35,6 +35,32 @@ func SendFruitMachine(date string, round uint32) error {
return nil
}
func SendFruitMachineToUser(date string, round uint32, userIds []uint64) error {
msg := &userProxy.FruitMachine{
Date: date,
Round: round,
}
if buffer, err := proto.Marshal(msg); err == nil {
rspUids, err := multicast(userIds, MsgFruitMachine, buffer)
//记录socket,注意闭包问题
go func(userId uint64, msg *userProxy.FruitMachine, rspUids []uint64, err error) {
buf, _ := json.Marshal(msg)
AddRpcLog(MsgFruitMachine, userId, string(buf[:]), rspUids, err)
}(0, msg, rspUids, err)
if err != nil {
mylogrus.MyLog.Errorf("grpc SendFruitMachine send fail")
return err
} else {
mylogrus.MyLog.Info("grpc SendFruitMachine send success")
}
} else {
return err
}
return nil
}
func SendGlobalRocketNotice(groupId string, period string, round uint32, stage uint32, fromUserId uint64, topUserIcon string, nick string, code string, avatar string) error {
msg := &userProxy.GlobalRocketNotice{
GroupId: groupId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment