本文整理汇总了C#中OpenSim.Framework.UserProfileData类的典型用法代码示例。如果您正苦于以下问题:C# UserProfileData类的具体用法?C# UserProfileData怎么用?C# UserProfileData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserProfileData类属于OpenSim.Framework命名空间,在下文中一共展示了UserProfileData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public static string Serialize(UserProfileData profile)
{
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
xtw.Formatting = Formatting.Indented;
xtw.WriteStartDocument();
xtw.WriteStartElement("user_profile");
xtw.WriteAttributeString("major_version", MAJOR_VERSION.ToString());
xtw.WriteAttributeString("minor_version", MINOR_VERSION.ToString());
xtw.WriteElementString("name", profile.Name);
xtw.WriteElementString("id", profile.ID.ToString());
xtw.WriteElementString("about", profile.AboutText);
// Not sure if we're storing this yet, need to take a look
// xtw.WriteElementString("Url", profile.Url);
// or, indeed, interests
xtw.WriteEndElement();
xtw.Close();
sw.Close();
return sw.ToString();
}
示例2: GetUserProfile
public UserProfileData GetUserProfile(Uri uri)
{
UserProfileData userProfile = new UserProfileData();
// userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret));
return userProfile;
}
示例3: IsLocalUser
public bool IsLocalUser(UserProfileData userData)
{
if (userData != null)
{
if (userData is ForeignUserProfileData)
return IsLocalUser(((ForeignUserProfileData)userData).UserServerURI);
else
return true;
}
else
// Something fishy; ignore it
return true;
}
示例4: PrepareLoginToRegion
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, string clientVersion)
{
return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response, clientVersion);
}
示例5: buildUserProfile
/***********************************************************************
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant
*
**********************************************************************/
/// <summary>
/// TODO: this doesn't work yet because something more
/// interesting has to be done to actually get these values
/// back out. Not enough time to figure it out yet.
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
private static UserProfileData buildUserProfile(DataRow row)
{
UserProfileData user = new UserProfileData();
UUID tmp;
UUID.TryParse((String)row["UUID"], out tmp);
user.ID = tmp;
user.FirstName = (String) row["username"];
user.SurName = (String) row["surname"];
user.Email = (row.IsNull("email")) ? "" : (String) row["email"];
user.PasswordHash = (String) row["passwordHash"];
user.PasswordSalt = (String) row["passwordSalt"];
user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]);
user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]);
user.HomeLocation = new Vector3(
Convert.ToSingle(row["homeLocationX"]),
Convert.ToSingle(row["homeLocationY"]),
Convert.ToSingle(row["homeLocationZ"])
);
user.HomeLookAt = new Vector3(
Convert.ToSingle(row["homeLookAtX"]),
Convert.ToSingle(row["homeLookAtY"]),
Convert.ToSingle(row["homeLookAtZ"])
);
UUID regionID = UUID.Zero;
UUID.TryParse(row["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use UUID.Zero
user.HomeRegionID = regionID;
user.Created = Convert.ToInt32(row["created"]);
user.LastLogin = Convert.ToInt32(row["lastLogin"]);
user.UserInventoryURI = (String) row["userInventoryURI"];
user.UserAssetURI = (String) row["userAssetURI"];
user.CanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
user.WantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
user.AboutText = (String) row["profileAboutText"];
user.FirstLifeAboutText = (String) row["profileFirstText"];
UUID.TryParse((String)row["profileImage"], out tmp);
user.Image = tmp;
UUID.TryParse((String)row["profileFirstImage"], out tmp);
user.FirstLifeImage = tmp;
user.WebLoginKey = new UUID((String) row["webLoginKey"]);
user.UserFlags = Convert.ToInt32(row["userFlags"]);
user.GodLevel = Convert.ToInt32(row["godLevel"]);
user.CustomType = row["customType"].ToString();
user.Partner = new UUID((String) row["partner"]);
return user;
}
示例6: AddNewUserProfile
/// <summary>
/// Creates a new user profile
/// </summary>
/// <param name="user">The profile to add to the database</param>
override public void AddNewUserProfile(UserProfileData user)
{
DataTable users = ds.Tables["users"];
UUID zero = UUID.Zero;
if (ExistsFirstLastName(user.FirstName, user.SurName) || user.ID == zero)
return;
lock (ds)
{
DataRow row = users.Rows.Find(user.ID.ToString());
if (row == null)
{
row = users.NewRow();
fillUserRow(row, user);
users.Rows.Add(row);
m_log.Debug("[USER DB]: Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
// save changes off to disk
da.Update(ds, "users");
}
else
{
m_log.WarnFormat("[USER DB]: Ignoring add since user with id {0} already exists", user.ID);
}
}
}
示例7: UpdateUserProfile
public bool UpdateUserProfile(UserProfileData user)
{
m_userProfilesByUuid[user.ID] = user;
m_userProfilesByName[user.FirstName + " " + user.SurName] = user;
return true;
}
示例8: AddTemporaryUserProfile
public void AddTemporaryUserProfile(UserProfileData userProfile)
{
// Not interested
}
示例9: AddNewUserProfile
/// <summary>
/// Creates a new users profile
/// </summary>
/// <param name="user">The user profile to create</param>
override public void AddNewUserProfile(UserProfileData user)
{
try
{
InsertUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt,
user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
user.HomeLocation.Z,
user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
user.LastLogin, user.UserInventoryURI, user.UserAssetURI,
user.CanDoMask, user.WantDoMask,
user.AboutText, user.FirstLifeAboutText, user.Image,
user.FirstLifeImage, user.WebLoginKey, user.HomeRegionID,
user.GodLevel, user.UserFlags, user.CustomType, user.Partner);
}
catch (Exception e)
{
m_log.ErrorFormat("[USER DB] Error adding new profile, error: {0}", e.Message);
}
}
示例10: PrepareNextDefaultRegion
// For returning users' where the preferred region is down
protected bool PrepareNextDefaultRegion(LoginResponse response, UserProfileData theUser, string clientVersion)
{
return PrepareNextRegion(response, theUser, _DefaultRegionsList, "safe", clientVersion);
}
示例11: PrepareNextDefaultLogin
// For new users' first-time logins
protected bool PrepareNextDefaultLogin(LoginResponse response, UserProfileData theUser, string startLocationRequest, string clientVersion)
{
return PrepareNextRegion(response, theUser, _DefaultLoginsList, startLocationRequest, clientVersion);
}
示例12: PrepareNextRegion
protected bool PrepareNextRegion(LoginResponse response, UserProfileData theUser, List<string> theList, string startLocationRequest, string clientVersion)
{
Regex reURI = new Regex(@"^(?<region>[^&]+)/(?<x>\d+)/(?<y>\d+)/(?<z>\d+)$");
if ((startLocationRequest != "home") && (startLocationRequest != "last"))
startLocationRequest = "safe";
foreach (string location in theList)
{
if (PrepareLoginToREURI(reURI, response, theUser, location, "safe", "default region", clientVersion))
return true;
}
return false;
}
示例13: PrepareLoginToREURI
protected bool PrepareLoginToREURI(Regex reURI, LoginResponse response, UserProfileData theUser, string startLocationRequest, string StartLocationType, string desc, string clientVersion)
{
string region;
RegionInfo regionInfo = null;
Match uriMatch = reURI.Match(startLocationRequest);
if (uriMatch == null)
{
m_log.InfoFormat("[LOGIN]: Got {0} {1}, but can't process it", desc, startLocationRequest);
return false;
}
region = uriMatch.Groups["region"].ToString();
regionInfo = RequestClosestRegion(region);
if (regionInfo == null)
{
m_log.InfoFormat("[LOGIN]: Got {0} {1}, can't locate region {2}", desc, startLocationRequest, region);
return false;
}
theUser.CurrentAgent.Position = new Vector3(float.Parse(uriMatch.Groups["x"].Value),
float.Parse(uriMatch.Groups["y"].Value), float.Parse(uriMatch.Groups["z"].Value));
response.LookAt = "[r0,r1,r0]";
// can be: last, home, safe, url
response.StartLocation = StartLocationType;
return PrepareLoginToRegion(regionInfo, theUser, response, clientVersion);
}
示例14: CreateAgent
public void CreateAgent(UserProfileData profile, OSD request)
{
m_userManager.CreateAgent(profile, request);
}
示例15: AuthenticateUser
public virtual bool AuthenticateUser(UserProfileData profile, UUID webloginkey)
{
bool passwordSuccess = false;
m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.ID);
// Match web login key unless it's the default weblogin key UUID.Zero
passwordSuccess = ((profile.WebLoginKey == webloginkey) && profile.WebLoginKey != UUID.Zero);
return passwordSuccess;
}