本文整理汇总了C#中Plus.HabboHotel.GameClients.GameClient.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.SendMessage方法的具体用法?C# GameClient.SendMessage怎么用?C# GameClient.SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plus.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
{
if (Session == null || Item == null)
return;
if (!HasRights)
return;
IWiredItem Box = null;
if (!Item.GetRoom().GetWired().TryGet(Item.Id, out Box))
return;
Item.ExtraData = "1";
Item.UpdateState(false, true);
Item.RequestUpdate(2, true);
if (Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect)
return;
if (Item.GetRoom().GetWired().IsTrigger(Item))
{
List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(Box, Item.GetRoom().GetWired().GetEffects(Box));
Session.SendMessage(new WiredTriggerConfigComposer(Box, BlockedItems));
}
else if (Item.GetRoom().GetWired().IsEffect(Item))
{
List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(Box, Item.GetRoom().GetWired().GetTriggers(Box));
Session.SendMessage(new WiredEffectConfigComposer(Box, BlockedItems));
}
else if (Item.GetRoom().GetWired().IsCondition(Item))
Session.SendMessage(new WiredConditionConfigComposer(Box));
}
示例2: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
string PetName = Packet.PopString();
if (PetName.Length < 2)
{
Session.SendMessage(new CheckPetNameComposer(2, "2"));
return;
}
else if (PetName.Length > 15)
{
Session.SendMessage(new CheckPetNameComposer(1, "15"));
return;
}
else if (!PlusEnvironment.IsValidAlphaNumeric(PetName))
{
Session.SendMessage(new CheckPetNameComposer(3, ""));
return;
}
else if (PlusEnvironment.GetGame().GetChatManager().GetFilter().IsFiltered(PetName))
{
Session.SendMessage(new CheckPetNameComposer(4, ""));
return;
}
Session.SendMessage(new CheckPetNameComposer(0, ""));
}
示例3: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
string VoucherCode = Packet.PopString().Replace("\r", "");
Voucher Voucher = null;
if (!PlusEnvironment.GetGame().GetCatalog().GetVoucherManager().TryGetVoucher(VoucherCode, out Voucher))
{
Session.SendMessage(new VoucherRedeemErrorComposer(0));
return;
}
if (Voucher.CurrentUses >= Voucher.MaxUses)
{
Session.SendNotification("Oops, this voucher has reached the maximum usage limit!");
return;
}
DataRow GetRow = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT * FROM `user_vouchers` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `voucher` = @Voucher LIMIT 1");
dbClient.AddParameter("Voucher", VoucherCode);
GetRow = dbClient.getRow();
}
if (GetRow != null)
{
Session.SendNotification("You've already used this voucher code, one per each user, sorry!");
return;
}
else
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("INSERT INTO `user_vouchers` (`user_id`,`voucher`) VALUES ('" + Session.GetHabbo().Id + "', @Voucher)");
dbClient.AddParameter("Voucher", VoucherCode);
dbClient.RunQuery();
}
}
Voucher.UpdateUses();
if (Voucher.Type == VoucherType.CREDIT)
{
Session.GetHabbo().Credits += Voucher.Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
else if (Voucher.Type == VoucherType.DUCKET)
{
Session.GetHabbo().Duckets += Voucher.Value;
Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Duckets, Voucher.Value));
}
Session.SendMessage(new VoucherRedeemOkComposer());
}
示例4: CheckRewards
public void CheckRewards(GameClient Session)
{
if (Session == null || Session.GetHabbo() == null)
return;
foreach (KeyValuePair<int, Reward> Entry in _rewards)
{
int Id = Entry.Key;
Reward Reward = Entry.Value;
if (this.HasReward(Session.GetHabbo().Id, Id))
continue;
if (Reward.isActive())
{
switch (Reward.Type)
{
case RewardType.BADGE:
{
if (!Session.GetHabbo().GetBadgeComponent().HasBadge(Reward.RewardData))
Session.GetHabbo().GetBadgeComponent().GiveBadge(Reward.RewardData, true, Session);
break;
}
case RewardType.CREDITS:
{
Session.GetHabbo().Credits += Convert.ToInt32(Reward.RewardData);
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
break;
}
case RewardType.DUCKETS:
{
Session.GetHabbo().Duckets += Convert.ToInt32(Reward.RewardData);
Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Duckets, Convert.ToInt32(Reward.RewardData)));
break;
}
case RewardType.DIAMONDS:
{
Session.GetHabbo().Diamonds += Convert.ToInt32(Reward.RewardData);
Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, Convert.ToInt32(Reward.RewardData), 5));
break;
}
}
if (!String.IsNullOrEmpty(Reward.Message))
Session.SendNotification(Reward.Message);
this.LogReward(Session.GetHabbo().Id, Id);
}
else
continue;
}
}
示例5: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
/*int Sub = 0;
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription)
{
Sub = Session.GetHabbo().GetSubscriptionManager().GetSubscription().SubscriptionId;
}*/
Session.SendMessage(new CatalogIndexComposer(Session, PlusEnvironment.GetGame().GetCatalog().GetPages()));//, Sub));
Session.SendMessage(new CatalogItemDiscountComposer());
Session.SendMessage(new BCBorrowedItemsComposer());
}
示例6: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
string Type = Packet.PopString();
string PacketType = "";
int PetId = PlusEnvironment.GetGame().GetCatalog().GetPetRaceManager().GetPetId(Type, out PacketType);
Session.SendMessage(new SellablePetBreedsComposer(PacketType, PetId, PlusEnvironment.GetGame().GetCatalog().GetPetRaceManager().GetRacesForRaceId(PetId)));
}
示例7: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
if (!Session.GetHabbo().InRoom)
return;
if (!Session.GetHabbo().EnterRoom(Session.GetHabbo().CurrentRoom))
Session.SendMessage(new CloseConnectionComposer());
}
示例8: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
string Junk = Packet.PopString();
string MachineId = Packet.PopString();
Session.MachineId = MachineId;
Session.SendMessage(new SetUniqueIdComposer(MachineId));
}
示例9: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
if (Session == null)
return;
ICollection<SearchResultList> Categories = PlusEnvironment.GetGame().GetNavigator().GetFlatCategories();
Session.SendMessage(new UserFlatCatsComposer(Categories, Session.GetHabbo().Rank));
}
示例10: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
int Id = Packet.PopInt();
Session.GetHabbo().FavoriteRooms.Remove(Id);
Session.SendMessage(new UpdateFavouriteRoomComposer(Id, false));
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM user_favorites WHERE user_id = " + Session.GetHabbo().Id + " AND room_id = " + Id + " LIMIT 1");
}
}
示例11: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
if (Session == null || Session.GetHabbo() == null)
return;
int PageId = Packet.PopInt();
int ItemId = Packet.PopInt();
int RoomId = Packet.PopInt();
string Name = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
bool junk3 = Packet.PopBoolean();
string Desc = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
int CategoryId = Packet.PopInt();
RoomData Data = PlusEnvironment.GetGame().GetRoomManager().GenerateRoomData(RoomId);
if (Data == null)
return;
if (Data.OwnerId != Session.GetHabbo().Id)
return;
if (Data.Promotion == null)
Data.Promotion = new RoomPromotion(Name, Desc, CategoryId);
else
{
Data.Promotion.Name = Name;
Data.Promotion.Description = Desc;
Data.Promotion.TimestampExpires += 7200;
}
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("REPLACE INTO `room_promotions` (`room_id`,`title`,`description`,`timestamp_start`,`timestamp_expire`,`category_id`) VALUES (@room_id, @title, @description, @start, @expires, @CategoryId)");
dbClient.AddParameter("room_id", RoomId);
dbClient.AddParameter("title", Name);
dbClient.AddParameter("description", Desc);
dbClient.AddParameter("start", Data.Promotion.TimestampStarted);
dbClient.AddParameter("expires", Data.Promotion.TimestampExpires);
dbClient.AddParameter("CategoryId", CategoryId);
dbClient.RunQuery();
}
if (!Session.GetHabbo().GetBadgeComponent().HasBadge("RADZZ"))
Session.GetHabbo().GetBadgeComponent().GiveBadge("RADZZ", true, Session);
Session.SendMessage(new PurchaseOKComposer());
if (Session.GetHabbo().InRoom && Session.GetHabbo().CurrentRoomId == RoomId)
Session.GetHabbo().CurrentRoom.SendMessage(new RoomEventComposer(Data, Data.Promotion));
Session.GetHabbo().GetMessenger().BroadcastAchievement(Session.GetHabbo().Id, HabboHotel.Users.Messenger.MessengerEventTypes.EVENT_STARTED, Name);
}
示例12: CancelQuest
public void CancelQuest(GameClient Session, ClientPacket Message)
{
Quest Quest = GetQuest(Session.GetHabbo().GetStats().QuestID);
if (Quest == null)
return;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `user_quests` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND `quest_id` = '" + Quest.Id + "';" +
"UPDATE `user_stats` SET `quest_id` = '0' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
Session.GetHabbo().GetStats().QuestID = 0;
Session.SendMessage(new QuestAbortedComposer());
GetList(Session, null);
}
示例13: Parse
public void Parse(GameClient Session, ClientPacket Packet)
{
int PageId = Packet.PopInt();
int Something = Packet.PopInt();
string CataMode = Packet.PopString();
CatalogPage Page = null;
if (!PlusEnvironment.GetGame().GetCatalog().TryGetPage(PageId, out Page))
return;
if (!Page.Enabled || !Page.Visible || Page.MinimumRank > Session.GetHabbo().Rank || (Page.MinimumVIP > Session.GetHabbo().VIPRank && Session.GetHabbo().Rank == 1))
return;
Session.SendMessage(new CatalogPageComposer(Page, CataMode));
}
示例14: ActivateQuest
public void ActivateQuest(GameClient Session, int QuestId)
{
Quest Quest = GetQuest(QuestId);
if (Quest == null)
return;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("REPLACE INTO `user_quests` (`user_id`,`quest_id`) VALUES ('" + Session.GetHabbo().Id + "', '" + Quest.Id + "')");
dbClient.RunQuery("UPDATE `user_stats` SET `quest_id` = '" + Quest.Id + "' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
Session.GetHabbo().GetStats().QuestID = Quest.Id;
GetList(Session, null);
Session.SendMessage(new QuestStartedComposer(Session, Quest));
}
示例15: Execute
public void Execute(GameClient Session, Room Room, string[] Params)
{
TimeSpan Uptime = DateTime.Now - PlusEnvironment.ServerStarted;
int OnlineUsers = PlusEnvironment.GetGame().GetClientManager().Count;
int RoomCount = PlusEnvironment.GetGame().GetRoomManager().Count;
Session.SendMessage(new RoomNotificationComposer("Powered by PlusEmulator",
"<b>Credits</b>:\n" +
"Sledmore (Developer)\n" +
"123 (Developer)\n" +
"Joopie (Encryption)\n" +
"Tweeney (PlusEMU)\n" +
"Butterfly Emulator developers\n\n" +
"<b>Current run time information</b>:\n" +
"Online Users: " + OnlineUsers + "\n" +
"Rooms Loaded: " + RoomCount + "\n" +
"Uptime: " + Uptime.Days + " day(s), " + Uptime.Hours + " hours and " + Uptime.Minutes + " minutes.\n\n" +
"<b>SWF Revision</b>:\n" + PlusEnvironment.SWFRevision, "plus", ""));
}