/// <summary>
        /// Обработчик начала работы
        /// </summary>
        private void StartWork(Client player, object[] args)
        {
            var onBoat = (bool)args[0];

            WorkInfoManager.CreateInfoIfNeed(player, WorkType.Fisherman);
            if (!CanWork(player, MIN_LEVEL, false) || HasActiveWork(player))
            {
                return;
            }
            var work = WorkInfoManager.GetWorkInfo(player, WorkType.Fisherman);

            if (onBoat && work.Level < 3)
            {
                API.sendNotificationToPlayer(player, "~r~Необходимый уровень работы 3 и выше", true);
                return;
            }
            WorkInfoManager.SetActivity(player, WorkType.Fisherman, true);
            player.setSyncedData(onBoat ? WorkData.IS_FISHERMAN_ON_BOAT : WorkData.IS_FISHERMAN, true);
            if (!player.hasData(FishermanManager.FISH_BAITS_COUNT))
            {
                player.setData(FishermanManager.FISH_BAITS_COUNT, 0);
            }
            player.setData(FishermanManager.POINT_BAITS_COUNT, 0);
            FishermanManager.ShowNextPoint(player);
            _workEquipmentManager.SetEquipment(player);
            API.sendNotificationToPlayer(player, "Вы начали работу ~b~рыбаком");
            API.triggerClientEvent(player, ServerEvent.HIDE_FISHERMAN_MENU);
        }
Exemple #2
0
        /// <summary>
        /// Проверяет, что игрок выбрал доступный контракт
        /// </summary>
        private bool AllowChooseContract(Client player, DeliveryContract contract)
        {
            var workLevel = WorkInfoManager.GetWorkInfo(player, WorkType.Pilot).Level;

            if (_farmContracts.Contains(contract.Type) && !LevelEnough(player, workLevel, 2) ||
                _militaryContracts.Contains(contract.Type) && !LevelEnough(player, workLevel, 3) ||
                ClanFarmContracts.Contains(contract.Type) && !ClanRankEnough(player, workLevel, 3, ClanRank.Low) ||
                ClanMilitaryContracts.Contains(contract.Type) && !ClanRankEnough(player, workLevel, 4, ClanRank.Middle))
            {
                return(false);
            }
            return(true);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         WorkInfoManager Manager = new WorkInfoManager();
         txtWorkID.Value = Request.QueryString["ID"];
         DataTable dt = Manager.GetWorkInfo(txtWorkID.Value);
         if (dt.Rows.Count == 1)
         {
             txtChuliYj.Value      = dt.Rows[0]["ChuLiYiJian"] as string;
             txtShebei.Value       = dt.Rows[0]["ShebeiName"] as string;
             txtGZXX.Value         = dt.Rows[0]["GuZhangXx"] as string;
             txtCurrentStaus.Value = dt.Rows[0]["Status"] as string;
             WorkHandLog last = Manager.GetLstWorkHandInfo(txtWorkID.Value);
             if (last != null)
             {
                 txtLastHandle.Value = last.ChuliYj;
             }
         }
     }
 }