Пример #1
0
 // Use this for initialization
 void Start()
 {
     playerTransform = player.GetComponent<Transform>();
     forwardTransform = forward.GetComponent<Transform>();
     theTransform = GetComponent<Transform>();
     info = FindObjectOfType<InfoManager>();
 }
Пример #2
0
        public SysConfig()
        {
            sysinfomgr = new InfoManager<SysInfo>("SysInfo", SysInfo.CreateNew);
            sys_info = sysinfomgr["Default"];
            gripaddrs = Enumerable.Range(0, 32);
            InitializeComponent();
            this.cb_MasterAddr.ItemsSource = Enumerable.Range(1, 32);
            this.cb_Scan1Addr.ItemsSource = gripaddrs;
            this.cb_Scan2Addr.ItemsSource = gripaddrs;
            this.cb_OvenAddr.ItemsSource = gripaddrs;
            this.cb_CurrExtAddr.ItemsSource = gripaddrs;

            this.cb_MasterType.ItemsSource = new string[] { "QJ55A" };
            this.cb_Scan1Type.ItemsSource = new string[] { "RT2010" };
            this.cb_Scan2Type.ItemsSource = new string[] { "RT2010" };
            this.cb_OvenType.ItemsSource = new string[] { "RT25" };
            this.cb_CurrExtType.ItemsSource = new string[] { "RT10" };





            this.cb_MasterAddr.SelectedValue = sys_info.iMasterAddr;
            this.cb_Scan1Addr.SelectedValue = sys_info.iScanner1Addr;
            this.cb_Scan2Addr.SelectedValue = sys_info.iScanner2Addr;
            this.cb_OvenAddr.SelectedValue = sys_info.iOvenAddr;
            this.cb_CurrExtAddr.SelectedValue = sys_info.iCurrentExtAddr;

            this.cb_MasterAddr.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.iMasterAddr = Int32.Parse(cb_MasterAddr.SelectedValue.ToString()); });
            this.cb_Scan1Addr.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.iScanner1Addr = Int32.Parse(cb_Scan1Addr.SelectedValue.ToString()); });
            this.cb_Scan2Addr.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.iScanner1Addr = Int32.Parse(cb_Scan2Addr.SelectedValue.ToString()); });
            this.cb_OvenAddr.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.iOvenAddr = Int32.Parse(cb_OvenAddr.SelectedValue.ToString()); });
            this.cb_CurrExtAddr.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.iCurrentExtAddr = Int32.Parse(cb_CurrExtAddr.SelectedValue.ToString()); });


            this.cb_MasterType.SelectedValue = sys_info.sMasterType;
            this.cb_Scan1Type.SelectedValue = sys_info.sScanner1Type;
            this.cb_Scan2Type.SelectedValue = sys_info.sScanner2Type;
            this.cb_OvenType.SelectedValue = sys_info.sOvenType;
            this.cb_CurrExtType.SelectedValue = sys_info.sCurrentExtType;

            this.cb_MasterType.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.sMasterType = cb_MasterType.SelectedValue.ToString(); });
            this.cb_Scan1Type.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.sScanner1Type = cb_Scan1Type.SelectedValue.ToString(); });
            this.cb_Scan2Type.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.sScanner2Type = cb_Scan2Type.SelectedValue.ToString(); });
            this.cb_OvenType.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.sOvenType = cb_OvenType.SelectedValue.ToString(); });
            this.cb_CurrExtType.SelectionChanged += new SelectionChangedEventHandler((a, b) => { sys_info.sCurrentExtType = cb_CurrExtType.SelectedValue.ToString(); });

            this.tb_MasterSerial.SetBinding(TextBox.TextProperty, new Binding("sMasterSerial") { Source = sys_info, Mode= BindingMode.TwoWay });
            this.tb_Scan1Serial.SetBinding(TextBox.TextProperty, new Binding("sScanner1Serial") { Source = sys_info, Mode = BindingMode.TwoWay });
            this.tb_Scan2Serial.SetBinding(TextBox.TextProperty, new Binding("sScanner2Serial") { Source = sys_info, Mode = BindingMode.TwoWay });
            this.tb_OvenSerial.SetBinding(TextBox.TextProperty, new Binding("sOvenSerial") { Source = sys_info, Mode = BindingMode.TwoWay });
            this.tb_CurrExtSerial.SetBinding(TextBox.TextProperty, new Binding("sCurrentExtSerial") { Source = sys_info, Mode = BindingMode.TwoWay });
            /*
            this.tb_MasterSerial.Text = sys_info.sMasterSerial;
            this.cb_Scan1Serial.Text = sys_info.sScanner1Serial;
            this.cb_Scan2Serial.Text = sys_info.sScanner2Serial;
            this.cb_OvenSerial.Text = sys_info.sOvenSerial;
            this.cb_CurrExtSerial.Text = sys_info.sCurrentExtSerial;
             */
        }
Пример #3
0
        public void Close()
        {
            // Close the connection
            _setupManager = null;
            _readerManager = null;
            _infoManager = null;

            _dataManager.Close();
            //Console.WriteLine("Connection Closed");
        }
Пример #4
0
 // Use this for initialization
 public void realStart()
 {
     guards = FindObjectsOfType<GuardDetection>();
     info = GetComponent<InfoManager>();
     if (InfoManager.loadInfo)
     {
         Node[] optimalStartingLocations = info.optimalNodes();
         distributeGuards(optimalStartingLocations);
         addNodesToMap(optimalStartingLocations);
     }
 }
        protected new void ForceInfoMode(InfoManager.InfoMode mode, InfoManager.SubInfoMode subMode)
        {
            var currentTool = ToolsModifierControl.GetCurrentTool<ToolBase>();
            switch (currentTool.GetType().Name)
            {

                case "BuildingTool":
                case "TreeTool":
                case "ResourceTool":
                case "DistrictTool":
                case "TransportTool":
                    if (!Util.IsInfoViewsPanelVisible())
                    {
                        mode = InfoManager.InfoMode.None;
                        subMode = InfoManager.SubInfoMode.Default;
                    }
                    else
                    {
                        ApplyForcedMode(ref mode, ref  subMode);
                    }
                    break;
                case "NetTool":
                case "NetToolFine":
                    if (Util.IsInfoViewsPanelVisible())
                    {
                        ApplyForcedMode(ref mode, ref  subMode);
                        if (mode == InfoManager.InfoMode.None)
                        {
                            mode = InfoManager.InfoMode.Traffic;
                            subMode = InfoManager.SubInfoMode.Default;
                        }
                    }
                    break;
                default:
                    break;
            }

            if (mode == InfoManager.InfoMode.None &&
                (InfoManager.InfoMode)Field.GetValue(this) == InfoManager.InfoMode.None)
            {
                return;
            }

            Field.SetValue(this, mode);
            Singleton<InfoManager>.instance.SetCurrentMode(mode, subMode);
        }
 public override Color GetColor(ushort buildingID, ref Building data, InfoManager.InfoMode infoMode)
 {
     if (infoMode == InfoManager.InfoMode.Water)
     {
         if ((data.m_flags & Building.Flags.Active) == Building.Flags.None)
         {
             return Singleton<InfoManager>.instance.m_properties.m_modeProperties[(int)infoMode].m_inactiveColor;
         }
         if (this.m_waterIntake != 0)
         {
             return Singleton<InfoManager>.instance.m_properties.m_modeProperties[(int)infoMode].m_activeColor;
         }
         //if (this.m_sewageOutlet != 0)
         //{
         //    return Singleton<InfoManager>.instance.m_properties.m_modeProperties[(int)infoMode].m_activeColorB;
         //}
         return base.GetColor(buildingID, ref data, infoMode);
     }
     else
     {
         if (infoMode == InfoManager.InfoMode.NoisePollution)
         {
             int noiseAccumulation = this.m_noiseAccumulation;
             return CommonBuildingAI.GetNoisePollutionColor((float)noiseAccumulation);
         }
         if (infoMode != InfoManager.InfoMode.Pollution)
         {
             return base.GetColor(buildingID, ref data, infoMode);
         }
         if (this.m_waterIntake != 0)
         {
             float t = Mathf.Clamp01((float)data.m_waterPollution * 0.0117647061f);
             return ColorUtils.LinearLerp(Singleton<InfoManager>.instance.m_properties.m_neutralColor, Singleton<InfoManager>.instance.m_properties.m_modeProperties[(int)infoMode].m_activeColor, t);
         }
         //if (this.m_sewageOutlet != 0)
         //{
         //    return Singleton<InfoManager>.instance.m_properties.m_modeProperties[(int)infoMode].m_activeColor;
         //}
         return base.GetColor(buildingID, ref data, infoMode);
     }
 }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        info = GetComponent<InfoManager>();
        guards = FindObjectsOfType<GuardDetection>();
        lights = FindObjectsOfType<LightPlayer>();
        allNodes = FindObjectsOfType<Node>();
        sound = GetComponent<SoundManager>();
        miniMapManager.realStart();

        foreach (Node n in allNodes)
        {
            n.realStart();
        }
        foreach (GuardDetection guard in guards)
        {
            OptimalTraversal optimal = guard.GetComponent<OptimalTraversal>();
            optimal.realStart();
        }

        headGuard = GetComponent<GuardManager>();
        info.realStart();
        headGuard.realStart();
    }
