Exemplo n.º 1
0
 public RemotingSession(uint id, uint functionId, Remoting remoting, IBytesPool bytesPool)
 {
     this.Id         = id;
     this.FunctionId = functionId;
     _remoting       = remoting;
     _bytesPool      = bytesPool;
 }
Exemplo n.º 2
0
        private void MainWindow_OnActivated(object sender, EventArgs e)
        {
            if (FirstTimeActivated)
            {
                FirstTimeActivated = false;

                var allAssemblies = new List <LeagueSharpAssembly>();
                foreach (var profile in Config.Instance.Profiles)
                {
                    allAssemblies.AddRange(profile.InstalledAssemblies);
                }

                allAssemblies = allAssemblies.Distinct().ToList();

                GitUpdater.ClearUnusedRepos(allAssemblies);
                PrepareAssemblies(allAssemblies, Config.Instance.FirstRun || Config.Instance.UpdateOnLoad, true, true);
                Remoting.Init();
            }

            var text = Clipboard.GetText();

            if (text.StartsWith(LSUriScheme.FullName))
            {
                Clipboard.SetText("");
                LSUriScheme.HandleUrl(text, this);
            }
        }
Exemplo n.º 3
0
 void Remoting.ICore.AssignBinder(Remoting.ISoulBinder binder)
 {
     if (_Center != null)
     {
         _Join(binder);
     }
 }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // create flutter view host
            var flutterView = Flutter.Bindings.Flutter.CreateView(this, this.Lifecycle, "home");
            var layout      = new FrameLayout.LayoutParams(600, 800)
            {
                LeftMargin = 200, TopMargin = 400
            };

            // setup Autofac
            var cb = new ContainerBuilder();

            cb.RegisterType <TestService>().As <ITestService>();
            var container = cb.Build();

            // create the service factory
            var serviceFactory = new AutofacServiceFactory(container, new TypeResolver());
            // create the remoting instance
            var remotingInstance = Remoting.Create <FlutterView, PlatformChannelsHandler>(serviceFactory);

            // and tell Flutter that 'we are listening'
            remotingInstance.Start(flutterView);

            AddContentView(flutterView, layout);
        }
Exemplo n.º 5
0
 public Adventure(Adventurer adventurer, Remoting.ISoulBinder binder, IZone zone)
 {
     _Adventurer = adventurer;
     _Zone = zone;
     this._Binder = binder;
     _Squad = new Squad(adventurer.Formation ,_Adventurer.Teammates, _Adventurer.Controller);
 }
Exemplo n.º 6
0
 public User(Remoting.ISoulBinder binder , IStorage storage)
 {
     _Machine = new Utility.StageMachine();
     this._Binder = binder;
     _Account = new Data.Account();
     _Storage = storage;
 }
Exemplo n.º 7
0
 public User(Remoting.ISoulBinder binder, IStorage _Storage , Zone zone)
 {
     this._Binder = binder;
     _Zone = zone;
     _Binder.BreakEvent += _Break;
     this._Storage = _Storage;
     _Machine = new Regulus.Utility.StageMachine();
 }
Exemplo n.º 8
0
        public Adventure(ActorInfomation actor_infomation , Remoting.ISoulBinder binder, IMap zone)
        {
            _ActorInfomation = actor_infomation;
            _Map = zone;

            this._Binder = binder;

            _Entity = new Entity(_ActorInfomation.Id);
        }
Exemplo n.º 9
0
 public User(Remoting.ISoulBinder provider, Regulus.Project.SamebestKeys.UserRoster user_roster, IWorld world , IStorage storage)
 {
     _Storage = storage;
     _UserRoster = user_roster;
     _Machine = new Regulus.Game.StageMachine<User>(this);
     Provider = provider;
     provider.BreakEvent += Quit;
     _World = world;
 }
Exemplo n.º 10
0
 public InterQStandalone()
 {
     T.DefaultContext.OutputRedirect += DefaultContext_OutputRedirect;
     InitializeComponent();
     //CheckForIllegalCrossThreadCalls = false;
     numericUpDown1.Value = T.DefaultContext.CurrentLevel;
     T.INFO("--- INTER-QUEUES STANDALONE INICIADO --");
     Remoting.DumpAllInfoAboutRegisteredRemotingTypes();
 }
