Exemple #1
0
        private GService(IExtension container, GService parent, IPEndPoint moduleServer)
        {
            _container             = container ?? this;
            _unknownDataAttributes = parent?._unknownDataAttributes ?? new List <DataCaptureAttribute>();
            _inDataAttributes      = parent?._inDataAttributes ?? new Dictionary <ushort, List <DataCaptureAttribute> >();
            _outDataAttributes     = parent?._outDataAttributes ?? new Dictionary <ushort, List <DataCaptureAttribute> >();

            _extensionEvents = new Dictionary <ushort, Action <HPacket> >
            {
                [1] = _container.OnDoubleClick,
                [2] = _container.OnInfoRequest,
                [3] = _container.OnPacketIntercept,
                [4] = _container.OnFlagsCheck,
                [5] = _container.OnConnected,
                [6] = _container.OnDisconnected,
                [7] = _container.OnInitialized
            };

            _entities = new ConcurrentDictionary <int, HEntity>();
            Entities  = new ReadOnlyDictionary <int, HEntity>(_entities);

            _wallItems = new ConcurrentDictionary <int, HWallItem>();
            WallItems  = new ReadOnlyDictionary <int, HWallItem>(_wallItems);

            _floorItems = new ConcurrentDictionary <int, HFloorItem>();
            FloorItems  = new ReadOnlyDictionary <int, HFloorItem>(_floorItems);

            if (LicenseManager.UsageMode != LicenseUsageMode.Runtime)
            {
                return;
            }
            foreach (MethodInfo method in _container.GetType().GetAllMethods())
            {
                foreach (var dataCaptureAtt in method.GetCustomAttributes <DataCaptureAttribute>())
                {
                    dataCaptureAtt.Method = method;
                    if (_unknownDataAttributes.Any(dca => dca.Equals(dataCaptureAtt)))
                    {
                        continue;
                    }

                    dataCaptureAtt.Target = _container;
                    if (dataCaptureAtt.Id != null)
                    {
                        AddCallback(dataCaptureAtt, (ushort)dataCaptureAtt.Id);
                    }
                    else
                    {
                        _unknownDataAttributes.Add(dataCaptureAtt);
                    }
                }
            }
            _installer = HNode.ConnectNewAsync(moduleServer ?? DefaultModuleServer).GetAwaiter().GetResult();
            if (_installer == null)
            {
                OnCriticalError("Connection failed"); return;
            }
            Task handleInstallerDataTask = HandleInstallerDataAsync();
        }
Exemple #2
0
 public ConsoleBot(GService ExtensionChild, string BotName, string BotMotto = "Console bot.", string BotLook = "hd-3704-29.ch-3135-95.lg-3136-95", string BotBadges = "BOT FR17A NO83 ITB26 NL446", string BotCreationDate = "W-W-1984", string BotCreatorName = "Lilith", string BotCreatorLook = "hr-3870-45.hd-600-10.ch-665-71.lg-3781-100-71.ha-3614-91-95.he-3469-1412.fa-3276-1412.ca-3702-71-71")
 {
     {
         this.ExtensionChild = ExtensionChild;
         this.ExtensionChild.OnDataInterceptEvent += ExtensionChild_OnDataInterceptEvent;
         this.BotName         = BotName;
         this.BotMotto        = BotMotto;
         this.BotLook         = BotLook;
         this.BotBadges       = BotBadges;
         this.BotCreationDate = BotCreationDate;
         this.BotCreatorName  = BotCreatorName;
         this.BotCreatorLook  = BotCreatorLook;
     }
 }
Exemple #3
0
 protected GService(GService parent, IPEndPoint moduleServer)
     : this(null, parent, moduleServer)
 {
 }
Exemple #4
0
 protected GService(GService parent)
     : this(null, parent, null)
 {
 }