Пример #8
0
 /// <summary>
 /// Sets up managers when a user is logged in
 /// </summary>
 /// <param name="user">User.</param>
 public static void UserLoggedIn(User user)
 {
     Log.WriteLine (Log.Layer.AL, typeof(Application), "User logged in: " + user);
     User = user;
     GameStatusManager = new GameStatusManager (user);
     InfoManager = new InfoManager (user);
     ItemManager = new ItemManager (user);
     OrderTypeManager = new OrderTypeManager (user);
     PositionManager = new PositionManager (user);
     StarSystemManager = new StarSystemManager (user);
     OrderManager = new OrderManager (user);
     NotificationManager = new NotificationManager (user);
 }
Пример #9
0
        /// <summary>
        /// Reloads the steam group
        /// </summary>
        public static void Reload()
        {
            InfoManager im = (InfoManager)ServiceManager.GetService("InfoManager.InfoManager");

            im.LoadSteamGroups();
        }
Пример #10
0
 public void RemoveUpdateHandler(string videoId, Action <ThumbnailInfo> handler)
 {
     InfoManager?.RemoveUpdateHandler(videoId, handler);
 }
Пример #11
0
 public CCTVOnlineStatus GetOnlineStatus(string videoId)
 {
     return(InfoManager?.GetOnlineStatus(videoId));
 }
Пример #12
0
 public CCTVStaticInfo GetStaticInfo(string videoId)
 {
     return(InfoManager?.GetStaticInfo(videoId));
 }
Пример #13
0
    public void ProcessRespond(object receivedRespond)
    {
                #if CLIENT
        if (null == state && receivedRespond is WorldState)
        {
            StopAllCoroutines();

            state    = (WorldState)receivedRespond;
            startPos = new Vector3(-state.size / 2.0f + .5f, .0f, -state.size / 2.0f + .5f);

            bool built = Build();

            /* Building walls failed */
            if (null != instantiatedPrefabsCatalog && !built)
            {
                foreach (Transform instantiated in instantiatedPrefabsCatalog)
                {
                    Destroy(instantiated.gameObject);
                }

                InfoManager.Log(failedToBuildEntry);
            }
            else if (built)
            {
                SpawnUnits();
                SpawnGridFloor();
            }

            return;
        }

        if (receivedRespond is Respond)
        {
            StopAllCoroutines();

            Respond respond = (Respond)receivedRespond;

            if (!respond.success)
            {
                return;
            }

            int j = 0;
            foreach (int[] command in respond.commands)
            {
                Unit.GetInstance(command[0]).Receive(command);

                for (int i = j; i < state.positions.Length; i++)
                {
                    if (command[0] == state.positions[i])
                    {
                        j = i;
                        state.positions[i] = command[command.Length - 1];
                        break;
                    }
                }
            }

            return;
        }
                #endif // CLIENT
    }
Пример #14
0
 public void Delete(int id)
 {
     InfoManager.Delete(id);
 }
Пример #15
0
 public InfoModel AddInfo(Models.Info.InfoModel infoModel)
 {
     Entities.Info info = InfoManager.AddInfo(infoModel.Description, infoModel.Mission, infoModel.Vision, infoModel.BecomeMember, infoModel.AboutUs, infoModel.AboutFax);
     return(Fczrk.API.Helpers.Mapper.Map(info));
 }
Пример #16
0
 public InfoModel Get(int id)
 {
     Entities.Info info = InfoManager.Get(id);
     return(Fczrk.API.Helpers.Mapper.Map(info));
 }
Пример #17
0
 void Start()
 {
     infoManager = FindObjectOfType <InfoManager>();
     button      = GetComponent <Button>();
     button.onClick.AddListener(infoManager.OnPlantBackButtonClick);
 }