Exemplo n.º 11
0
    public static int Helper(string socketPath)
    {
        DoSomething self = new DoSomething();

        Remoting.Publish(socketPath, self);

        Thread.Sleep(Timeout.Infinite);
        return(0);
    }
Exemplo n.º 12
0
        public User(Remoting.ISoulBinder provider, IWorld world , IStorage storage)
        {
            _Storage = storage;

            _Machine = new Regulus.Utility.StageMachine();
            Provider = provider;
            provider.BreakEvent += Quit;
            _World = world;
        }
Exemplo n.º 13
0
        private Scene _Create(Data.Scene realm, Remoting.Time time)
        {
            var instance = new Generator(realm).Create();

            if (realm.Singleton)
            {
                _Register(instance ,  realm.Name);
            }
            return instance;
        }
Exemplo n.º 14
0
 private void _BroadcastBattler(Remoting.Value<IBattleAdmissionTickets> value, Guid[] battlers)
 {
     value.OnValue += (battle_admission_tickets) =>
     {
         foreach (var battler in battlers)
         {
             _BattleEvent(battler , battle_admission_tickets);
         }
     };
 }
Exemplo n.º 15
0
        public Scene(Team team, Zone zone, Remoting.Time time , bool need_recovery)
        {
            _Team = team;
            _Id = Guid.NewGuid();
            this._Zone = zone;
            this._Time = time;

            _Updater = new Utility.Updater();
            _NeedRecover = need_recovery;
        }
Exemplo n.º 16
0
        public ActorCast(Serializable.Skill skill, ActorPropertyAbility actor, Remoting.Value<CastResult> return_value)
        {
            _Actor = actor;
            this._Skill = skill;

            this._ReturnValue = return_value;
            _Done = false;
            _Machine = new Utility.StageMachine();
            _Step = CastStep.NotYet;
        }
Exemplo n.º 17
0
        private void InitSystem()
        {
            PathRandomizer.CopyFiles();
            Remoting.Init();

            this.InjectThread = new Thread(
                () =>
            {
                var trigger = new EdgeTrigger();

                trigger.Rising += (sender, args) =>
                {
                    Application.Current.Dispatcher.InvokeAsync(
                        () =>
                    {
                        this.icon_connected.Visibility    = Visibility.Visible;
                        this.icon_disconnected.Visibility = Visibility.Collapsed;
                    });
                };

                trigger.Falling += (sender, args) =>
                {
                    Application.Current.Dispatcher.InvokeAsync(
                        async() =>
                    {
                        this.icon_connected.Visibility    = Visibility.Collapsed;
                        this.icon_disconnected.Visibility = Visibility.Visible;
                        await this.UpdateAccount();
                    });
                };

                while (true)
                {
                    try
                    {
                        Thread.Sleep(3000);

                        if (Config.Instance.Install)
                        {
                            Injection.Pulse();
                            trigger.Value = Injection.IsInjected;

                            Console.WriteLine(Injection.SharedMemory.Data.IsLoaded);
                        }
                    }
                    catch
                    {
                        // ignored - A task was canceled.
                    }
                }
            });

            this.InjectThread.SetApartmentState(ApartmentState.STA);
            this.InjectThread.Start();
        }
