本文整理汇总了C#中GameClients.GetMessageHandler方法的典型用法代码示例。如果您正苦于以下问题:C# GameClients.GetMessageHandler方法的具体用法?C# GameClients.GetMessageHandler怎么用?C# GameClients.GetMessageHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClients
的用法示例。
在下文中一共展示了GameClients.GetMessageHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
public void OnTrigger(GameClients.GameClient Session, RoomItem 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 = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("UPDATE users SET look = @look, gender = @gender WHERE id = " + Session.GetHabbo().Id);
dbClient.addParameter("look", Session.GetHabbo().Look);
dbClient.addParameter("gender", Session.GetHabbo().Gender);
dbClient.runQuery();
}
Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);
Session.GetMessageHandler().GetResponse().AppendInt32(-1);
Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look);
Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower());
Session.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto);
Session.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
Session.GetMessageHandler().SendResponse();
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
RoomUpdate.AppendInt32(User.VirtualId);
RoomUpdate.AppendString(Session.GetHabbo().Look);
RoomUpdate.AppendString(Session.GetHabbo().Gender.ToLower());
RoomUpdate.AppendString(Session.GetHabbo().Motto);
RoomUpdate.AppendInt32(Session.GetHabbo().AchievementPoints);
Session.GetHabbo().CurrentRoom.SendMessage(RoomUpdate);
}
}