public void HandleMain(string argument, bool antenna)
            {
                string[] split;
                long     messageSource = 0;

                if (antenna && acpWrapper != null)
                {
                    split = acpWrapper.Main(argument, out messageSource);
                }
                else
                {
                    split = argument.Split('|');
                }

                if (split.Count() < 1)
                {
                    return;
                }

                Action <List <string>, long> action;

                if (commands.TryGetValue(split[0], out action))
                {
                    action?.Invoke(split.ToList(), messageSource);
                }
            }
예제 #2
0
        public void SubMain(string args, UpdateType uType)
        {
            //Initialize
            if (!initializer.MoveNext())
            {
                initializer.Dispose();
            }
            else
            {
                return;
            }

            //Parse regular commands
            if (!ParseCommands(args))
            {
                //Parse Messages
                long     senderId;
                string[] messages = antennaComms.Main(args, out senderId);
                if (messages != null)
                {
                    ParseMessages(messages, senderId);
                }
            }


            if (currentMode == CurrentSystemMode.Automatic)
            {
                missileCoordination.Main(uType);
                turretMonitor.SlowScan();
            }

            if ((uType & UpdateType.Update10) != 0)
            {
                EveryTenTick();
            }
            if ((uType & UpdateType.Update100) != 0)
            {
                EveryHundredTick();
            }
        }
예제 #3
0
        void SubMain(string args, UpdateType uType)
        {
            if (!initializer.MoveNext())
            {
                initializer.Dispose();
            }
            else
            {
                return;
            }

            //Parse messages
            if (messages != null)
            {
                ParseMessages(messages, senderId);
            }

            //Parse commands
            if (!ParseCommands(args))
            {
                //Get Messages
                messages = antennaComms.Main(args, out senderId);
            }



            if ((uType & UpdateType.Update1) != 0)
            {
                EveryTick();
            }
            if ((uType & UpdateType.Update10) != 0)
            {
                EveryTenTick();
            }
            if ((uType & UpdateType.Update100) != 0)
            {
                EveryHundredTick();
            }
        }