Exemplo n.º 18
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Settings storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue("Uuid", Uuid);
            storage.SetValue("Address", Address.To <string>());
            storage.SetValue("Login", Login);
            storage.SetValue("Password", Password);
            storage.SetValue("Remoting", Remoting.To <string>());
            storage.SetValue("UseNativeReconnect", UseNativeReconnect);
            storage.SetValue("EnableOECLogging", EnableOECLogging);
        }
        private void OnLogin(string username)
        {
            Utility.Log(LogStatus.Ok, "Login", string.Format("Succesfully signed in as {0}", username), Logs.MainLog);
            this.Browser.Visibility    = Visibility.Visible;
            this.TosBrowser.Visibility = Visibility.Visible;

            try
            {
                Utility.MapClassToXmlFile(typeof(Config), Config.Instance, Directories.ConfigFilePath);
            }
            catch
            {
                MessageBox.Show(Utility.GetMultiLanguageText("ConfigWriteError"));
            }

            if (!PathRandomizer.CopyFiles())
            {
            }

            Remoting.Init();

            this.InjectThread = new Thread(
                () =>
            {
                while (true)
                {
                    if (Config.Instance.Install)
                    {
                        Injection.Pulse();
                    }

                    Application.Current.Dispatcher.Invoke(
                        () =>
                    {
                        if (Injection.IsInjected)
                        {
                            this.icon_connected.Visibility    = Visibility.Visible;
                            this.icon_disconnected.Visibility = Visibility.Collapsed;
                        }
                        else
                        {
                            this.icon_connected.Visibility    = Visibility.Collapsed;
                            this.icon_disconnected.Visibility = Visibility.Visible;
                        }
                    });

                    Thread.Sleep(3000);
                }
            });

            this.InjectThread.SetApartmentState(ApartmentState.STA);
            this.InjectThread.Start();
        }
