本文整理汇总了C#中Phoenix.HabboHotel.GameClients.GameClient.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.SendMessage方法的具体用法?C# GameClient.SendMessage怎么用?C# GameClient.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phoenix.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parse
public void parse(GameClient Session, ClientMessage Event)
{
uint Id = Event.PopWiredUInt();
Event.PopFixedString();
Event.PopWiredInt32();
RoomData Data = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);
if (Data != null)
{
if (Data.Type == "private")
{
ServerMessage Message = new ServerMessage(286);
Message.AppendBoolean(Data.IsPublicRoom);
Message.AppendUInt(Id);
Session.SendMessage(Message);
}
else
{
ServerMessage Message2 = new ServerMessage(453);
Message2.AppendUInt(Data.Id);
Message2.AppendStringWithBreak(Data.CCTs);
Message2.AppendUInt(Data.Id);
Session.SendMessage(Message2);
}
}
}
示例2: parse
public void parse(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null && [email protected])
{
RoomUser class2 = @class.method_48(num);
if (class2 == null || class2.PetData == null)
{
DataRow dataRow = null;
using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
{
class3.AddParamWithValue("petid", num);
dataRow = class3.ReadDataRow("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE Id = @petid LIMIT 1");
}
if (dataRow != null)
{
Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GeneratePetFromRow(dataRow).SerializeInfo());
}
}
else
{
Session.SendMessage(class2.PetData.SerializeInfo());
}
}
}
示例3: parse
public void parse(GameClient Session, ClientMessage Event)
{
Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room != null && Room.CheckRights(Session, true))
{
Event.PopWiredInt32();
Dictionary<int, int> Items = new Dictionary<int, int>();
int BackgroundImage = Event.PopWiredInt32();
int ForegroundImage = Event.PopWiredInt32();
int num3 = Event.PopWiredInt32();
for (int i = 0; i < num3; i++)
{
int num4 = Event.PopWiredInt32();
int num5 = Event.PopWiredInt32();
if (num4 < 0 || num4 > 10 || (num5 < 1 || num5 > 27) || Items.ContainsKey(num4))
{
return;
}
Items.Add(num4, num5);
}
if (BackgroundImage >= 1 && BackgroundImage <= 24 && (ForegroundImage >= 0 && ForegroundImage <= 11))
{
StringBuilder stringBuilder = new StringBuilder();
int num6 = 0;
foreach (KeyValuePair<int, int> Item in Items)
{
if (num6 > 0)
{
stringBuilder.Append("|");
}
stringBuilder.Append(Item.Key + "," + Item.Value);
num6++;
}
using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
{
adapter.ExecuteQuery("UPDATE rooms SET icon_bg = '" + BackgroundImage + "', icon_fg = '" + ForegroundImage + "', icon_items = '" + stringBuilder.ToString() + "' WHERE Id = '" + Room.RoomId + "' LIMIT 1");
}
Room.myIcon = new RoomIcon(BackgroundImage, ForegroundImage, Items);
ServerMessage Message = new ServerMessage(457);
Message.AppendUInt(Room.RoomId);
Message.AppendBoolean(true);
Session.SendMessage(Message);
ServerMessage Message2 = new ServerMessage(456);
Message2.AppendUInt(Room.RoomId);
Session.SendMessage(Message2);
RoomData Data = Room.RoomData;
ServerMessage Message3 = new ServerMessage(454);
Message3.AppendBoolean(false);
Data.Serialize(Message3, false, false);
Session.SendMessage(Message3);
}
}
}
示例4: parse
public void parse(GameClient Session, ClientMessage Event)
{
Dictionary<Room, int> dictionary = PhoenixEnvironment.GetGame().GetRoomManager().method_21();
Room @class = null;
IEnumerable<Room> arg_35_0 = dictionary.Keys;
if (FindNewFriendsMessageEvent.func_0 == null)
{
FindNewFriendsMessageEvent.func_0 = new Func<Room, int>(FindNewFriendsMessageEvent.smethod_0);
}
IOrderedEnumerable<Room> orderedEnumerable = arg_35_0.OrderByDescending(FindNewFriendsMessageEvent.func_0);
int num = 0;
foreach (Room current in orderedEnumerable)
{
num++;
string a = PhoenixEnvironment.GetRandomNumber(1, 5).ToString();
if (a == "2")
{
goto IL_83;
}
if (num == orderedEnumerable.Count<Room>())
{
goto IL_83;
}
bool arg_A2_0 = true;
IL_A2:
if (arg_A2_0)
{
continue;
}
@class = current;
break;
IL_83:
arg_A2_0 = (Session.GetHabbo().CurrentRoom == null || Session.GetHabbo().CurrentRoom == current);
goto IL_A2;
}
if (@class == null)
{
ServerMessage Message = new ServerMessage(831u);
Message.AppendBoolean(false);
Session.SendMessage(Message);
}
else
{
ServerMessage Message2 = new ServerMessage(286u);
Message2.AppendBoolean(@class.IsPublic);
Message2.AppendUInt(@class.RoomId);
Session.SendMessage(Message2);
ServerMessage Message3 = new ServerMessage(831u);
Message3.AppendBoolean(true);
Session.SendMessage(Message3);
}
}
示例5: parse
public void parse(GameClient Session, ClientMessage Request)
{
ServerMessage message = new ServerMessage(267);
message.AppendBoolean(Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"));
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
{
using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
{
adapter.AddParamWithValue("userid", Session.GetHabbo().Id);
DataTable Row = adapter.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;");
if (Row == null)
{
message.AppendInt32(0);
}
else
{
message.AppendInt32(Row.Rows.Count);
foreach (DataRow row in Row.Rows)
{
message.AppendUInt((uint)row["slot_id"]);
message.AppendStringWithBreak((string)row["look"]);
message.AppendStringWithBreak((string)row["gender"]);
}
}
}
Session.SendMessage(message);
}
else
{
using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
{
adapter.AddParamWithValue("userid", Session.GetHabbo().Id);
DataTable Row = adapter.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;");
if (Row == null)
{
message.AppendInt32(0);
}
else
{
message.AppendInt32(Row.Rows.Count);
foreach (DataRow row in Row.Rows)
{
message.AppendUInt((uint)row["slot_id"]);
message.AppendStringWithBreak((string)row["look"]);
message.AppendStringWithBreak((string)row["gender"]);
}
}
}
Session.SendMessage(message);
}
}
示例6: SellItem
public void SellItem(GameClient Session, uint ItemId, int SellingPrice)
{
UserItem Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);
if (Item == null || SellingPrice > GlobalClass.MaxMarketPlacePrice || !this.CanSellItem(Item))
{
ServerMessage Message = new ServerMessage(610u);
Message.AppendBoolean(false);
Session.SendMessage(Message);
}
else
{
int num = this.CalculateComissionPrice((float)SellingPrice);
int num2 = SellingPrice + num;
int num3 = 1;
if (Item.GetBaseItem().Type == 'i')
{
num3++;
}
using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient())
{
class2.AddParamWithValue("public_name", Item.GetBaseItem().PublicName);
class2.AddParamWithValue("extra_data", Item.ExtraData);
class2.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO catalog_marketplace_offers (furni_id, item_id,user_id,asking_price,total_price,public_name,sprite_id,item_type,timestamp,extra_data) VALUES ('",
ItemId,
"','",
Item.BaseItem,
"','",
Session.GetHabbo().Id,
"','",
SellingPrice,
"','",
num2,
"',@public_name,'",
Item.GetBaseItem().SpriteId,
"','",
num3,
"','",
PhoenixEnvironment.GetUnixTimestamp(),
"',@extra_data)"
}));
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId, 0u, true);
ServerMessage Message2 = new ServerMessage(610u);
Message2.AppendBoolean(true);
Session.SendMessage(Message2);
}
}
示例7: parse
public void parse(GameClient Session, ClientMessage Event)
{
if (Session.GetHabbo() == null)
{
Session.Login(Event.PopFixedString());
if (Session.GetHabbo() != null && Session.GetHabbo().MutedUsers != null && Session.GetHabbo().MutedUsers.Count > 0)
{
using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
{
try
{
ServerMessage Message = new ServerMessage(420);
Message.AppendInt32(Session.GetHabbo().MutedUsers.Count);
foreach (uint Id in Session.GetHabbo().MutedUsers)
{
string string_ = adapter.ReadString("SELECT username FROM users WHERE Id = " + Id + " LIMIT 1;");
Message.AppendStringWithBreak(string_);
}
Session.SendMessage(Message);
}
catch
{
Console.ForegroundColor = ConsoleColor.Red;
Logging.WriteLine("Login error: User is ignoring a user that no longer exists");
Console.ForegroundColor = ConsoleColor.Gray;
}
}
}
}
}
示例8: parse
public void parse(GameClient Session, ClientMessage Event)
{
if (Session != null && Session.GetHabbo() != null)
{
Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GetIndexMessageForRank(Session.GetHabbo().Rank));
}
}
示例9: parse
public void parse(GameClient Session, ClientMessage Event)
{
if (Session.GetHabbo().GetMessenger() != null)
{
Session.SendMessage(Session.GetHabbo().GetMessenger().PerformSearch(Event.PopFixedString()));
}
}
示例10: parse
public void parse(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
Room room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(num);
if (room != null && room.CheckRights(Session, true) && roomUserByHabbo != null && !roomUserByHabbo.IsBot && !room.UsersWithRights.Contains(num))
{
room.UsersWithRights.Add(num);
using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
{
adapter.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO room_rights (room_id,user_id) VALUES ('",
room.RoomId,
"','",
num,
"')"
}));
}
ServerMessage Message = new ServerMessage(510);
Message.AppendUInt(room.RoomId);
Message.AppendUInt(num);
Message.AppendStringWithBreak(roomUserByHabbo.GetClient().GetHabbo().Username);
Session.SendMessage(Message);
roomUserByHabbo.AddStatus("flatctrl", "");
roomUserByHabbo.UpdateNeeded = true;
roomUserByHabbo.GetClient().SendMessage(new ServerMessage(42));
}
}
示例11: parse
public void parse(GameClient Session, ClientMessage Event)
{
if (Session != null && Session.GetHabbo() != null)
{
Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializeFloorItemInventory());
}
}
示例12: parse
public void parse(GameClient Session, ClientMessage Event)
{
if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null)
{
Session.SendMessage(Session.GetHabbo().GetMessenger().SerializeUpdates());
}
}
示例13: parse
public void parse(GameClient Session, ClientMessage Event)
{
DataTable dataTable_ = Session.GetHabbo().GroupMemberships;
if (dataTable_ != null)
{
ServerMessage Message = new ServerMessage(915u);
Message.AppendInt32(dataTable_.Rows.Count);
foreach (DataRow dataRow in dataTable_.Rows)
{
Group @class = GroupManager.GetGroup((int)dataRow["groupid"]);
Message.AppendInt32(@class.Id);
Message.AppendStringWithBreak(@class.Name);
Message.AppendStringWithBreak(@class.Badge);
if (Session.GetHabbo().GroupID == @class.Id) // is favorite group?
{
Message.AppendBoolean(true);
}
else
{
Message.AppendBoolean(false);
}
}
Session.SendMessage(Message);
}
}
示例14: parse
public void parse(GameClient Session, ClientMessage Event)
{
ServerMessage Message = new ServerMessage(443);
Message.AppendInt32(Session.GetHabbo().AchievementScore);
Message.AppendStringWithBreak("");
Session.SendMessage(Message);
}
示例15: parse
public void parse(GameClient Session, ClientMessage Event)
{
Room class14_ = Session.GetHabbo().CurrentRoom;
if (class14_ != null)
{
Event.PopWiredUInt();
string string_ = Event.PopFixedString();
RoomUser @class = class14_.GetRoomUserByHabbo(string_);
if (@class != null)
{
uint uint_ = @class.GetClient().GetHabbo().Id;
if (Session.GetHabbo().MutedUsers.Contains(uint_))
{
Session.GetHabbo().MutedUsers.Remove(uint_);
using (DatabaseClient class2 = PhoenixEnvironment.GetDatabase().GetClient())
{
class2.ExecuteQuery(string.Concat(new object[]
{
"DELETE FROM user_ignores WHERE user_id = ",
Session.GetHabbo().Id,
" AND ignore_id = ",
uint_,
" LIMIT 1;"
}));
}
ServerMessage Message = new ServerMessage(419u);
Message.AppendInt32(3);
Session.SendMessage(Message);
}
}
}
}