Beispiel #1
0
 public ViewModel()
 {
     server = new CCC_Server();
     Clients = new ObservableCollection<string>();
     Port = 0;
     LocalAddress = IPUtils.GetLocalAddress(); ;
     PublicAddress = IPUtils.GetPublicAddress();
     startCommand = new RelayCommand(OnStartExecuted, OnStartCanExecute);
     stopCommand = new RelayCommand(OnStopExecuted, OnStopCanExecute);
 }
Beispiel #2
0
    // Use this for initialization
    /// <summary>
    /// Start this instance.
    /// </summary>
    void Start()
    {
        SetDeviceInfo();
        SetPlayerInfo();
        Connect_SetValidationsOnInput();
        Player_SetValidationsOnInput();
        Player_PrepareUI();
        Preferences_PrepareUI();
        onChange = true;

        ui_connectionIpAdress.text = IPUtils.GetLocalAddress().ToString();
        ui_connectionPort.text     = 63001 + "";
    }
Beispiel #3
0
        public ViewModel()
        {
            server        = new CCC_Server();
            Clients       = new ObservableCollection <PlayerData>();
            Port          = 63000;
            LocalAddress  = IPUtils.GetLocalAddress();
            PublicAddress = IPUtils.GetPublicAddress();
            Running       = false;
            LastSync      = DateTime.MinValue;
            startCommand  = new RelayCommand(OnStartExecuted, OnStartCanExecute);
            stopCommand   = new RelayCommand(OnStopExecuted, OnStopCanExecute);

            server.PlayerConnected    += OnClientConnect;
            server.PlayerDisconnected += OnClientDisconnect;
            server.PlayerMoved        += OnPlayerMove;
            server.PlayerCrouch       += OnPlayerCrouch;
            server.Sync += Server_Sync;
        }