本文整理汇总了C#中Yupi.Messages.ServerMessage.AppendServerMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendServerMessage方法的具体用法?C# ServerMessage.AppendServerMessage怎么用?C# ServerMessage.AppendServerMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yupi.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendServerMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeSearchResultListStatics
/// <summary>
/// Serializes the search result list statics.
/// </summary>
/// <param name="staticId">The static identifier.</param>
/// <param name="direct">if set to <c>true</c> [direct].</param>
/// <param name="message">The message.</param>
/// <param name="session">The session.</param>
/// <param name="opened"></param>
/// <param name="showImage"></param>
internal static void SerializeSearchResultListStatics(string staticId, bool direct, ServerMessage message, GameClient session, bool opened = false, bool showImage = false)
{
if (string.IsNullOrEmpty(staticId) || staticId == "official")
staticId = "official_view";
if (staticId != "hotel_view" && staticId != "roomads_view" && staticId != "myworld_view" && !staticId.StartsWith("category__") && staticId != "official_view")
{
message.AppendString(staticId);
message.AppendString(string.Empty);
message.AppendInteger(1);
message.AppendBool(!opened); // staticId != "my" && staticId != "popular" && staticId != "official-root"
message.AppendInteger(showImage ? 1 : 0);
}
KeyValuePair<RoomData, uint>[] rooms;
switch (staticId)
{
case "hotel_view":
{
NavigatorCategory navCategory = Yupi.GetGame().GetNavigator().GetNavigatorCategory(staticId);
foreach (NavigatorSubCategory subCategory in navCategory.SubCategories)
SerializeSearchResultListStatics(subCategory.Caption, false, message, session, subCategory.IsOpened, subCategory.IsImage);
foreach (PublicCategory flat in Yupi.GetGame().GetNavigator().PrivateCategories.Values)
SerializeSearchResultListFlatcats(flat.Id, false, message);
break;
}
case "official_view":
{
NavigatorCategory navCategory = Yupi.GetGame().GetNavigator().GetNavigatorCategory(staticId);
foreach (NavigatorSubCategory subCategory in navCategory.SubCategories)
SerializeSearchResultListStatics(subCategory.Caption, false, message, session, subCategory.IsOpened, subCategory.IsImage);
}
break;
case "myworld_view":
{
NavigatorCategory navCategory = Yupi.GetGame().GetNavigator().GetNavigatorCategory(staticId);
foreach (NavigatorSubCategory subCategory in navCategory.SubCategories)
SerializeSearchResultListStatics(subCategory.Caption, false, message, session, subCategory.IsOpened, subCategory.IsImage);
}
break;
case "roomads_view":
{
foreach (PublicCategory flat in Yupi.GetGame().GetNavigator().PrivateCategories.Values)
SerializePromotionsResultListFlatcats(flat.Id, false, message);
NavigatorCategory navCategory = Yupi.GetGame().GetNavigator().GetNavigatorCategory(staticId);
foreach (NavigatorSubCategory subCategory in navCategory.SubCategories)
SerializeSearchResultListStatics(subCategory.Caption, false, message, session, subCategory.IsOpened, subCategory.IsImage);
break;
}
case "official-root":
{
message.AppendServerMessage(Yupi.GetGame().GetNavigator().NewPublicRooms);
break;
}
case "staffpicks":
{
message.AppendServerMessage(Yupi.GetGame().GetNavigator().NewStaffPicks);
break;
}
case "my":
{
int i = 0;
message.StartArray();
foreach (RoomData data in session.GetHabbo().UsersRooms)
{
if (data != null)
{
data.Serialize(message);
message.SaveArray();
if (i++ == (direct ? 100 : 8))
break;
}
}
//.........这里部分代码省略.........