本文整理汇总了C#中GoldTree.Messages.ServerMessage类的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage类的具体用法?C# ServerMessage怎么用?C# ServerMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerMessage类属于GoldTree.Messages命名空间,在下文中一共展示了ServerMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: method_10
public ServerMessage method_10(string string_0)
{
DataTable dataTable = null;
using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
{
@class.AddParamWithValue("query", string_0);
dataTable = @class.ReadDataTable("SELECT Id,title FROM help_topics WHERE title LIKE @query OR body LIKE @query LIMIT 25");
}
ServerMessage Message = new ServerMessage(521u);
ServerMessage result;
if (dataTable == null)
{
Message.AppendBoolean(false);
result = Message;
}
else
{
Message.AppendInt32(dataTable.Rows.Count);
foreach (DataRow dataRow in dataTable.Rows)
{
Message.AppendUInt((uint)dataRow["Id"]);
Message.AppendStringWithBreak((string)dataRow["title"]);
}
result = Message;
}
return result;
}
示例2: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room class14_ = Session.GetHabbo().CurrentRoom;
if (class14_ != null)
{
Event.PopWiredUInt();
string string_ = Event.PopFixedString();
RoomUser @class = class14_.method_56(string_);
if (@class != null && @class.GetClient().GetHabbo().Rank <= 2u)
{
uint uint_ = @class.GetClient().GetHabbo().Id;
if (!Session.GetHabbo().list_2.Contains(uint_))
{
Session.GetHabbo().list_2.Add(uint_);
using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
{
class2.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO user_ignores(user_id, ignore_id) VALUES (",
Session.GetHabbo().Id,
", ",
uint_,
");"
}));
}
ServerMessage Message = new ServerMessage(419u);
Message.AppendInt32(1);
Session.SendMessage(Message);
}
}
}
}
示例3: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
if (Session != null && Session.GetHabbo() != null)
{
Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null)
{
RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
if (class2 != null && !class2.IsBot && class2.GetClient() != null)
{
ServerMessage Message = new ServerMessage(228u);
Message.AppendUInt(class2.GetClient().GetHabbo().Id);
Message.AppendInt32(class2.GetClient().GetHabbo().method_22().Int32_1);
using (TimedLock.Lock(class2.GetClient().GetHabbo().method_22().List_0))
{
foreach (Badge current in class2.GetClient().GetHabbo().method_22().List_0)
{
if (current.Slot > 0)
{
Message.AppendInt32(current.Slot);
Message.AppendStringWithBreak(current.Code);
}
}
}
Session.SendMessage(Message);
}
}
}
}
示例4: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
string text = Event.PopFixedString();
ServerMessage Message = new ServerMessage(7u);
Message.AppendStringWithBreak(text.ToLower());
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip"))
{
double num = (double)Session.GetHabbo().GetSubscriptionManager().method_1("habbo_vip").Int32_0;
double num2 = num - GoldTree.GetUnixTimestamp();
int num3 = (int)Math.Ceiling(num2 / 86400.0);
int num4 = num3 / 31;
if (num4 >= 1)
{
num4--;
}
Message.AppendInt32(num3 - num4 * 31);
Message.AppendBoolean(true);
Message.AppendInt32(num4);
Message.AppendBoolean(true);
Message.AppendBoolean(true);
Message.AppendBoolean(Session.GetHabbo().Vip);
Message.AppendInt32(0);
Message.AppendInt32(0);
}
else
{
if (Session.GetHabbo().GetSubscriptionManager().HasSubscription(text))
{
double num = (double)Session.GetHabbo().GetSubscriptionManager().method_1(text).Int32_0;
double num2 = num - GoldTree.GetUnixTimestamp();
int num3 = (int)Math.Ceiling(num2 / 86400.0);
int num4 = num3 / 31;
if (num4 >= 1)
{
num4--;
}
Message.AppendInt32(num3 - num4 * 31);
Message.AppendBoolean(true);
Message.AppendInt32(num4);
if (Session.GetHabbo().Rank >= 2u)
{
Message.AppendInt32(1);
Message.AppendInt32(1);
Message.AppendInt32(2);
}
else
{
Message.AppendInt32(1);
}
}
else
{
for (int i = 0; i < 3; i++)
{
Message.AppendInt32(0);
}
}
}
Session.SendMessage(Message);
}
示例5: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
if (bool_0)
{
ServerMessage Message = new ServerMessage(650u);
Message.AppendInt32(0);
Message.AppendInt32(5);
Message.AppendInt32(0);
Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
Message.AppendUInt(RoomItem_0.uint_0);
Message.AppendStringWithBreak("");
Message.AppendString("I");
if (RoomItem_0.string_3.Length > 0)
{
Message.AppendString(RoomItem_0.string_3);
}
else
{
Message.AppendString("RB");
}
Message.AppendStringWithBreak("HRAH");
Session.SendMessage(Message);
RoomItem_0.ReqUpdate(1);
}
}
示例6: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
Room room = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (room != null)
{
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 client = GoldTree.GetDatabase().GetClient())
{
client.ExecuteQuery(string.Concat(new object[]
{
"INSERT INTO room_rights (room_id,user_id) VALUES (",
room.Id,
",",
num,
")"
}));
}
ServerMessage serverMessage = new ServerMessage(510u);
serverMessage.AppendUInt(room.Id);
serverMessage.AppendUInt(num);
serverMessage.AppendStringWithBreak(roomUserByHabbo.GetClient().GetHabbo().Username);
Session.SendMessage(serverMessage);
roomUserByHabbo.AddStatus("flatctrl", "");
roomUserByHabbo.UpdateNeeded = true;
roomUserByHabbo.GetClient().SendMessage(new ServerMessage(42u));
}
}
}
示例7: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room room = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (room != null)
{
RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);
if (roomUserByHabbo != null)
{
roomUserByHabbo.Unidle();
int num = Event.PopWiredInt32();
if (num < 0 || num > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && num > 1))
{
num = 0;
}
if (num > 0 && roomUserByHabbo.CarryItemID > 0)
{
roomUserByHabbo.CarryItem(0);
}
roomUserByHabbo.DanceId = num;
ServerMessage serverMessage = new ServerMessage(480u);
serverMessage.AppendInt32(roomUserByHabbo.VirtualId);
serverMessage.AppendInt32(num);
room.SendMessage(serverMessage, null);
if (Session.GetHabbo().CurrentQuestId > 0 && GoldTree.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "DANCE")
{
GoldTree.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
}
}
}
}
示例8: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
ServerMessage Message = new ServerMessage(611u);
Message.AppendBoolean(true);
Message.AppendInt32(2);
Session.SendMessage(Message);
}
示例9: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
DataTable dataTable_ = Session.GetHabbo().dataTable_0;
if (dataTable_ != null)
{
ServerMessage Message = new ServerMessage(915u);
Message.AppendInt32(dataTable_.Rows.Count);
foreach (DataRow dataRow in dataTable_.Rows)
{
GroupsManager @class = Groups.smethod_2((int)dataRow["groupid"]);
Message.AppendInt32(@class.int_0);
Message.AppendStringWithBreak(@class.string_0);
Message.AppendStringWithBreak(@class.string_2);
if (Session.GetHabbo().int_0 == @class.int_0) // is favorite group?
{
Message.AppendBoolean(true);
}
else
{
Message.AppendBoolean(false);
}
}
Session.SendMessage(Message);
}
}
示例10: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
ServerMessage Message = new ServerMessage(443u);
Message.AppendInt32(Session.GetHabbo().AchievementScore);
Message.AppendStringWithBreak("");
Session.SendMessage(Message);
}
示例11: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null && !Session.GetHabbo().list_4.Contains(@class.Id) && [email protected](Session, true))
{
switch (Event.PopWiredInt32())
{
case -1:
@class.Score--;
break;
case 0:
return;
case 1:
@class.Score++;
break;
default:
return;
}
using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
{
class2.ExecuteQuery(string.Concat(new object[]
{
"UPDATE rooms SET score = '",
@class.Score,
"' WHERE Id = '",
@class.Id,
"' LIMIT 1"
}));
}
Session.GetHabbo().list_4.Add(@class.Id);
ServerMessage Message = new ServerMessage(345u);
Message.AppendInt32(@class.Score);
Session.SendMessage(Message);
}
}
示例12: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
string text = GoldTree.FilterString(Event.PopFixedString());
if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null)
{
if (num == 0u && Session.GetHabbo().HasFuse("cmd_sa"))
{
ServerMessage Message = new ServerMessage(134u);
Message.AppendUInt(0u);
Message.AppendString(Session.GetHabbo().Username + ": " + text);
GoldTree.GetGame().GetClientManager().method_17(Session, Message);
}
else
{
if (num == 0u)
{
ServerMessage Message2 = new ServerMessage(261u);
Message2.AppendInt32(4);
Message2.AppendUInt(0u);
Session.SendMessage(Message2);
}
else
{
if (Session != null && Session.GetHabbo() != null)
{
Session.GetHabbo().GetMessenger().method_18(num, text);
}
}
}
}
}
示例13: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room class14_ = Session.GetHabbo().CurrentRoom;
if (class14_ != null)
{
Event.PopWiredUInt();
string string_ = Event.PopFixedString();
RoomUser @class = class14_.method_56(string_);
if (@class != null)
{
uint uint_ = @class.GetClient().GetHabbo().Id;
if (Session.GetHabbo().list_2.Contains(uint_))
{
Session.GetHabbo().list_2.Remove(uint_);
using (DatabaseClient class2 = GoldTree.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);
}
}
}
}
示例14: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
if (Session.GetHabbo() == null)
{
Session.method_6(Event.PopFixedString());
if (Session.GetHabbo() != null && Session.GetHabbo().list_2 != null && Session.GetHabbo().list_2.Count > 0)
{
using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
{
try
{
ServerMessage Message = new ServerMessage(420u);
Message.AppendInt32(Session.GetHabbo().list_2.Count);
foreach (uint current in Session.GetHabbo().list_2)
{
string string_ = @class.ReadString("SELECT username FROM users WHERE Id = " + current + " 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;
}
}
}
}
}
示例15: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (UserHasRights && Session != null)
{
Item.method_9();
ServerMessage Message = new ServerMessage(652u);
Message.AppendInt32(0);
Message.AppendInt32(5);
if (Item.string_5.Length > 0)
{
Message.AppendString(Item.string_5);
}
else
{
Message.AppendInt32(0);
}
Message.AppendInt32(Item.GetBaseItem().Sprite);
Message.AppendUInt(Item.uint_0);
Message.AppendStringWithBreak("");
Message.AppendString("J");
if (Item.string_3.Length > 0)
{
Message.AppendString(Item.string_3);
}
else
{
Message.AppendString("HHH");
}
Session.SendMessage(Message);
}
}
开发者ID:ArneVanDaele,项目名称:GoldenTreeEMU,代码行数:31,代码来源:InteractorWiredConditionFurniStatesAndPositionsMatch.cs