当前位置: 首页>>代码示例>>C#>>正文


C# GameObjects.GamePlayer类代码示例

本文整理汇总了C#中Game.Server.GameObjects.GamePlayer的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer类的具体用法?C# GamePlayer怎么用?C# GamePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GamePlayer类属于Game.Server.GameObjects命名空间,在下文中一共展示了GamePlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AASStateGet

        public static int AASStateGet(GamePlayer player)
        {
            int userID = player.PlayerCharacter.ID;
            bool result = true;
            player.IsAASInfo = false;
            player.IsMinor = true;

            using (ProduceBussiness db = new ProduceBussiness())
            {
                String ID = db.GetASSInfoSingle(userID);
                if (ID != "")
                {
                    player.IsAASInfo = true;
                    result = false;
                    int Age = Convert.ToInt32(ID.Substring(6, 4));
                    int month = Convert.ToInt32(ID.Substring(10, 2));

                    if (DateTime.Now.Year.CompareTo(Age + 18) > 0 || (DateTime.Now.Year.CompareTo(Age + 18) == 0 && DateTime.Now.Month.CompareTo(month) >= 0))
                        player.IsMinor = false;
                }
            }
            //int now=  DateTime.Now.Month;

            if (result && player.PlayerCharacter.IsFirst != 0 && player.PlayerCharacter.DayLoginCount < 1 && ISASSon)
            {
                player.Out.SendAASState(result);
            }

            //if (player.IsMinor || !player.IsAASInfo && ISASSon)
            //{
                player.Out.SendAASControl(AntiAddictionMgr.ISASSon, player.IsAASInfo, player.IsMinor);
            //}
            return 0;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:AntiAddictionMgr.cs

示例2: Execute

        public void Execute(GamePlayer player, ItemInfo item)
        {
            //if (player.CurrentGame.Data.CurrentSpell != this)
            if (player.CurrentGame.Data.CurrentFire == null)
            {
                player.CurrentGame.Data.CurrentSpell = this;
                player.CurrentGame.Data.CurrentPorp = item;
                //player.CurrentGame.Data.CurrentBall = Bussiness.Managers.BallMgr.FindBall(1);
                player.CurrentGame.Data.SetCurrentBall(BallMgr.FindBall(1), false);

                player.CurrentGame.Data.AddAttack = -1;
                player.CurrentGame.Data.AddBall = 1;
            }
            else
            {
                if (player.CurrentGame.Data.Players[player].IsFrost == 0)
                {
                    IceFronzeEffect ice = new IceFronzeEffect(item.Template.Property2);
                    ice.Start(player);
                }
                else
                {
                    player.CurrentGame.Data.Players[player].SetFrost(item.Template.Property2);
                }

            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:27,代码来源:FrostSpell.cs

示例3: IsCompleted

 public override bool IsCompleted(GamePlayer player)
 {
     bool result=false;
     int tempComp=0;
     using (ConsortiaBussiness db = new ConsortiaBussiness())
     {
         ConsortiaInfo info = db.GetConsortiaSingle(player.PlayerCharacter.ConsortiaID);
         switch (m_info.Para1)
         {
             case 0:  //公会人数
                 tempComp=info.Count;
                 break;
             case 1:  //公会贡献度
                 tempComp=player.PlayerCharacter.RichesOffer+player.PlayerCharacter.RichesRob;
                 break;
             case 2:  //公会铁匠铺等级
                 tempComp=info.SmithLevel;
                 break;
             case 3:  //公会商城等级
                 tempComp=info.ShopLevel;
                 break;
             case 4:  //公会保管箱等级
                 tempComp = info.StoreLevel;
                 break;
             default:
                 break;
         }
         if (tempComp >= m_info.Para2)
         {
             Value = 0;
             result=true;
         }
         return result;
     }
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:35,代码来源:OwnConsortiaCondition.cs

示例4: RemovePlayer

        /// <summary>
        /// Removes a player from the scene.
        /// </summary>
        /// <param name="player"></param>
        public void RemovePlayer(GamePlayer player)
        {
            _locker.AcquireWriterLock(Timeout.Infinite);
            try
            {
                if (_players.ContainsKey(player.PlayerCharacter.ID))
                    _players.Remove(player.PlayerCharacter.ID);
            }
            finally
            {
                _locker.ReleaseWriterLock();
            }

            //通知客户端、场景用有人离开
            GamePlayer[] list = GetAllPlayer();
            GSPacketIn pkg = null;
            foreach (GamePlayer p in list)
            {
                if (pkg == null)
                {
                    pkg = p.Out.SendSceneRemovePlayer(player);
                }
                else
                {
                    p.Out.SendTCP(pkg);
                }
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:32,代码来源:Scene.cs

示例5: CommonBag

 public CommonBag(GamePlayer player,int bagType)
     : base(49, bagType)
 {
     _player = player;
     _bagType = bagType;
     _removedList = new List<ItemInfo>();
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:CommonPage.cs

示例6: HandleCommand

        public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            //if (player.CurrentGame.Data.CurrentFire == player && player.CurrentGame.Data.ReduceFireBombs)
            //{
            //    player.CurrentGame.ReturnPacket(player, packet);

            //    int id = packet.ReadInt();

            //    player.CurrentGame.Data.BlastID = id;
            //    player.CurrentGame.Data.BlastX = packet.ReadInt();
            //    player.CurrentGame.Data.BlastY = packet.ReadInt();
            //    FireBallInfo ballInfo = player.CurrentGame.Data.FireBall[id];
            //    ballInfo.EndTime = packet.ReadInt();

            //    if (player.CurrentGame.Data.BlastX > 0)
            //    {
            //        int space = ballInfo.GetSpace(player.CurrentGame.Data.BlastX, player.CurrentGame.Data.BlastY, ballInfo.EndTime);
            //        if (space > 20)
            //        {
            //            GameServer.log.Error("子弹爆炸错误,距离为:" + space.ToString());
            //            player.Client.Disconnect();
            //            return false;
            //        }

            //    }

            //    process.TankFire(player.CurrentGame, player, player.CurrentGame.Data.BlastX, player.CurrentGame.Data.BlastY, ballInfo);
            //}
            return true;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:30,代码来源:BlastCommand.cs

示例7: Start

 public virtual void Start(GamePlayer player)
 {
     m_info.UserID = player.PlayerId;
     m_info.IsExist = true;
     m_player = player;
     m_player.BufferList.AddBuffer(this);
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:AbstractBuffer.cs

示例8: HandleCommand

        public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            //if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.FRIST || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
            if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
            {
                player.CurrentGame.ReturnPacket(player, packet);
                player.CurrentGame.Data.Players[player].SetXY(packet.ReadInt(), packet.ReadInt());
                //player.CurrentGame.Data.Players[player].StartMoving();

                //GameServer.log.Error(string.Format("StopMoving {0} {1}",player.CurrentGame.Data.Players[player].X,player.CurrentGame.Data.Players[player].Y));
                
                //由于同步问题,暂时去掉
                //if (player.CurrentGame != null)
                //    player.CurrentGame.Data.Players[player].StartMoving();
               
                // GameServer.log.Error(string.Format("StopMoving {0} {1}", player.CurrentGame.Data.Players[player].X, player.CurrentGame.Data.Players[player].Y));
                return true;
            }
            else
            {
                //if (player.CurrentGame.Data.CurrentFire != null)
                //{
                    //int x = packet.ReadInt();
                    //player.CurrentGame.Data.Players[player].PosY = packet.ReadInt();
                //}
                //return true;
            }
            return false;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:MoveStopCommand.cs

示例9: GetAnnex

 public bool GetAnnex(string value, GamePlayer player, ref string msg, ref bool result, ref eMessageType eMsg)
 {
     int gid = int.Parse(value);
     using (PlayerBussiness db = new PlayerBussiness())
     {
         ItemInfo goods = db.GetUserItemSingle(gid);
         if (goods != null)
         {
             if (goods.TemplateID == 11408)
             {
                 player.AddMedal(goods.Count);
                 return true;
             }
             else
             {
                 if (player.AddItem(goods))
                 {
                     eMsg = eMessageType.Normal;
                     return true;
                 }
                 else
                 {
                     eMsg = eMessageType.ERROR;
                     result = false;
                     msg = LanguageMgr.GetTranslation(goods.GetBagName()) + LanguageMgr.GetTranslation("MailGetAttachHandler.NoPlace");
                 }
             }
         }
     }
     return false;
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:MailGetAttachHandler.cs

示例10: PlayerInventory

 public PlayerInventory(GamePlayer player)
     : base(60,0)
 {
     _player = player;
     _removedList = new List<ItemInfo>();
     //LoadFromDatabase(player.PlayerCharacter.ID);
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:PlayerInventory.cs

示例11: BufferList

 public BufferList(GamePlayer player)
 {
     m_player = player;
     m_lock = new object();
     m_buffers = new List<AbstractBuffer>();
     m_clearList = new ArrayList();
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:BufferList.cs

示例12: CommonBag

 public CommonBag(GamePlayer player,int bagType,int count)
     : base(count, bagType, true)
 {
     _player = player;
     _bagType = bagType;
     _removedList = new List<ItemInfo>();
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:CommonPage.cs

示例13: OnPlayerStateChanged

        public override void OnPlayerStateChanged(BaseSceneGame game, GamePlayer player)
        {
            base.OnPlayerStateChanged(game, player);

            if (player.CurrentGameState == ePlayerGameState.FINISH && game.GameState == eGameState.LOAD)
                CanStartGame(game);
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:TankGameLogicProcessor.cs

示例14: Execute

        public void Execute(GamePlayer player, ItemInfo item)
        {
            TankData data = player.CurrentGame.Data;
            data.AddWound = (data.AddWound + (double)item.Template.Property2 / 100);

            GSPacketIn pkg = player.Out.SendAddWound(player);
            player.CurrentGame.SendToPlayerExceptSelf(pkg, player);
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:8,代码来源:AddWoudSpell.cs

示例15: HandleCommand

        public bool HandleCommand(TankHotSpringLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentHotSpringRoom != null)
            {

            }
            return false;
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:8,代码来源:TimeUpdateCommand.cs


注:本文中的Game.Server.GameObjects.GamePlayer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。