本文整理汇总了C#中Essential.HabboHotel.GameClients.GameClient.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.SendMessage方法的具体用法?C# GameClient.SendMessage怎么用?C# GameClient.SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
ServerMessage message = new ServerMessage(Outgoing.SendGuildParts); //Rootkit
message.AppendInt32(10);
message.AppendInt32((int)(Session.GetHabbo().OwnedRooms.Count - this.GetMyRoomsGuilds(Session)));
foreach (RoomData data in Session.GetHabbo().OwnedRooms)
{
if (data.GuildId == 0)
{
message.AppendInt32(data.Id);
message.AppendString(data.Name);
message.AppendBoolean(false);
}
}
message.AppendInt32(5);
message.AppendInt32(10);
message.AppendInt32(3);
message.AppendInt32(4);
message.AppendInt32(0x19);
message.AppendInt32(0x11);
message.AppendInt32(5);
message.AppendInt32(0x19);
message.AppendInt32(0x11);
message.AppendInt32(3);
message.AppendInt32(0x1d);
message.AppendInt32(11);
message.AppendInt32(4);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
Session.SendMessage(message);
Session.SendMessage(Essential.GetGame().GetCatalog().groupsDataMessage);
}
示例2: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
if (!Session.GetHabbo().CurrentRoom.CCTs.Contains("park"))
{
return;
}
if (Session.GetHabbo().CurrentRoom.IsInfobusOpen == false)
{
ServerMessage InfobusClosed = new ServerMessage(Outgoing.InfobusMessage);
InfobusClosed.AppendStringWithBreak("Ich bin zurzeit geschlossen! Komm später wieder.");
Session.SendMessage(InfobusClosed);
}
else
{
Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).MoveTo(28, 5);
if (Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).X == 28 && Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id).Y == 5)
{
ServerMessage Message = new ServerMessage(Outgoing.RoomForward);
Message.AppendBoolean(true);
Message.AppendInt32(56);
Session.SendMessage(Message);
}
}
}
示例3: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
Room @class = Essential.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 = Essential.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(Essential.GetGame().GetCatalog().GetPet(dataRow).SerializeInfo());
}
}
else
{
Session.SendMessage(class2.PetData.SerializeInfo());
}
}
}
示例4: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room Room = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room != null && Room.CheckRights(Session, true))
{
ServerMessage LoadUsersWithRights = new ServerMessage(Outgoing.FlatControllerAdded);
LoadUsersWithRights.AppendUInt(Room.Id);
LoadUsersWithRights.AppendInt32(Room.UsersWithRights.Count);
foreach (uint current2 in Room.UsersWithRights)
{
LoadUsersWithRights.AppendUInt(current2);
LoadUsersWithRights.AppendString(Essential.GetGame().GetClientManager().GetNameById(current2));
}
Session.SendMessage(LoadUsersWithRights);
foreach (uint current3 in Room.UsersWithRights)
{
ServerMessage serverMessage = new ServerMessage(Outgoing.GivePowers); // Updated
serverMessage.AppendUInt(Room.Id);
serverMessage.AppendUInt(current3);
serverMessage.AppendStringWithBreak(Essential.GetGame().GetClientManager().GetNameById(current3));
Session.SendMessage(serverMessage);
}
}
}
示例5: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
if (Session.GetHabbo().InRoom)
{
int num = Event.PopWiredInt32();
if (num >= 3)
{
for (int i = 0; i < num; i++)
{
UserItem @class = Session.GetHabbo().GetInventoryComponent().GetItemById(Event.PopWiredUInt());
if (@class == null || [email protected]().AllowRecycle)
{
return;
}
Session.GetHabbo().GetInventoryComponent().method_12(@class.uint_0, 0u, false);
}
uint num2 = Essential.GetGame().GetCatalog().GetNextId();
EcotronReward class2 = Essential.GetGame().GetCatalog().GetEcotronReward();
using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
{
class3.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO items (Id,user_id,base_item,wall_pos) VALUES ('",
num2,
"','",
Session.GetHabbo().Id,
"','1478','')"
}));
class3.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO items_extra_data (item_id,extra_data) VALUES ('",
num2,
"','",
DateTime.Now.ToLongDateString(),
"')"
}));
class3.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO user_presents (item_id,base_id,amount,extra_data) VALUES ('",
num2,
"','",
class2.uint_2,
"','1','')"
}));
}
Session.GetHabbo().GetInventoryComponent().method_9(true);
ServerMessage Response = new ServerMessage(Outgoing.SendPurchaseAlert);
Response.AppendInt32(1);
Response.AppendInt32(1);
Response.AppendInt32(1);
Response.AppendInt32(class2.GetBaseItem().Sprite);
Session.SendMessage(Response);
ServerMessage Response2 = new ServerMessage(Outgoing.RecycleState);
Response2.AppendInt32(1);
Response2.AppendInt32(class2.GetBaseItem().Sprite);
Session.SendMessage(Response2);
}
}
}
示例6: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int GameId = Event.PopWiredInt32();
ServerMessage InitGame = new ServerMessage(Outgoing.GameID);
InitGame.AppendInt32(GameId);
InitGame.AppendInt32(0);
Session.SendMessage(InitGame);
ServerMessage Game2WeeklyLeaderboardEvent = new ServerMessage(Outgoing.Game2WeeklyLeaderboard);
Game2WeeklyLeaderboardEvent.AppendInt32(DateTime.Now.Year);
Game2WeeklyLeaderboardEvent.AppendInt32(1); // ??
Game2WeeklyLeaderboardEvent.AppendInt32(0); // ??
Game2WeeklyLeaderboardEvent.AppendInt32(0); // ??
Game2WeeklyLeaderboardEvent.AppendInt32(5231); // ??
Game2WeeklyLeaderboardEvent.AppendInt32(1); // count:
// foreach...
Game2WeeklyLeaderboardEvent.AppendUInt(Session.GetHabbo().Id); // user id
Game2WeeklyLeaderboardEvent.AppendInt32(DateTime.Now.Year); // time of clasification
Game2WeeklyLeaderboardEvent.AppendInt32(1); // position
Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Username); // username
Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Figure);
Game2WeeklyLeaderboardEvent.AppendString(Session.GetHabbo().Gender.ToLower());
Game2WeeklyLeaderboardEvent.AppendInt32(3);
Game2WeeklyLeaderboardEvent.AppendInt32(GameId);
Session.SendMessage(Game2WeeklyLeaderboardEvent);
ServerMessage Game2AccountGameStatusMessageEvent = new ServerMessage(Outgoing.Game2AccountGameStatus);
Game2AccountGameStatusMessageEvent.AppendInt32(GameId);
Game2AccountGameStatusMessageEvent.AppendInt32(-1);
Game2AccountGameStatusMessageEvent.AppendInt32(132);
Session.SendMessage(Game2AccountGameStatusMessageEvent);
ServerMessage InitGame2 = new ServerMessage(Outgoing.InitGame);
InitGame2.AppendInt32(GameId);
InitGame2.AppendInt32(0);
Session.SendMessage(InitGame2);
ServerMessage GameCenterLayoutBestOfWeek = new ServerMessage(Outgoing.BestOfWeek);
GameCenterLayoutBestOfWeek.AppendInt32(GameId);
GameCenterLayoutBestOfWeek.AppendInt32(0); // enabled 0 : 1
// if enabled
GameCenterLayoutBestOfWeek.AppendString("s");
GameCenterLayoutBestOfWeek.AppendInt32(4313);
GameCenterLayoutBestOfWeek.AppendString("200");
GameCenterLayoutBestOfWeek.AppendInt32(1);
GameCenterLayoutBestOfWeek.AppendInt32(-1);
GameCenterLayoutBestOfWeek.AppendBoolean(false);
//
GameCenterLayoutBestOfWeek.AppendInt32(5231); // minutos que quedan.
GameCenterLayoutBestOfWeek.AppendBoolean(false); // enabled??
Session.SendMessage(GameCenterLayoutBestOfWeek);
}
示例7: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint userId = Event.PopWiredUInt();
GameClient gc = Essential.GetGame().GetClientManager().GetClientByHabbo(Essential.GetGame().GetClientManager().GetNameById(userId));
if (gc != null)
Session.SendMessage(gc.GetHabbo().GetRelationshipComposer().SerializeRelationshipsProfile());
else
Session.SendMessage(new RelationshipComposer(userId).SerializeRelationshipsProfile());
}
示例8: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
try
{
Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null && @class.CheckRights(Session, true))
{
RoomItem class2 = @class.method_28(Event.PopWiredUInt());
if (class2 != null)
{
DataRow dataRow = null;
using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
{
dataRow = class3.ReadDataRow("SELECT base_id,amount,extra_data FROM user_presents WHERE item_id = '" + class2.uint_0 + "' LIMIT 1");
}
if (dataRow != null)
{
Item class4 = Essential.GetGame().GetItemManager().GetItemById((uint)dataRow["base_id"]);
if (class4 != null)
{
@class.method_29(Session, class2.uint_0, true, true);
ServerMessage Message = new ServerMessage(Outgoing.UpdateInventary);
Message.AppendUInt(class2.uint_0);
Session.SendMessage(Message);
/*ServerMessage Message2 = new ServerMessage(Outgoing.Item2);
Message2.AppendStringWithBreak(class4.Type.ToString());
Message2.AppendInt32(class4.Sprite);
Message2.AppendStringWithBreak(class4.Name);
Message2.AppendInt32(class2.uint_0);
Message2.AppendString(class2.GetBaseItem().Type.ToString());
Message2.AppendBoolean(true);
Message2.AppendString(class2.ExtraData);
Session.SendMessage(Message2);*/
ServerMessage Message3 = new ServerMessage(Outgoing.OpenGift);
Message3.AppendString(class4.Type.ToString());
Message3.AppendInt32(class4.Sprite);
Message3.AppendString(class4.Name);
Message3.AppendInt32(class2.uint_0);
Message3.AppendString(class2.GetBaseItem().Type.ToString());
Message3.AppendBoolean(true);
Message3.AppendString(class2.ExtraData);
Session.SendMessage(Message3);
using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
{
class3.ExecuteQuery("DELETE FROM user_presents WHERE item_id = '" + class2.uint_0 + "' LIMIT 1");
}
Essential.GetGame().GetCatalog().AddItemToInventory(Session, class4, (int)dataRow["amount"], (string)dataRow["extra_data"], true, 0u, 0, 0, "");
}
}
}
}
}
catch
{
}
}
示例9: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int botId = Event.PopWiredInt32();
int skillType = Event.PopWiredInt32();
switch (skillType)
{
case 2:
{
string truncatedText = "";
using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
DataTable dt;
DataRow speakingRow;
dt = dbClient.ReadDataTable("SELECT * FROM bots_speech WHERE bot_id = " + botId);
if (dt != null)
{
foreach (DataRow dr in dt.Rows)
{
truncatedText += (dr["text"] + "\n");
}
speakingRow = dbClient.ReadDataRow("SELECT * FROM user_bots WHERE id = " + botId);
truncatedText += ";#;";
truncatedText += Convert.ToString(speakingRow["automatic_chat"]);
truncatedText += ";#;";
truncatedText += Convert.ToString(speakingRow["speaking_interval"]);
}
}
ServerMessage message = new ServerMessage(Outgoing.SerializeSpeechList);
message.AppendInt32(botId);
message.AppendInt32(skillType);
message.AppendString(truncatedText);
Session.SendMessage(message);
break;
}
case 5:
{
ServerMessage message = new ServerMessage(Outgoing.SerializeSpeechList);
message.AppendInt32(botId);
message.AppendInt32(skillType);
using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
message.AppendString(dbClient.ReadString("SELECT name FROM user_bots WHERE id = " + botId));
}
Session.SendMessage(message);
break;
}
default:
return;
}
}
示例10: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Dictionary<Room, int> dictionary = Essential.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 = Essential.smethod_5(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 == null ||Session.GetHabbo() == null || Session.GetHabbo().CurrentRoom == null || Session.GetHabbo().CurrentRoom == current);
goto IL_A2;
}
if (@class == null)
{
ServerMessage Message = new ServerMessage(Outgoing.SearchFriendsMessage); // Updated
Message.AppendBoolean(false);
Session.SendMessage(Message);
}
else
{
ServerMessage Message2 = new ServerMessage(Outgoing.RoomForward); // Updated
Message2.AppendBoolean(@class.IsPublic);
Message2.AppendUInt(@class.Id);
Session.SendMessage(Message2);
ServerMessage Message3 = new ServerMessage(Outgoing.SearchFriendsMessage);
Message3.AppendBoolean(true);
Session.SendMessage(Message3);
}
}
示例11: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
ServerMessage Message = new ServerMessage(Outgoing.WardrobeData); //Rootkit
Message.AppendInt32(Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") ? 1 : 0);
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club"))
{
using (DatabaseClient @class = Essential.GetDatabase().GetClient())
{
@class.AddParamWithValue("userid", Session.GetHabbo().Id);
DataTable dataTable = @class.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;");
if (dataTable == null)
{
Message.AppendInt32(0);
}
else
{
Message.AppendInt32(dataTable.Rows.Count);
foreach (DataRow dataRow in dataTable.Rows)
{
Message.AppendUInt((uint)dataRow["slot_id"]);
Message.AppendStringWithBreak((string)dataRow["look"]);
Message.AppendStringWithBreak((string)dataRow["gender"]);
}
}
}
Session.SendMessage(Message);
}
else
{
using (DatabaseClient @class = Essential.GetDatabase().GetClient())
{
@class.AddParamWithValue("userid", Session.GetHabbo().Id);
DataTable dataTable = @class.ReadDataTable("SELECT slot_id, look, gender FROM user_wardrobe WHERE user_id = @userid;");
if (dataTable == null)
{
Message.AppendInt32(0);
}
else
{
Message.AppendInt32(dataTable.Rows.Count);
foreach (DataRow dataRow in dataTable.Rows)
{
Message.AppendUInt((uint)dataRow["slot_id"]);
Message.AppendStringWithBreak((string)dataRow["look"]);
Message.AppendStringWithBreak((string)dataRow["gender"]);
}
}
}
Session.SendMessage(Message);
}
}
示例12: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
try
{
/*if (Essential.GetGame().GetGuideManager().UserMadeTicket(Session.GetHabbo().Id))
{
Session.SendMessage(Essential.GetGame().GetGuideManager().ErrorMessage);
return;
}*/
Event.PopWiredInt32();
string msg = Event.PopFixedString();
GameClient randomGuide = Essential.GetGame().GetClientManager().GetClientByHabbo(Essential.GetGame().GetClientManager().GetNameById(Essential.GetGame().GetGuideManager().GetRandomGuide().Id));
ServerMessage Message = new ServerMessage(Outgoing.GuideSessionAttached); //Rootkit
Message.AppendBoolean(true);
Message.AppendInt32(Session.GetHabbo().Id);
Message.AppendString(msg);
Message.AppendInt32(Essential.GetGame().GetGuideManager().Timer);
randomGuide.SendMessage(Message);
Message = new ServerMessage(Outgoing.GuideSessionAttached); //Rootkit
Message.AppendBoolean(false);
Message.AppendInt32(Session.GetHabbo().Id);
Message.AppendString(msg);
Message.AppendInt32(Essential.GetGame().GetGuideManager().Timer);
Session.SendMessage(Message);
Essential.GetGame().GetGuideManager().CreateTicket(Session.GetHabbo(), randomGuide.GetHabbo());
Action<object> a = delegate(object obj)
{
int i = Essential.GetGame().GetGuideManager().Timer;
while (i != 0)
{
Thread.Sleep(1000);
i--;
}
GuideTicket gt = Essential.GetGame().GetGuideManager().GetTicket(Session.GetHabbo().Id);
if (gt == null || !gt.Answered)
{
try
{
gt.SendToTicket(Essential.GetGame().GetGuideManager().DetachedMessage);
Essential.GetGame().GetGuideManager().RemoveTicket(Session.GetHabbo().Id);
Essential.GetGame().GetGuideManager().GetGuideById(gt.GuideId).IsInUse = false;
}
catch { }
}
};
new Task(a,"break").Start();
}catch
{
Session.SendMessage(Essential.GetGame().GetGuideManager().ErrorMessage);
}
}
示例13: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint requester = Event.PopWiredUInt();
uint newStatus = Event.PopWiredUInt();
if (Session.GetHabbo().GetRelationshipComposer().GetRelationshipList.ContainsKey(requester))
{
if (Session.GetHabbo().GetRelationshipComposer().GetRelationshipList[requester] != newStatus)
Session.SendMessage(Session.GetHabbo().GetRelationshipComposer().SerializeRelationshipUpdate(requester, newStatus));
}
else if ((!Session.GetHabbo().GetRelationshipComposer().GetRelationshipList.ContainsKey(requester)) && (newStatus != 0))
Session.SendMessage(Session.GetHabbo().GetRelationshipComposer().SerializeRelationshipUpdate(requester, newStatus));
else
return;
}
示例14: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
try
{
Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
{
ServerMessage Message = new ServerMessage(Outgoing.DimmerData); // Updated
Message.AppendInt32(@class.MoodlightData.Presets.Count);
Message.AppendInt32(@class.MoodlightData.CurrentPreset);
int num = 0;
foreach (MoodlightPreset current in @class.MoodlightData.Presets)
{
num++;
Message.AppendInt32(num);
Message.AppendInt32(int.Parse(Essential.BooleanToString(current.BackgroundOnly)) + 1);
Message.AppendStringWithBreak(current.ColorCode);
Message.AppendInt32(current.ColorIntensity);
}
Session.SendMessage(Message);
}
}
catch
{
}
}
示例15: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int num = Event.PopWiredInt32();
ServerMessage Message = new ServerMessage(Outgoing.SongInfo); // Updated
Message.AppendInt32(num);
if (num > 0)
{
for (int i = 0; i < num; i++)
{
int num2 = Event.PopWiredInt32();
if (num2 > 0)
{
Message.AppendInt32(SongManager.GetSong(num2).Id);
Message.AppendString(SongManager.GetSong(num2).Name);
Message.AppendString(SongManager.GetSong(num2).Track);
Message.AppendInt32(SongManager.GetSong(num2).Length);
Message.AppendString(SongManager.GetSong(num2).Author);
}
else
{
// Ei lähetetä osittaista pakettia!!
return;
}
}
}
Session.SendMessage(Message);
}