Пример #1
0
        public int HandlePacket(GameClient client, Game.Base.Packets.GSPacketIn packet)
        {
            int type_award = packet.ReadInt();
            //1:isDailyGotten
            //2:isShowEgg
            //3:Vip
            if (type_award == 3)
            {
                //client.Player.PlayerCharacter.CanTakeVipReward = false;
                client.Player.PlayerCharacter.LastVIPPackTime = DateTime.Now;
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    db.UpdateLastVIPPackTime(client.Player.PlayerCharacter);
                }
            }
            if (type_award == 2)
            {

            }
            if (Managers.AwardMgr.AddDailyAward(client.Player) == true && type_award ==1)
            {
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    if (db.UpdatePlayerLastAward(client.Player.PlayerCharacter.ID))
                    {
                        client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Success"));
                    }
                    else
                    {
                        client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Fail"));
                    }
                }

            }
            else
            {
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Fail1"));
            }
            return 2;
        }