本文整理汇总了C#中Azure.Messages.ServerMessage.AppendBool方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendBool方法的具体用法?C# ServerMessage.AppendBool怎么用?C# ServerMessage.AppendBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Azure.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, Quest quest)
{
var amountOfQuestsInCategory = Azure.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(quest.Category);
var i = (quest == null) ? amountOfQuestsInCategory : quest.Number;
var i2 = (quest == null) ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestCompletedMessageComposer"));
serverMessage.AppendString(quest.Category);
serverMessage.AppendInteger(i);
serverMessage.AppendInteger(quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
serverMessage.AppendInteger((quest == null) ? 3 : quest.RewardType);
serverMessage.AppendInteger((quest == null) ? 0u : quest.Id);
serverMessage.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
serverMessage.AppendString((quest == null) ? string.Empty : quest.ActionName);
serverMessage.AppendString((quest == null) ? string.Empty : quest.DataBit);
serverMessage.AppendInteger((quest == null) ? 0 : quest.Reward);
serverMessage.AppendString((quest == null) ? string.Empty : quest.Name);
serverMessage.AppendInteger(i2);
serverMessage.AppendInteger((quest == null) ? 0u : quest.GoalData);
serverMessage.AppendInteger((quest == null) ? 0 : quest.TimeUnlock);
serverMessage.AppendString("");
serverMessage.AppendString("");
serverMessage.AppendBool(true);
serverMessage.AppendBool(true);
return serverMessage;
}
示例2: ComposeIndex
/// <summary>
/// Composes the index.
/// </summary>
/// <param name="rank">The rank.</param>
/// <param name="type">The type.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage ComposeIndex(uint rank, string type)
{
IEnumerable<CatalogPage> pages =
Azure.GetGame().GetCatalog().Categories.Values.OfType<CatalogPage>().ToList();
var sortedPages = pages.Where(x => x.ParentId == -2 && x.MinRank <= rank).OrderBy(x => x.OrderNum);
if (type == "NORMAL")
sortedPages = pages.Where(x => x.ParentId == -1 && x.MinRank <= rank).OrderBy(x => x.OrderNum);
var message = new ServerMessage(LibraryParser.OutgoingRequest("CatalogueIndexMessageComposer"));
message.AppendBool(true);
message.AppendInteger(0);
message.AppendInteger(-1);
message.AppendString("root");
message.AppendString(string.Empty);
message.AppendInteger(0);
message.AppendInteger(sortedPages.Count());
foreach (var cat in sortedPages)
{
message.AppendBool(cat.Visible);
message.AppendInteger(cat.IconImage);
message.AppendInteger(cat.PageId);
message.AppendString(cat.CodeName);
message.AppendString(cat.Caption);
message.AppendInteger(cat.FlatOffers.Count);
foreach (var i in cat.FlatOffers.Keys)
message.AppendInteger(i);
var sortedSubPages =
pages.Where(x => x.ParentId == cat.PageId && x.MinRank <= rank).OrderBy(x => x.OrderNum);
message.AppendInteger(sortedSubPages.Count());
foreach (var subCat in sortedSubPages)
{
message.AppendBool(subCat.Visible);
message.AppendInteger(subCat.IconImage);
message.AppendInteger(subCat.PageId);
message.AppendString(subCat.CodeName);
message.AppendString(subCat.Caption);
message.AppendInteger(subCat.FlatOffers.Count);
foreach (var i2 in subCat.FlatOffers.Keys)
message.AppendInteger(i2);
message.AppendInteger(0);
}
}
message.AppendBool(false);
message.AppendString(type);
return message;
}
示例3: Searialize
/// <summary>
/// Searializes the specified reply.
/// </summary>
/// <param name="reply">The reply.</param>
internal void Searialize(ServerMessage reply)
{
reply.AppendInteger(UserId);
reply.AppendString(UserName);
reply.AppendString(Motto);
reply.AppendBool(AzureEmulator.GetGame().GetClientManager().GetClient(UserId) != null);
reply.AppendBool(false);
reply.AppendString(string.Empty);
reply.AppendInteger(0);
reply.AppendString(Look);
reply.AppendString(LastOnline);
}
示例4: ComposeClubPurchasePage
/// <summary>
/// Composes the club purchase page.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="windowId">The window identifier.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage ComposeClubPurchasePage(GameClient session, int windowId)
{
var message = new ServerMessage(LibraryParser.OutgoingRequest("CatalogueClubPageMessageComposer"));
var habboClubItems = AzureEmulator.GetGame().GetCatalog().HabboClubItems;
message.AppendInteger(habboClubItems.Count);
foreach (var item in habboClubItems)
{
message.AppendInteger(item.Id);
message.AppendString(item.Name);
message.AppendBool(false);
message.AppendInteger(item.CreditsCost);
if (item.DiamondsCost > 0)
{
message.AppendInteger(item.DiamondsCost);
message.AppendInteger(105);
}
else
{
message.AppendInteger(item.DucketsCost);
message.AppendInteger(0);
}
message.AppendBool(true);
var fuckingArray = item.Name.Split('_');
double dayTime = 31;
if (item.Name.Contains("DAY"))
dayTime = int.Parse(fuckingArray[3]);
else if (item.Name.Contains("MONTH"))
{
var monthTime = int.Parse(fuckingArray[3]);
dayTime = monthTime * 31;
}
else if (item.Name.Contains("YEAR"))
{
var yearTimeOmg = int.Parse(fuckingArray[3]);
dayTime = yearTimeOmg * 31 * 12;
}
var newExpiryDate = DateTime.Now.AddDays(dayTime);
if (session.GetHabbo().GetSubscriptionManager().HasSubscription)
newExpiryDate =
AzureEmulator.UnixToDateTime(session.GetHabbo().GetSubscriptionManager().GetSubscription().ExpireTime)
.AddDays(dayTime);
message.AppendInteger((int)dayTime / 31);
message.AppendInteger((int)dayTime);
message.AppendBool(false);// can gift
message.AppendInteger((int)dayTime);
message.AppendInteger(newExpiryDate.Year);
message.AppendInteger(newExpiryDate.Month);
message.AppendInteger(newExpiryDate.Day);
}
message.AppendInteger(windowId);
return message;
}
示例5: SerializeSearchResultListFlatcats
/// <summary>
/// Serializes the search result list flatcats.
/// </summary>
/// <param name="flatCatId">The flat cat identifier.</param>
/// <param name="direct">if set to <c>true</c> [direct].</param>
/// <param name="message">The message.</param>
internal static void SerializeSearchResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
{
var flatCat = Azure.GetGame().GetNavigator().GetFlatCat(flatCatId);
if (flatCat == null)
return;
message.AppendString($"category__{flatCat.Caption}");
message.AppendString(flatCat.Caption);
message.AppendInteger(0);
message.AppendBool(true);
message.AppendInteger(-1);
try
{
var rooms = Azure.GetGame().GetRoomManager().GetActiveRooms();
Azure.GetGame()
.GetNavigator()
.SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
}
catch
{
message.AppendInteger(0);
}
}
示例6: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="achievements">The achievements.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, List<Achievement> achievements)
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AchievementListMessageComposer"));
serverMessage.AppendInteger(achievements.Count);
foreach (var achievement in achievements)
{
var achievementData = session.GetHabbo().GetAchievementData(achievement.GroupName);
var i = achievementData?.Level + 1 ?? 1;
var count = achievement.Levels.Count;
if (i > count)
i = count;
var achievementLevel = achievement.Levels[i];
var oldLevel = (achievement.Levels.ContainsKey(i - 1)) ? achievement.Levels[i - 1] : achievementLevel;
serverMessage.AppendInteger(achievement.Id);
serverMessage.AppendInteger(i);
serverMessage.AppendString($"{achievement.GroupName}{i}");
serverMessage.AppendInteger(oldLevel.Requirement);
serverMessage.AppendInteger(achievementLevel.Requirement);
serverMessage.AppendInteger(achievementLevel.RewardPoints);
serverMessage.AppendInteger(0);
serverMessage.AppendInteger(achievementData?.Progress ?? 0);
if (achievementData == null)
serverMessage.AppendBool(false);
else if (achievementData.Value.Level >= count)
serverMessage.AppendBool(true);
else
serverMessage.AppendBool(false);
serverMessage.AppendString(achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInteger(count);
serverMessage.AppendInteger(0);
}
serverMessage.AppendString(string.Empty);
return serverMessage;
}
示例7: Serialize
internal void Serialize(ref ServerMessage message)
{
var habbo = Azure.GetHabboById(UserId);
message.AppendInteger(Azure.DifferenceInMilliSeconds(TimeStamp, DateTime.Now));
message.AppendInteger(UserId);
message.AppendString(habbo == null ? "*User not found*" : habbo.UserName);
message.AppendString(Message);
message.AppendBool(GlobalMessage);
}
示例8: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="quests">The quests.</param>
/// <param name="send">if set to <c>true</c> [send].</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient session, List<Quest> quests, bool send)
{
var dictionary = new Dictionary<string, int>();
var dictionary2 = new Dictionary<string, Quest>();
foreach (var current in quests)
{
if (!current.Category.Contains("xmas2012"))
{
if (!dictionary.ContainsKey(current.Category))
{
dictionary.Add(current.Category, 1);
dictionary2.Add(current.Category, null);
}
if (current.Number >= dictionary[current.Category])
{
var questProgress = session.GetHabbo().GetQuestProgress(current.Id);
if (session.GetHabbo().CurrentQuestId != current.Id && questProgress >= current.GoalData)
{
dictionary[current.Category] = (current.Number + 1);
}
}
}
}
foreach (var current2 in quests)
{
foreach (var current3 in dictionary)
{
if (!current2.Category.Contains("xmas2012") && current2.Category == current3.Key &&
current2.Number == current3.Value)
{
dictionary2[current3.Key] = current2;
break;
}
}
}
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("QuestListMessageComposer"));
serverMessage.AppendInteger(dictionary2.Count);
foreach (var current4 in dictionary2)
{
if (current4.Value != null)
{
SerializeQuest(serverMessage, session, current4.Value, current4.Key);
}
}
foreach (var current5 in dictionary2)
{
if (current5.Value == null)
{
SerializeQuest(serverMessage, session, current5.Value, current5.Key);
}
}
serverMessage.AppendBool(send);
return serverMessage;
}
示例9: Execute
public override bool Execute(GameClient session, string[] pms)
{
session.GetHabbo().NewNavigator = !session.GetHabbo().NewNavigator;
var msg = new ServerMessage(LibraryParser.OutgoingRequest("SendPerkAllowancesMessageComposer"));
msg.AppendInteger(1);
msg.AppendString("NAVIGATOR_PHASE_TWO_2014");
msg.AppendString("");
msg.AppendBool(session.GetHabbo().NewNavigator);
session.SendMessage(msg);
return true;
}
示例10: Compose
/// <summary>
/// Composes the specified session.
/// </summary>
/// <param name="Session">The session.</param>
/// <param name="Achievements">The achievements.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AchievementListMessageComposer"));
serverMessage.AppendInteger(Achievements.Count);
foreach (Achievement achievement in Achievements)
{
UserAchievement achievementData = Session.GetHabbo().GetAchievementData(achievement.GroupName);
int i = achievementData != null ? (achievementData.Level + 1) : 1;
int count = achievement.Levels.Count;
if (i > count)
i = count;
AchievementLevel achievementLevel = achievement.Levels[i];
AchievementLevel oldLevel = (achievement.Levels.ContainsKey(i - 1)) ? achievement.Levels[i - 1] : achievementLevel;
serverMessage.AppendInteger(achievement.Id);
serverMessage.AppendInteger(i);
serverMessage.AppendString(string.Format("{0}{1}", achievement.GroupName, i));
serverMessage.AppendInteger(oldLevel.Requirement);
serverMessage.AppendInteger(achievementLevel.Requirement);
serverMessage.AppendInteger(achievementLevel.RewardPoints);
serverMessage.AppendInteger(0);
serverMessage.AppendInteger(achievementData != null ? achievementData.Progress : 0);
if (achievementData == null)
serverMessage.AppendBool(false);
else if (achievementData.Level >= count)
serverMessage.AppendBool(true);
else
serverMessage.AppendBool(false);
serverMessage.AppendString(achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInteger(count);
serverMessage.AppendInteger(0);
}
serverMessage.AppendString("");
return serverMessage;
}
示例11: GetPacket
/// <summary>
/// Gets the packet.
/// </summary>
/// <returns>ServerMessage.</returns>
internal ServerMessage GetPacket()
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("EffectsInventoryMessageComposer"));
serverMessage.AppendInteger(_effects.Count);
foreach (var current in _effects)
{
serverMessage.AppendInteger(current.EffectId);
serverMessage.AppendInteger(current.Type); // type (0 : normal - 1 : costume)
serverMessage.AppendInteger(current.TotalDuration);
serverMessage.AppendInteger(0); // count (0 : 1 - 1 : 2 ...)
serverMessage.AppendInteger(current.TimeLeft);
serverMessage.AppendBool(current.TotalDuration == -1); // permanent
}
return serverMessage;
}
示例12: Compose
/// <summary>
/// Composes the specified achievement.
/// </summary>
/// <param name="Achievement">The achievement.</param>
/// <param name="TargetLevel">The target level.</param>
/// <param name="TargetLevelData">The target level data.</param>
/// <param name="TotalLevels">The total levels.</param>
/// <param name="UserData">The user data.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData, int TotalLevels, UserAchievement UserData)
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AchievementProgressMessageComposer"));
serverMessage.AppendInteger(Achievement.Id);
serverMessage.AppendInteger(TargetLevel);
serverMessage.AppendString(string.Format("{0}{1}", Achievement.GroupName, TargetLevel));
serverMessage.AppendInteger(TargetLevelData.Requirement);
serverMessage.AppendInteger(TargetLevelData.Requirement);
serverMessage.AppendInteger(TargetLevelData.RewardPixels);
serverMessage.AppendInteger(0);
serverMessage.AppendInteger(UserData != null ? UserData.Progress : 0);
serverMessage.AppendBool(UserData != null && UserData.Level >= TotalLevels);
serverMessage.AppendString(Achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInteger(TotalLevels);
serverMessage.AppendInteger(0);
return serverMessage;
}
示例13: Compose
/// <summary>
/// Composes the specified achievement.
/// </summary>
/// <param name="achievement">The achievement.</param>
/// <param name="level">The level.</param>
/// <param name="pointReward">The point reward.</param>
/// <param name="pixelReward">The pixel reward.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(Achievement achievement, int level, int pointReward, int pixelReward)
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("UnlockAchievementMessageComposer"));
serverMessage.AppendInteger(achievement.Id);
serverMessage.AppendInteger(level);
serverMessage.AppendInteger(144);
serverMessage.AppendString($"{achievement.GroupName}{level}");
serverMessage.AppendInteger(pointReward);
serverMessage.AppendInteger(pixelReward);
serverMessage.AppendInteger(0);
serverMessage.AppendInteger(10);
serverMessage.AppendInteger(21);
serverMessage.AppendString(level > 1 ? $"{achievement.GroupName}{(level - 1)}" : string.Empty);
serverMessage.AppendString(achievement.Category);
serverMessage.AppendBool(true);
return serverMessage;
}
示例14: SerializePromotionsResultListFlatcats
/// <summary>
/// Serializes the promotions result list flatcats.
/// </summary>
/// <param name="flatCatId">The flat cat identifier.</param>
/// <param name="direct">if set to <c>true</c> [direct].</param>
/// <param name="message">The message.</param>
internal static void SerializePromotionsResultListFlatcats(int flatCatId, bool direct, ServerMessage message)
{
var flatCat = AzureEmulator.GetGame().GetNavigator().GetFlatCat(flatCatId);
message.AppendString("new_ads");
message.AppendString(flatCat.Caption);
message.AppendInteger(0);
message.AppendBool(true);
message.AppendInteger(-1);
try
{
var rooms = AzureEmulator.GetGame().GetRoomManager().GetEventRooms();
AzureEmulator.GetGame()
.GetNavigator()
.SerializeNavigatorPopularRoomsNews(ref message, rooms, flatCatId, direct);
}
catch
{
message.AppendInteger(0);
}
}
示例15: Compose
/// <summary>
/// Composes the specified achievement.
/// </summary>
/// <param name="achievement">The achievement.</param>
/// <param name="targetLevel">The target level.</param>
/// <param name="targetLevelData">The target level data.</param>
/// <param name="totalLevels">The total levels.</param>
/// <param name="userData">The user data.</param>
/// <returns>ServerMessage.</returns>
internal static ServerMessage Compose(Achievement achievement, int targetLevel, AchievementLevel targetLevelData, int totalLevels, UserAchievement userData)
{
var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AchievementProgressMessageComposer"));
serverMessage.AppendInteger(achievement.Id);
serverMessage.AppendInteger(targetLevel);
serverMessage.AppendString($"{achievement.GroupName}{targetLevel}");
serverMessage.AppendInteger(targetLevelData.Requirement);
serverMessage.AppendInteger(targetLevelData.Requirement);
serverMessage.AppendInteger(targetLevelData.RewardPixels);
serverMessage.AppendInteger(0);
serverMessage.AppendInteger(userData.Progress);
serverMessage.AppendBool(userData.Level >= totalLevels);
serverMessage.AppendString(achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInteger(totalLevels);
serverMessage.AppendInteger(0);
return serverMessage;
}