本文整理汇总了C#中GameClients.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# GameClients.SendMessage方法的具体用法?C# GameClients.SendMessage怎么用?C# GameClients.SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClients
的用法示例。
在下文中一共展示了GameClients.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the room owner can run this command!");
return;
}
foreach (RoomUser User in Room.GetRoomUserManager().GetUserList().ToList())
{
if (User == null || User.IsPet || !User.IsBot)
continue;
RoomUser BotUser = null;
if (!Room.GetRoomUserManager().TryGetBot(User.BotData.Id, out BotUser))
return;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `bots` SET `room_id` = '0' WHERE `id` = @id LIMIT 1");
dbClient.AddParameter("id", User.BotData.Id);
dbClient.RunQuery();
}
Session.GetHabbo().GetInventoryComponent().TryAddBot(new Bot(Convert.ToInt32(BotUser.BotData.Id), Convert.ToInt32(BotUser.BotData.ownerID), BotUser.BotData.Name, BotUser.BotData.Motto, BotUser.BotData.Look, BotUser.BotData.Gender));
Session.SendMessage(new BotInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetBots()));
Room.GetRoomUserManager().RemoveBot(BotUser.VirtualId, false);
}
Session.SendWhisper("Success, removed all bots.");
}
示例2: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniTriggerEvent);
message.AddBoolean(false);
message.AddInt32(5);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
message.AddString(string.Empty);
message.AddInt32(1);
if (Item.wiredHandler != null)
{
ScoreAchieved handler = (ScoreAchieved)Item.wiredHandler;
message.AddInt32(handler.scoreLevel);
}
else
{
message.AddInt32(0);
}
message.AddInt32(0);
message.AddInt32(10);
message.AddInt32(0);
message.AddString(string.Empty);
Session.SendMessage(message);
}
示例3: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null || User.GetClient() == null)
return;
string[] headParts;
string[] figureParts = Session.GetHabbo().Look.Split('.');
foreach (string Part in figureParts)
{
if (Part.StartsWith("hd"))
{
headParts = Part.Split('-');
if (!headParts[1].Equals("99999"))
headParts[1] = "99999";
else
return;
Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, "hd-" + headParts[1] + "-" + headParts[2]);
break;
}
}
Session.GetHabbo().Look = PlusEnvironment.GetGame().GetAntiMutant().RunLook(Session.GetHabbo().Look);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `users` SET `look` = '" + Session.GetHabbo().Look + "' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
}
Session.SendMessage(new UserChangeComposer(User, true));
Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(User, false));
return;
}
示例4: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniActionEvent);
message.AddBoolean(false);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
message.AddString(string.Empty);
message.AddInt32(2);
if (Item.wiredHandler != null)
{
GiveScore handler = (GiveScore)Item.wiredHandler;
message.AddInt32(handler.scoreToGive);
message.AddInt32(handler.maxCountPerGame);
}
else
{
message.AddInt32(0); //Points
message.AddInt32(0); //Rounds
}
message.AddInt32(0);
message.AddInt32(6);
message.AddInt32(0);
message.AddInt32(0);
message.AddString(string.Empty);
Session.SendMessage(message);
}
示例5: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
int TotalValue = 0;
try
{
DataTable Table = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `id` FROM `items` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND (`room_id`= '0' OR `room_id` = '')");
Table = dbClient.getTable();
}
if (Table == null)
{
Session.SendWhisper("You currently have no items in your inventory!");
return;
}
foreach (DataRow Row in Table.Rows)
{
Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(Convert.ToInt32(Row[0]));
if (Item == null)
continue;
if (!Item.GetBaseItem().ItemName.StartsWith("CF_") && !Item.GetBaseItem().ItemName.StartsWith("CFC_"))
continue;
if (Item.RoomId > 0)
continue;
string[] Split = Item.GetBaseItem().ItemName.Split('_');
int Value = int.Parse(Split[1]);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);
TotalValue += Value;
if (Value > 0)
{
Session.GetHabbo().Credits += Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
}
if (TotalValue > 0)
Session.SendNotification("All credits have successfully been converted!\r\r(Total value: " + TotalValue + " credits!");
else
Session.SendNotification("It appears you don't have any exchangeable items!");
}
catch
{
Session.SendNotification("Oops, an error occoured whilst converting your credits!");
}
}
示例6: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniTriggerEvent);
message.AddBoolean(false);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
if (Item.wiredHandler != null)
{
EntersRoom handler = (EntersRoom)Item.wiredHandler;
if (!string.IsNullOrEmpty(handler.userName))
message.AddString(handler.userName);
else
message.AddString(string.Empty);
}
else
{
message.AddString(string.Empty);
}
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(7);
message.AddInt32(0);
message.AddString(string.Empty);
Session.SendMessage(message);
}
示例7: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!this.CanChangeName(Session.GetHabbo()))
{
Session.SendWhisper("Sorry, it seems you currently do not have the option to change your username!");
return;
}
Session.GetHabbo().ChangingName = true;
Session.SendNotification("Please be aware that if your username is deemed as inappropriate, you will be banned without question.\r\rAlso note that Staff will NOT change your username again should you have an issue with what you have chosen.\r\rClose this window and click yourself to begin choosing a new username!");
Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
}
示例8: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniActionEvent);
if (Item.wiredHandler != null)
{
MoveRotate handler = (MoveRotate)Item.wiredHandler;
message.AddBoolean(false);
message.AddInt32(MAX_FURNI_SELECTION);
message.AddInt32(handler.items.Count);
foreach (RoomItem item in handler.items)
{
message.AddInt32((int)item.Id);
}
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
message.AddString(string.Empty);
message.AddInt32(2);
message.AddInt32((int)handler.movement);
message.AddInt32((int)handler.rotation);
message.AddInt32(0);
message.AddInt32(4);
message.AddInt32(handler.delay);
message.AddInt32(0);
message.AddString(string.Empty);
}
else
{
message.AddBoolean(false);
message.AddInt32(MAX_FURNI_SELECTION);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
message.AddString(string.Empty);
message.AddInt32(2);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(4);
message.AddInt32(0);
message.AddInt32(0);
message.AddString(string.Empty);
}
Session.SendMessage(message);
}
示例9: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Please enter the username of the user you wish to mimic.");
return;
}
GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
return;
}
if (!TargetClient.GetHabbo().AllowMimic)
{
Session.SendWhisper("Oops, you cannot mimic this user - sorry!");
return;
}
RoomUser TargetUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
if (TargetUser == null)
{
Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online or in this room.");
return;
}
Session.GetHabbo().Gender = TargetUser.GetClient().GetHabbo().Gender;
Session.GetHabbo().Look = TargetUser.GetClient().GetHabbo().Look;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `users` SET `gender` = @gender, `look` = @look WHERE `id` = @id LIMIT 1");
dbClient.AddParameter("gender", Session.GetHabbo().Gender);
dbClient.AddParameter("look", Session.GetHabbo().Look);
dbClient.AddParameter("id", Session.GetHabbo().Id);
dbClient.RunQuery();
}
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User != null)
{
Session.SendMessage(new UserChangeComposer(User, true));
Room.SendMessage(new UserChangeComposer(User, false));
}
}
示例10: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniTriggerEvent);
message.AddBoolean(false);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
message.AddString(string.Empty);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(8);
message.AddInt32(0);
message.AddString(string.Empty);
Session.SendMessage(message);
}
示例11: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
return;
Room.GetRoomItemHandler().RemoveItems(Session);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `items` SET `room_id` = '0' WHERE `room_id` = @RoomId AND `user_id` = @UserId");
dbClient.AddParameter("RoomId", Room.Id);
dbClient.AddParameter("UserId", Session.GetHabbo().Id);
dbClient.RunQuery();
}
List<Item> Items = Room.GetRoomItemHandler().GetWallAndFloor.ToList();
if (Items.Count > 0)
Session.SendWhisper("There are still more items in this room, manually remove them or use :ejectall to eject them!");
Session.SendMessage(new FurniListUpdateComposer());
}
示例12: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniTriggerEvent);
message.AddBoolean(false);
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(Item.GetBaseItem().SpriteId);
message.AddUInt32(Item.Id);
if (Item.wiredHandler != null)
{
UserSays trigger = (UserSays)Item.wiredHandler;
message.AddString(trigger.triggerMessage);
}
else
{
message.AddString(string.Empty); // What is said
}
message.AddInt32(1);
if (Item.wiredHandler != null && Item.wiredHandler as UserSays != null)
{
UserSays says = (Item.wiredHandler as UserSays);
message.AddInt32(says.IsOwnerOnly ? 1 : 0);
}
else
{
message.AddInt32(0);
}
message.AddInt32(0);
message.AddInt32(0);
message.AddInt32(0);
message.AddString(string.Empty);
Session.SendMessage(message);
}
示例13: Execute
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (!Room.CheckRights(Session, true))
{
Session.SendWhisper("Oops, only the room owner can run this command!");
return;
}
if (Room.GetRoomUserManager().GetPets().Count > 0)
{
foreach (RoomUser Pet in Room.GetRoomUserManager().GetUserList().ToList())
{
if (Pet == null)
continue;
if (Pet.RidingHorse)
{
RoomUser UserRiding = Room.GetRoomUserManager().GetRoomUserByVirtualId(Pet.HorseID);
if (UserRiding != null)
{
UserRiding.RidingHorse = false;
UserRiding.ApplyEffect(-1);
UserRiding.MoveTo(new Point(UserRiding.X + 1, UserRiding.Y + 1));
}
else
Pet.RidingHorse = false;
}
Pet.PetData.RoomId = 0;
Pet.PetData.PlacedInRoom = false;
Pet pet = Pet.PetData;
if (pet != null)
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `bots` SET `room_id` = '0', `x` = '0', `Y` = '0', `Z` = '0' WHERE `id` = '" + pet.PetId + "' LIMIT 1");
dbClient.RunQuery("UPDATE `bots_petdata` SET `experience` = '" + pet.experience + "', `energy` = '" + pet.Energy + "', `nutrition` = '" + pet.Nutrition + "', `respect` = '" + pet.Respect + "' WHERE `id` = '" + pet.PetId + "' LIMIT 1");
}
}
if (pet.OwnerId != Session.GetHabbo().Id)
{
GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(pet.OwnerId);
if (Target != null)
{
Target.GetHabbo().GetInventoryComponent().TryAddPet(Pet.PetData);
Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);
Target.SendMessage(new PetInventoryComposer(Target.GetHabbo().GetInventoryComponent().GetPets()));
return;
}
}
Session.GetHabbo().GetInventoryComponent().TryAddPet(Pet.PetData);
Room.GetRoomUserManager().RemoveBot(Pet.VirtualId, false);
Session.SendMessage(new PetInventoryComposer(Session.GetHabbo().GetInventoryComponent().GetPets()));
}
Session.SendWhisper("Success, removed all pets.");
}
else
{
Session.SendWhisper("Oops, there isn't any pets in here!?");
}
}
示例14: OnTrigger
public void OnTrigger(GameClients.GameClient Session, Item Item, int Request, bool HasRights)
{
if (Item.ExtraData.Contains(Convert.ToChar(5).ToString()))
{
String[] Stuff = Item.ExtraData.Split(Convert.ToChar(5));
Session.GetHabbo().Gender = Stuff[0].ToUpper();
Dictionary<String, String> NewFig = new Dictionary<String, String>();
NewFig.Clear();
foreach (String Man in Stuff[1].Split('.'))
{
foreach (String Fig in Session.GetHabbo().Look.Split('.'))
{
if (Fig.Split('-')[0] == Man.Split('-')[0])
{
if (NewFig.ContainsKey(Fig.Split('-')[0]) && !NewFig.ContainsValue(Man))
{
NewFig.Remove(Fig.Split('-')[0]);
NewFig.Add(Fig.Split('-')[0], Man);
}
else if (!NewFig.ContainsKey(Fig.Split('-')[0]) && !NewFig.ContainsValue(Man))
{
NewFig.Add(Fig.Split('-')[0], Man);
}
}
else
{
if (!NewFig.ContainsKey(Fig.Split('-')[0]))
{
NewFig.Add(Fig.Split('-')[0], Fig);
}
}
}
}
string Final = "";
foreach (String Str in NewFig.Values)
{
Final += Str + ".";
}
Session.GetHabbo().Look = Final.TrimEnd('.');
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE users SET look = @look, gender = @gender WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
dbClient.AddParameter("look", Session.GetHabbo().Look);
dbClient.AddParameter("gender", Session.GetHabbo().Gender);
dbClient.RunQuery();
}
Room Room = Session.GetHabbo().CurrentRoom;
if (Room != null)
{
RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);
if (User != null)
{
Session.SendMessage(new UserChangeComposer(User, true));
Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(User, false));
}
}
}
}
示例15: DoTrigger
protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (UserHasRights)
Session.SendMessage(ConditionPacketBuilder.GenerateMessage(Item));
}