本文整理汇总了C#中GameClient.GetHabbo方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetHabbo方法的具体用法?C# GameClient.GetHabbo怎么用?C# GameClient.GetHabbo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClient
的用法示例。
在下文中一共展示了GameClient.GetHabbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(GameClient session, string[] pms)
{
var user = AzureEmulator.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(TextManager.GetText("user_is_higher_rank"));
return;
}
try
{
AzureEmulator.GetGame()
.GetBanManager()
.BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(1)),
true, false);
}
catch
{
Writer.Writer.LogException("Error while banning");
}
}
示例2: Execute
public override void Execute(GameClient session, string[] pms)
{
ushort itemId;
if (!ushort.TryParse(pms[0], out itemId))
{
return;
}
var user = session.GetHabbo()
.CurrentRoom.GetRoomUserManager()
.GetRoomUserByHabbo(session.GetHabbo().UserName);
if (user.RidingHorse)
{
session.SendWhisper(TextManager.GetText("horse_handitem_error"));
return;
}
if (user.IsLyingDown)
{
return;
}
user.CarryItem(itemId);
}
示例3: Execute
public override void Execute(GameClient session, string[] pms)
{
var user = AzureEmulator.GetHabboForName(pms[0]);
if (user == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
if (user.Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(TextManager.GetText("user_is_higher_rank"));
return;
}
using (var adapter = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
adapter.AddParameter("name", user.UserName);
adapter.RunQuery();
AzureEmulator.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
string.Format("User has been Unbanned [{0}]", pms[0]));
return;
}
}
示例4: OnTrigger
public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u ||
session == null)
{
return;
}
RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null)
{
return;
}
if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y))
{
roomUserByHabbo.MoveTo(item.SquareInFront);
return;
}
item.InteractingUser = session.GetHabbo().Id;
roomUserByHabbo.CanWalk = false;
roomUserByHabbo.ClearMovement();
roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y));
item.ReqUpdate(2, true);
item.ExtraData = "1";
item.UpdateState(false, true);
}
示例5: Execute
public override void Execute(GameClient session, string[] pms)
{
if (pms[0].Length < 2) return;
var room = session.GetHabbo().CurrentRoom;
foreach (var current in room.GetRoomUserManager().UserList.Values)
{
try
{
if (!current.IsBot && current.GetClient() != null &&
current.GetClient().GetHabbo() != null)
{
current.GetClient()
.GetHabbo()
.GetBadgeComponent()
.GiveBadge(pms[0], true, current.GetClient(), false);
}
}
catch
{
}
}
AzureEmulator.GetGame().GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName,
string.Empty, "Badge",
string.Concat("Roombadge in room [", room.RoomId, "] with badge [", pms[0], "]"));
}
示例6: OnTrigger
public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (item == null || item.GetRoom() == null || session == null || session.GetHabbo() == null)
{
return;
}
RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null)
{
return;
}
if (!(roomUserByHabbo.Coordinate == item.Coordinate) && !(roomUserByHabbo.Coordinate == item.SquareInFront))
{
if (roomUserByHabbo.CanWalk)
{
roomUserByHabbo.MoveTo(item.SquareInFront);
}
return;
}
if (item.InteractingUser != 0u)
{
return;
}
roomUserByHabbo.TeleDelay = 2;
item.InteractingUser = roomUserByHabbo.GetClient().GetHabbo().Id;
}
示例7: Execute
public override bool Execute(GameClient session, string[] pms)
{
var room = Azure.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
foreach (var user in room.GetRoomUserManager().GetRoomUsers()) user.ApplyEffect(108);
return true;
}
示例8: Execute
public override void Execute(GameClient session, string[] pms)
{
var room = AzureEmulator.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
if (room == null) return;
var user2 = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().LastSelectedUser);
if (user2 == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().UserName);
if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 1)
{
session.SendWhisper(TextManager.GetText("kil_command_error_1"));
return;
}
if (user2.IsLyingDown || user2.IsSitting)
{
session.SendWhisper(TextManager.GetText("kil_command_error_2"));
return;
}
if (!String.Equals(user2.GetUserName(), session.GetHabbo().UserName, StringComparison.CurrentCultureIgnoreCase))
{
user2.Statusses.Add("lay", "0.55");
user2.IsLyingDown = true;
user2.UpdateNeeded = true;
user.Chat(user.GetClient(), TextManager.GetText("command.kill.user"), true, 0, 3);
user2.Chat(user2.GetClient(), TextManager.GetText("command.kill.userdeath"), true, 0,
3);
return;
}
user.Chat(session, "I am sad", false, 0, 0);
}
示例9: Execute
public override void Execute(GameClient session, string[] pms)
{
var user = AzureEmulator.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null || user.GetHabbo() == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(TextManager.GetText("user_is_higher_rank"));
return;
}
try
{
user.GetConnection().Dispose();
AzureEmulator.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
string.Format("Disconnect User[{0}]", pms[1]));
}
catch
{
}
}
示例10: Execute
public override void Execute(GameClient session, string[] pms)
{
var user = AzureEmulator.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(TextManager.GetText("user_not_found"));
return;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(TextManager.GetText("user_is_higher_rank"));
return;
}
try
{
var length = int.Parse(pms[1]);
var message = pms.Length < 3 ? string.Empty : string.Join(" ", pms.Skip(2));
if (string.IsNullOrWhiteSpace(message)) message = TextManager.GetText("command_ban_user_no_reason");
ModerationTool.BanUser(session, user.GetHabbo().Id, length, message);
AzureEmulator.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "Ban",
string.Format("USER:{0} TIME:{1} REASON:{2}", pms[0], pms[1], message));
}
catch
{
// error handle
}
}
示例11: Execute
public override void Execute(GameClient session, string[] pms)
{
var currentRoom = session.GetHabbo().CurrentRoom;
var roomUserByHabbo = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null) return;
roomUserByHabbo.AllowOverride = !roomUserByHabbo.AllowOverride;
}
示例12: CompleteUserTalent
/// <summary>
/// Completes the user talent.
/// </summary>
/// <param name="Session">The session.</param>
/// <param name="Talent">The talent.</param>
internal void CompleteUserTalent(GameClient Session, Talent Talent)
{
if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentTalentLevel < Talent.Level || Session.GetHabbo().Talents.ContainsKey(Talent.Id))
return;
if (!LevelIsCompleted(Session, Talent.Type, Talent.Level))
return;
if (!string.IsNullOrEmpty(Talent.Prize) && Talent.PrizeBaseItem > 0u)
{
Item item = AzureEmulator.GetGame().GetItemManager().GetItem(Talent.PrizeBaseItem);
AzureEmulator.GetGame().GetCatalog().DeliverItems(Session, item, 1, "", 0, 0, "");
}
var value = new UserTalent(Talent.Id, 1);
Session.GetHabbo().Talents.Add(Talent.Id, value);
using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
queryReactor.RunFastQuery(string.Concat("REPLACE INTO users_talents VALUES (", Session.GetHabbo().Id, ", ", Talent.Id, ", ", 1, ");"));
}
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("TalentLevelUpMessageComposer"));
serverMessage.AppendString(Talent.Type);
serverMessage.AppendInteger(Talent.Level);
serverMessage.AppendInteger(0);
if (Talent.Type == "citizenship" && Talent.Level == 4)
{
serverMessage.AppendInteger(2);
serverMessage.AppendString("HABBO_CLUB_VIP_7_DAYS");
serverMessage.AppendInteger(7);
serverMessage.AppendString(Talent.Prize);
serverMessage.AppendInteger(0);
}
else
{
serverMessage.AppendInteger(1);
serverMessage.AppendString(Talent.Prize);
serverMessage.AppendInteger(0);
}
Session.SendMessage(serverMessage);
if (Talent.Type == "citizenship")
{
if (Talent.Level == 3)
AzureEmulator.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_Citizenship", 1);
else if (Talent.Level == 4)
{
Session.GetHabbo().GetSubscriptionManager().AddSubscription(7);
using (IQueryAdapter queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
queryReactor.RunFastQuery(string.Concat(new object[]
{
"UPDATE users SET talent_status = 'helper' WHERE id = ",
Session.GetHabbo().Id,
";"
}));
}
}
}
}
示例13: Execute
public override void Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
session.GetHabbo()
.GetAvatarEffectsInventoryComponent()
.ActivateCustomEffect(user != null && user.CurrentEffect != 140 ? 140 : 0);
}
示例14: Execute
public override void Execute(GameClient session, string[] pms)
{
ushort effectId;
if (!ushort.TryParse(pms[0], out effectId)) return;
var room = AzureEmulator.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
foreach (var user in room.GetRoomUserManager().GetRoomUsers().Where(user => !user.RidingHorse)) user.ApplyEffect(effectId);
}
示例15: Execute
public override void Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
if (room == null) return;
var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return;
user.IsMoonwalking = !user.IsMoonwalking;
}