Exemplo n.º 1
0
        public override bool TakeAction()
        {
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            PBGearFoundryInfo roomInfo = pf.MatchRoom(m_RequestPacket.MatchMode);

            if (roomInfo == null)
            {
                return(true);
            }
            else
            {
                m_ResponsePacket.Data = roomInfo;
            }

            pf.PushRoomPlayerChangedNotify(roomInfo.TeamId, false);
            return(true);
        }
Exemplo n.º 2
0
        public PBGearFoundryInfo GetAllFoundryData()
        {
            PBGearFoundryInfo retData = new PBGearFoundryInfo()
            {
                TeamId = m_Foundry.CurrentRoomId,
                NextFoundryTimeInTicks = m_Foundry.NextFoundryTime,
            };

            for (int i = 0; i < GameConfigs.GetInt("Gear_Foundry_Level_Count", 3); i++)
            {
                retData.RewardFlags.Add(m_Foundry.CanReceiveRewards[i]);
            }
            var roomInfo = GetRoomInfo();

            if (roomInfo != null)
            {
                PlayerLogic p = new PlayerLogic();
                foreach (int playerId in roomInfo.Players)
                {
                    p.SetUser(playerId);
                    SetUser(playerId);
                    retData.Players.Add(new PBGearFoundryPlayerInfo()
                    {
                        Player = new PBPlayerInfo()
                        {
                            Id           = playerId,
                            Name         = p.MyPlayer.Name,
                            PortraitType = p.MyPlayer.PortraitType
                        },
                        FoundryCount = m_Foundry.FoundryCount,
                    });
                }
                retData.Progress = new PBGearFoundryProgressInfo()
                {
                    CurrentLevel    = roomInfo.Level,
                    CurrentProgress = roomInfo.Progress,
                };
            }
            return(retData);
        }