Exemplo n.º 20
0
 private void RequestID()
 {
     try
     {
         clientTcp    = new ClientTcp();
         req          = Activator.GetObject(typeof(Remoting), "tcp://localhost:1000/TakeID") as Remoting;
         clientTcp.ID = req.GetID();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 21
0
 public CrossStage(Remoting.ISoulBinder provider 
                 , Regulus.Project.SamebestKeys.IWorld world
                 , string target_map
                 , Regulus.CustomType.Vector2 target_position
                 , string current_map
                 , Regulus.CustomType.Vector2 current_position)
 {
     this._World = world;
     this._TargetMap = target_map;
     this._TargetPosition = target_position;
     this._CurrentMap = current_map;
     this._CurrentPosition = current_position;
     _Provider = provider;
 }
Exemplo n.º 22
0
    public static int Run()
    {
        DoSomething doSomething;
        TimeSpan    time;

        Console.WriteLine("Measuring remote");
        using (Remoting helper = new Remoting()) {
            helper.Start("RemotingHelper.exe", helper.SocketPath);
            doSomething = helper.Get <DoSomething>();
            time        = Do(doSomething);
        }
        Console.WriteLine("Elapsed (remote): {0}", time);

        Console.WriteLine("Measuring local");
        doSomething = new DoSomething();
        time        = Do(doSomething);
        Console.WriteLine("Elapsed (local): {0}", time);
        return(0);
    }
Exemplo n.º 23
0
        public void ApplyMachineInformation(string ipAddress, Remoting.Server.Data.Transfer.Machine machine)
        {
            if (ipAddress.Equals("localhost"))
                ipAddress = Instances.Single(i => i.MachineName.Equals(Environment.MachineName)).IpAddress;

            Instance instance = Instances.SingleOrDefault(i => i.IpAddress.Equals(ipAddress));
            if (instance != null)
                instanceMachines[instance] = machine;

            TreeNode[] nodes = treeView1.Nodes[0].Nodes.Find(ipAddress, false);
            if (nodes.Length > 0)
            {
                if ((machine.TotalSha256Hashrate > 0) && (machine.TotalScryptHashrate > 0))
                {
                    nodes[0].Text = String.Format("{0} ({1}, {2})",
                        GetMachineName(ipAddress),
                        machine.TotalSha256Hashrate.ToHashrateString(),
                        machine.TotalScryptHashrate.ToHashrateString());
                }
                else if (machine.TotalSha256Hashrate > 0)
                {
                    nodes[0].Text = String.Format("{0} ({1})",
                        GetMachineName(ipAddress),
                        machine.TotalSha256Hashrate.ToHashrateString());
                }
                else if (machine.TotalScryptHashrate > 0)
                {
                    nodes[0].Text = String.Format("{0} ({1})",
                        GetMachineName(ipAddress),
                        machine.TotalScryptHashrate.ToHashrateString());
                }
                else
                {
                    nodes[0].Text = GetMachineName(ipAddress);
                }
            }

            RefreshNetworkTotals();
        }
Exemplo n.º 24
0
        private void InitSystem()
        {
            PathRandomizer.CopyFiles();
            Remoting.Init();

            this.InjectThread = new Thread(
                () =>
            {
                while (true)
                {
                    if (Config.Instance.Install)
                    {
                        Injection.Pulse();
                    }

                    Application.Current.Dispatcher.Invoke(
                        () =>
                    {
                        if (Injection.IsInjected)
                        {
                            this.icon_connected.Visibility    = Visibility.Visible;
                            this.icon_disconnected.Visibility = Visibility.Collapsed;
                        }
                        else
                        {
                            this.icon_connected.Visibility    = Visibility.Collapsed;
                            this.icon_disconnected.Visibility = Visibility.Visible;
                        }
                    });

                    Thread.Sleep(3000);
                }
            });

            this.InjectThread.SetApartmentState(ApartmentState.STA);
            this.InjectThread.Start();
        }
Exemplo n.º 25
0
        public void ApplyMachineInformation(string ipAddress, Remoting.Data.Transfer.Machine machine)
        {
            if (ipAddress.Equals("localhost"))
                ipAddress = ThisPCInstance.IpAddress;

            Instance instance = Instances.SingleOrDefault(i => i.IpAddress.Equals(ipAddress));
            if (instance != null)
            {
                instanceUpdateDates[instance] = DateTime.Now;
                instanceMachines[instance] = machine;
            }

            TreeNode[] nodes = treeView1.Nodes[0].Nodes.Find(ipAddress, false);
            if (nodes.Length > 0)
            {
                if (machine.TotalHashrates.Keys.Count > 0)
                {
                    string text = String.Empty;
                    foreach (string algorithm in machine.TotalHashrates.Keys)
                    {
                        if (!String.IsNullOrEmpty(text))
                            text = text + ", ";
                        text = String.Format("{0}{1}: {2}", text, algorithm, machine.TotalHashrates[algorithm].ToHashrateString());
                    }
                    nodes[0].Text = String.Format("{0} ({1})", GetMachineName(ipAddress), text);
                }
                else
                {
                    nodes[0].Text = GetMachineName(ipAddress);
                }
            }

            RemoveOrphans();

            RefreshNetworkTotals();
        }
Exemplo n.º 26
0
        private void _Bind(Player player, Remoting.ISoulBinder binder)
        {
            binder.Bind<IPlayer>(player);

            var observe = player.FindAbility<IObserveAbility>();
            if (observe != null)
            {
                _ObservedInto = (observed) =>
                {
                    binder.Bind<IObservedAbility>(observed);
                    _Observeds.Add(observed);
                };

                _ObservedLeft = (observed) =>
                {
                    _Observeds.Remove(observed);
                    binder.Unbind<IObservedAbility>(observed);
                };

                observe.IntoEvent += _ObservedInto;
                observe.LeftEvent += _ObservedLeft;
            }
            binder.Bind<Regulus.Remoting.ITime>(LocalTime.Instance);

            binder.Bind<IRealmJumper>(this);
        }
Exemplo n.º 27
0
            public IRemoting Create(IConnection connection, IRemotingMessengerFactory messengerFactory, IRemotingFunctionFactory functionFactory, IBytesPool bytesPool)
            {
                var result = new Remoting(connection, messengerFactory, functionFactory, bytesPool);

                return(result);
            }
Exemplo n.º 28
0
        private void SetConfigurationRequested(object sender, Remoting.ConfigurationEventArgs ea)
        {
            PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
            {
                string oldConfigPath = PathConfiguration.SharedConfigPath;

                if (ea.Application != null)
                {
                    ObjectCopier.CopyObject(ea.Application.ToModelObject(), ApplicationConfiguration);
                    ApplicationConfiguration.SaveApplicationConfiguration();
                }

                if (ea.Engine != null)
                {
                    ObjectCopier.CopyObject(ea.Engine.ToModelObject(), EngineConfiguration);
                    EngineConfiguration.SaveAllConfigurations();
                }

                if (ea.Path != null)
                {
                    ObjectCopier.CopyObject(ea.Path, PathConfiguration);
                    PathConfiguration.SavePathConfiguration();
                }

                if (ea.Perks != null)
                {
                    ObjectCopier.CopyObject(ea.Perks, PerksConfiguration);
                    PerksConfiguration.SavePerksConfiguration();
                }

                //save settings as the "shared" config path may have changed
                //these are settings not considered machine/device-specific
                //e.g. no device settings, no miner settings
                string newConfigPath = PathConfiguration.SharedConfigPath;
                MigrateSettingsToNewFolder(oldConfigPath, newConfigPath);

                Context.BeginInvoke((Action)(() =>
                {
                    //code to update UI
                    LocalViewModel.ApplyCoinConfigurationModels(EngineConfiguration.CoinConfigurations);
                    LocalViewModel.ApplyDeviceConfigurationModels(EngineConfiguration.DeviceConfigurations,
                        EngineConfiguration.CoinConfigurations);
                    if (ConfigurationModified != null) ConfigurationModified(this, new EventArgs());
                }), null);
            });
        }
Exemplo n.º 29
0
 private void GetConfigurationRequested(object sender, Remoting.ConfigurationEventArgs ea)
 {
     PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
     {
         ObjectCopier.CopyObject(ApplicationConfiguration.ToTransferObject(), ea.Application);
         ObjectCopier.CopyObject(EngineConfiguration.ToTransferObject(), ea.Engine);
         ObjectCopier.CopyObject(PathConfiguration, ea.Path);
         ObjectCopier.CopyObject(PerksConfiguration, ea.Perks);
     });
 }