Пример #18
0
        /// <summary>
        /// Analyze server packets.
        /// </summary>
        /// <param name="packet">Server packet</param>
        /// <returns>True if the packet will be ignored by the client</returns>
        private bool Remote_PacketHandler(Packet packet)
        {
            // Opcode filter
            switch (packet.Opcode)
            {
            case Opcode.GLOBAL_IDENTIFICATION:
                if (Bot.Get.LoggedFromBot)
                {
                    string service = packet.ReadAscii();
                    if (service == "AgentServer")
                    {
                        Packet protocol = new Packet(Opcode.CLIENT_AUTH_REQUEST, true);
                        protocol.WriteUInt(id);
                        protocol.WriteAscii(Window.Get.Login_tbxUsername.Text);
                        protocol.WriteAscii(Window.Get.Login_tbxPassword.Text);
                        protocol.WriteUShort(DataManager.Locale);
                        // "MAC"
                        protocol.WriteUInt(0u);
                        protocol.WriteUShort(0);
                        this.InjectToServer(protocol);
                    }
                }
                break;

            case Opcode.SERVER_AUTH_RESPONSE:
            {
                byte success = packet.ReadByte();
                if (success == 1)
                {
                    // Protocol
                    if (ClientlessMode)
                    {
                        PacketBuilder.RequestCharacterList();
                    }

                    InfoManager.OnConnected();
                }
                else
                {
                    byte error = packet.ReadByte();
                    Window.Get.Log("Login error [" + error + "]");
                }
            }
            break;

            case Opcode.SERVER_CHARACTER_SELECTION_ACTION_RESPONSE:
                PacketParser.CharacterSelectionActionResponse(packet);
                break;

            case Opcode.SERVER_CHARACTER_SELECTION_JOIN_RESPONSE:
                PacketParser.CharacterSelectionJoinResponse(packet);
                break;

            case Opcode.SERVER_CHARACTER_DATA_BEGIN:
                PacketParser.CharacterDataBegin(packet);
                break;

            case Opcode.SERVER_CHARACTER_DATA:
                PacketParser.CharacterData(packet);
                break;

            case Opcode.SERVER_CHARACTER_DATA_END:
                PacketParser.CharacterDataEnd();
                if (ClientlessMode)
                {
                    // Confirm spawn after loading with some delay
                    Packet protocol = new Packet(Opcode.CLIENT_CHARACTER_CONFIRM_SPAWN);
                    InjectToServer(protocol);

                    // Generating Bot Events to keep methods clean
                    InfoManager.OnTeleported();

                    protocol = new Packet(Opcode.CLIENT_CONSIGNMENT_LIST_REQUEST);
                    InjectToServer(protocol);
                }
                break;

            case Opcode.SERVER_CHARACTER_STATS_UPDATE:
                PacketParser.CharacterStatsUpdate(packet);
                break;

            case Opcode.SERVER_CHARACTER_EXPERIENCE_UPDATE:
                PacketParser.CharacterExperienceUpdate(packet);
                break;

            case Opcode.SERVER_CHARACTER_INFO_UPDATE:
                PacketParser.CharacterInfoUpdate(packet);
                break;

            case Opcode.SERVER_CHARACTER_DIED:
                PacketParser.CharacterDied(packet);
                break;

            case Opcode.GLOBAL_XTRAP_IDENTIFICATION:
                if (ClientlessMode)
                {
                    Packet protocol = new Packet(Opcode.GLOBAL_XTRAP_IDENTIFICATION);
                    protocol.WriteByte(2);
                    protocol.WriteByte(2);
                    //p.WriteUInt8Array(new byte[1024]);
                    protocol.WriteUInt64Array(new ulong[128]);
                    InjectToServer(protocol);
                }
                break;

            case Opcode.SERVER_ENTITY_SPAWN:
                PacketParser.EntitySpawn(packet);
                break;

            case Opcode.SERVER_ENTITY_DESPAWN:
                PacketParser.EntityDespawn(packet);
                break;

            case Opcode.SERVER_ENTITY_GROUPSPAWN_BEGIN:
                PacketParser.EntityGroupSpawnBegin(packet);
                break;

            case Opcode.SERVER_ENTITY_GROUPSPAWN_DATA:
                PacketParser.EntityGroupSpawnData(packet);
                break;

            case Opcode.SERVER_ENTITY_GROUPSPAWN_END:
                PacketParser.EntityGroupSpawnEnd(packet);
                break;

            case Opcode.SERVER_ENTITY_SELECTION:
                PacketParser.EntitySelection(packet);
                break;

            case Opcode.SERVER_ENTITY_LEVEL_UP:
                PacketParser.EntityLevelUp(packet);
                break;

            case Opcode.SERVER_ENTITY_STATUS_UPDATE:
                PacketParser.EntityStatusUpdate(packet);
                break;

            case Opcode.SERVER_ENTITY_MOVEMENT:
                PacketParser.EntityMovement(packet);
                break;

            case Opcode.SERVER_ENTITY_MOVEMENT_STUCK:
                PacketParser.EntityMovementStuck(packet);
                break;

            case Opcode.SERVER_ENTITY_MOVEMENT_ANGLE:
                PacketParser.EntityMovementAngle(packet);
                break;

            case Opcode.SERVER_ENTITY_SPEED_UPDATE:
                PacketParser.EntitySpeedUpdate(packet);
                break;

            case Opcode.SERVER_ENTITY_STATE_UPDATE:
                PacketParser.EntityStateUpdate(packet);
                break;

            case Opcode.SERVER_ENTITY_STALL_CREATE:
                PacketParser.EntityStallCreate(packet);
                break;

            case Opcode.SERVER_ENTITY_STALL_DESTROY:
                PacketParser.EntityStallDestroy(packet);
                break;

            case Opcode.SERVER_ENTITY_STALL_TITLE_UPDATE:
                PacketParser.EntityStallTitleUpdate(packet);
                break;

            case Opcode.SERVER_ENTITY_SKILL_START:
                PacketParser.EntitySkillStart(packet);
                break;

            case Opcode.SERVER_ENTITY_SKILL_END:
                PacketParser.EntitySkillEnd(packet);
                break;

            case Opcode.SERVER_ENTITY_SKILL_BUFF_ADDED:
                PacketParser.EntitySkillBuffAdded(packet);
                break;

            case Opcode.SERVER_ENTITY_SKILL_BUFF_REMOVED:
                PacketParser.EntitySkillBuffRemoved(packet);
                break;

            case Opcode.SERVER_ENVIROMENT_CELESTIAL_POSITION:
                PacketParser.EnviromentCelestialPosition(packet);
                break;

            case Opcode.SERVER_ENVIROMENT_CELESTIAL_UPDATE:
                PacketParser.EnviromentCelestialUpdate(packet);
                break;

            case Opcode.SERVER_ENVIROMENT_WHEATER_UPDATE:
                PacketParser.EnviromentWheaterUpdate(packet);
                break;

            case Opcode.SERVER_CHAT_UPDATE:
                PacketParser.ChatUpdate(packet);
                break;

            case Opcode.SERVER_NOTICE_UPDATE:
                PacketParser.NoticeUniqueUpdate(packet);
                break;

            case Opcode.SERVER_PLAYER_PETITION_REQUEST:
                PacketParser.PlayerPetitionRequest(packet);
                break;

            case Opcode.SERVER_EXCHANGE_STARTED:
                PacketParser.ExchangeStarted(packet);
                break;

            case Opcode.SERVER_EXCHANGE_PLAYER_CONFIRMED:
                PacketParser.ExchangePlayerConfirmed(packet);
                break;

            case Opcode.SERVER_EXCHANGE_COMPLETED:
                PacketParser.ExchangeCompleted(packet);
                break;

            case Opcode.SERVER_EXCHANGE_CANCELED:
                PacketParser.ExchangeCanceled(packet);
                break;

            case Opcode.SERVER_EXCHANGE_ITEMS_UPDATE:
                PacketParser.ExchangeItemsUpdate(packet);
                break;

            case Opcode.SERVER_EXCHANGE_GOLD_UPDATE:
                PacketParser.ExchangeGoldUpdate(packet);
                break;

            case Opcode.SERVER_EXCHANGE_INVITATION_RESPONSE:
                PacketParser.ExchangeInvitationResponse(packet);
                break;

            case Opcode.SERVER_EXCHANGE_CONFIRM_RESPONSE:
                PacketParser.ExchangeConfirmResponse(packet);
                break;

            case Opcode.SERVER_EXCHANGE_APPROVE_RESPONSE:
                PacketParser.ExchangeApproveResponse(packet);
                break;

            case Opcode.SERVER_EXCHANGE_EXIT_RESPONSE:
                PacketParser.ExchangeExitResponse(packet);
                break;

            case Opcode.SERVER_PARTY_DATA:
                PacketParser.PartyData(packet);
                break;

            case Opcode.SERVER_PARTY_UPDATE:
                PacketParser.PartyUpdate(packet);
                break;

            case Opcode.SERVER_PARTY_MATCH_LIST_RESPONSE:
                PacketParser.PartyMatchListResponse(packet);
                break;

            case Opcode.SERVER_PARTY_MATCH_DELETE_RESPONSE:
                PacketParser.PartyMatchDeleteResponse(packet);
                break;

            case Opcode.SERVER_PARTY_MATCH_JOIN_REQUEST:
                PacketParser.PartyMatchJoinRequest(packet);
                break;

            case Opcode.SERVER_GUILD_CREATED_DATA:
                PacketParser.GuildCreatedData(packet);
                break;

            case Opcode.SERVER_GUILD_DATA_BEGIN:
                PacketParser.GuildDataBegin();
                break;

            case Opcode.SERVER_GUILD_DATA:
                PacketParser.GuildData(packet);
                break;

            case Opcode.SERVER_GUILD_DATA_END:
                PacketParser.GuildDataEnd();
                break;

            case Opcode.SERVER_GUILD_UPDATE:
                PacketParser.GuildUpdate(packet);
                break;

            case Opcode.SERVER_GUILD_STORAGE_DATA_BEGIN:
                PacketParser.GuildStorageDataBegin(packet);
                break;

            case Opcode.SERVER_GUILD_STORAGE_DATA:
                PacketParser.GuildStorageData(packet);
                break;

            case Opcode.SERVER_GUILD_STORAGE_DATA_END:
                PacketParser.GuildStorageDataEnd(packet);
                break;

            case Opcode.SERVER_ACADEMY_DATA:
                PacketParser.AcademyData(packet);
                break;

            case Opcode.SERVER_CHARACTER_ADD_INT_RESPONSE:
                PacketParser.CharacterAddStatPointResponse(packet);
                break;

            case Opcode.SERVER_CHARACTER_ADD_STR_RESPONSE:
                PacketParser.CharacterAddStatPointResponse(packet);
                break;

            case Opcode.SERVER_INVENTORY_ITEM_USE:
                PacketParser.InventoryItemUse(packet);
                break;

            case Opcode.SERVER_INVENTORY_ITEM_MOVEMENT:
                return(PacketParser.InventoryItemMovement(packet));

            case Opcode.SERVER_INVENTORY_ITEM_DURABILITY_UPDATE:
                PacketParser.InventoryItemDurabilityUpdate(packet);
                break;

            case Opcode.SERVER_INVENTORY_ITEM_UPDATE:
                PacketParser.InventoryItemUpdate(packet);
                break;

            case Opcode.SERVER_INVENTORY_CAPACITY_UPDATE:
                PacketParser.InventoryCapacityUpdate(packet);
                break;

            case Opcode.SERVER_STORAGE_DATA_BEGIN:
                PacketParser.StorageDataBegin(packet);
                break;

            case Opcode.SERVER_STORAGE_DATA:
                PacketParser.StorageData(packet);
                break;

            case Opcode.SERVER_STORAGE_DATA_END:
                PacketParser.StorageDataEnd(packet);
                break;

            case Opcode.SERVER_CONSIGNMENT_REGISTER_RESPONSE:
                PacketParser.ConsigmentRegisterResponse(packet);
                break;

            case Opcode.SERVER_CONSIGNMENT_UNREGISTER_RESPONSE:
                PacketParser.ConsigmentUnregisterResponse(packet);
                break;

            case Opcode.SERVER_STALL_CREATE_RESPONSE:
                PacketParser.StallCreateResponse(packet);
                break;

            case Opcode.SERVER_STALL_DESTROY_RESPONSE:
                PacketParser.StallDestroyResponse(packet);
                break;

            case Opcode.SERVER_STALL_TALK_RESPONSE:
                PacketParser.StallTalkResponse(packet);
                break;

            case Opcode.SERVER_STALL_BUY_RESPONSE:
                PacketParser.StallBuyResponse(packet);
                break;

            case Opcode.SERVER_STALL_LEAVE_RESPONSE:
                PacketParser.StallLeaveResponse(packet);
                break;

            case Opcode.SERVER_STALL_UPDATE_RESPONSE:
                PacketParser.StallUpdateResponse(packet);
                break;

            case Opcode.SERVER_STALL_ENTITY_ACTION:
                PacketParser.StalleEntityAction(packet);
                break;

            case Opcode.SERVER_PET_DATA:
                PacketParser.PetData(packet);
                break;

            case Opcode.SERVER_PET_UPDATE:
                PacketParser.PetUpdate(packet);
                break;

            case Opcode.SERVER_PET_SETTINGS_CHANGE_RESPONSE:
                PacketParser.PetSettingsChangeResponse(packet);
                break;

            case Opcode.SERVER_PET_PLAYER_MOUNTED:
                PacketParser.PetPlayerMounted(packet);
                break;

            case Opcode.SERVER_MASTERY_SKILL_LEVELUP_RESPONSE:
                PacketParser.MasterySkillLevelUpResponse(packet);
                break;

            case Opcode.SERVER_MASTERY_SKILL_LEVELDOWN_RESPONSE:
                PacketParser.MasterySkillLevelDownResponse(packet);
                break;

            case Opcode.SERVER_MASTERY_LEVELUP_RESPONSE:
                PacketParser.MasteryLevelUpResponse(packet);
                break;

            case Opcode.SERVER_MASTERY_LEVELDOWN_RESPONSE:
                PacketParser.MasteryLevelDownResponse(packet);
                break;

            case Opcode.SERVER_TELEPORT_READY_REQUEST:
                if (ClientlessMode)
                {
                    Packet protocol = new Packet(Opcode.CLIENT_TELEPORT_READY_RESPONSE);
                    this.InjectToServer(protocol);
                }
                break;

            case Opcode.SERVER_ENTITY_TALK_RESPONSE:
                PacketParser.EntityTalkResponse(packet);
                break;

            case Opcode.SERVER_NPC_CLOSE_RESPONSE:
                PacketParser.NpcCloseResponse(packet);
                break;
            }
            return(false);
        }
Пример #19
0
 private void Awake()
 {
     _instance = this;
 }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     theTransform = GetComponent<Transform>();
     forwardTransform = forward.GetComponent<Transform>();
     leftTransform = left.GetComponent<Transform>();
     theRigidBody = GetComponent<Rigidbody>();
     guards = FindObjectsOfType<GuardDetection>();
     info = FindObjectOfType<InfoManager>();
     foreach (string s in Input.GetJoystickNames())
     {
         using360Controller = !string.IsNullOrEmpty(s);
     }
     randomSpawnSpot();
 }
Пример #21
0
 protected override void DoSave()
 {
     InfoManager.SaveCharacteristic(this);
 }
