本文整理汇总了C#中RoomUser.GetUserName方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.GetUserName方法的具体用法?C# RoomUser.GetUserName怎么用?C# RoomUser.GetUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomUser
的用法示例。
在下文中一共展示了RoomUser.GetUserName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendUserInfo
private static void AppendUserInfo(RoomUser user, StringBuilder text)
{
text.Append(string.Format("## userId: {0} name: {1} rank: {2} \r", user.UserId, user.GetUserName(),
user.GetClient().GetHabbo().Rank));
if (user.IsDancing) text.Append("actions: dancing \r");
if (user.IsLyingDown) text.Append("actions: lying \r");
if (user.IsSitting) text.Append("actions: sitting \r");
if (user.CurrentEffect > 0) text.Append("actions: effect." + user.CurrentEffect);
if (user.IsWalking) text.Append(string.Format(" walking.To(X/Y {0}/{1})", user.GoalX, user.GoalY));
text.Append("\r");
text.Append("room rights: ");
if (user.GetClient().GetHabbo().HasFuse("moderator")) text.Append(" staff");
if (user.GetClient().GetHabbo().HasFuse("user_control_any_room")) text.Append(" controlAnyRoom");
if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), true)) text.Append(" owner");
if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), false, true)) text.Append(" groupAdmin");
else if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), false, false, true)) text.Append(" groupMember");
text.Append("\r");
text.Append("prohibitions: ");
if (!user.CanWalk) text.Append(" walk");
if (user.GetClient().GetHabbo().Muted) text.Append(" chat");
text.Append("\r");
text.AppendLine(string.Format("X/Y/Z/Rot: {0}/{1}/{2}/{3}", user.X, user.Y, user.Z, user.RotBody));
}
示例2: OnUserEnterRoom
/// <summary>
/// Called when [user enter room].
/// </summary>
/// <param name="user">The user.</param>
internal override void OnUserEnterRoom(RoomUser user)
{
if (user.GetClient() == null || user.GetClient().GetHabbo() == null)
return;
RoomUser roomUser = GetRoomUser();
if (roomUser == null || user.GetClient().GetHabbo().UserName != roomUser.PetData.OwnerName)
return;
Random random = new Random();
string[] value = PetLocale.GetValue("welcome.speech.pet");
string message = value[random.Next(0, (value.Length - 1))];
message += user.GetUserName();
roomUser.Chat(null, message, false, 0, 0);
}
示例3: AppendUserInfo
private static void AppendUserInfo(RoomUser user, StringBuilder text)
{
text.Append(
$"## userId: {user.UserId} name: {user.GetUserName()} rank: {user.GetClient().GetHabbo().Rank} \r");
if (user.IsDancing) text.Append("actions: dancing \r");
if (user.IsLyingDown) text.Append("actions: lying \r");
if (user.IsSitting) text.Append("actions: sitting \r");
if (user.CurrentEffect > 0) text.Append("actions: effect." + user.CurrentEffect);
if (user.IsWalking) text.Append($" walking.To(X/Y {user.GoalX}/{user.GoalY})");
text.Append("\r");
text.Append("room rights: ");
if (user.GetClient().GetHabbo().HasFuse("fuse_mod")) text.Append(" staff");
if (user.GetClient().GetHabbo().HasFuse("fuse_any_room_controller")) text.Append(" controlAnyRoom");
if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), true)) text.Append(" owner");
if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), false, true))
text.Append(" groupAdmin");
else if (user.GetClient().GetHabbo().CurrentRoom.CheckRights(user.GetClient(), false, false, true))
text.Append(" groupMember");
text.Append("\r");
text.Append("prohibitions: ");
if (!user.CanWalk) text.Append(" walk");
if (user.GetClient().GetHabbo().Muted) text.Append(" chat");
text.Append("\r");
text.AppendLine($"X/Y/Z/Rot: {user.X}/{user.Y}/{user.Z}/{user.RotBody}");
}