Exemplo n.º 30
0
        public void PopulateLocalMachineHashrates(Remoting.Data.Transfer.Machine machine, bool includeNetworkDevices)
        {
            machine.TotalScryptHashrate = GetLocalInstanceHashrate(AlgorithmNames.Scrypt, includeNetworkDevices);
            machine.TotalSha256Hashrate = GetLocalInstanceHashrate(AlgorithmNames.SHA256, includeNetworkDevices);

            IList<CoinAlgorithm> algorithms = MinerFactory.Instance.Algorithms;
            foreach (CoinAlgorithm algorithm in algorithms)
            {
                double hashrate = GetLocalInstanceHashrate(algorithm.Name, includeNetworkDevices);
                if (hashrate > 0.00)
                    machine.TotalHashrates[algorithm.Name] = hashrate;
            }
        }
Exemplo n.º 31
0
        private void HandlePacketReceived(object sender, Remoting.Server.Broadcast.PacketReceivedArgs ea)
        {
            Type type = typeof(Remoting.Server.Data.Transfer.Machine);
            if (ea.Packet.Descriptor.Equals(type.FullName))
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                Remoting.Server.Data.Transfer.Machine dto = serializer.Deserialize<Remoting.Server.Data.Transfer.Machine>(ea.Packet.Payload);

                BeginInvoke((Action)(() =>
                {
                    //code to update UI
                    instancesControl.ApplyMachineInformation(ea.IpAddress, dto);
                }));
            }
        }
Exemplo n.º 32
0
        private void HandlePacketReceived(object sender, Remoting.Broadcast.PacketReceivedArgs ea)
        {
            Type type = typeof(Remoting.Data.Transfer.Machine);
            if (ea.Packet.Descriptor.Equals(type.FullName))
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                Remoting.Data.Transfer.Machine dto = serializer.Deserialize<Remoting.Data.Transfer.Machine>(ea.Packet.Payload);

                if ((instancesControl.ThisPCInstance != null) &&
                    (instancesControl.ThisPCInstance.IpAddress.Equals(ea.IpAddress)))
                    //don't process packets broadcast by This PC
                    //for instance we don't broadcast out hashrate for Network Devices and
                    //so don't want to process the packet
                    return;

                BeginInvoke((Action)(() =>
                {
                    //code to update UI
                    instancesControl.ApplyMachineInformation(ea.IpAddress, dto);
                }));
            }
        }