Пример #22
0
        public InfoModel Edit(InfoModel infoModel)
        {
            Info info = InfoManager.Edit(infoModel.Id, infoModel.Description, infoModel.Mission, infoModel.Vision, infoModel.BecomeMember, infoModel.AboutUs, infoModel.AboutFax);

            return(Fczrk.API.Helpers.Mapper.Map(info));
        }
Пример #23
0
        public void RenderVehicle(VehicleInfo info, Color color, bool useColor = true)
        {
            InfoManager infoManager = Singleton <InfoManager> .instance;

            InfoManager.InfoMode    currentMod    = infoManager.CurrentMode;
            InfoManager.SubInfoMode currentSubMod = infoManager.CurrentSubMode;;
            infoManager.SetCurrentMode(InfoManager.InfoMode.None, InfoManager.SubInfoMode.Default);
            infoManager.UpdateInfoMode();

            Light   sunLight       = DayNightProperties.instance.sunLightSource;
            float   lightIntensity = sunLight.intensity;
            Color   lightColor     = sunLight.color;
            Vector3 lightAngles    = sunLight.transform.eulerAngles;

            sunLight.intensity             = 2f;
            sunLight.color                 = Color.white;
            sunLight.transform.eulerAngles = new Vector3(50, 180, 70);

            Light mainLight = RenderManager.instance.MainLight;

            RenderManager.instance.MainLight = sunLight;

            if (mainLight == DayNightProperties.instance.moonLightSource)
            {
                DayNightProperties.instance.sunLightSource.enabled  = true;
                DayNightProperties.instance.moonLightSource.enabled = false;
            }

            Vector3 one = Vector3.one;

            float magnitude = info.m_mesh.bounds.extents.magnitude;
            float num       = magnitude + 16f;
            float num2      = magnitude * m_zoom;

            m_camera.transform.position = Vector3.forward * num2;
            m_camera.transform.rotation = Quaternion.AngleAxis(180, Vector3.up);
            m_camera.nearClipPlane      = Mathf.Max(num2 - num * 1.5f, 0.01f);
            m_camera.farClipPlane       = num2 + num * 1.5f;

            Quaternion rotation = Quaternion.Euler(20f, 0f, 0f) * Quaternion.Euler(0f, m_rotation, 0f);
            Vector3    position = rotation * -info.m_mesh.bounds.center;

            VehicleManager instance   = Singleton <VehicleManager> .instance;
            Matrix4x4      matrixBody = Matrix4x4.TRS(position, rotation, Vector3.one);
            Matrix4x4      matrixTyre = info.m_vehicleAI.CalculateTyreMatrix(Vehicle.Flags.Created, ref position, ref rotation, ref one, ref matrixBody);

            MaterialPropertyBlock materialBlock = instance.m_materialBlock;

            materialBlock.Clear();
            materialBlock.SetMatrix(instance.ID_TyreMatrix, matrixTyre);
            materialBlock.SetVector(instance.ID_TyrePosition, Vector3.zero);
            materialBlock.SetVector(instance.ID_LightState, Vector3.zero);
            if (useColor)
            {
                materialBlock.SetColor(instance.ID_Color, color);
            }

            instance.m_drawCallData.m_defaultCalls = instance.m_drawCallData.m_defaultCalls + 1;

            info.m_material.SetVectorArray(instance.ID_TyreLocation, info.m_generatedInfo.m_tyres);
            Graphics.DrawMesh(info.m_mesh, matrixBody, info.m_material, 0, m_camera, 0, materialBlock, true, true);

            m_camera.RenderWithShader(info.m_material.shader, "");

            sunLight.intensity             = lightIntensity;
            sunLight.color                 = lightColor;
            sunLight.transform.eulerAngles = lightAngles;

            RenderManager.instance.MainLight = mainLight;

            if (mainLight == DayNightProperties.instance.moonLightSource)
            {
                DayNightProperties.instance.sunLightSource.enabled  = false;
                DayNightProperties.instance.moonLightSource.enabled = true;
            }

            infoManager.SetCurrentMode(currentMod, currentSubMod);
            infoManager.UpdateInfoMode();
        }
Пример #24
0
 private void Awake()
 {
     Instance = this;
     DontDestroyOnLoad(this);
 }
Пример #25
0
 public CCTVHierarchyNode GetHierarchyRoot()
 {
     return(InfoManager?.GetHierarchyRoot());
 }
Пример #26
0
    // Use this for initialization
    void Start()
    {
        logo = GameObject.Find("Logo");
        logo.SetActive(false);
        soundManager      = FindObjectOfType <SoundManager>();
        gestureManager    = FindObjectOfType <GestureManager>();
        controller        = FindObjectOfType <Controller>();
        infoManager       = FindObjectOfType <InfoManager>();
        shadowModeManager = GetComponent <ShadowModeManager>();

        keywords.Add("Move", () =>
        {
            gestureManager.BroadcastMessage("StartManipulation");
            controller.GetComponent <Rotation>().enabled = false;
        });

        keywords.Add("Done", () =>
        {
            gestureManager.BroadcastMessage("QuitMode");
            controller.GetComponent <Rotation>().enabled = true;
        });

        keywords.Add("Number One", () =>
        {
            if (pieces.Length > 0)
            {
                controller.PieceSelected(pieces[0]);
            }
            voiceOne = true;
        });

        keywords.Add("Number Two", () =>
        {
            if (pieces.Length > 1)
            {
                controller.PieceSelected(pieces[1]);
            }
            voiceOne = false;
        });

        keywords.Add("Number Three", () =>
        {
            if (pieces.Length > 2)
            {
                controller.PieceSelected(pieces[2]);
            }
            voiceOne = false;
        });

        keywords.Add("Number Four", () =>
        {
            if (pieces.Length > 3)
            {
                controller.PieceSelected(pieces[3]);
            }
            voiceOne = false;
        });

        keywords.Add("Number Five", () =>
        {
            if (pieces.Length > 4)
            {
                controller.PieceSelected(pieces[4]);
            }
            voiceOne = false;
        });

        keywords.Add("Number Six", () =>
        {
            if (pieces.Length > 5)
            {
                controller.PieceSelected(pieces[5]);
            }
            voiceOne = false;
        });

        keywords.Add("Extend", () =>
        {
            controller.ScaleUp();
        });

        keywords.Add("Big", () =>
        {
            controller.FixedScaleUp();
        });

        keywords.Add("Down", () =>
        {
            controller.ScaleDown();
        });

        keywords.Add("Small", () =>
        {
            controller.FixedScaleDown();
        });

        keywords.Add("Go Back", () =>
        {
            infoManager.HideInformations();
            controller.GoBackToSplit();
            controller.StopClipDebug();
        });

        keywords.Add("show me", () =>
        {
            infoManager.OnInformationsCommand();
        });

        keywords.Add("Pedestal", () =>
        {
            shadowModeManager.PedestalOn();
        });

        keywords.Add("Shadow", () =>
        {
            shadowModeManager.ShadowOn();
        });

        keywords.Add("Rotate", () =>
        {
            controller.GetComponent <Rotation>().enabled = true;
        });

        keywords.Add("Stop", () =>
        {
            controller.GetComponent <Rotation>().enabled = false;
        });

        keywords.Add("Mapping", () =>
        {
            GameObject.Find("SpatialMappingManager").SendMessage("OnBackground");
        });

        keywords.Add("Logo", () =>
        {
            if (logo != null)
            {
                logo.SetActive(!logo.activeInHierarchy);
            }
        });

        // Tell the KeywordRecognizer about our keywords.
        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());

        // Register a callback for the KeywordRecognizer and start recognizing!
        keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
        keywordRecognizer.Start();
    }
Пример #27
0
 public CCTVDynamicInfo GetDynamicInfo(string videoId)
 {
     return(InfoManager?.GetDynamicInfo(videoId));
 }
Пример #28
0
        /// <summary>
        /// Primary selector following valid user choice from available options
        /// </summary>
        /// <param name="choice">Integer value of user choice</param>
        public void select(int choice)
        {
            using (var bc = new BusinessContext())
            {
                InfoManager infoManager = new InfoManager(bc);
                switch (choice)
                {
                case 1:
                    // Place an order
                    OrderManager manager = new OrderManager(customer, bc);
                    manager.prompt();
                    break;

                case 2:
                    // Order History
                    var orders = infoManager.customerOrders(customer.CustomerId);
                    if (orders.Count > 0)
                    {
                        var columns = typeof(Order).GetProperties().Select(property => property.Name).ToList();
                        for (int i = 0; i < columns.Count - 1; i++)
                        {
                            Console.Write("{0} ", columns[i]);
                        }
                        Console.WriteLine();
                        foreach (var o in orders)
                        {
                            Console.WriteLine(o.ToString());
                        }
                    }
                    else
                    {
                        Console.WriteLine("No results found");
                    }
                    break;

                case 3:
                    // Order Details
                    var details = infoManager.orderDetails(Prompter.InputString("order id"), customer.CustomerId);
                    if (details != null)
                    {
                        var columns = typeof(OrderItem).GetProperties().Select(property => property.Name).ToList();
                        for (int i = 0; i < columns.Count; i++)
                        {
                            Console.Write("{0} ", columns[i]);
                        }
                        Console.WriteLine();
                        foreach (var detail in details)
                        {
                            Console.WriteLine(detail.ToString());
                        }
                    }
                    else
                    {
                        Console.WriteLine("No results found");
                    }
                    break;

                default:
                    Console.WriteLine("Please select a valid option");
                    break;
                }
            } Console.WriteLine();
        }
