Ejemplo n.º 1
0
        public void UserInitialize(CoreList CoreList)
        {
            ServerQueryConnection = (ServerQueryConnection.ServerQueryConnection)CoreList[typeof(ServerQueryConnection.ServerQueryConnection).Name];

            //TODO: Add permission list from ts3 somehow
            //var PermissionsList = ServerQueryConnection.QueryRunner.GetPermissionList().ToList();
        }
Ejemplo n.º 2
0
        /*
         * public void testlists()
         * {
         *  Dictionary<int, markinginfo> lst = new Dictionary<int, markinginfo>();
         *  markinginfo a = new markinginfo()
         *  {
         *      flim = "1one",
         *      llim = "2one",
         *      txt = "1one extr<div>aone 1two extra<div>two 1three found<div>three 2three 2two 2one",
         *      //filler = "filler1out",
         *      vl = " extr<div>aone 1two extra<div>two 1three found<div>three 2three 2two ",
         *     //replaced = " 1onefiller1out2one "
         *  };
         *  lst.Add(1, a);
         *  a = new markinginfo()
         *  {
         *      flim = "1two",
         *      llim = "2two",
         *      txt = "  extr<div>aone 1two extra<div>two 1three found<div>three 2three 2two ",
         *      //filler = "filler2out",
         *      vl = " extra<div>two 1three found<div>three 2three ",
         *      //replaced = " 1twofiller2out2two "
         *  };
         *  lst.Add(2, a);
         *  a = new markinginfo()
         *  {
         *      flim = "1three",
         *      llim = "2three",
         *      txt = " extra<div>two 1three found<div>three 2three   ",
         *      //filler = "filler3out",
         *      vl = " found<div>three ",
         *      //replaced = "1threefiller3out2three"
         *  };
         *  lst.Add(3, a);
         *
         *  string val = "";
         *  foreach (KeyValuePair<int, markinginfo> b in lst.OrderByDescending(t=>t.Key))
         *  {
         *      // if value is blank - last item then make val from the val
         *      if (String.IsNullOrEmpty(val))
         *      {
         *          val = b.Value.vl.Replace("<div>", "<X>");
         *      }
         *      // replace value with a filler in text
         *      string cvtxt = b.Value.txt.Replace(b.Value.flim + b.Value.vl + b.Value.llim, "myfiller");
         *      // convert text with a filler
         *      cvtxt = cvtxt.Replace("<div>", "<X>");
         *      val = cvtxt.Replace("myfiller", "<div>" + b.Value.flim.Replace("<div>", "<X>") + "</div>" + val + "<div>" + b.Value.llim.Replace("<div>", "<X>") + "</div>");
         *
         *  }
         * }
         */
        // GET: index
        public ActionResult Index()
        {
            //testlists();
            //processdb();
            CoreList a = new CoreList();

            a.getallprocesses();
            return(View("Index", a));
        }
Ejemplo n.º 3
0
        public void Initialize(CoreList CoreInjections)
        {
            var core = this as ICore;

            core.UserInitialize(CoreInjections);

            this.IsInitialized = true;
            logger.Debug(this.Name + " initialized successfully.");
        }
Ejemplo n.º 4
0
        public void UserInitialize(CoreList AddonInjections)
        {
            this.ServerQueryConnection = AddonInjections[typeof(ServerQueryConnection.ServerQueryConnection).Name] as ServerQueryConnection.ServerQueryConnection;
            this.UserManager           = AddonInjections[typeof(UserManager.UserManager).Name] as UserManager.UserManager;

            this.ServerQueryConnection.BotCommandAttempt += onBotCommand;

            ModelCustomizer.AddModelCustomization(Hooks.ModelCustomizer.OnModelCreating);
        }
