本文整理汇总了C#中Essential.HabboHotel.GameClients.GameClient.GetClientMessageHandler方法的典型用法代码示例。如果您正苦于以下问题:C# GameClient.GetClientMessageHandler方法的具体用法?C# GameClient.GetClientMessageHandler怎么用?C# GameClient.GetClientMessageHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential.HabboHotel.GameClients.GameClient
的用法示例。
在下文中一共展示了GameClient.GetClientMessageHandler方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
string string_ = Event.PopFixedString();
Event.PopWiredInt32();
Session.GetHabbo().uint_2 = num;
if (Session.GetClientMessageHandler() == null)
Session.CreateClientMessageHandler();
Session.GetClientMessageHandler().method_5(num, string_);
}
示例2: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint uint_ = Event.PopWiredUInt();
bool bool_ = Event.PopWiredBoolean();
bool flag = Event.PopWiredBoolean();
if (uint_ == Session.GetHabbo().CurrentRoomId)
{
return;
}
RoomData @class = Essential.GetGame().GetRoomManager().method_12(uint_);
if (@class != null)
{
ServerMessage Message = new ServerMessage(Outgoing.GetGuestRoomResult); // Updated
Message.AppendBoolean(false);
Message.AppendUInt(@class.Id);
Message.AppendBoolean(false);
Message.AppendString(@class.Name);
Message.AppendBoolean(true);
Message.AppendInt32(@class.OwnerId);
Message.AppendStringWithBreak(@class.Owner);
Message.AppendInt32(@class.State); // @class state
Message.AppendInt32(@class.UsersNow);
Message.AppendInt32(@class.UsersMax);
Message.AppendStringWithBreak(@class.Description);
Message.AppendInt32(0); // dunno!
Message.AppendInt32((@class.Category == 9) ? 2 : 0); // can trade!
Message.AppendInt32(@class.Score);
Message.AppendInt32(@class.Category);
Message.AppendInt32(0);
Message.AppendInt32(0);
Message.AppendStringWithBreak("");
Message.AppendInt32(@class.TagCount);
foreach (string Tag in @class.Tags)
{
Message.AppendStringWithBreak(Tag);
}
Message.AppendInt32(0);
Message.AppendInt32(0);
Message.AppendInt32(0);
Message.AppendBoolean(true);
Message.AppendBoolean(false);
Message.AppendBoolean(true);
Message.AppendString("");
Message.AppendBoolean(false);
Session.SendMessage(Message);
Session.GetClientMessageHandler().method_5(@class.Id, "");
}
}
示例3: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
RoomData @class = Essential.GetGame().GetRoomManager().method_12(Session.GetHabbo().uint_2);
if (@class != null)
{
if (@class.Model == null)
{
Session.SendNotification("Error loading room, please try again soon! (Error Code: MdlData)");
Session.SendMessage(new ServerMessage(Outgoing.OutOfRoom)); // P
Session.GetClientMessageHandler().method_7();
}
else
{
Session.SendMessage(@class.Model.method_1(Essential.GetGame().GetRoomManager().GetRoom(@class.Id)));
Session.SendMessage(@class.Model.method_2(Essential.GetGame().GetRoomManager().GetRoom(@class.Id)));
/*if (@class.IsPublicRoom)
{
if (@class.Model.string_2.Contains("|"))
{
ServerMessage Message = new ServerMessage(Outgoing.RoomModel); // Updated
Message.AppendInt32(@class.Model.string_2.Split('|').Length);
foreach (string PublicIt in @class.Model.string_2.Split('|'))
{
Message.AppendInt32(0);
Message.AppendString(PublicIt.Split(' ')[0]);
Message.AppendString(PublicIt.Split(' ')[1]);
Message.AppendInt32(int.Parse(PublicIt.Split(' ')[2]));
Message.AppendInt32(int.Parse(PublicIt.Split(' ')[3]));
Message.AppendInt32(int.Parse(PublicIt.Split(' ')[4]));
Message.AppendInt32(int.Parse(PublicIt.Split(' ')[5]));
}
Session.SendMessage(Message);
ServerMessage Message6 = new ServerMessage(Outgoing.RoomEntryInfo); // P
Message6.AppendBoolean(false);
Message6.AppendString(@class.ModelName);
Message6.AppendUInt(0);
Message6.AppendBoolean(false);
Session.SendMessage(Message6);
}
} */
}
}
}
示例4: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
if (Essential.GetConfig().data["emu.messages.roommgr"] == "1")
{
Logging.WriteLine("[RoomMgr] Requesting Public Room [ID: " + num + "]");
}
RoomData @class = Essential.GetGame().GetRoomManager().method_12(num);
Session.GetHabbo().uint_2 = num;
Session.GetClientMessageHandler().method_5(num, "");
/* RoomData @class = Essential.GetGame().GetRoomManager().method_12(num);
if (@class != null && !(@class.Type != "public"))
{
Session.GetClientMessageHandler().method_5(num, "");
}
else
{
}
*/
}
示例5: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int guildId = Event.PopWiredInt32();
GroupsManager guild = Groups.GetGroupById(guildId);
if (guild != null && guild.UserWithRanks.Contains((int)Session.GetHabbo().Id))
{
int userId = Event.PopWiredInt32();
guild.JoinGroup(userId);
guild.Petitions.Remove(userId);
using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM group_requests WHERE userid=" + userId + " AND groupid=" + guildId);
dbClient.ExecuteQuery("UPDATE user_stats SET groupid=" + guildId + " WHERE id=" + userId);
dbClient.ExecuteQuery("INSERT INTO group_memberships (`groupid`,`userid`) VALUES (" + guildId +"," +userId+")");
}
GameClient gc = Essential.GetGame().GetClientManager().GetClientById((uint)userId);
Habbo habbo = null;
if (gc != null)
habbo = gc.GetHabbo();
if (habbo != null)
{
Room room = Essential.GetGame().GetRoomManager().GetRoom((uint)guild.RoomId);
if (habbo.FavouriteGroup == 0)
{
habbo.FavouriteGroup = guild.Id;
habbo.RefreshGuilds();
if (habbo.CurrentRoomId > 0)
{
if (room == null)
{
return;
}
ServerMessage message = new ServerMessage(Outgoing.SendGroup); //Rootkit
message.AppendInt32(1);
message.AppendInt32(guild.Id);
message.AppendString(guild.Badge);
gc.SendMessage(message);
ServerMessage message2 = new ServerMessage(Outgoing.SetRoomUser); //Rootkit
message2.AppendInt32(1);
RoomUser ru = gc.GetHabbo().CurrentRoom.GetRoomUserByHabbo(habbo.Id);
if (ru != null)
ru.method_14(message2);
gc.GetHabbo().CurrentRoom.SendMessage(message2,null);
}
}
ServerMessage message3 = new ServerMessage(Outgoing.AddNewMember); //Rootkit
message3.AppendInt32(guildId);
message3.AppendInt32(guild.getRank(userId));
message3.AppendInt32(habbo.Id);
message3.AppendString(habbo.Username);
message3.AppendString(habbo.Figure);
message3.AppendString(string.Concat(new object[] { DateTime.Now.Month, " ", DateTime.Now.Day, ", ", DateTime.Now.Year }));
Session.SendMessage(message3);
ServerMessage message4 = new ServerMessage(Outgoing.UpdatePetitionsGuild); //Rootkit
message4.AppendInt32(1);
message4.AppendInt32(guild.Id);
message4.AppendInt32(3);
message4.AppendString(guild.Name);
Session.SendMessage(message4);
gc.SendMessage(message4);
ServerMessage message5 = new ServerMessage(Outgoing.SetRoomUser); //Rootkit
message5.AppendInt32(1);
RoomUser ru2 = gc.GetHabbo().CurrentRoom.GetRoomUserByHabbo(habbo.Id);
if (ru2 != null)
ru2.method_14(message5);
gc.GetHabbo().CurrentRoom.SendMessage(message5,null);
}
ServerMessage message6 = new ServerMessage(Outgoing.SendHtmlColors);
message6.AppendInt32(Session.GetHabbo().dataTable_0.Rows.Count);
foreach (DataRow num4 in Session.GetHabbo().dataTable_0.Rows)
{
GroupsManager guild2 = Groups.GetGroupById((int)num4["groupid"]);
message6.AppendInt32(guild2.Id);
message6.AppendString(guild2.Name);
message6.AppendString(guild2.Badge);
message6.AppendString(guild2.ColorOne);
message6.AppendString(guild2.ColorTwo);
message6.AppendBoolean(guild2.Id == Session.GetHabbo().FavouriteGroup);
}
Session.SendMessage(message6);
Session.GetClientMessageHandler().LoadMembersPetitions(2, guildId, 0, "", Session);
RoomData data = Essential.GetGame().GetRoomManager().method_11((uint)guild.RoomId);
if (gc != null)
{
ServerMessage message7 = new ServerMessage(Outgoing.SendAdvGroupInit);
message7.AppendInt32(guild.Id);
message7.AppendBoolean(true);
message7.AppendInt32(guild.Type);
message7.AppendString(guild.Name);
message7.AppendString(guild.Description);
message7.AppendString(guild.Badge);
message7.AppendInt32(data.Id);
message7.AppendString(data.Name);
if (guild.Petitions.Contains((int)habbo.Id))
{
message7.AppendInt32(2);
}
else if (!habbo.InGuild(guild.Id))
{
//.........这里部分代码省略.........
示例6: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int guildId = Event.PopWiredInt32();
GroupsManager guild = Groups.GetGroupById(guildId);
if (guild != null && guild.UserWithRanks.Contains((int)Session.GetHabbo().Id))
{
int num2 = Event.PopWiredInt32();
RoomData data = Essential.GetGame().GetRoomManager().method_11((uint)guild.RoomId);
if(guild.Petitions.Contains(num2))
guild.Petitions.Remove(num2);
using(DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
dbClient.ExecuteQuery("DELETE FROM group_requests WHERE userid=" + num2 + " AND groupid=" + guildId);
dbClient.ExecuteQuery("UPDATE user_stats WHERE id=" + num2 + " AND groupid=" + guildId);
}
GameClient gc = Essential.GetGame().GetClientManager().GetClientById((uint)num2);
Habbo habbo = null;
if (gc != null) habbo = gc.GetHabbo();
if (gc != null && habbo != null)
{
Room room = Essential.GetGame().GetRoomManager().GetRoom((uint)guild.RoomId);
if (room != null)
{
ServerMessage message;
message = new ServerMessage(Outgoing.SendAdvGroupInit);
message.AppendInt32(guild.Id);
message.AppendBoolean(true);
message.AppendInt32(guild.Type);
message.AppendString(guild.Name);
message.AppendString(guild.Description);
message.AppendString(guild.Badge);
message.AppendInt32(data.Id);
message.AppendString(data.Name);
if (guild.Petitions.Contains((int)habbo.Id))
{
message.AppendInt32(2);
}
else if (!habbo.InGuild(guild.Id))
{
message.AppendInt32(0);
}
else if (habbo.InGuild(guild.Id))
{
message.AppendInt32(1);
}
message.AppendInt32(guild.Members.Count);
message.AppendBoolean(false);
message.AppendString(guild.Created);
message.AppendBoolean(guild.UserWithRanks.Contains((int)Session.GetHabbo().Id));//habbo.Id == guild.OwnerId);
if (habbo.InGuild(guild.Id))
{
if (guild.UserWithRanks.Contains((int)habbo.Id))
message.AppendBoolean(true);
else message.AppendBoolean(false);
}
else message.AppendBoolean(false);
message.AppendString(guild.OwnerName);
message.AppendBoolean(true);
message.AppendBoolean(true);
message.AppendInt32(guild.Members.Contains((int)habbo.Id) ? guild.Petitions.Count : 0);
gc.SendMessage(message);
}
}
}
Session.GetClientMessageHandler().LoadMembersPetitions(2, guild.Id, 0, "", Session);
}
示例7: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Session.GetClientMessageHandler().method_6();
}
示例8: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
// Session.SendNotification("Sorry. Diese Funktion ist im Moment noch nicht verfügbar! Wir arbeiten daran :)");
Action<object> action2 = null;
SnowStorm War = Session.GetClientMessageHandler().CheckAGame();
if (War == null)
War = new SnowStorm(Session.GetHabbo());
if(!War.WarUsers.Contains(Session.GetHabbo()))
War.WarUsers.Add(Session.GetHabbo());
ServerMessage message = new ServerMessage(Outgoing.CreateWar);
message.AppendInt32(-1);
message.AppendString("SnowStorm level " + War.WarLevel);
message.AppendInt32(0);
message.AppendInt32(War.WarLevel);
message.AppendInt32(2);
message.AppendInt32(War.MaxUsers);
message.AppendString(War.WarOwner.Username);
message.AppendInt32(0x11);
message.AppendInt32(War.WarUsers.Count);
foreach(Habbo WarUser in War.WarUsers)
{
message.AppendInt32(WarUser.Id);
message.AppendString(WarUser.Username);
message.AppendString(WarUser.Figure);
message.AppendString(WarUser.Gender.ToLower());
message.AppendInt32(-1);
message.AppendInt32(WarUser.SnowLevel);
message.AppendInt32(WarUser.SnowPoints);
message.AppendInt32(1);
}
message.AppendInt32(120);
Session.SendMessage(message);
//Session.GetHabbo().SnowUserId = War.WarUsers.Count;
War.SendToStorm(Session.GetClientMessageHandler().AddToNewGame(War), false, Session.GetHabbo().Id);
if (War.WarOwner == Session.GetHabbo())
{
if (action2 == null)
{
action2 = delegate(object obj)
{
while(War.Countdown != 0)
{
War.Countdown--;
Thread.Sleep(1000);
}
try
{
this.StartGame(War);
}catch
{
foreach(Habbo h in War.WarUsers)
{
if (h != null && h.GetClient() != null)
h.GetClient().SendNotification("Spiel wurde abgebrochen. Der Ersteller ist offline gegangen!");
}
}
};
}
Action<object> action = action2;
new Task(action, "break").Start();
}
ServerMessage packet = new ServerMessage(Outgoing.StartCounter);
packet.AppendInt32(War.Countdown);
Session.SendMessage(packet);
}
示例9: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
int guildId = Event.PopWiredInt32();
GroupsManager guild = Groups.GetGroupById(guildId);
if (guild != null && guild.UserWithRanks.Contains((int)Session.GetHabbo().Id))
{
int num2 = Event.PopWiredInt32();
GameClient gc = Essential.GetGame().GetClientManager().GetClientByHabbo(Essential.GetGame().GetClientManager().GetNameById((uint)num2));
Habbo habbo = gc.GetHabbo();
using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
{
if (guild.UserWithRanks.Contains(num2))
{
dbClient.ExecuteQuery("UPDATE group_memberships SET hasRights='0' WHERE userid=" + num2 + " AND groupid=" + guild.Id);
guild.UserWithRanks.Remove(num2);
}
else
{
dbClient.ExecuteQuery("UPDATE group_memberships SET hasRights='1' WHERE userid=" + num2 + " AND groupid=" + guild.Id);
guild.UserWithRanks.Add(num2);
}
}
if (gc != null && habbo != null)
{
RoomData data = Essential.GetGame().GetRoomManager().method_11((uint)guild.RoomId);
try
{
ServerMessage message = new ServerMessage(Outgoing.SendHtmlColors);
message.AppendInt32(habbo.dataTable_0.Rows.Count);
foreach (DataRow num3 in habbo.dataTable_0.Rows)
{
GroupsManager guild2 = Groups.GetGroupById((int)num3["groupid"]);
message.AppendInt32(guild2.Id);
message.AppendString(guild2.Name);
message.AppendString(guild2.Badge);
message.AppendString(guild2.ColorOne);
message.AppendString(guild2.ColorTwo);
message.AppendBoolean(guild2.Id == habbo.FavouriteGroup);
}
gc.SendMessage(message);
ServerMessage message1;
message1 = new ServerMessage(Outgoing.SendAdvGroupInit);
message1.AppendInt32(guild.Id);
message1.AppendBoolean(true);
message1.AppendInt32(guild.Type);
message1.AppendString(guild.Name);
message1.AppendString(guild.Description);
message1.AppendString(guild.Badge);
message1.AppendInt32(data.Id);
message1.AppendString(data.Name);
if (guild.Petitions.Contains((int)habbo.Id))
{
message1.AppendInt32(2);
}
else if (!habbo.InGuild(guild.Id))
{
message1.AppendInt32(0);
}
else if (habbo.InGuild(guild.Id))
{
message1.AppendInt32(1);
}
message1.AppendInt32(guild.Members.Count);
message1.AppendBoolean(false);
message1.AppendString(guild.Created);
message1.AppendBoolean(guild.UserWithRanks.Contains((int)Session.GetHabbo().Id));//habbo.Id == guild.OwnerId);
if (Session.GetHabbo().InGuild(guild.Id))
{
if (guild.UserWithRanks.Contains((int)habbo.Id))
message1.AppendBoolean(true);
else message1.AppendBoolean(false);
}
else message1.AppendBoolean(false);
message1.AppendString(guild.OwnerName);
message1.AppendBoolean(true);
message1.AppendBoolean(true);
message1.AppendInt32(guild.Members.Contains((int)habbo.Id) ? guild.Petitions.Count : 0);
gc.SendMessage(message);
}
catch
{
}
Session.GetClientMessageHandler().LoadMembersPetitions(0, guildId, 0, "", Session);
}
}
}
示例10: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
string text = Essential.DoFilter(Event.PopFixedString(), false, true);
if (text.Length < 3)
{
ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated
Message.AppendInt32(2);
Message.AppendString(text);
Message.AppendInt32(0);
Session.SendMessage(Message);
}
else
{
if (text.Length > 15)
{
ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated
Message.AppendInt32(3);
Message.AppendString(text);
Message.AppendInt32(0);
Session.SendMessage(Message);
}
else
{
if (text.Contains(" ") || !Session.GetClientMessageHandler().method_8(text) || text != ChatCommandHandler.ApplyFilter(text))
{
ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated
Message.AppendInt32(5);
Message.AppendString(text);
Message.AppendInt32(0);
Session.SendMessage(Message);
}
else
{
if (Event.Id == 3511)
{
ServerMessage Message = new ServerMessage(Outgoing.ChangeUsernameError); // Updated
Message.AppendInt32(0);
Message.AppendString(text);
Message.AppendInt32(0);
Session.SendMessage(Message);
}
else
{
if (Event.Id == 1457)
{
ServerMessage Message3 = new ServerMessage(Outgoing.ChangeUsername1); // Updated
Message3.AppendUInt(Session.GetHabbo().Id);
Message3.AppendUInt(Session.GetHabbo().CurrentRoomId);
Message3.AppendString(text);
Session.SendMessage(Message3);
if (Session.GetHabbo().CurrentRoomId > 0u)
{
Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
ServerMessage Message4 = new ServerMessage(Outgoing.SetRoomUser); // P
Message4.AppendInt32(1);
class2.method_14(Message4);
@class.SendMessage(Message4, null);
}
Dictionary<Room, int> dictionary = Essential.GetGame().GetRoomManager().method_22();
IEnumerable<Room> arg_204_0 = dictionary.Keys;
if (ChangeUserNameMessageEvent.func_0 == null)
{
ChangeUserNameMessageEvent.func_0 = new Func<Room, int>(ChangeUserNameMessageEvent.smethod_0);
}
IOrderedEnumerable<Room> orderedEnumerable = arg_204_0.OrderByDescending(ChangeUserNameMessageEvent.func_0);
foreach (Room current in orderedEnumerable)
{
if (current.Owner == Session.GetHabbo().Username)
{
current.Owner = text;
Essential.GetGame().GetRoomManager().method_16(Essential.GetGame().GetRoomManager().GetRoom(current.Id));
}
}
using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
{
class3.AddParamWithValue("newuname", text);
class3.AddParamWithValue("olduname", Session.GetHabbo().Username);
class3.ExecuteQuery(string.Concat(new string[]
{
"UPDATE rooms SET owner = @newuname WHERE owner = @olduname"
}));
class3.AddParamWithValue("newuname", text);
class3.ExecuteQuery(string.Concat(new object[]
{
"UPDATE users SET username = @newuname WHERE Id = '",
Session.GetHabbo().Id,
"' LIMIT 1"
}));
Essential.GetGame().GetClientManager().StoreCommand(Session, "flagme", "OldName: " + Session.GetHabbo().Username + " NewName: " + text);
Session.GetHabbo().Username = text;
Session.GetHabbo().method_1(class3);
foreach (RoomData current2 in Session.GetHabbo().OwnedRooms)
{
current2.Owner = text;
}
}
Session.GetHabbo().ChangeNamaAchievementsCompleted();
//.........这里部分代码省略.........