Пример #29
0
 public VideoDataSource GetStorageSource()
 {
     return(InfoManager?.GetStorageSource());
 }
        public void Execute()
        {
            if (MenuHelper.GetCheckBoxValue(Config.Settings.Menu, "Settings.PreventCanceling") && !Player.Instance.ShouldUseItem())
            {
                return;
            }

            var target = TargetSelector.GetTarget(700.0f, DamageType.Mixed, Player.Instance.Position);

            if (target == null || target.IsInvulnerable)
            {
                return;
            }
            int enemies = Player.Instance.CountEnemyChampionsInRange(MenuHelper.GetSliderValue(Config.Settings.Menu, "Settings.Range"));

            foreach (var item in Player.Instance.InventoryItems)
            {
                if (EloBuddy.SDK.Core.GameTickCount - ItemManager.GetLastUse(item.Id) < 500 || !item.CanUseItem())
                {
                    continue;
                }

                switch (item.Id)
                {
                case ItemId.Ravenous_Hydra:
                case ItemId.Tiamat:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Tiamat.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Tiamat.Combo") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        if (target.IsInRange(Player.Instance, 400))
                        {
                            item.Cast();
                        }
                    }

                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Tiamat.Farm") && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
                    {
                        if (Player.Instance.GetBestFarmTarget(400.0f, (int)(Player.Instance.BaseAttackDamage * 0.6)) != null)
                        {
                            item.Cast();
                        }
                    }
                    break;

                case ItemId.Titanic_Hydra:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.TitanicHydra.Status"))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.TitanicHydra.Distance")))
                    {
                        continue;
                    }
                    if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        item.Cast();
                    }
                    break;

                case ItemId.Youmuus_Ghostblade:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Youmuu.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Youmuu.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Youmuu.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Youmuu.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Youmuu.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    item.Cast();
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;

                case ItemId.Bilgewater_Cutlass:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Cutlass.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Cutlass.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, 550.0f))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Cutlass.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Cutlass.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Cutlass.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    item.Cast(target);
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;

                case ItemId.Blade_of_the_Ruined_King:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Botrk.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Botrk.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, 550.0f))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Botrk.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Botrk.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Botrk.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    item.Cast(target);
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;

                case ItemId.Hextech_Gunblade:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Gunblade.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Gunblade.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, 700.0f))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Gunblade.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Gunblade.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Gunblade.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    item.Cast(target);
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;

                case ItemId.Hextech_Protobelt_01:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Protobelt.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Protobelt.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Protobelt.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Protobelt.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.Protobelt.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, 400.0f))
                    {
                        continue;
                    }
                    if (target.IsMelee && !MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Protobelt.Melee"))
                    {
                        continue;
                    }
                    if (Managers.EntityManager.IsWallBetweenPlayer(target.Position.To2D()) && MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.Protobelt.EnableWall"))
                    {
                        continue;
                    }
                    item.Cast(target.Position);
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;

                case ItemId.Hextech_GLP_800:
                    if (!MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.HextechGLP.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(Config.OItems.Menu, "Items.Offensive.HextechGLP.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.HextechGLP.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.HextechGLP.Me.MinHealth") || target.HealthPercent < MenuHelper.GetSliderValue(Config.OItems.Menu, "Items.Offensive.HextechGLP.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    if (!target.IsInRange(Player.Instance, 400.0f))
                    {
                        continue;
                    }
                    item.Cast(target.Position);
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, target);
                    break;
                }
            }
        }
Пример #31
0
 public static ScriptClockIS Load(ZipArchive packageContent, IClockRenderer render, InfoManager infoManager, ClockRefreshIntervalEnum refreshInterval = ClockRefreshIntervalEnum.PerSecond)
 {
     return(new ScriptClockIS(new PackageLoader(packageContent), render, infoManager, refreshInterval));
 }
Пример #32
0
    public void Test(string fileName)
    {
        if (!InfoManager.YesNo("Test"))
        {
            return;
        }

        //string path = @"\\erp\TEMP\App\Остатки\";

        string path = @"\\erp\TEMP\App\Остатки\20.12.17\";
        //string path = @"\\erp\TEMP\App\Остатки\540\";
        //string path = @"\\erp\TEMP\App\Остатки\17.02.18\";


        //

        //string fileName = "010 - 13004 - 1120665 - Лопатіна д";
        //string extension = "xlsx";

        string          connectionString;
        OleDbConnection connection;

        //connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + fileName + "." + extension + "; Extended Properties=\"Excel 12.0 Xml;HDR=Yes\";";
        connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + fileName + "; Extended Properties=\"Excel 12.0 Xml;HDR=Yes\";";
        connection       = new OleDbConnection(connectionString);
        connection.Open();

        OleDbCommand command = connection.CreateCommand();

        command.CommandText = "Select * From [sheet$A0:I15000] "; //Where [К-во (факт)] = 20 ";

        OleDbDataAdapter da = new OleDbDataAdapter(command);
        DataTable        dt = new DataTable();

        da.Fill(dt);

        //int s = dt.AsEnumerable().Count();
        try
        {
            var rows2 = dt.Select().AsEnumerable().Select(x => x["kmat"].ToString() == "001-100012").Single();

            InfoManager.MessageBox(rows2.ToString());

            //IEnumerable<DataTable> dd = (IEnumerable<DataTable>)dt;
            //System.Data.EnumerableRowCollection<System.Data.DataRow> dd = dt;

            //System.Data.EnumerableRowCollection<System.Data.DataRow> dd;
            //DataRow rowKmat = dt.AsEnumerable().Single(x => x["kmat"].ToString() == kmat_old);
            var rows = dt.Select("kmat = '001-100006' ");

            StringBuilder sb = new StringBuilder();
            //ceh	n_kdk	kmat	naim	size_type	ei	price	count	sum
            sb.AppendLine("Строк: " + rows.Count());

            foreach (DataRow row in rows)
            {
                sb.AppendLine("kmat = " + row["kmat"].ToString());
                sb.AppendLine("naim = " + row["naim"].ToString());
            }

            InfoManager.MessageBox(sb.ToString());

            InfoManager.MessageBox("Ok");
        }
        catch (Exception)
        {
            InfoManager.MessageBox("No");
        }

        //var objects =

        connection.Close();
    }
Пример #33
0
 public ListCharacteristicsCommand(ServiceInfo serviceInfo)
 {
     _serviceInfo      = serviceInfo;
     _deviceController = IoC.Get <DeviceController>();
     _infoManager      = IoC.Get <InfoManager>();
 }
Пример #34
0
 public InfoManager()
 {
     current = this;
 }