Ejemplo n.º 5
0
        public void UserInitialize(CoreList AddonInjections)
        {
            this.ServerQueryConnection = AddonInjections[typeof(ServerQueryConnection.ServerQueryConnection).Name] as ServerQueryConnection.ServerQueryConnection;
            this.UserManager           = AddonInjections[typeof(UserManager.UserManager).Name] as UserManager.UserManager;

            this.ServerQueryConnection.QueryRunner.Notifications.ClientMessageReceived += Notifications_ClientMessageReceived;

            ModelCustomizer.AddModelCustomization(Hooks.ModelCustomizer.OnModelCreating);

            //logger.Info("I have been initialized yo!");
        }
Ejemplo n.º 6
0
        public void UserInitialize(CoreList AddonInjections)
        {
            this.Name = this.GetType().Name;
            ModelCustomizer.AddModelCustomization(Hooks.ModelCustomizer.OnModelCreating);

            this.ServerQueryConnection = AddonInjections[typeof(ServerQueryConnection.ServerQueryConnection).Name] as ServerQueryConnection.ServerQueryConnection;
            this.ServerQueryAddon      = AddonInjections[typeof(ServerQueryShell.ServerQueryShell).Name] as ServerQueryShell.ServerQueryShell;

            // Native serverquery events are in queryRunner object. Uncomment if you want to use them.
            this.ServerQueryConnection.BotCommandAttempt += ServerQueryConnection_BotCommandReceived;
            this.ServerQueryConnection.QueryRunner.Notifications.ClientMoved += Notifications_ClientMoved;

            //logger.Debug("TestAddon initialized!");
        }
Ejemplo n.º 7
0
        public void UserInitialize(CoreList CoreList)
        {
            // Core Initialization
            ServerQueryConnection = (ServerQueryConnection.ServerQueryConnection)CoreList["ServerQueryConnection"];

            // Addon Initialization
            // Just give us _all_ the cores (for now) so we can share them with the addons that need them
            this.CoreList = CoreList;
            // We can't initialize addons until the core addons have been initialized
            InitializeAddons();

            GetSchemas();
            ServerQueryConnection.BotCommandAttempt += onBotCommandAttempt;
        }
Ejemplo n.º 8
0
        public void UserInitialize(CoreList AddonInjections)
        {
            if (Nickname == null)
            {
                if (this.Subscriber.BotNickName == null)
                {
                    Nickname = Subscriber.AdminUsername;
                }
                else
                {
                    Nickname = Subscriber.BotNickName;
                }
            }

            this.connectionChange = new AutoResetEvent(false);
            AsyncTcpDispatcher    = new AsyncTcpDispatcher(Subscriber.ServerIp, (ushort)Subscriber.ServerPort);
            QueryRunner           = new QueryRunner(AsyncTcpDispatcher);

            //atd.ServerClosedConnection += atd_ServerClosedConnection;
            AsyncTcpDispatcher.ReadyForSendingCommands += atd_ReadyForSendingCommands;
            AsyncTcpDispatcher.SocketError             += atd_SocketError;

            Connect();

            SimpleResponse loginResult = Login();

            if (loginResult.IsBanned)
            {
                logger.Info("Login failure due to ban: {0}", loginResult.ResponseText);
            }
            else if (loginResult.IsErroneous)
            {
                logger.Info("Login failure due to error: {0}", loginResult.ResponseText);
            }
            else
            {
                SendSetNameCmd();

                SelectServer(Subscriber);

                SendSetNameCmd();

                UpdateServerUniqueId();

                whoAmI = QueryRunner.SendWhoAmI();

                RegisterEvents();
            }
        }
