本文整理汇总了C#中Butterfly.HabboHotel.GameClients.GameClient.GetHabbo方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetHabbo方法的具体用法?C# GameClient.GetHabbo怎么用?C# GameClient.GetHabbo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Butterfly.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.GetHabbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 && Session != null)
{
RoomUser user = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (user == null)
return;
if (!Gamemap.TilesTouching(user.X, user.Y, Item.GetX, Item.GetY))
{
user.MoveTo(Item.SquareInFront);
return;
}
Item.InteractingUser = Session.GetHabbo().Id;
//user.ClearMovement(true);
user.SetRot(Rotation.Calculate(user.X, user.Y, Item.GetX, Item.GetY), false);
Item.ReqUpdate(2, true);
Item.ExtraData = "1";
Item.UpdateState(false, true);
}
}
示例2: UserGotAuthorization
internal bool UserGotAuthorization(GameClient session)
{
foreach (string subsciption in this.clubsAllowed)
{
if (!session.GetHabboDataContainer().GetSubscriptionManager().HasSubscription(subsciption) && subsciption != string.Empty)
return false;
}
if (minrank == 0)
return true;
else if (minrank > 0)
{
if (minrank <= session.GetHabbo().Rank)
return true;
}
else if (minrank < 0)
{
if (minrank == -1)
{
if (session.GetHabbo().CurrentRoom.CheckRights(session, false))
return true;
}
else if (minrank == -2)
{
if (session.GetHabbo().CurrentRoom.CheckRights(session, true))
return true;
}
}
return false;
}
示例3: AlertUser
internal static void AlertUser(GameClient ModSession, uint UserId, String Message, Boolean Caution)
{
GameClient Client = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
if (Client == null || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
{
return;
}
if (Caution && Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
{
ModSession.SendNotif(LanguageLocale.GetValue("moderation.caution.missingrank"));
Caution = false;
}
Client.SendNotif(Message, Caution);
if (Caution)
{
using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = " + UserId + "");
}
}
}
示例4: GivePixels
internal static void GivePixels(GameClient Client)
{
Double Timestamp = ButterflyEnvironment.GetUnixTimestamp();
Client.GetHabbo().LastActivityPointsUpdate = Timestamp;
Client.GetHabbo().ActivityPoints += RCV_AMOUNT;
Client.GetHabbo().UpdateActivityPointsBalance(0);
}
示例5: GivePixels
internal static void GivePixels(GameClient Client, int amount)
{
Double Timestamp = ButterflyEnvironment.GetUnixTimestamp();
Client.GetHabbo().LastActivityPointsUpdate = Timestamp;
Client.GetHabbo().ActivityPoints += amount;
Client.GetHabboDataContainer().UpdateActivityPointsBalance();
}
示例6: ProgressUserQuest
internal void ProgressUserQuest(GameClient Session, QuestType QuestType, uint EventData = 0)
{
if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().CurrentQuestId <= 0)
return;
Quest UserQuest = GetQuest(Session.GetHabbo().CurrentQuestId);
if (UserQuest == null || UserQuest.GoalType != QuestType)
return;
int CurrentProgress = Session.GetHabbo().GetQuestProgress(UserQuest.Id);
int NewProgress = CurrentProgress;
bool PassQuest = false;
switch (QuestType)
{
default:
NewProgress++;
if (NewProgress >= UserQuest.GoalData)
PassQuest = true;
break;
case QuestType.EXPLORE_FIND_ITEM:
if (EventData != UserQuest.GoalData)
return;
NewProgress = (int)UserQuest.GoalData;
PassQuest = true;
break;
}
using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE user_quests SET progress = " + NewProgress + " WHERE user_id = " + Session.GetHabbo().Id + " AND quest_id = " + UserQuest.Id);
if (PassQuest)
dbClient.runFastQuery("UPDATE users SET currentquestid = 0 WHERE id = " + Session.GetHabbo().Id);
}
Session.GetHabbo().quests[Session.GetHabbo().CurrentQuestId] = NewProgress;
Session.SendMessage(QuestStartedComposer.Compose(Session, UserQuest));
if (PassQuest)
{
Session.GetHabbo().CurrentQuestId = 0;
Session.GetHabbo().LastCompleted = UserQuest.Id;
Session.SendMessage(QuestCompletedComposer.Compose(Session, UserQuest));
Session.GetHabbo().ActivityPoints += UserQuest.Reward;
Session.GetHabboDataContainer().UpdateActivityPointsBalance();
GetList(Session, null);
}
}
示例7: CreateMessage
internal static ChatMessage CreateMessage(string message, GameClient user, Room room)
{
uint userID = user.GetHabbo().Id;
string username = user.GetHabbo().Username;
uint roomID = room.RoomId;
string roomName = room.Name;
DateTime timeSpoken = DateTime.Now;
ChatMessage chatMessage = new ChatMessage(userID, username, roomID, roomName, message, timeSpoken);
return chatMessage;
}
示例8: SendChatMessage
private static void SendChatMessage(GameClient GetClient, string Message, int Type)
{
ServerMessage TellMsg = PacketHandelingManager.GetRecycledItem(OutputCode.WhisperMessageEvent);
TellMsg.AddInt32(GetClient.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(GetClient.GetHabbo().Username).VirtualId);
TellMsg.AddString(Message);
TellMsg.AddInt32(0);
TellMsg.AddInt32(0);
TellMsg.AddInt32(Type);
TellMsg.AddInt32(0);
GetClient.SendMessage(TellMsg);
}
示例9:
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Session == null || Session.GetHabbo() == null || Item.InteractingUser > 0)
return;
string username = Session.GetHabbo().Username;
RoomUser user = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(username);
user.GoalX = Item.GetX;
user.GoalY = Item.GetY;
if (user.team != Team.none)
user.throwBallAtGoal = true;
}
示例10: if
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Session == null)
return;
RoomUser interactingUser = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
Point userCoord = interactingUser.Coordinate;
Point ballCoord = Item.Coordinate;
int differenceX = userCoord.X - ballCoord.X;
int differenceY = userCoord.Y - ballCoord.Y;
if (differenceX <= 1 && differenceX >= -1 && differenceY <= 1 && differenceY >= -1)
{
differenceX = differenceX * 2;
differenceY = differenceY * 2;
int newX = Item.GetX + differenceX;
int newY = Item.GetY + differenceY;
Item.GetRoom().GetSoccer().MoveBall(Item, Session, newX, newY);
interactingUser.MoveTo(ballCoord);
}
else //if (differenceX == 2 || differenceY == 2 || differenceY == - 2 || differenceX == -2)
{
Item.interactingBallUser = Session.GetHabbo().Id;
differenceX = differenceX * (-1);
differenceY = differenceY * (-1);
if (differenceX > 1)
differenceX = 1;
else if (differenceX < -1)
differenceX = -1;
if (differenceY > 1)
differenceY = 1;
else if (differenceY < -1)
differenceY = -1;
int newX = Item.GetX + differenceX;
int newY = Item.GetY + differenceY;
interactingUser.MoveTo(new Point(newX, newY));
}
}
示例11: AddToPlaylist
private static void AddToPlaylist(GameClient Session, ClientMessage Message)
{
Room Instance = Session.GetHabbo().CurrentRoom;
if (Instance == null || !Instance.CheckRights(Session, true) || !Instance.GotMusicController() ||
Instance.GetRoomMusicController().PlaylistSize >= Instance.GetRoomMusicController().PlaylistCapacity)
{
return;
}
UserItem DiskUserItem = Session.GetHabbo().GetInventoryComponent().GetItem(Message.PopWiredUInt());
if (DiskUserItem == null || DiskUserItem.GetBaseItem().InteractionType != InteractionType.musicdisc)
{
return;
}
SongItem item = new SongItem(DiskUserItem);
int NewOrder = Instance.GetRoomMusicController().AddDisk(item);
if (NewOrder < 0)
{
return;
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(item.itemID, true);
Session.SendMessage(JukeboxComposer.Compose(Instance.GetRoomMusicController().PlaylistCapacity,
Instance.GetRoomMusicController().Playlist.Values.ToList()));
}
示例12:
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
RoomUser User = null;
if (Session != null)
User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
{
if (Item.ExtraData != "-1")
{
if (Request == -1)
{
Item.ExtraData = "0";
Item.UpdateState();
}
else
{
Item.ExtraData = "-1";
Item.UpdateState(false, true);
Item.ReqUpdate(4, true);
}
}
}
else
{
User.MoveTo(Item.SquareInFront);
}
}
示例13: SellItem
internal static void SellItem(GameClient Session, uint ItemId, int SellingPrice)
{
UserItem item = Session.GetHabboDataContainer().GetInventoryComponent().GetItem(ItemId);
if (item == null || SellingPrice > 10000 || !CanSellItem(item))
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
message.AddInt32(0);
Session.SendMessage(message);
}
else
{
int comissionPrice = CalculateComissionPrice(SellingPrice);
int totalPrice = SellingPrice + comissionPrice;
int itemType = (item.GetBaseItem().Type == 'i') ? 2 : 1;
using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("INSERT INTO catalog_marketplace_offers (item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES (" + item.BaseItemID + "," + Session.GetHabbo().Id + "," + SellingPrice + "," + totalPrice + ",@public_name," + item.GetBaseItem().SpriteId + "," + itemType + "," + ButterflyEnvironment.GetUnixTimestamp() + ",@extra_data)");
dbClient.addParameter("public_name", item.GetBaseItem().PublicName);
dbClient.addParameter("extra_data", item.extraData);
dbClient.runQuery();
}
Session.GetHabboDataContainer().GetInventoryComponent().RemoveItem(ItemId, true);
Session.GetHabboDataContainer().GetInventoryComponent().RunDBUpdate();
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.MarketplaceMakeOfferResult);
message.AddInt32(1);
Session.SendMessage(message);
}
}
示例14: AdminRoomUserMessageArgs
public AdminRoomUserMessageArgs(GameClient session)
{
this.session = session;
this.RoomUser = null;
this.allowsExecution = false;
this.Room = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);
if (Room != null)
{
this.allowsExecution = Room.CheckRights(session, true);
this.RoomUser = Room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
}
if (Room == null || RoomUser == null || !allowsExecution)
allowsExecution = false;
}
示例15: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(436); //436
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
int TotalLevels = Achievement.Levels.Count;
if (TargetLevel > TotalLevels)
{
TargetLevel = TotalLevels;
}
AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];
Message.AppendUInt(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.RewardPixels); // Pixel reward
Message.AppendInt32(TargetLevelData.RewardPoints); // Unknown(??)
Message.AppendInt32(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendStringWithBreak(Achievement.Category); // Category
Message.AppendInt32(TotalLevels); // Total amount of levels
}
return Message;
}