Пример #35
0
	public MainWindow (string profilePath) : base(Gtk.WindowType.Toplevel)
	{
		Build ();
		notebook1.Page = 1;

		Config = GuiCompare.Config.GetConfig ();
		
		//
		// Configure the GUI
		//
		info_manager = new InfoManager (this, profilePath);
		
		treeStore = new Gtk.TreeStore (typeof (string), // Name
		                               typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf), // TypeIcon, StatusIcon
		                               typeof (Gdk.Pixbuf), typeof (string), // MissingIcon, MissingText
		                               typeof (Gdk.Pixbuf), typeof (string), // ExtraIcon, ExtraText
		                               typeof (Gdk.Pixbuf), typeof (string), // ErrorIcon, ErrorText
		                               typeof (Gdk.Pixbuf), typeof (string), // TodoIcon, TodoText
		                               typeof (Gdk.Pixbuf), typeof (string), // NiexIcon, NiexText
		                               typeof (ComparisonNode), typeof (string)); // Node, Foreground
		
		treeFilter = new Gtk.TreeModelFilter (treeStore, null);
		treeFilter.VisibleFunc = FilterTree;
		tree.Model = treeFilter;
		
		// Create a column for the node name
		Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
		nameColumn.Title = "Name";
		nameColumn.Resizable = true;
		
		Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf typeCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf ();
		
		nameColumn.PackStart (statusCell, false);
		nameColumn.PackStart (typeCell, false);
		nameColumn.PackStart (nameCell, true);
		
		tree.AppendColumn (nameColumn);
		
		nameColumn.AddAttribute (nameCell, "text", (int)TreeCol.Name);
		nameColumn.AddAttribute (nameCell, "foreground", (int)TreeCol.Foreground);
		nameColumn.AddAttribute (typeCell, "pixbuf", (int)TreeCol.TypeIcon);
		nameColumn.AddAttribute (statusCell, "pixbuf", (int)TreeCol.StatusIcon);
		
		// Create a column for the status counts
		Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn ();
		countsColumn.Title = "Counts";
		countsColumn.Resizable = true;
		
		Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererText missingTextCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf extraPixbufCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererText extraTextCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf errorPixbufCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererText errorTextCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf todoPixbufCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererText todoTextCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf niexPixbufCell = new Gtk.CellRendererPixbuf ();
		Gtk.CellRendererText niexTextCell = new Gtk.CellRendererText ();
		
		countsColumn.PackStart (missingPixbufCell, false);
		countsColumn.PackStart (missingTextCell, false);
		countsColumn.PackStart (extraPixbufCell, false);
		countsColumn.PackStart (extraTextCell, false);
		countsColumn.PackStart (errorPixbufCell, false);
		countsColumn.PackStart (errorTextCell, false);
		countsColumn.PackStart (todoPixbufCell, false);
		countsColumn.PackStart (todoTextCell, false);
		countsColumn.PackStart (niexPixbufCell, false);
		countsColumn.PackStart (niexTextCell, false);
		
		tree.AppendColumn (countsColumn);

		countsColumn.AddAttribute (missingPixbufCell, "pixbuf", (int)TreeCol.MissingIcon);
		countsColumn.AddAttribute (missingTextCell, "text", (int)TreeCol.MissingText);
		countsColumn.AddAttribute (extraPixbufCell, "pixbuf", (int)TreeCol.ExtraIcon);
		countsColumn.AddAttribute (extraTextCell, "text", (int)TreeCol.ExtraText);
		countsColumn.AddAttribute (errorPixbufCell, "pixbuf", (int)TreeCol.ErrorIcon);
		countsColumn.AddAttribute (errorTextCell, "text", (int)TreeCol.ErrorText);
		countsColumn.AddAttribute (todoPixbufCell, "pixbuf", (int)TreeCol.TodoIcon);
		countsColumn.AddAttribute (todoTextCell, "text", (int)TreeCol.TodoText);
		countsColumn.AddAttribute (niexPixbufCell, "pixbuf", (int)TreeCol.NiexIcon);
		countsColumn.AddAttribute (niexTextCell, "text", (int)TreeCol.NiexText);

		CreateTags (AdditionalInfoText.Buffer);

		tree.Selection.Changed += delegate (object sender, EventArgs e) {
			Gtk.TreeIter iter;
			if (tree.Selection.GetSelected (out iter)) {
				List<string> msgs = null;
				ComparisonNode n = tree.Model.GetValue (iter, (int)TreeCol.Node) as ComparisonNode;
				TextBuffer buffer = AdditionalInfoText.Buffer;
				bool showInfo = false;
				TextIter textIter = TextIter.Zero;

				buffer.Clear ();

				if (!String.IsNullOrEmpty (n.ExtraInfo)) {
					showInfo = true;
					textIter = buffer.StartIter;

					buffer.InsertWithTagsByName (ref textIter, "Additional information:\n", "bold");
					InsertWithMarkup (buffer, ref textIter, "\t" + n.ExtraInfo + "\n");
				}

				if (n != null) msgs = n.Messages;
				if (msgs != null && msgs.Count > 0) {
					if (!showInfo) {
						showInfo = true;
						textIter = buffer.StartIter;
					}

					buffer.InsertWithTagsByName (ref textIter, "Errors:\n", "red", "bold");

					for (int i = 0; i < msgs.Count; i ++) {
						buffer.InsertWithTagsByName (ref textIter, String.Format ("\t{0}: ", i + 1), "bold");
						InsertWithMarkup (buffer, ref textIter, msgs [i]);
					}
				}
				
				if (n != null) msgs = n.Todos;
				if (msgs != null && msgs.Count > 0) {
					if (!showInfo) {
						showInfo = true;
						textIter = buffer.StartIter;
					}

					buffer.InsertWithTagsByName (ref textIter, "TODO:\n", "green", "bold");
					for (int i = 0; i < msgs.Count; i ++) {
						buffer.InsertWithTagsByName (ref textIter, String.Format ("\t{0}: ", i + 1), "bold");
						buffer.Insert (ref textIter, msgs [i]);
					}
				}
				
				if (showInfo)
					AdditionalInfoWindow.Visible = true;
				else
					AdditionalInfoWindow.Visible = false;

				string msdnUrl = n != null ? n.MSDNUrl : null;
				if (!String.IsNullOrEmpty (msdnUrl))
					Status = GetMSDNVersionedUrl (msdnUrl);
				else
					Status = String.Empty;
			}
		};

		tree.RowActivated += delegate (object sender, RowActivatedArgs args) {
			Gtk.TreeIter iter;
			if (!tree.Model.GetIter (out iter, args.Path))
				return;

			ComparisonNode n = tree.Model.GetValue (iter, (int)TreeCol.Node) as ComparisonNode;
			if (n == null || String.IsNullOrEmpty (n.MSDNUrl))
				return;

			System.Diagnostics.Process browser = new System.Diagnostics.Process ();
			browser.StartInfo.FileName = GetMSDNVersionedUrl (n.MSDNUrl);
			browser.StartInfo.UseShellExecute = true;
			browser.Start ();
		};
		
		//
		// Load configuration
		//
		ShowMissing.Active = Config.ShowMissing;
		ShowErrors.Active = Config.ShowErrors;
		ShowExtra.Active = Config.ShowExtra;
		ShowPresent.Active = Config.ShowPresent;
		ShowTodo.Active = Config.ShowTodo;

		//
		// Legend
		//
		legendImageOK.Pixbuf = okPixbuf;
		legendImageError.Pixbuf = errorPixbuf;
		legendImageNIEX.Pixbuf = niexPixbuf;
		legendImageMissing.Pixbuf = missingPixbuf;
		legendImageTODO.Pixbuf = todoPixbuf;
		legendImageExtra.Pixbuf = extraPixbuf;
	}
 public static void ForceMode(InfoManager.InfoMode mode, InfoManager.SubInfoMode subMode)
 {
     _forceMode = true;
     _forcedMode = mode;
     _forcesSubMode = subMode;
 }
Пример #37
0
    bool InsertBalanceDMZ(out decimal undoc, out string ndm_s, int CEH, string N_KDK, string fileName)
    {
        bool res = false;

        undoc = 0;
        ndm_s = "";

        try
        {
            decimal cnt = 1;
            undoc = SqlClient.CreateCommand("Select LAST_NOM From LSTN Where Alias = 'DMR     ' ").ExecScalar <decimal>() + cnt;
            decimal ndm = SqlClient.CreateCommand(string.Format("Select LAST_NOM From LSTN Where ALIAS = 'DMZ' and LSTNOBJ = 'CO000CBALOBORM201712' ")).ExecScalar <decimal>() + cnt;

            ndm_s = ndm.ToString();

            //if (!InfoManager.YesNo("undoc = " + undoc.ToString() + "\n" + "ndm = " + ndm.ToString())) return;

            SqlClient.CreateCommand(string.Format("Update LSTN Set LAST_NOM = @undoc Where ALIAS = 'DMR     ' "), new SqlParam("undoc", undoc)).ExecNonQuery();
            SqlClient.CreateCommand(string.Format("Update LSTN Set LAST_NOM = @undoc Where ALIAS = 'DMZ' and LSTNOBJ = 'CO000CBALOBORM201712' "), new SqlParam("undoc", ndm)).ExecNonQuery();

            //
            //DateTime DT = DateTime.Now;
            //DateTime DT = new DateTime(2017, 10, 31);

            // DateTime DT = new DateTime(2018, 11, 1);

            DateTime DT = new DateTime(2019, 08, 1);


            var ib = SqlClient.Main.CreateInsertBuilder();

            ib.TableName = "DMZ";

            ib.AddValue("UNDOC", undoc);
            ib.AddValue("GODMEC", "201811");
            ib.AddValue("DDM", DT);
            ib.AddValue("NDM", ndm_s.ToString());
            //ib.AddValue("KDMT", "_BALANCES");
            ib.AddValue("KDMT", "BALOBOR");
            ib.AddValue("KSTO", 0);

            ib.AddValue("KOBJ_CR", "CO000");
            ib.AddValue("KOBJ_DB", "CO000");

            ib.AddValue("CEH_K", CEH);
            ib.AddValue("N_KDK_K", N_KDK);       // Получатель               - N_KDK_UMC

            ib.AddValue("ORG_2", 1);

            ib.AddValue("NBNK2", 10);
            ib.AddValue("ORG_GPO_2", 1);

            ib.AddValue("KVAL", 980);
            ib.AddValue("KKVT", "NB");
            ib.AddValue("KURS", 1);
            ib.AddValue("PRRA", "+");
            ib.AddValue("KSD2", "05");

            ib.AddValue("KSTO", 246);

            ib.AddValue("COMM", fileName);

            ib.AddValue("KBLS", "UKR");
            ib.AddValue("FIO_D", "ADM");
            ib.AddValue("DATE_D", DateTime.Now);

            ib.Exec();

            FixStageBusinessProcess(undoc);

            res = true;

            return(res);
        }
        catch (Exception ex)
        {
            res = false;
            InfoManager.MessageBox("False DMZ");

            return(res);
        }
    }
Пример #38
0
        /// <summary>
        /// Called everytime a party invitation is detected.
        /// </summary>
        public void OnPartyInvitation(uint uniqueID, SRParty.Setup Setup)
        {
            // Check GUI
            Window w = Window.Get;

            // All
            if (w.Party_cbxAcceptAll.Checked)
            {
                if (w.Party_cbxAcceptOnlyPartySetup.Checked)
                {
                    // Exactly same party setup?
                    if (w.GetPartySetup() == Setup)
                    {
                        PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                    }
                    else if (w.Party_cbxRefuseInvitations.Checked)
                    {
                        PacketBuilder.PlayerPetitionResponse(false, SRTypes.PlayerPetition.PartyInvitation);
                    }
                }
                else
                {
                    PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                }
                // Highest priority, has no sense continue checking ..
                return;
            }
            // Check party list
            if (w.Party_cbxAcceptPartyList.Checked)
            {
                string playerName = InfoManager.GetEntity(uniqueID).Name.ToUpper();

                bool found = false;
                w.Party_lstvPartyList.InvokeIfRequired(() => {
                    found = w.Party_lstvPartyList.Items.ContainsKey(playerName);
                });
                if (found)
                {
                    if (w.Party_cbxAcceptOnlyPartySetup.Checked)
                    {
                        if (w.GetPartySetup() == Setup)
                        {
                            PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                            return;
                        }
                    }
                    else
                    {
                        PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                        return;
                    }
                }
            }
            // Check leader list
            if (w.Party_cbxAcceptLeaderList.Checked)
            {
                string playerName = InfoManager.GetEntity(uniqueID).Name.ToUpper();

                bool found = false;
                w.Party_lstvLeaderList.InvokeIfRequired(() => {
                    w.Party_lstvLeaderList.InvokeIfRequired(() => {
                        found = w.Party_lstvLeaderList.Items.ContainsKey(playerName);
                    });
                });
                if (found)
                {
                    if (w.Party_cbxAcceptOnlyPartySetup.Checked)
                    {
                        if (w.GetPartySetup() == Setup)
                        {
                            PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                            return;
                        }
                    }
                    else
                    {
                        PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.PartyInvitation);
                        return;
                    }
                }
            }
            if (w.Party_cbxRefuseInvitations.Checked)
            {
                PacketBuilder.PlayerPetitionResponse(false, SRTypes.PlayerPetition.PartyInvitation);
            }
        }