Exemplo n.º 33
0
 private void SetConfigurationRemotely(
     Instance instance,
     Remoting.Data.Transfer.Configuration.Application application,
     Remoting.Data.Transfer.Configuration.Engine engine,
     Remoting.Data.Transfer.Configuration.Path path,
     Remoting.Data.Transfer.Configuration.Perks perks)
 {
     PerformRemoteCommand(instance, (service) =>
     {
         service.SetApplicationConfiguration(
             GetSendingSignature(instance),
             application,
             engine,
             path,
             perks);
     });
 }
Exemplo n.º 34
0
        private void _Unbind(Player player, Remoting.ISoulBinder binder)
        {
            binder.Unbind<IRealmJumper>(this);

            binder.Unbind<Regulus.Remoting.ITime>(LocalTime.Instance);

            var observe = player.FindAbility<IObserveAbility>();
            if (observe != null)
            {
                observe.IntoEvent -= _ObservedInto;
                observe.LeftEvent -= _ObservedLeft;
            }
            foreach (var o in _Observeds)
            {
                binder.Unbind<IObservedAbility>(o);
            }

            binder.Unbind<IPlayer>(player);
        }
Exemplo n.º 35
0
 void Utility.ICore.ObtainController(Remoting.ISoulBinder binder)
 {
     _Hall.PushUser(new User(binder, _Stroage));
 }
Exemplo n.º 36
0
 private void button1_Click(object sender, EventArgs e)
 {
     T.MARK(" ------------ INTER-QUEUES STANDALONE MARK {0} ------------ ", mark_cnt++);
     Remoting.DumpAllInfoAboutRegisteredRemotingTypes();
 }
Exemplo n.º 37
0
 void Game.ICore.ObtainController(Remoting.ISoulBinder binder)
 {
     _Complex.ObtainController(binder);
 }
Exemplo n.º 38
0
 public static Remoting GetInstance()
 {
     if (_theUniqueInstance == null)
         return _theUniqueInstance = new Remoting();
     return _theUniqueInstance;
 }
Exemplo n.º 39
0
 public RemotingMessageReceiver(Remoting remoting)
 {
     _remoting = remoting;
 }
Exemplo n.º 40
0
 public VerifyStage(Remoting.ISoulBinder binder, Verify verify)
 {
     this._Verify = verify;
     this._Binder = binder;
 }
Exemplo n.º 41
0
        private void PopulateLocalMachineHashrates(Remoting.Data.Transfer.Machine machine, bool includeNetworkDevices)
        {
            machine.TotalScryptHashrate = GetLocalInstanceHashrate(CoinAlgorithm.Scrypt, includeNetworkDevices);
            machine.TotalSha256Hashrate = GetLocalInstanceHashrate(CoinAlgorithm.SHA256, includeNetworkDevices);

            IList<CoinAlgorithm> algorithms = ((CoinAlgorithm[])Enum.GetValues(typeof(CoinAlgorithm))).ToList();
            foreach (CoinAlgorithm algorithm in algorithms)
            {
                double hashrate = GetLocalInstanceHashrate(algorithm, includeNetworkDevices);
                if (hashrate > 0.00)
                    machine.TotalHashrates[algorithm.ToString()] = hashrate;
            }
        }
Exemplo n.º 42
0
 public VerifyStage(Remoting.ISoulBinder binder , IStorage storage)
 {
     this._Binder = binder;
     _Storage = storage;
 }
Exemplo n.º 43
0
 public SkillHitToIdleBehaviorHandler(Entity entity, Remoting.Value<CastResult> result)
 {
     this._Entity = entity;
     this._Result = result;
 }
Exemplo n.º 44
0
        public Battle(IBattleAdmissionTickets battle_admission_tickets, ActorInfomation actor_infomation, Remoting.ISoulBinder binder, IStorage stroage)
        {
            _BattleAdmissionTickets = battle_admission_tickets;
            _ActorInfomation = actor_infomation;
            _Binder = binder;

            _Storage = stroage;
        }