本文整理汇总了C#中Essential.Messages.ServerMessage.AppendString方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendString方法的具体用法?C# ServerMessage.AppendString怎么用?C# ServerMessage.AppendString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
internal void Serialize(ServerMessage Message)
{
try
{
Message.AppendInt32(this.Id);
Message.AppendString((this.itemType != PublicItemType.PUBLIC_FLAT) ? this.Caption : string.Empty);
Message.AppendString(this.Description);
Message.AppendInt32(this.Type);
Message.AppendString((this.itemType == PublicItemType.PUBLIC_FLAT) ? this.Caption : string.Empty);
Message.AppendString(this.Image);
Message.AppendInt32((this.ParentId > 0) ? this.ParentId : 0);
Message.AppendInt32((this.RoomInfo != null) ? this.RoomInfo.UsersNow : 0);
Message.AppendInt32((this.itemType == PublicItemType.NONE) ? 0 : ((this.itemType == PublicItemType.TAG) ? 1 : ((this.itemType == PublicItemType.FLAT) ? 2 : ((this.itemType == PublicItemType.PUBLIC_FLAT) ? 2 : ((this.itemType == PublicItemType.CATEGORY) ? 4 : 0)))));
if (this.itemType == PublicItemType.TAG)
{
Message.AppendString(this.TagsToSearch);
}
else if (this.itemType == PublicItemType.CATEGORY)
{
Message.AppendBoolean(false);
}
else if (this.itemType == PublicItemType.FLAT)
{
this.RoomInfo.Serialize(Message, false, false);
}
else if (this.itemType == PublicItemType.PUBLIC_FLAT)
{
this.RoomInfo.Serialize(Message, false, false);
}
}
catch (Exception exception)
{
Console.WriteLine("Exception on publicitems composing: " + exception.ToString());
}
}
示例2: 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);
}
示例3: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
uint num = Event.PopWiredUInt();
string text = Essential.FilterString(Event.PopFixedString());
if (Session != null && Session.GetHabbo() != null && Session.GetHabbo().GetMessenger() != null && Session.GetHabbo().PassedSafetyQuiz)
{
Session.GetHabbo().CheckForUnmute();
if (num == 0u && Session.GetHabbo().HasFuse("cmd_sa"))
{
ServerMessage Message = new ServerMessage(Outgoing.InstantChat);
Message.AppendUInt(0u);
Message.AppendString(Session.GetHabbo().Username + ": " + text);
Message.AppendString(Essential.GetUnixTimestamp() + string.Empty);
Essential.GetGame().GetClientManager().SendToStaffs(Session, Message, false);
}
else
{
if (num == 0u)
{
/* ServerMessage Message2 = new ServerMessage(1133);
Message2.AppendInt32(4);
Message2.AppendUInt(0u);
Session.SendMessage(Message2);*/
}
else
{
if (Session != null && Session.GetHabbo() != null)
{
Session.GetHabbo().GetMessenger().method_18(num, text);
}
}
}
}
}
示例4: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
if (bool_0)
{
ServerMessage message = new ServerMessage(Outgoing.WiredFurniTrigger);
message.AppendBoolean(false);
if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
message.AppendInt32(1000000);
else
message.AppendInt32(5);
message.AppendInt32(0);
message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
message.AppendInt32(RoomItem_0.uint_0);
if (RoomItem_0.string_3.Length > 0)
{
message.AppendString(RoomItem_0.string_3);
}
else
{
message.AppendString("I");
}
message.AppendInt32(1);
message.AppendInt32(1);
message.AppendInt32(1);
message.AppendInt32(3);
message.AppendInt32(0);
message.AppendInt32(0);
Session.SendMessage(message);
}
}
示例5: 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);
}
示例6: Serialize
public void Serialize(ServerMessage Message)
{
Message.AppendInt32(CreatorId);
Message.AppendString(CreatorName);
Message.AppendString(CreatorLook);
Message.AppendInt32(GuideId);
Message.AppendString(GuideName);
Message.AppendString(GuideLook);
}
示例7: 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
{
}
}
示例8: 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, "");
}
}
示例9: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
ServerMessage SerializePowerUps = new ServerMessage(15);
SerializePowerUps.AppendInt32(Essential.GetGame().GetGamesManager().PowerupPackages.Count);
foreach (PowerupPackage PowPackage in Essential.GetGame().GetGamesManager().PowerupPackages.Values)
{
SerializePowerUps.AppendString(PowPackage.PackageName);
SerializePowerUps.AppendString(PowPackage.PowerupType);
SerializePowerUps.AppendInt32(PowPackage.Amount);
SerializePowerUps.AppendInt32(PowPackage.CostCredits);
}
Session.SendMessage(SerializePowerUps);
}
示例10: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (@class != null && @class.method_26(Session))
{
string string_ = Event.PopFixedString();
bool canletin = Event.PopWiredBoolean();
GameClient class2 = Essential.GetGame().GetClientManager().GetClientByHabbo(string_);
if (class2 != null && class2.GetHabbo() != null && class2.GetHabbo().bool_6 && class2.GetHabbo().uint_2 == Session.GetHabbo().CurrentRoomId)
{
if (canletin)
{
class2.GetHabbo().bool_5 = true;
ServerMessage Message4 = new ServerMessage(Outgoing.FlatAccessible); // Updated
Message4.AppendString("");
class2.SendMessage(Message4);
}
else
{
ServerMessage Message5 = new ServerMessage(Outgoing.DoorBellNoPerson); // Updated
Message5.AppendString("");
class2.SendMessage(Message5);
}
}
}
}
示例11: 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);
}
示例12: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
if (Session.GetHabbo().CurrentRoom.CheckRights(Session, true))
{
ServerMessage message = new ServerMessage(Outgoing.WiredCondition);
message.AppendBoolean(false);
if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
message.AppendInt32(1000000);
else
message.AppendInt32(5);
message.AppendInt32(0);
message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
message.AppendInt32(RoomItem_0.uint_0);
message.AppendString("");
message.AppendInt32(2);
if (!string.IsNullOrEmpty(RoomItem_0.string_3))
{
message.AppendInt32(int.Parse(RoomItem_0.string_3.Split(';')[0]));
message.AppendInt32(int.Parse(RoomItem_0.string_3.Split(';')[1]));
}
else
{
message.AppendInt32(1);
message.AppendInt32(50);
}
message.AppendBoolean(false);
message.AppendInt32(0);
message.AppendInt32(1290);
Session.SendMessage(message);
}
}
示例13: Handle
public void Handle(GameClient Session, ClientMessage Event)
{
Room Room = Session.GetHabbo().CurrentRoom;
if (Room != null)
{
string string_ = Event.PopFixedString();
RoomUser @class = Room.method_56(string_);
if (@class != null)
{
uint uint_ = @class.GetClient().GetHabbo().Id;
if (!Session.GetHabbo().list_2.Contains(uint_))
{
Session.GetHabbo().list_2.Add(uint_);
using (DatabaseClient class2 = Essential.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(Outgoing.UpdateIgnoreStatus); // Updated
Message.AppendInt32(1);
Message.AppendString(string_);
Session.SendMessage(Message);
}
}
}
}
示例14: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
if (bool_0)
{
ServerMessage message = new ServerMessage(Outgoing.WiredEffect); // Updated
message.AppendBoolean(false);
if (Session.GetHabbo().HasFuse("wired_unlimitedselects"))
message.AppendInt32(1000000);
else
message.AppendInt32(5);
message.AppendInt32(0);
message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
message.AppendInt32(RoomItem_0.uint_0);
message.AppendString("");
message.AppendInt32(2);
if (RoomItem_0.string_2 != "")
message.AppendInt32(int.Parse(RoomItem_0.string_2));
else
message.AppendInt32(5);
if (RoomItem_0.string_3 != "")
message.AppendInt32(int.Parse(RoomItem_0.string_3));
else
message.AppendInt32(1);
message.AppendInt32(0);
message.AppendInt32(6);
message.AppendInt32(0);
message.AppendInt32(0);
message.AppendInt32(0);
Session.SendMessage(message);
}
}
示例15: 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);
}
}
}