Пример #39
0
        private void SetupManagers()
        {
            // Open a connection to the reader
            _dataManager = new DataManager(DataManager.ConnectionTypes.SOCKET, _ipAddress, 0);
            _dataManager.OpenConnection();
            //Console.WriteLine("Connection Opened");

            // Get the reader's name
            _infoManager = new InfoManager(_dataManager);
            String v = _infoManager.Name;
            //Console.WriteLine("Name: " + v);
            _infoManager = null;

            // Login as administrator
            _readerManager = new ReaderManager(_dataManager);
            if (!_readerManager.Login(_login, _password))
            {
                throw new Exception("Login attempt failed: " + _readerManager.LastErrorMessage);
            }

            v = _readerManager.WhoAmI();
            //Console.WriteLine("Login: " + v);
        }
Пример #40
0
    public void OpenExcel(string path, string fileName)
    {
        OleDbConnection connection;

        try
        {
            if (!InfoManager.YesNo("OpenExcel_"))
            {
                return;
            }

            decimal undoc;
            string  ndm_s;

            string BS = "00223";        // Забалонсовый счет

            string[] stringSeparator = new string[] { " - " };
            string[] result          = fileName.Split(stringSeparator, StringSplitOptions.RemoveEmptyEntries);

            int    cehDMZ   = Convert.ToInt32(result[1].ToString());
            string n_kdkDMZ = result[2].ToString();

            string connectionString;

            //'Для Excel 12.0
            connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + fileName + "; Extended Properties=\"Excel 12.0 Xml;HDR=Yes\";";
            connection       = new OleDbConnection(connectionString);
            connection.Open();

            OleDbCommand command = connection.CreateCommand();

            command.CommandText = "Select * From [sheet$A0:I15000] "; //Where [К-во (факт)] = 20 ";

            OleDbDataAdapter da = new OleDbDataAdapter(command);
            DataTable        dt = new DataTable();
            da.Fill(dt);

            //if (!InfoManager.YesNo("InsertBalanceDMZ")) return;
            if (!InsertBalanceDMZ(out undoc, out ndm_s, cehDMZ, n_kdkDMZ, fileName))
            {
                InfoManager.MessageBox("DMZ не вставилась!!!");
                return;
            }
            //if (!InfoManager.YesNo("Вставка прошла DMZ")) return;

            //if (!InfoManager.YesNo("Подготовка на вставку строк DMS")) return;

            RowTXT rowTXT = new RowTXT();
            rowTXT.CloneTable(dt);

            List <string> DoubleKmat = new List <string>();

            int k = 0;
            foreach (DataRow row in dt.Rows)
            {
                //if (!InfoManager.YesNo("Прдолжить добавление строк?")) return;

                try
                {
                    string ceh_s    = row["ceh"].ToString();
                    string kmat_old = row["kmat"].ToString();

                    //string kmat = ConvertKmat(kmat_old, ceh_s);
                    string kmat = ConvertKmat(kmat_old, ceh_s, DoubleKmat);

                    bool     flag1       = false;
                    object[] arrayColumn = row.ItemArray;

                    if (Flag(arrayColumn))
                    {
                        break;
                    }

                    int ceh = Convert.ToInt32(ceh_s);

                    string  n_kdk     = row["n_kdk"].ToString();
                    string  naim      = row["naim"].ToString();
                    string  size_type = row["size_type"].ToString();
                    int     ei        = FuncEI(row["ei"].ToString());
                    decimal price     = FuncPrice(row["price"].ToString());
                    decimal count     = FuncCount(row["count"].ToString());

                    //InfoManager.MessageBox("row['sum'].ToString() = " + row["sum"].ToString());
                    decimal sum = FuncSum(row["sum"].ToString());

                    #region "   ShowKmat   "

                    //StringBuilder sb = new StringBuilder();

                    //sb.Append(ceh.ToString() + "\n");
                    //sb.Append(kmat.ToString() + "\n");
                    //sb.Append(naim.ToString() + "\n");
                    //sb.Append(size_type.ToString() + "\n");
                    //sb.Append(ei.ToString() + "\n");
                    //sb.Append(price.ToString() + "\n");
                    //sb.Append(count.ToString() + "\n");
                    //sb.Append(sum.ToString() + "\n");

                    ////InfoManager.MessageBox(sb.ToString());

                    //if (!InfoManager.YesNo(sb.ToString())) return;

                    #endregion

                    //=================================================================

                    try
                    {
                        if (!DoubleKmat.Contains(kmat_old) | kmat_old == "")
                        {
                            DoubleKmat.Add(kmat_old);

                            DataRow[] rows1 = null;
                            try
                            {
                                rows1 = dt.Select("kmat = '" + kmat_old + "' and naim = '" + naim + "'");
                            }
                            catch (Exception)
                            {
                                rows1 = dt.Select("kmat = " + kmat_old + " and naim = '" + naim + "'");
                            }


                            int flag = 0;

                            if (rows1.Count() > 1)
                            {
                                flag = 1;
                                for (int i = 0; i < rows1.Count(); i++)
                                {
                                    DataRow r1 = rows1[i];

                                    naim      = r1["naim"].ToString();
                                    size_type = r1["size_type"].ToString();
                                    ei        = FuncEI(r1["ei"].ToString());
                                    price     = FuncPrice(r1["price"].ToString());
                                    count     = FuncCount(r1["count"].ToString());
                                    sum       = FuncSum(r1["sum"].ToString());

                                    if (i == 0)
                                    {
                                        string ss1 = rows1[0].ItemArray[2].ToString();
                                        string ss2 = rows1[0].ItemArray[3].ToString();



                                        string sss = rows1.ToString();
                                        if (!KsmTable.IsRecord(kmat))
                                        {
                                            InsertKmat(kmat, kmat_old, naim, size_type, ei, fileName, BS);
                                        }

                                        try
                                        {
                                            InsertBalanceDMS(undoc, ndm_s, ceh, n_kdk, kmat, ei, count, price, sum, BS);
                                        }
                                        catch (Exception)
                                        {
                                            if (!InfoManager.YesNo("Insert False"))
                                            {
                                                return;
                                            }
                                        }



                                        //KSM.Add(kmat, ss2);
                                        //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}", k, ceh, kmat, kmat_old.PadRight(12), naim.PadRight(30), size_type.PadRight(20), ei, price, count, sum));
                                    }
                                    else
                                    {
                                        try
                                        {
                                            InsertBalanceDMS(undoc, ndm_s, ceh, n_kdk, kmat, ei, count, price, sum, BS);
                                        }
                                        catch (Exception)
                                        {
                                            if (!InfoManager.YesNo("Insert False"))
                                            {
                                                return;
                                            }
                                        }


                                        //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}", k, ceh, kmat, kmat_old.PadRight(12), naim.PadRight(30), size_type.PadRight(20), ei, price, count, sum));
                                    }
                                }
                            }

                            DataRow[] rows2 = null;
                            try
                            {
                                rows2 = dt.Select("kmat = '" + kmat_old + "'");
                            }
                            catch (Exception)
                            {
                                rows2 = dt.Select("kmat = " + kmat_old);
                            }

                            if (flag == 0)
                            {
                                if (rows2.Count() > 1)
                                {
                                    for (int i = 0; i < rows2.Count(); i++)
                                    {
                                        DataRow r2 = rows2[i];

                                        naim      = r2["naim"].ToString();
                                        size_type = r2["size_type"].ToString();
                                        ei        = FuncEI(r2["ei"].ToString());
                                        price     = FuncPrice(r2["price"].ToString());
                                        count     = FuncCount(r2["count"].ToString());
                                        sum       = FuncSum(r2["sum"].ToString());

                                        if (i == 0)
                                        {
                                            //naim = r2["naim"].ToString();
                                            //size_type = r2["size_type"].ToString();

                                            if (!KsmTable.IsRecord(kmat))
                                            {
                                                InsertKmat(kmat, kmat_old, naim, size_type, Convert.ToInt32(ei), fileName, BS);
                                            }

                                            try
                                            {
                                                InsertBalanceDMS(undoc, ndm_s, ceh, n_kdk, kmat, Convert.ToInt32(ei), count, price, sum, BS);
                                            }
                                            catch (Exception)
                                            {
                                                if (!InfoManager.YesNo("Insert False"))
                                                {
                                                    return;
                                                }
                                            }

                                            //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}", k, ceh, kmat, kmat_old.PadRight(12), naim.PadRight(30), size_type.PadRight(20), ei, price, count, sum));
                                            //}
                                        }
                                        else
                                        {
                                            counter++;
                                            kmat = ConvertKmat("", ceh_s, DoubleKmat);

                                            if (!KsmTable.IsRecord(kmat))
                                            {
                                                InsertKmat(kmat, kmat_old, naim, size_type, Convert.ToInt32(ei), fileName, BS);
                                            }

                                            try
                                            {
                                                InsertBalanceDMS(undoc, ndm_s, ceh, n_kdk, kmat, Convert.ToInt32(ei), count, price, sum, BS);
                                            }
                                            catch (Exception)
                                            {
                                                if (!InfoManager.YesNo("Insert False"))
                                                {
                                                    return;
                                                }
                                            }


                                            //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}", k, ceh, kmat, kmat_old.PadRight(12), naim.PadRight(30), size_type.PadRight(20), ei, price, count, sum));
                                        }
                                    }
                                }
                                else
                                {
                                    //string ss1 = rows2[0].ItemArray[2].ToString();
                                    //string ss2 = rows2[0].ItemArray[3].ToString();
                                    //if (!KsmTable.IsRecord(kmat))
                                    //{
                                    //InsertKmat(kmat, kmat_old, naim, size_type, Convert.ToInt32(ei), fileName, BS);

                                    if (kmat_old == "")
                                    {
                                        counter++;
                                        kmat = ConvertKmat("", ceh_s, DoubleKmat);
                                        //kmat = ConvertKmat("", ceh_s);
                                    }

                                    if (!KsmTable.IsRecord(kmat))
                                    {
                                        InsertKmat(kmat, kmat_old, naim, size_type, Convert.ToInt32(ei), fileName, BS);
                                    }

                                    try
                                    {
                                        InsertBalanceDMS(undoc, ndm_s, ceh, n_kdk, kmat, Convert.ToInt32(ei), count, price, sum, BS);
                                    }
                                    catch (Exception)
                                    {
                                        if (!InfoManager.YesNo("Insert False"))
                                        {
                                            return;
                                        }
                                    }


                                    //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}", k, ceh, kmat, kmat_old.PadRight(12), naim.PadRight(30), size_type.PadRight(20), ei, price, count, sum));
                                }
                            }


                            //else
                            //    InfoManager.MessageBox(String.Format("Кода {0} нет!", kmat));

                            //KSM.Add(rowKmat["kmat"].ToString(), rowKmat["kmat"].ToString());
                            //Console.WriteLine(String.Format("{0}\t{1}\t{2}\t  {3}\t{4}\t{5}\t{6}\t{7}", k, ceh, kmat, kmat_old, ei, price, count, sum));
                        }
                    }
                    catch (Exception)
                    {
                        InfoManager.MessageBox("Ошибка!");

                        //DoubleKmat.Add(kmat_old);

                        //var rowsKmat = dt.AsEnumerable().Where(x => x["kmat"].ToString() == kmat_old);
                        var rowsKmat = dt.Select("kmat = '" + kmat_old + "' ");

                        foreach (var rowKmat in rowsKmat)
                        {
                            rowTXT.Add(rowKmat, dt.Rows.IndexOf(rowKmat) + 2);
                        }
                    }

                    //=================================================================

                    //if (!InfoManager.YesNo("InsertKSM " + kmat)) return;
                    //if (!InfoManager.YesNo("InsertBalanceDMS")) return;
                }
                catch (Exception ex)
                {
                    //if (!InfoManager.YesNo(ex.Message)) return;

                    bool     flag = false;
                    object[] ddd  = row.ItemArray;
                    for (int i = 0; i < ddd.Length - 1; i++)
                    {
                        flag = ddd[i].ToString() == "" ? true : false;
                    }

                    if (flag)
                    {
                        break;
                    }


                    rowTXT.Add(row, k);
                }
            }

            rowTXT.WriteTXT(path, fileName, n_kdkDMZ);

            try
            {
                connection.Close();
            }
            catch (Exception ex)
            {
                if (!InfoManager.YesNo("Ошибка:\n" + ex.Message))
                {
                    return;
                }
            }
        }
        catch (Exception ex)
        {
            if (!InfoManager.YesNo("Ошибка:\n" + ex.Message))
            {
                return;
            }
        }
    }
 private static void ApplyForcedMode(ref InfoManager.InfoMode mode, ref InfoManager.SubInfoMode subMode)
 {
     if (!_forceMode) return;
     mode = _forcedMode;
     subMode = _forcesSubMode;
 }