Ejemplo n.º 9
0
        // load
        public void LoadData()
        {
            for (int i = 0; i < BUTTON; i++)
            {
                Board         _newBoard         = new Board(BOARD_NAME + (i + 1), COUNT + (i + 1) + TYPE + BOARD_NAME, (i + 1) * COST * TWO);
                Core          _newCpu           = new Core(CORE_NAME + (i + 1), COUNT + (i + 1) + TYPE + CORE_NAME, (i + 1) * COST * THREE);
                Disk          _newDisk          = new Disk(DISK_NAME + (i + 1), COUNT + (i + 1) + TYPE + DISK_NAME, (i + 1) * COST);
                Memory        _newMemory        = new Memory(MEMORY_NAME + (i + 1), COUNT + (i + 1) + TYPE + MEMORY_NAME, (i + 1) * COST);
                DisplayCard   _newDisplayCard   = new DisplayCard(CARD_NAME + (i + 1), COUNT + (i + 1) + TYPE + CARD_NAME, (i + 1) * COST * FOUR);
                ComboComputer _newComboComputer = new ComboComputer(COMPUTER_NAME + (i + 1), COUNT + (i + 1) + TYPE + COMPUTER_NAME, (i + 1) * COST * FIVE);

                BoardList.Add(_newBoard);
                CoreList.Add(_newCpu);
                DiskList.Add(_newDisk);
                MemoryList.Add(_newMemory);
                DisplayCardList.Add(_newDisplayCard);
                ComboComputerList.Add(_newComboComputer);
            }
        }
