Commit f3f88e2e authored by hujiebin's avatar hujiebin

游戏大厅匹配成功

parent bb7f7b99
......@@ -463,4 +463,13 @@ message MicUserData {
string micEffect = 14;
string headwearIcon = 15;
Svip svip = 16;
}
/* id == 157 游戏大厅匹配成功 */
message LobbyMatchSuccess {
uint64 game_id = 1;
uint64 mode = 2;
string group_id = 3;
User user = 4;
User otherUser = 5;
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ const (
MsgTypeCpUpgrade = 150 // cp升级
MsgTypeSvipUpgrade = 151 // svip升级
MsgTypeGroupMicChange = 155 // 麦位变化
MsgTypeLobbyMatchSuccess = 157 // 羊羊匹配成功
)
const (
......
......@@ -444,3 +444,34 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
}
return nil
}
// 游戏大厅匹配成功
func SendLobbyMatchSuccess(myUserId, otherUserId uint64, nick1, nick2, avatar1, avatar2 string, gameId uint64, txGroupId string, mode int) error {
msg := &userProxy.LobbyMatchSuccess{
GameId: gameId,
GroupId: txGroupId,
Mode: uint64(mode),
User: &userProxy.User{Id: myUserId, Nick: nick1, Avatar: avatar1},
OtherUser: &userProxy.User{Id: otherUserId, Nick: nick2, Avatar: avatar2},
}
if buffer, err := proto.Marshal(msg); err == nil {
userIds := []uint64{myUserId}
rspUids, err := multicast(userIds, MsgTypeLobbyMatchSuccess, buffer)
//记录socket,注意闭包问题
go func(userIds []uint64, msg *userProxy.LobbyMatchSuccess, rspUids []uint64, err error) {
buf, _ := json.Marshal(msg)
AddRpcLogs(MsgTypeLobbyMatchSuccess, userIds, string(buf[:]), rspUids, err)
}(userIds, msg, rspUids, err)
if err != nil {
mylogrus.MyLog.Errorf("grpc LobbyMatchSuccess send fail")
return err
} else {
mylogrus.MyLog.Info("grpc LobbyMatchSuccess send success")
}
} else {
return err
}
return nil
}
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