Esempio n. 1
0
        public Player(string name, string userId, string tableNumber, TileStackWnd myWnd, MainWindow mWnd)
        {
            Name   = name;
            MyWnd  = myWnd;
            UserId = userId;
            var url = $"{ProgramConfig.ServerUrl}/ws/monkey?userID={userId}&tableNumber={tableNumber}";

            url = url.Replace("http", "ws");
            Ws  = new WebSocket(string.Format(url, userId, tableNumber));
            MyWnd.SetPlayer(this);
            MWnd = mWnd;
        }
Esempio n. 2
0
        public Player(string name, string userId, string roomNumber, TileStackWnd myWnd, MainWindow mWnd)
        {
            Name   = name;
            MyWnd  = myWnd;
            UserId = userId;
            var url = $"{ProgramConfig.ServerUrl}/ws/monkey?userID={userId}&roomNumber={roomNumber}";

            if (url.StartsWith("https://"))
            {
                url = url.Replace("https", "wss");
            }
            else
            {
                url = url.Replace("http", "ws");
            }
            url = url.Replace("http", "ws");
            Ws  = new WebSocket(string.Format(url, userId, roomNumber));
            MyWnd.SetPlayer(this);
            MWnd = mWnd;
        }