예제 #1
0
        private void SetPlayerInfo()
        {
            long         nextRecoverTime;
            PBPlayerInfo playerInfo = new PBPlayerInfo();

            playerInfo.Id = m_UserId;
            PlayerLogic player = new PlayerLogic();

            player.SetUser(m_UserId);
            playerInfo.IsFemale               = player.MyPlayer.IsFemale;
            playerInfo.Level                  = player.MyPlayer.Level;
            playerInfo.Money                  = player.MyPlayer.Money;
            playerInfo.Name                   = player.MyPlayer.Name;
            playerInfo.PortraitType           = player.MyPlayer.PortraitType;
            playerInfo.Exp                    = player.MyPlayer.Exp;
            playerInfo.Energy                 = player.GetNewEnergy(out nextRecoverTime);
            playerInfo.NextEnergyRecoveryTime = nextRecoverTime;
            playerInfo.Coin                   = player.MyPlayer.Coin;
            playerInfo.MeridianEnergy         = player.MyPlayer.StarEnergy;
            playerInfo.ArenaToken             = player.MyPlayer.ArenaToken;
            playerInfo.Spirit                 = player.MyPlayer.Spirit;
            playerInfo.DisplayId              = player.MyPlayer.UUID;
            playerInfo.PvpToken               = player.MyPlayer.PvpToken;
            NearbyPlayerLogic np = new NearbyPlayerLogic();

            np.SetUser(m_UserId);
            playerInfo.PositionX        = np.NearbyPlayers.MyPositionX;
            playerInfo.PositionY        = np.NearbyPlayers.MyPositionY;
            m_ResponsePacket.PlayerInfo = playerInfo;
        }
예제 #2
0
        public override bool TakeAction()
        {
            NearbyPlayerLogic np = new NearbyPlayerLogic();

            foreach (int player in m_RequestPacket.SelectedPlayers)
            {
                np.SetUser(player);
                np.AddVisitor(m_UserId);
            }
            return(true);
        }
예제 #3
0
        public override bool TakeAction()
        {
            NearbyPlayerLogic np = new NearbyPlayerLogic();

            np.SetUser(m_UserId);
            np.Move(m_RequestPacket.LobbyPositionX, m_RequestPacket.LobbyPositionY);
            m_ResponsePacket.LobbyPositionY = m_RequestPacket.LobbyPositionY;
            m_ResponsePacket.LobbyPositionX = m_RequestPacket.LobbyPositionX;
            m_ResponsePacket.PlayerId       = m_UserId;
            return(true);
        }
예제 #4
0
        public override bool TakeAction()
        {
            PlayerFriendsLogic pf = new PlayerFriendsLogic();

            pf.SetUser(m_UserId);
            var               nearbyPlayers = pf.GetOnlinePlayers();
            var               friends       = pf.GetFriends();
            HeroTeamLogic     ht            = new HeroTeamLogic();
            PlayerHeroLogic   ph            = new PlayerHeroLogic();
            NearbyPlayerLogic np            = new NearbyPlayerLogic();

            foreach (var player in nearbyPlayers)
            {
                ht.SetUser(player.Id);
                ph.SetUser(player.Id).SetHero(ht.GetTeam()[0]);
                Hero hero = ph.GetHeroInfo();
                if (hero == null)
                {
                    continue;
                }
                m_ResponsePacket.Heroes.Add(new PBLobbyHeroInfo()
                {
                    Type               = hero.HeroType,
                    Level              = hero.HeroLv,
                    StarLevel          = hero.HeroStarLevel,
                    ConsciousnessLevel = hero.ConsciousnessLevel,
                    ElevationLevel     = hero.ElevationLevel
                });
                np.SetUser(player.Id);
                m_ResponsePacket.Players.Add(new PBPlayerInfo()
                {
                    Id               = player.Id,
                    Name             = player.Name,
                    Level            = player.Level,
                    VipLevel         = player.VIPLevel,
                    PortraitType     = player.PortraitType,
                    LastLoginInTicks = player.LastLoginTime,
                    PositionX        = np.NearbyPlayers.MyPositionX,
                    PositionY        = np.NearbyPlayers.MyPositionY,
                    DisplayId        = player.UUID
                });
                if (friends.ContainsKey(player.Id))
                {
                    m_ResponsePacket.IsMyFriend.Add(true);
                }
                else
                {
                    m_ResponsePacket.IsMyFriend.Add(false);
                }
            }
            return(true);
        }