/// <summary> /// Logins to the poker service. /// </summary> /// <remarks> /// This method must be called after a call to <see cref="Initialize"/> /// </remarks> public void Connect() { // assure initialized CheckInitialized(proxyService); CheckInitialized(chatProxy); // check that the server didn't refuse the connection already if (canConnect) { // get the user name string userName = concreteClient.GetName(); // try to login (the server might call NotifyNameExists or NotifyGameInProgress) Player loggedIn = proxyService.Login(userName); // when the server replies with a null result, try a new login name... if (loggedIn == null) { Connect(); } else // otherwise, the player logged in, try to sign in to the chat session { chatProxy.Login(proxyService.InnerChannel.SessionId); Running = true; } } }
/// <summary> /// Gets the login name of the client. This method may be called again after a call to <see cref="NotifyNameExists"/></summary> /// <returns>A valid user name to login the client</returns> /// <remarks> /// This method must aquire the user login name. A new value must be returned after a call to <see cref="NotifyNameExists"/></remarks> public virtual string GetName() { return(helper.GetName()); }