Пример #42
0
        public void Execute()
        {
            var target  = TargetSelector.GetTarget(700.0f, DamageType.Mixed, Player.Instance.Position);
            int enemies = Player.Instance.CountEnemyChampionsInRange(MenuHelper.GetSliderValue(ConfigList.Settings.Menu, "Settings.Range")),
                allies  = Player.Instance.CountAllyChampionsInRange(MenuHelper.GetSliderValue(ConfigList.Settings.Menu, "Settings.Range"));

            foreach (var item in Player.Instance.InventoryItems)
            {
                if (EloBuddy.SDK.Core.GameTickCount - ItemManager.GetLastUse(item.Id) < 500 || !item.CanUseItem())
                {
                    continue;
                }

                switch (item.Id)
                {
                case ItemId.Zhonyas_Hourglass:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Zhonya.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Zhonya.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Zhonya.Enemies") || allies < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Zhonya.Allies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent > MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Zhonya.Me.MinHealth"))
                    {
                        continue;
                    }
                    item.Cast();
                    ItemManager.SetLastUse(item.Id);
                    break;

                case ItemId.Locket_of_the_Iron_Solari:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Enemies") || allies < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Allies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent <= MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Me.MinHealth"))
                    {
                        item.Cast();
                    }

                    var allies_list = EloBuddy.SDK.EntityManager.Heroes.Allies.Where(c => c.IsAlive() && c.IsInRange(Player.Instance, 600));
                    foreach (var a in allies_list.Where(a => !a.IsMe && a.IsInRange(Player.Instance, 1050)))
                    {
                        if (a.HealthPercent <= MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Ally.MinHealth"))
                        {
                            item.Cast();
                            break;
                        }
                    }

                    if (allies_list.Sum(a => a.HealthPercent) / allies_list.Count() <= MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Solari.Allies.MinHealth"))
                    {
                        item.Cast();
                    }
                    break;

                case ItemId.Face_of_the_Mountain:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Fotm.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Fotm.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent <= MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Fotm.Me.MinHealth"))
                    {
                        InfoManager.Show(item, Player.Instance);
                        item.Cast(Player.Instance);
                        ItemManager.SetLastUse(item.Id);
                        continue;
                    }

                    foreach (var a in EloBuddy.SDK.EntityManager.Heroes.Allies.Where(a => !a.IsMe))
                    {
                        if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, $"Items.Deffensive.Fotm.Use.{a.ChampionName}") && a.HealthPercent <= MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Fotm.Ally.MinHealth"))
                        {
                            InfoManager.Show(item, a);
                            item.Cast(a);
                            ItemManager.SetLastUse(item.Id);
                            continue;
                        }
                    }
                    break;

                case ItemId.Seraphs_Embrace:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Seraph.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Seraph.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (enemies < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Seraph.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent > MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Seraph.Me.MinHealth"))
                    {
                        continue;
                    }
                    InfoManager.Show(item, Player.Instance);
                    item.Cast();
                    ItemManager.SetLastUse(item.Id);
                    break;

                case ItemId.Redemption:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Redemption.Status"))
                    {
                        continue;
                    }

                    var rAllies = EloBuddy.SDK.EntityManager.Heroes.Allies.Where(a => a.IsInRange(Managers.EntityManager.GetAlliesGroup(5500, 550, MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Redemption.Allies")), 550));
                    if (rAllies.Count() < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Redemption.Allies"))
                    {
                        continue;
                    }
                    if (rAllies.Sum(e => Prediction.Health.GetPrediction(e, 2500)) / rAllies.Sum(e => e.TotalMaxHealth()) > MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Redemption.Hp"))
                    {
                        continue;
                    }

                    List <Vector3> vectors = new List <Vector3>();
                    foreach (var a in rAllies)
                    {
                        vectors.Add(a.Position);
                    }
                    item.Cast(Managers.EntityManager.CenterOfVectors(vectors));
                    ItemManager.SetLastUse(item.Id);
                    InfoManager.Show(item, Player.Instance);
                    break;

                case ItemId.Randuins_Omen:
                    if (!MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Omen.Status"))
                    {
                        continue;
                    }
                    if (MenuHelper.GetCheckBoxValue(ConfigList.DItems.Menu, "Items.Deffensive.Omen.ComboOnly") && !Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        continue;
                    }
                    if (Player.Instance.CountEnemyChampionsInRange(550) < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Omen.Enemies"))
                    {
                        continue;
                    }
                    if (Player.Instance.HealthPercent < MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Omen.Me.MinHealth"))
                    {
                        continue;
                    }
                    if (target.HealthPercent > MenuHelper.GetSliderValue(ConfigList.DItems.Menu, "Items.Deffensive.Omen.Enemy.MinHealth"))
                    {
                        continue;
                    }
                    ItemManager.SetLastUse(item.Id);
                    item.Cast();
                    break;
                }
            }
        }
Пример #43
0
 void Awake()
 {
     InfoManager.Instance = this;
 }
 public override void GetPlacementInfoMode(out InfoManager.InfoMode mode, out InfoManager.SubInfoMode subMode)
 {
     mode = InfoManager.InfoMode.None;
     subMode = InfoManager.SubInfoMode.FlowingWater;
 }