进入好友房

This commit is contained in:
sk 2024-06-03 18:36:06 +08:00
parent 5e0b6139f9
commit 776ba8a19c
5 changed files with 568 additions and 547 deletions

View File

@ -169,7 +169,6 @@ const (
// 房间模式
const (
SceneMode_Public = iota //公共房间
SceneMode_Club //俱乐部房间
SceneMode_Private //私人房间
SceneMode_Match //赛事房间
SceneMode_Thr //三方房间

File diff suppressed because it is too large Load Diff

View File

@ -615,6 +615,7 @@ message CSQueryRoomInfo{
repeated int32 GameIds = 1;
int32 GameSite = 2; //1. 2. 3.
repeated int32 Id = 3; //gamefreeid
int32 SceneMode = 4; // 0 1
}
//

2
public

@ -1 +1 @@
Subproject commit 2c0eb89b3a6245c8c95ff2390ad0c729b931cf24
Subproject commit 7f2452e10c176dc35fc5ed1ffdb0b4145aec8160

View File

@ -1304,6 +1304,9 @@ func (this *CSQueryRoomInfoHandler) ProcessLocalGame(s *netlib.Session, packetid
pack.GameIds = append(pack.GameIds, gameid)
scenes := SceneMgrSingleton.GetScenesByGame(int(gameid))
for _, scene := range scenes {
if scene == nil {
continue
}
var isShow bool
if mapGameCfg != nil {
if cfg, have := mapGameCfg[scene.dbGameFree.Id]; have && cfg.GroupId != 0 && cfg.GroupId == scene.groupId {
@ -1311,8 +1314,16 @@ func (this *CSQueryRoomInfoHandler) ProcessLocalGame(s *netlib.Session, packetid
}
}
if p.Platform == scene.limitPlatform.IdStr || isShow {
if scene != nil && scene.sceneMode == common.SceneMode_Public && len(scene.players) != 0 {
if scene.sceneMode == int(msg.GetSceneMode()) && len(scene.players) != 0 {
if scene.gameId == int(gameid) && scene.gameSite == int(msg.GetGameSite()) {
// 私人房需要是好友
if scene.sceneMode == common.SceneMode_Private {
if !FriendMgrSington.IsFriend(p.Platform, p.SnId, scene.creator) {
continue
}
}
roomInfo := &gamehall.QRoomInfo{
GameFreeId: proto.Int32(scene.dbGameFree.GetId()),
GameId: proto.Int32(scene.dbGameFree.GetGameId()),