本文整理汇总了C#中Yupi.Game.GameClients.Interfaces.GameClient.GetHabbo方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetHabbo方法的具体用法?C# GameClient.GetHabbo怎么用?C# GameClient.GetHabbo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yupi.Game.GameClients.Interfaces.GameClient
的用法示例。
在下文中一共展示了GameClient.GetHabbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
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);
}
示例2: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = Yupi.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
foreach (RoomUser user in room.GetRoomUserManager().GetRoomUsers()) user.ApplyEffect(108);
return true;
}
示例3: Execute
public override bool Execute(GameClient session, string[] pms)
{
Habbo user = Yupi.GetHabboForName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
using (IQueryAdapter adapter = Yupi.GetDatabaseManager().GetQueryReactor())
{
adapter.SetQuery("DELETE FROM users_bans WHERE value = @name");
adapter.AddParameter("name", user.UserName);
adapter.RunQuery();
Yupi.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.UserName, "Unban",
$"User has been Unbanned [{pms[0]}]");
return true;
}
}
示例4: 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 = Yupi.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 ? 0 : 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;
}
示例5: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
commitableQueryReactor.RunFastQuery(
$"UPDATE rooms_data SET roomtype = 'public' WHERE id = {room.RoomId}");
uint roomId = session.GetHabbo().CurrentRoom.RoomId;
List<RoomUser> users = new List<RoomUser>(session.GetHabbo().CurrentRoom.GetRoomUserManager().UserList.Values);
Yupi.GetGame().GetRoomManager().UnloadRoom(session.GetHabbo().CurrentRoom, "Unload command");
Yupi.GetGame().GetRoomManager().LoadRoom(roomId);
ServerMessage roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
roomFwd.AppendInteger(roomId);
byte[] data = roomFwd.GetReversedBytes();
foreach (RoomUser user in users.Where(user => user != null && user.GetClient() != null))
user.GetClient().SendMessage(data);
return true;
}
示例6: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null || user.GetHabbo() == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
user.GetConnection().Dispose();
Yupi.GetGame()
.GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName, user.GetHabbo().UserName, "dc",
$"Disconnect User[{pms[1]}]");
}
catch
{
}
return true;
}
示例7: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room 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.Load(LibraryParser.OutgoingRequest("AlertNotificationMessageComposer"));
message.AppendString("Room is now UnMuted.");
message.AppendString("");
room.SendMessage(message);*/
room.SendMessage(GameClient.GetBytesNotif("Este quarto foi des-selenciado."));
Yupi.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Unmute", "Room UnMuted");
return true;
}
示例8: Execute
public override bool Execute(GameClient session, string[] pms)
{
if (pms[0].Length < 2) return true;
Room room = session.GetHabbo().CurrentRoom;
foreach (RoomUser 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
{
}
}
Yupi.GetGame().GetModerationTool()
.LogStaffEntry(session.GetHabbo().UserName,
string.Empty, "Badge",
string.Concat("Roombadge in room [", room.RoomId, "] with badge [", pms[0], "]"));
return true;
}
示例9: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
Yupi.GetGame()
.GetBanManager()
.BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
true, false);
}
catch
{
ServerLogManager.LogException($"An error occurred when {session.GetHabbo().UserName} tried to ban {user.GetHabbo().UserName}");
}
return true;
}
示例10: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room 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)}"));
Yupi.GetGame()
.GetModerationTool().LogStaffEntry(session.GetHabbo().UserName, string.Empty,
"Room Mute", "Room muted");
return true;
}
示例11: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room room = session.GetHabbo().CurrentRoom;
RoomUser 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;
}
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (client.GetHabbo().Id == session.GetHabbo().Id)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_pull_error_own"));
return true;
}
RoomUser user2 = room.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id);
if (user2 == null) return true;
if (user2.TeleportEnabled)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("command_error_teleport_enable"));
return true;
}
if (PathFinder.GetDistance(user.X, user.Y, user2.X, user2.Y) > 2)
{
session.SendWhisper(Yupi.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;
}
示例12: Execute
public override bool Execute(GameClient session, string[] pms)
{
Room currentRoom = session.GetHabbo().CurrentRoom;
RoomUser roomUserByHabbo = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null) return true;
roomUserByHabbo.AllowOverride = !roomUserByHabbo.AllowOverride;
return true;
}
示例13: Execute
public override bool Execute(GameClient session, string[] pms)
{
RoomUser user =
Yupi.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)
{
Room room = session.GetHabbo().CurrentRoom;
RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
session.GetHabbo()
.GetAvatarEffectsInventoryComponent()
.ActivateCustomEffect(user != null && user.CurrentEffect != 140 ? 140 : 0);
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;
}