Ejemplo n.º 1
0
        public void InitUser(string fbUserId)
        {
            if (DisableServer)
            {
                UserData = new UserData {
                    FbUserId = fbUserId, UserName = "******", IsPassenger = true
                };
                return;
            }

            UserData = AppData.KnownUserDatas.Find((userData) => userData.FbUserId == fbUserId);
            if (UserData == null)
            {
                using (var client = new UsersManager.Client(GetThriftProtocol(PortOffsets.UsersManager)))
                {
                    var user = client.getUser(fbUserId);
                    UserData = new UserData {
                        UserName = user.UserName, IsPassenger = user.IsPassenger
                    };
                }
            }
            IsPassenger.Value = UserData.IsPassenger;
        }
Ejemplo n.º 2
0
		public void InitUser(string fbUserId)
		{
			if (DisableServer) {
				UserData = new UserData { FbUserId = fbUserId, UserName = "******", IsPassenger = true };
				return;
			}

			UserData = AppData.KnownUserDatas.Find ((userData) => userData.FbUserId == fbUserId);
			if (UserData == null) {

				using (var client = new UsersManager.Client(GetThriftProtocol(PortOffsets.UsersManager)))
				{
					var user = client.getUser(fbUserId);
					UserData = new UserData { UserName = user.UserName, IsPassenger = user.IsPassenger };
				}
			}
			IsPassenger.Value = UserData.IsPassenger;
		}