Ejemplo n.º 10
0
        public void Accounts_AreTransactionsRegistered()
        {
            _SavingsAccount.Deposit(2000); //Tr 2
            Assert.AreEqual(3000, _SavingsAccount.GetBalance());
            Assert.AreEqual(0.002, _SavingsAccount.GetEffectiveRate());

            _SavingsAccount.Withdraw(70000); //Tr Expected Fail

            _SavingsAccount.Withdraw(1500);  // Tr 3
            Assert.AreEqual(1500, _SavingsAccount.GetBalance());

            _SavingsAccount.Deposit(10000);                   // Tr 4
            _SavingsAccount.Transfer(_CheckingAccount, 4000); // Tr 5

            Assert.AreEqual(7500, _SavingsAccount.GetBalance());
            Assert.AreEqual(5000, _CheckingAccount.GetBalance());

            CoreList <ITransaction> _savingsTransactions  = _SavingsAccount.Transactions;
            CoreList <ITransaction> _checkingTransactions = _SavingsAccount.Transactions;

            Assert.AreEqual(5, _savingsTransactions.Count);
            Assert.AreEqual(2, _checkingTransactions.Count);
        }
        public DataTable GerarRelatorio(MatriculaVinculo matriculaVinculo, TipoPesquisa tipoPesquisa)
        {
            List <MatriculaVinculo> listaMatricula = ConsultarMatriculaMestre(matriculaVinculo, tipoPesquisa);

            CoreList <MatriculaVinculoBoleto> resultado = new CoreList <MatriculaVinculoBoleto>();

            if (listaMatricula.Count == 0)
            {
                IMatriculaProcesso processo = MatriculaProcesso.Instance;
                Matricula          m        = new Matricula();
                m.Status = (int)Status.Ativo;
                m.ID     = matriculaVinculo.MatriculaMestreID;
                List <Matricula> matriculaMestreLista = processo.Consultar(m, tipoPesquisa);

                if (matriculaMestreLista.Count > 0)
                {
                    MatriculaVinculo matriculaVinculoUnica = new MatriculaVinculo();
                    matriculaVinculoUnica.MatriculaMestre   = matriculaMestreLista[0];
                    matriculaVinculoUnica.MatriculaMestreID = matriculaMestreLista[0].ID;
                    listaMatricula.Add(matriculaVinculoUnica);
                }
            }

            if (listaMatricula.Count > 0)
            {
                MatriculaVinculoBoleto mvbBase = new MatriculaVinculoBoleto();
                List <String>          meses   = new List <String>();
                meses.Add("Janeiro");
                meses.Add("Fevereiro");
                meses.Add("Março");
                meses.Add("Abril");
                meses.Add("Maio");
                meses.Add("Junho");
                meses.Add("Julho");
                meses.Add("Agosto");
                meses.Add("Setembro");
                meses.Add("Outubro");
                meses.Add("Novembro");
                meses.Add("Dezembro");

                mvbBase.NomeAluno1            = listaMatricula[0].MatriculaMestre.Aluno.Nome;
                mvbBase.NumeroMatriculaAluno1 = listaMatricula[0].MatriculaMestre.NumMatricula;
                mvbBase.Ano         = listaMatricula[0].MatriculaMestre.Ano.Value.ToString();
                mvbBase.SerieAluno += listaMatricula[0].MatriculaMestre.Aluno.SerieAtual;
                mvbBase.Valor      += listaMatricula[0].MatriculaMestre.Valor.Value;
                mvbBase.Vencimento  = new DateTime(DateTime.Now.Year, 1, listaMatricula[0].MatriculaMestre.DiaVencimento.Value);

                if (listaMatricula.Count == 2)
                {
                    mvbBase.NomeAluno2            = listaMatricula[0].MatriculaDependente.Aluno.Nome;
                    mvbBase.NumeroMatriculaAluno2 = listaMatricula[0].MatriculaDependente.NumMatricula;
                    mvbBase.NomeAluno3            = listaMatricula[1].MatriculaDependente.Aluno.Nome;
                    mvbBase.NumeroMatriculaAluno3 = listaMatricula[1].MatriculaDependente.NumMatricula;
                }
                else if (listaMatricula.Count == 1 && listaMatricula[0].MatriculaDependente != null && listaMatricula[0].MatriculaDependente.AlunoID.Value != 0)
                {
                    mvbBase.NomeAluno2            = listaMatricula[0].MatriculaDependente.Aluno.Nome;
                    mvbBase.NumeroMatriculaAluno2 = listaMatricula[0].MatriculaDependente.NumMatricula;
                    mvbBase.NomeAluno3            = "";
                    mvbBase.NumeroMatriculaAluno3 = "";
                }
                else if (listaMatricula[0].MatriculaDependente == null)
                {
                    mvbBase.NomeAluno2            = "";
                    mvbBase.NumeroMatriculaAluno2 = "";
                    mvbBase.NomeAluno3            = "";
                    mvbBase.NumeroMatriculaAluno3 = "";
                }

                foreach (MatriculaVinculo mv in listaMatricula)
                {
                    if (mv.MatriculaDependente != null)
                    {
                        mvbBase.SerieAluno += ", " + mv.MatriculaDependente.Aluno.SerieAtual;
                        mvbBase.Valor      += mv.MatriculaDependente.Valor.Value;
                    }
                }

                MatriculaVinculoBoleto mvbMes;
                for (int i = 0; i < 12; i++)
                {
                    mvbMes = new MatriculaVinculoBoleto();

                    mvbMes.NomeAluno1 = mvbBase.NomeAluno1;
                    mvbMes.NomeAluno2 = mvbBase.NomeAluno2;
                    mvbMes.NomeAluno3 = mvbBase.NomeAluno3;

                    mvbMes.NumeroMatriculaAluno1 = mvbBase.NumeroMatriculaAluno1;
                    mvbMes.NumeroMatriculaAluno2 = mvbBase.NumeroMatriculaAluno2;
                    mvbMes.NumeroMatriculaAluno3 = mvbBase.NumeroMatriculaAluno3;

                    mvbMes.Ano        = mvbBase.Ano;
                    mvbMes.SerieAluno = mvbBase.SerieAluno;
                    mvbMes.Valor      = mvbBase.Valor;
                    mvbMes.Vencimento = mvbBase.Vencimento.AddMonths(i);

                    mvbMes.Parcela = meses[i];
                    resultado.Add(mvbMes);
                }
            }


            return((DataTable)resultado);
        }
Ejemplo n.º 12
0
        //public void CreateUser(int subscriberId, string subscriberUniqueId, string userTeamSpeakClientUniqueId)
        //{
        //    CreateUser(subscriberId, subscriberUniqueId, userTeamSpeakClientUniqueId, null, null);
        //}

        public void UserInitialize(CoreList CoreList)
        {
            
        }