本文整理匯總了C#中Yupi.Messages.ServerMessage.Clear方法的典型用法代碼示例。如果您正苦於以下問題:C# ServerMessage.Clear方法的具體用法?C# ServerMessage.Clear怎麽用?C# ServerMessage.Clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Yupi.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.Clear方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SerializeNewStaffPicks
internal ServerMessage SerializeNewStaffPicks()
{
ServerMessage message = new ServerMessage();
message.StartArray();
foreach (PublicItem item in _publicItems.Values.Where(t => t.ParentId == -2))
{
message.Clear();
if (item.RoomData == null)
continue;
item.RoomData.Serialize(message);
message.SaveArray();
}
message.EndArray();
return message;
}
示例2: SerializeFlatCategories
/// <summary>
/// Serializes the flat categories.
/// </summary>
/// <param name="session">The session.</param>
/// <returns>ServerMessage.</returns>
internal ServerMessage SerializeFlatCategories(GameClient session)
{
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("FlatCategoriesMessageComposer"));
serverMessage.StartArray();
foreach (PublicCategory flatCat in PrivateCategories.Values)
{
serverMessage.Clear();
if (flatCat == null)
continue;
serverMessage.AppendInteger(flatCat.Id);
serverMessage.AppendString(flatCat.Caption);
serverMessage.AppendBool(flatCat.MinRank <= session.GetHabbo().Rank);
serverMessage.AppendBool(false);
serverMessage.AppendString("NONE");
serverMessage.AppendString(string.Empty);
serverMessage.AppendBool(false);
serverMessage.SaveArray();
}
serverMessage.EndArray();
return serverMessage;
}
示例3: SerializeSongInventory
/// <summary>
/// Serializes the song inventory.
/// </summary>
/// <param name="songs">The songs.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage SerializeSongInventory(HybridDictionary songs)
{
ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("SongsLibraryMessageComposer"));
if (songs == null)
{
serverMessage.AppendInteger(0);
return serverMessage;
}
serverMessage.StartArray();
foreach (UserItem userItem in songs.Values)
{
if (userItem == null)
{
serverMessage.Clear();
continue;
}
serverMessage.AppendInteger(userItem.Id);
SongData song = SoundMachineSongManager.GetSong(userItem.SongCode);
serverMessage.AppendInteger(song?.Id ?? 0);
serverMessage.SaveArray();
}
serverMessage.EndArray();
return serverMessage;
}