Exemplo n.º 1
0
        public ExtensionForm()
        {
            _module = this;
            _unknownDataAttributes = new List <DataCaptureAttribute>();
            _inDataAttributes      = new Dictionary <ushort, List <DataCaptureAttribute> >();
            _outDataAttributes     = new Dictionary <ushort, List <DataCaptureAttribute> >();

            Triggers = new HTriggers();
            foreach (MethodInfo method in GetAllMethods(GetType()))
            {
                foreach (var dataCaptureAtt in method.GetCustomAttributes <DataCaptureAttribute>())
                {
                    if (dataCaptureAtt == null)
                    {
                        continue;
                    }

                    dataCaptureAtt.Method = method;
                    if (_unknownDataAttributes.Any(dca => dca.Equals(dataCaptureAtt)))
                    {
                        continue;
                    }

                    dataCaptureAtt.Target = this;
                    if (dataCaptureAtt.Id != null)
                    {
                        AddCallback(dataCaptureAtt, (ushort)dataCaptureAtt.Id);
                    }
                    else
                    {
                        _unknownDataAttributes.Add(dataCaptureAtt);
                    }
                }
            }

            if (Installer == null && IsRemoteModule)
            {
                _remoteContractor = GetRemoteContractor();
                if (_remoteContractor != null)
                {
                    _connection           = new ContractorProxy(_remoteContractor);
                    _initializationSource = new TaskCompletionSource <bool>();

                    Task receiveRemContDataTask = ReceiveRemoteContractorDataAsync();

                    RequestRemoteContractorData();
                    _initializationSource.Task.Wait();
                    _initializationSource = null;
                }
            }
        }
Exemplo n.º 2
0
        public Contractor(IHConnection connection, HGameData gameData)
        {
            _connection = connection;

            _extensions = new List <IExtension>();
            Extensions  = new ReadOnlyCollection <IExtension>(_extensions);

            _extensionsRunning = new List <IExtension>();
            ExtensionsRunning  = new ReadOnlyCollection <IExtension>(_extensionsRunning);

            GameData = gameData;
            if (connection != null && !string.IsNullOrEmpty(connection.Host))
            {
                Hotel = SKore.ToHotel(connection.Host);
            }
        }
Exemplo n.º 3
0
        public Form()
        {
            InitializeComponent();
            wiredEffectData    = this.In.WiredEffectData;
            wiredTriggerData   = this.In.WiredTriggerData;
            wiredSaved         = this.In.WiredSaved;
            wiredConditionData = this.In.WiredConditionData;
            connection         = this.Connection;

            wireds.Add("showMessage", new ShowMessageEffect());
            wireds.Add("moveAndRotate", new MoveAndRotateFurniEffect());
            wireds.Add("teleportToFurni", new TeleportToFurni());
            wireds.Add("toggleFurni", new ToggleFurniStateEffect());
            wireds.Add("timerReset", new TimerResetEffect());
            wireds.Add("givePoints", new GivePointsEffect());
            wireds.Add("matchFurni", new MatchFurniToPositionStateEffect());
            wireds.Add("botWhispers", new BotTalksToUserEffect());
            wireds.Add("botTalks", new BotTalkToAllEffect());
            wireds.Add("userSays", new UserSaysTrigger());
        }
Exemplo n.º 4
0
 public Contractor(IHConnection connection)
 {
     _connection = connection;
     _extensions = new List <IExtension>();
 }