Пример #1
0
        // Initialise the remoting connection with http channel with binary formatter
        public bool RemotingConnection()
        {
            if (!_exist)
            {
                HttpChannel channel = null;
                try
                {
                    IDictionary props = new Hashtable();
                    props["port"] = TechnicalSettings.RemotingServerPort;
                    props.Add("typeFilterLevel", TypeFilterLevel.Full);
                    //props.Add("timeout", 2000);
                    BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
                    channel = new HttpChannel(props, clientProvider, null);
                    ChannelServices.RegisterChannel(channel, false);

                    //TcpChannel channel = new TcpChannel();
                    //ChannelServices.RegisterChannel(channel, true);
                    var server = string.Format("http://{0}:{1}/RemoteOperation", TechnicalSettings.RemotingServer,
                                               TechnicalSettings.RemotingServerPort);

                    _remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation), server);
                    _exist           = _remoteOperation.TestRemoting();

                    //ChannelServices.GetChannelSinkProperties(_remoteOperation)["timeout"] = 0;
                }
                catch (Exception e)
                {
                    _remotingUniqueInstance = null;
                    ChannelServices.UnregisterChannel(channel);
                    throw;
                }
            }
            return(true);
        }
Пример #2
0
 public MagicMenuState()
 {
     _remote = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                     "tcp://localhost:2345/RemoteOperation");
     atBegin   = true;
     this.Name = "magic";
 }
Пример #3
0
 public ObjectMenuState()
 {
     _remote = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                     "tcp://localhost:2345/RemoteOperation");
     atBegin = true;
     previousTimeStampHand = 0;
     this.Name             = "object menu";
 }
Пример #4
0
 public FightState()
 {
     this.handRaised = false;
     this._remote    = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                             "tcp://localhost:2345/RemoteOperation");
     this.shoulderCenter = -42;
     this.crouched       = false;
     this.Name           = "fight";
 }
Пример #5
0
 public SkillMenuState()
 {
     this._remote = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                          "tcp://localhost:2345/RemoteOperation");
     this.previousTimeStamp = 0;
     this.rightPressed      = false;
     this.leftPressed       = false;
     this.Name = "skill menu";
 }
Пример #6
0
 public MenuTabState()
 {
     _remote = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                     "tcp://localhost:2345/RemoteOperation");
     selected = new bool[4] {
         false, false, false, false
     };
     this.Name = "menu";
 }
Пример #7
0
        public SpeechRecognition()
        {
            //on prend le client
            _remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                                     "tcp://localhost:2345/RemoteOperation");

            _profileWords = new Dictionary <String, IMode>();

            //Load plugins
            ModeLoader modeLoader = new ModeLoader(Properties.Resources.pluginFolder);

            foreach (IMode m in modeLoader.getListMode())
            {
                //on prend le nom du plugin + son instance
                _profileWords.Add(m.getModeName(), m);
            }
        }
Пример #8
0
        public void Start()
        {
            //Creation du channel de communication
            TcpChannel channel = new TcpChannel();

            _remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                                     "tcp://localhost:" + port + "/RemoteOperation");

            //Demarre la configuration de la kinect
            if (SetupKinect())
            {
                _remoteOperation.message("Le client a démarré avec succés");
                Execute();
            }
            else
            {
                // Environment.Exit(1);
            }
        }
Пример #9
0
 public SkeletTracking()
 {
     _remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                              "tcp://localhost:1069/RemoteOperation");
 }
Пример #10
0
 public IMode()
 {
     remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation),
                                                             "tcp://localhost:2345/RemoteOperation");
     keysPress = new List <VirtualKeyCode>();
 }
Пример #11
0
        // Initialise the remoting connection with http channel with binary formatter
        public bool RemotingConnection()
        {
            if (!_exist)
            {

                HttpChannel channel = null;
                try
                {
                    IDictionary props = new Hashtable();
                    props["port"] = TechnicalSettings.RemotingServerPort;
                    props.Add("typeFilterLevel", TypeFilterLevel.Full);
                    //props.Add("timeout", 2000);
                    BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
                    channel = new HttpChannel(props, clientProvider, null);
                    ChannelServices.RegisterChannel(channel, false);

                    //TcpChannel channel = new TcpChannel();
                    //ChannelServices.RegisterChannel(channel, true);
                    var server = string.Format("http://{0}:{1}/RemoteOperation", TechnicalSettings.RemotingServer,
                                               TechnicalSettings.RemotingServerPort);

                    _remoteOperation = (IRemoteOperation) Activator.GetObject(typeof (IRemoteOperation), server);
                    _exist = _remoteOperation.TestRemoting();

                    //ChannelServices.GetChannelSinkProperties(_remoteOperation)["timeout"] = 0;
                }
                catch(Exception e)
                {
                    _remoting_unique_instance = null;
                    ChannelServices.UnregisterChannel(channel);
                    throw;
                }
            }
            return true;
        }