示例#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);
 }
示例#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 + "";
    }
示例#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;
        }