本文整理汇总了C#中ServerMessage.AppendStringWithBreak方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendStringWithBreak方法的具体用法?C# ServerMessage.AppendStringWithBreak怎么用?C# ServerMessage.AppendStringWithBreak使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendStringWithBreak方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
public static ServerMessage Compose(uint ItemId, string Flags)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_FLOOR_ITEM_UPDATE_FLAGS);
Message.AppendStringWithBreak(ItemId.ToString());
Message.AppendStringWithBreak(Flags);
return Message;
}
示例2: Compose
public static ServerMessage Compose(ModerationTicket Ticket, RoomInfo Info, ReadOnlyCollection<ModerationChatlogEntry> Entries)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_TICKET);
Message.AppendUInt32(Ticket.Id);
Message.AppendUInt32(Ticket.ReporteeUserId);
Message.AppendUInt32(Ticket.ReportedUserId);
Message.AppendUInt32(Ticket.Id); // Number to display in title. Chatlog ID?
Message.AppendBoolean(Info != null ? Info.Type == RoomType.Public : false);
Message.AppendUInt32(Info != null ? Info.Id : 0);
Message.AppendStringWithBreak(Info != null ? Info.Name : "(Unknown room)");
Message.AppendInt32(Entries.Count);
foreach (ModerationChatlogEntry Entry in Entries)
{
DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Entry.Timestamp);
Message.AppendInt32(Time.Hour);
Message.AppendInt32(Time.Minute);
Message.AppendUInt32(Entry.UserId);
Message.AppendStringWithBreak(Entry.UserName);
Message.AppendStringWithBreak(Entry.Message);
}
return Message;
}
示例3: Serialize
internal void Serialize(ServerMessage Message)
{
try
{
Message.AppendUInt(Id);
Message.AppendStringWithBreak(Name);
Message.AppendInt32(CreditsCost);
Message.AppendInt32(PixelsCost);
Message.AppendInt32(0);
Message.AppendInt32(1);
Message.AppendStringWithBreak(GetBaseItem().Type.ToString());
Message.AppendInt32(GetBaseItem().SpriteId);
if (Name.Contains("wallpaper_single") || Name.Contains("floor_single") || Name.Contains("landscape_single"))
{
string[] Analyze = Name.Split('_');
Message.AppendStringWithBreak(Analyze[2]);
}
else if (this.songID > 0 && GetBaseItem().InteractionType == InteractionType.musicdisc)
{
Message.AppendStringWithBreak(songID.ToString());
}
else
{
Message.AppendStringWithBreak(string.Empty);
}
Message.AppendInt32(Amount);
Message.AppendInt32(-1);
Message.AppendInt32(0);
}
catch
{
Console.WriteLine("Unable to load furniture item " + Id + ": " + Name);
}
}
示例4: Compose
public static ServerMessage Compose(Item Item)
{
ServerMessage Message = new ServerMessage(OpcodesOut.STICKY_DATA);
Message.AppendStringWithBreak(Item.Id.ToString());
Message.AppendStringWithBreak(Item.Flags);
return Message;
}
示例5: Compose
public static ServerMessage Compose(string Key, string Value)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_DECORATION);
Message.AppendStringWithBreak(Key);
Message.AppendStringWithBreak(Value);
return Message;
}
示例6: Compose
public static ServerMessage Compose(uint UserId, Dictionary<ModerationRoomVisit, ReadOnlyCollection<ModerationChatlogEntry>> Entries)
{
string CharacterNameString = CharacterResolverCache.GetNameFromUid(UserId);
ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_USER);
Message.AppendUInt32(UserId);
Message.AppendStringWithBreak(CharacterNameString);
Message.AppendInt32(Entries.Count);
foreach (KeyValuePair<ModerationRoomVisit, ReadOnlyCollection<ModerationChatlogEntry>> EntryData in Entries)
{
RoomInfo Info = RoomInfoLoader.GetRoomInfo(EntryData.Key.RoomId);
Message.AppendBoolean(Info != null && Info.Type == RoomType.Public);
Message.AppendUInt32(Info != null ? Info.Id : 0);
Message.AppendStringWithBreak(Info != null ? Info.Name : "(Unknown room)");
Message.AppendInt32(EntryData.Value.Count);
foreach (ModerationChatlogEntry Entry in EntryData.Value)
{
DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Entry.Timestamp);
Message.AppendInt32(Time.Hour);
Message.AppendInt32(Time.Minute);
Message.AppendUInt32(Entry.UserId);
Message.AppendStringWithBreak(Entry.UserId == UserId ? CharacterNameString :
CharacterResolverCache.GetNameFromUid(Entry.UserId));
Message.AppendStringWithBreak(Entry.Message);
}
}
return Message;
}
示例7: Compose
public static ServerMessage Compose(ModerationTicket Ticket)
{
string DisplayRoomName = string.Empty;
if (Ticket.RoomId > 0)
{
RoomInfo Info = RoomInfoLoader.GetRoomInfo(Ticket.RoomId);
DisplayRoomName = Info == null ? "(Unknown room " + Ticket.RoomId + ")" : Info.Name;
}
ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_TICKET);
Message.AppendUInt32(Ticket.Id);
Message.AppendUInt32(Ticket.TabId);
Message.AppendUInt32(11); // ?? unknown
Message.AppendUInt32(Ticket.CategoryId);
Message.AppendUInt32(11); // ?? unknown
Message.AppendUInt32(Ticket.Score);
Message.AppendUInt32(Ticket.ReporteeUserId);
Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReporteeUserId));
Message.AppendUInt32(Ticket.ReportedUserId);
Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReportedUserId));
Message.AppendUInt32(Ticket.ModeratorUserId);
Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ModeratorUserId));
Message.AppendStringWithBreak(Ticket.Message);
Message.AppendUInt32(Ticket.RoomId);
Message.AppendStringWithBreak(DisplayRoomName);
return Message;
}
示例8: Compose
public static ServerMessage Compose(string Title, string Text)
{
ServerMessage Message = new ServerMessage(OpcodesOut.USER_ALERT_MODERN);
Message.AppendStringWithBreak(Title);
Message.AppendStringWithBreak(Text);
return Message;
}
示例9: Compose
public static ServerMessage Compose(Interstitial Interstitial)
{
ServerMessage Message = new ServerMessage(258);
Message.AppendStringWithBreak(Interstitial == null ? string.Empty : Interstitial.Image);
Message.AppendStringWithBreak(Interstitial == null ? string.Empty : Interstitial.Url);
return Message;
}
示例10: Compose
public static ServerMessage Compose(Session Session, ReadOnlyCollection<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ACHIEVEMENTS_LIST);
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
UserAchievement UserData = Session.AchievementCache.GetAchievementData(Achievement.GroupName);
int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
int TotalLevels = Achievement.Levels.Count;
if (TargetLevel > TotalLevels)
{
TargetLevel = TotalLevels;
}
AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];
Message.AppendUInt32(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.PixelReward); // Pixel reward
Message.AppendInt32(TargetLevelData.PointsReward); // Unknown(??)
Message.AppendInt32(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendStringWithBreak(Achievement.Category); // Category
Message.AppendInt32(TotalLevels); // Total amount of levels
}
return Message;
}
示例11: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(436); //436
Message.AppendInt32(Achievements.Count);
foreach (Achievement Achievement in Achievements)
{
UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
int TotalLevels = Achievement.Levels.Count;
if (TargetLevel > TotalLevels)
{
TargetLevel = TotalLevels;
}
AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];
Message.AppendUInt(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendStringWithBreak(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.RewardPixels); // Pixel reward
Message.AppendInt32(TargetLevelData.RewardPoints); // Unknown(??)
Message.AppendInt32(UserData != null ? UserData.Progress : 0); // Current progress
Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false); // Set 100% completed(??)
Message.AppendStringWithBreak(Achievement.Category); // Category
Message.AppendInt32(TotalLevels); // Total amount of levels
}
return Message;
}
示例12: Compose
public static ServerMessage Compose(uint ActorId, string MessageText, int EmotionId, ChatType ChatType)
{
StringBuilder TextBuilder = new StringBuilder();
Dictionary<int, string> LinkRefs = new Dictionary<int, string>();
string[] Bits = MessageText.Split(' ');
int i = 0;
int j = 0;
foreach (string Bit in Bits)
{
if (j > 0)
{
TextBuilder.Append(' ');
}
if (Bit.StartsWith("http://"))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else if (Bit.StartsWith("www."))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else
{
TextBuilder.Append(Bit);
}
j++;
}
ServerMessage Message = new ServerMessage(ChatType == ChatType.Say ? OpcodesOut.ROOM_CHAT_SAY : (ChatType ==
ChatType.Whisper ? OpcodesOut.ROOM_CHAT_WHISPER : OpcodesOut.ROOM_CHAT_SHOUT));
Message.AppendUInt32(ActorId);
Message.AppendStringWithBreak(TextBuilder.ToString());
Message.AppendInt32(EmotionId);
Message.AppendInt32(LinkRefs.Count);
foreach (KeyValuePair<int, string> LinkedRef in LinkRefs)
{
string Url = LinkedRef.Value;
if (!Url.StartsWith("http://"))
{
Url = "http://" + Url;
}
Message.AppendStringWithBreak("/link_to.php?url=" + HttpUtility.UrlEncode(Url) + "&hash=xx");
Message.AppendStringWithBreak(LinkedRef.Value);
Message.AppendBoolean(false); // Trusted URL (instaopen)
}
Message.AppendInt32(0); // No idea
Message.AppendBoolean(true);
return Message;
}
示例13: Serialize
internal void Serialize(ref ServerMessage packet)
{
packet.AppendInt32(timeSpoken.Hour);
packet.AppendInt32(timeSpoken.Minute);
packet.AppendUInt(userID);
packet.AppendStringWithBreak(username);
packet.AppendStringWithBreak(message);
}
示例14: Serialize
internal void Serialize(ServerMessage Request)
{
// [email protected]22033860
Request.AppendUInt(FromUser);
Request.AppendStringWithBreak(mUsername);
Request.AppendStringWithBreak(FromUser.ToString());
}
示例15: Compose
public static ServerMessage Compose(uint UserId, MessengerFriendEventType EventType, string EventData)
{
ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_FRIEND_EVENT);
Message.AppendStringWithBreak(UserId.ToString());
Message.AppendInt32((int)EventType);
Message.AppendStringWithBreak(EventData);
return Message;
}