本文整理汇总了C#中Azure.HabboHotel.GameClients.Interfaces.GameClient.GetHabbo方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetHabbo方法的具体用法?C# GameClient.GetHabbo怎么用?C# GameClient.GetHabbo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Azure.HabboHotel.GameClients.Interfaces.GameClient
的用法示例。
在下文中一共展示了GameClient.GetHabbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
if (!session.GetHabbo().CurrentRoom.RoomMuted)
{
session.SendWhisper("Room isn't muted.");
return true;
}
session.GetHabbo().CurrentRoom.RoomMuted = false;
/*
var message = new ServerMessage();
message.Init(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
message.AppendString("Room is now UnMuted.");
message.AppendString("");
room.SendMessage(message);*/
room.SendMessage(GameClient.GetBytesNotif("Este quarto foi des-selenciado."));
Azure.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Unmute", "Room UnMuted");
return true;
}
示例2: 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;
}
示例3: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u ||
session == null)
return;
var 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);
}
示例4: Execute
public override bool Execute(GameClient session, string[] pms)
{
var user = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
Azure.GetGame()
.GetBanManager()
.BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
true, false);
}
catch
{
Writer.Writer.LogException("Error while banning");
}
return true;
}
示例5: Execute
public override bool Execute(GameClient session, string[] pms)
{
var user = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null || user.GetHabbo() == null)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
user.GetConnection().Dispose();
Azure.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
string.Format("Disconnect User[{0}]", pms[1]));
}
catch
{
}
return true;
}
示例6: Execute
public override bool Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
if (room.RoomMuted)
{
session.SendWhisper("Room is already muted.");
return true;
}
session.GetHabbo().CurrentRoom.RoomMuted = true;
/*
var message = new ServerMessage(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
message.AppendString(string.Format("The room was muted due to:\r{0}", string.Join(" ", pms)));
message.AppendString(string.Empty);
room.SendMessage(message);*/
room.SendMessage(GameClient.GetBytesNotif(
$"Este quarto foi silenciado pelo motivo:\r{string.Join(" ", pms)}"));
Azure.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Mute", "Room muted");
return true;
}
示例7: Execute
public override bool Execute(GameClient session, string[] pms)
{
if (pms[0].Length < 2) return true;
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());
}
}
catch
{
}
}
Azure.GetGame().GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName,
string.Empty, "Badge",
string.Concat("Roombadge in room [", room.RoomId, "] with badge [", pms[0], "]"));
return true;
}
示例8: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, Quest quest)
{
var amountOfQuestsInCategory = Azure.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(quest.Category);
var i = (quest == null) ? amountOfQuestsInCategory : quest.Number;
var i2 = (quest == null) ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestCompletedMessageComposer"));
serverMessage.AppendString(quest.Category);
serverMessage.AppendInteger(i);
serverMessage.AppendInteger(quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
serverMessage.AppendInteger((quest == null) ? 3 : quest.RewardType);
serverMessage.AppendInteger((quest == null) ? 0u : quest.Id);
serverMessage.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
serverMessage.AppendString((quest == null) ? string.Empty : quest.ActionName);
serverMessage.AppendString((quest == null) ? string.Empty : quest.DataBit);
serverMessage.AppendInteger((quest == null) ? 0 : quest.Reward);
serverMessage.AppendString((quest == null) ? string.Empty : quest.Name);
serverMessage.AppendInteger(i2);
serverMessage.AppendInteger((quest == null) ? 0u : quest.GoalData);
serverMessage.AppendInteger((quest == null) ? 0 : quest.TimeUnlock);
serverMessage.AppendString("");
serverMessage.AppendString("");
serverMessage.AppendBool(true);
serverMessage.AppendBool(true);
return serverMessage;
}
示例9: Execute
public override bool Execute(GameClient session, string[] pms)
{
var user = Azure.GetHabboForName(pms[0]);
if (user == null)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
using (var adapter = Azure.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
adapter.AddParameter("name", user.UserName);
adapter.RunQuery();
Azure.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
string.Format("User has been Unbanned [{0}]", pms[0]));
return true;
}
}
示例10: Execute
public override bool Execute(GameClient session, string[] pms)
{
var room = session.GetHabbo().CurrentRoom;
var user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null) return true;
if (room.RoomData.DisablePull)
{
session.SendWhisper("Realizar Pull Foi Desativado pelo Dono do Quarto");
return true;
}
var client = Azure.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Azure.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Id == session.GetHabbo().Id)
{
session.SendWhisper(Azure.GetLanguage().GetVar("command_pull_error_own"));
return true;
}
var user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
if (user2 == null) return true;
if (user2.TeleportEnabled)
{
session.SendWhisper(Azure.GetLanguage().GetVar("command_error_teleport_enable"));
return true;
}
if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 2)
{
session.SendWhisper(Azure.GetLanguage().GetVar("command_pull_error_far_away"));
return true;
}
if ((user.RotBody % 2) != 0) user.RotBody--;
switch (user.RotBody)
{
case 0:
user2.MoveTo(user.X, user.Y - 1);
break;
case 2:
user2.MoveTo(user.X + 1, user.Y);
break;
case 4:
user2.MoveTo(user.X, user.Y + 1);
break;
case 6:
user2.MoveTo(user.X - 1, user.Y);
break;
}
return true;
}
示例11: Execute
public override bool Execute(GameClient session, string[] pms)
{
var currentRoom = session.GetHabbo().CurrentRoom;
var roomUserByHabbo = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null) return true;
roomUserByHabbo.AllowOverride = !roomUserByHabbo.AllowOverride;
return true;
}
示例12: Execute
public override bool 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);
return true;
}
示例13: Execute
public override bool Execute(GameClient session, string[] pms)
{
var user =
Azure.GetGame()
.GetRoomManager()
.GetRoom(session.GetHabbo().CurrentRoomId)
.GetRoomUserManager()
.GetRoomUserByHabbo(session.GetHabbo().Id);
user.FastWalking = !user.FastWalking;
return true;
}
示例14: Execute
public override bool Execute(GameClient session, string[] pms)
{
ushort effectId;
if (!ushort.TryParse(pms[0], out effectId)) return true;
var room = Azure.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);
return true;
}
示例15: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="quests">The quests.</param>
/// <param name="send">if set to <c>true</c> [send].</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, List<Quest> quests, bool send)
{
var dictionary = new Dictionary<string, int>();
var dictionary2 = new Dictionary<string, Quest>();
foreach (var current in quests)
{
if (!current.Category.Contains("xmas2012"))
{
if (!dictionary.ContainsKey(current.Category))
{
dictionary.Add(current.Category, 1);
dictionary2.Add(current.Category, null);
}
if (current.Number >= dictionary[current.Category])
{
var questProgress = session.GetHabbo().GetQuestProgress(current.Id);
if (session.GetHabbo().CurrentQuestId != current.Id && questProgress >= current.GoalData)
{
dictionary[current.Category] = (current.Number + 1);
}
}
}
}
foreach (var current2 in quests)
{
foreach (var current3 in dictionary)
{
if (!current2.Category.Contains("xmas2012") && current2.Category == current3.Key &&
current2.Number == current3.Value)
{
dictionary2[current3.Key] = current2;
break;
}
}
}
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestListMessageComposer"));
serverMessage.AppendInteger(dictionary2.Count);
foreach (var current4 in dictionary2)
{
if (current4.Value != null)
{
SerializeQuest(serverMessage, session, current4.Value, current4.Key);
}
}
foreach (var current5 in dictionary2)
{
if (current5.Value == null)
{
SerializeQuest(serverMessage, session, current5.Value, current5.Key);
}
}
serverMessage.AppendBool(send);
return serverMessage;
}