本文整理汇总了C#中Cyber.Messages.ServerMessage.AppendBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendBoolean方法的具体用法?C# ServerMessage.AppendBoolean怎么用?C# ServerMessage.AppendBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cyber.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
internal static ServerMessage Compose(GameClient Session, Quest Quest)
{
int amountOfQuestsInCategory = CyberEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Quest.Category);
int i = (Quest == null) ? amountOfQuestsInCategory : Quest.Number;
int i2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
ServerMessage serverMessage = new ServerMessage(Outgoing.QuestCompletedMessageComposer);
serverMessage.AppendString(Quest.Category);
serverMessage.AppendInt32(i);
serverMessage.AppendInt32(Quest.Name.Contains("xmas2012") ? 1 : amountOfQuestsInCategory);
serverMessage.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
serverMessage.AppendUInt((Quest == null) ? 0u : Quest.Id);
serverMessage.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
serverMessage.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
serverMessage.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
serverMessage.AppendInt32((Quest == null) ? 0 : Quest.Reward);
serverMessage.AppendString((Quest == null) ? string.Empty : Quest.Name);
serverMessage.AppendInt32(i2);
serverMessage.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
serverMessage.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
serverMessage.AppendString("");
serverMessage.AppendString("");
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
return serverMessage;
}
示例2: Searialize
internal void Searialize(ServerMessage reply)
{
reply.AppendUInt(this.userID);
reply.AppendString(this.username);
reply.AppendString(this.motto);
bool b = CyberEnvironment.GetGame().GetClientManager().GetClient(this.userID) != null;
reply.AppendBoolean(b);
reply.AppendBoolean(false);
reply.AppendString(string.Empty);
reply.AppendInt32(0);
reply.AppendString(this.look);
reply.AppendString(this.last_online);
}
示例3: ComposeIndex
internal static ServerMessage ComposeIndex(uint Rank)
{
var Pages = CyberEnvironment.GetGame().GetCatalog().Categories.Values.OfType<CatalogPage>();
ServerMessage Message = new ServerMessage(Outgoing.CatalogueIndexMessageComposer);
var SortedPages = Pages.Where(x => x.ParentId == -1 && x.MinRank <= Rank).OrderBy(x => x.OrderNum);
Message.AppendBoolean(true);
Message.AppendInt32(0);
Message.AppendInt32(-1);
Message.AppendString("root");
Message.AppendString(string.Empty);
Message.AppendInt32(0);
Message.AppendInt32(SortedPages.Count());
foreach (CatalogPage Cat in SortedPages)
{
Message.AppendBoolean(Cat.Visible);
Message.AppendInt32(Cat.IconImage);
Message.AppendInt32(Cat.PageId);
Message.AppendString(Cat.CodeName);
Message.AppendString(Cat.Caption);
Message.AppendInt32(Cat.FlatOffers.Count);
foreach (int i in Cat.FlatOffers.Keys)
{
Message.AppendInt32(i);
}
var SortedSubPages = Pages.Where(x => x.ParentId == Cat.PageId && x.MinRank <= Rank).OrderBy(x => x.Caption);
Message.AppendInt32(SortedSubPages.Count());
foreach (CatalogPage SubCat in SortedSubPages)
{
Message.AppendBoolean(SubCat.Visible);
Message.AppendInt32(SubCat.IconImage);
Message.AppendInt32(SubCat.PageId);
Message.AppendString(SubCat.CodeName);
Message.AppendString(SubCat.Caption);
Message.AppendInt32(SubCat.FlatOffers.Count);
foreach (int i2 in SubCat.FlatOffers.Keys)
{
Message.AppendInt32(i2);
}
Message.AppendInt32(0);
}
}
Message.AppendBoolean(false);
Message.AppendString("NORMAL");
return Message;
}
示例4: SerializeQuest
internal static void SerializeQuest(ServerMessage Message, GameClient Session, Quest Quest, string Category)
{
if (Message == null || Session == null)
{
return;
}
int amountOfQuestsInCategory = CyberEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Category);
checked
{
int num = (Quest == null) ? amountOfQuestsInCategory : (Quest.Number - 1);
int num2 = (Quest == null) ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
if (Quest != null && Quest.IsCompleted(num2))
{
num++;
}
Message.AppendString(Category);
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : num));
Message.AppendInt32((Quest == null) ? 0 : (Quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
Message.AppendInt32((Quest == null) ? 3 : Quest.RewardType);
Message.AppendUInt((Quest == null) ? 0u : Quest.Id);
Message.AppendBoolean(Quest != null && Session.GetHabbo().CurrentQuestId == Quest.Id);
Message.AppendString((Quest == null) ? string.Empty : Quest.ActionName);
Message.AppendString((Quest == null) ? string.Empty : Quest.DataBit);
Message.AppendInt32((Quest == null) ? 0 : Quest.Reward);
Message.AppendString((Quest == null) ? string.Empty : Quest.Name);
Message.AppendInt32(num2);
Message.AppendUInt((Quest == null) ? 0u : Quest.GoalData);
Message.AppendInt32((Quest == null) ? 0 : Quest.TimeUnlock);
Message.AppendString("");
Message.AppendString("");
Message.AppendBoolean(true);
}
}
示例5: SerializeTool
internal ServerMessage SerializeTool()
{
ServerMessage serverMessage = new ServerMessage(Outgoing.LoadModerationToolMessageComposer);
serverMessage.AppendInt32(this.Tickets.Count);
foreach (SupportTicket current in this.Tickets)
{
current.Serialize(serverMessage);
}
serverMessage.AppendInt32(this.UserMessagePresets.Count);
foreach (string current2 in this.UserMessagePresets)
{
serverMessage.AppendString(current2);
}
IEnumerable<ModerationTemplate> enumerable =
from x in this.ModerationTemplates.Values
where x.Category == -1
select x;
serverMessage.AppendInt32(enumerable.Count<ModerationTemplate>());
using (IEnumerator<ModerationTemplate> enumerator3 = enumerable.GetEnumerator())
{
while (enumerator3.MoveNext())
{
ModerationTemplate Template = enumerator3.Current;
IEnumerable<ModerationTemplate> enumerable2 =
from x in this.ModerationTemplates.Values
where (long)x.Category == (long)((ulong)Template.Id)
select x;
serverMessage.AppendString(Template.Caption);
serverMessage.AppendBoolean(true);
serverMessage.AppendInt32(enumerable2.Count<ModerationTemplate>());
foreach (ModerationTemplate current3 in enumerable2)
{
serverMessage.AppendString(current3.Caption);
serverMessage.AppendString(current3.BanMessage);
serverMessage.AppendInt32((int)current3.BanHours);
serverMessage.AppendInt32(CyberEnvironment.BoolToInteger(current3.AvatarBan));
serverMessage.AppendInt32(CyberEnvironment.BoolToInteger(current3.Mute));
serverMessage.AppendInt32(CyberEnvironment.BoolToInteger(current3.TradeLock));
serverMessage.AppendString(current3.WarningMessage);
}
}
}
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendInt32(this.RoomMessagePresets.Count);
foreach (string current4 in this.RoomMessagePresets)
{
serverMessage.AppendString(current4);
}
return serverMessage;
}
示例6: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage serverMessage = new ServerMessage(Outgoing.AchievementListMessageComposer);
serverMessage.AppendInt32(Achievements.Count);
foreach (Achievement achievement in Achievements)
{
UserAchievement achievementData = Session.GetHabbo().GetAchievementData(achievement.GroupName);
int i = achievementData != null ? checked(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.AppendUInt(achievement.Id);
serverMessage.AppendInt32(i);
serverMessage.AppendString(achievement.GroupName + i);
serverMessage.AppendInt32(oldLevel.Requirement); // Requisito Anterior
serverMessage.AppendInt32(achievementLevel.Requirement); // Requisito Nuevo
serverMessage.AppendInt32(achievementLevel.RewardPoints);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(achievementData != null ? achievementData.Progress : 0); // Progreso Total
if (achievementData == null)
{
serverMessage.AppendBoolean(false);
}
else if (achievementData.Level >= count)
{
serverMessage.AppendBoolean(true);
}
else
{
serverMessage.AppendBoolean(false); // Terminado
}
serverMessage.AppendString(achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInt32(count); // Número de niveles
serverMessage.AppendInt32(0);
}
serverMessage.AppendString("");
return serverMessage;
}
示例7: Compose
internal static ServerMessage Compose(GameClient Session, List<Quest> Quests, bool Send)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>();
Dictionary<string, Quest> dictionary2 = new Dictionary<string, Quest>();
foreach (Quest 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])
{
int questProgress = Session.GetHabbo().GetQuestProgress(current.Id);
if (Session.GetHabbo().CurrentQuestId != current.Id && (long)questProgress >= (long)((ulong)current.GoalData))
{
dictionary[current.Category] = checked(current.Number + 1);
}
}
}
}
foreach (Quest current2 in Quests)
{
foreach (KeyValuePair<string, int> current3 in dictionary)
{
if (!current2.Category.Contains("xmas2012") && current2.Category == current3.Key && current2.Number == current3.Value)
{
dictionary2[current3.Key] = current2;
break;
}
}
}
ServerMessage serverMessage = new ServerMessage(Outgoing.QuestListMessageComposer);
serverMessage.AppendInt32(dictionary2.Count);
foreach (KeyValuePair<string, Quest> current4 in dictionary2)
{
if (current4.Value != null)
{
QuestListComposer.SerializeQuest(serverMessage, Session, current4.Value, current4.Key);
}
}
foreach (KeyValuePair<string, Quest> current5 in dictionary2)
{
if (current5.Value == null)
{
QuestListComposer.SerializeQuest(serverMessage, Session, current5.Value, current5.Key);
}
}
serverMessage.AppendBoolean(Send);
return serverMessage;
}
示例8: SerializeWall
internal void SerializeWall(ServerMessage Message, bool Inventory)
{
Message.AppendUInt(this.Id);
Message.AppendString(this.mBaseItem.Type.ToString().ToUpper());
Message.AppendUInt(this.Id);
Message.AppendInt32(this.GetBaseItem().SpriteId);
if (this.GetBaseItem().Name.Contains("a2"))
{
Message.AppendInt32(3);
}
else
{
if (this.GetBaseItem().Name.Contains("wallpaper"))
{
Message.AppendInt32(2);
}
else
{
if (this.GetBaseItem().Name.Contains("landscape"))
{
Message.AppendInt32(4);
}
else
{
Message.AppendInt32(1);
}
}
}
Message.AppendInt32(0);
Message.AppendString(this.ExtraData);
Message.AppendBoolean(this.GetBaseItem().AllowRecycle);
Message.AppendBoolean(this.GetBaseItem().AllowTrade);
Message.AppendBoolean(this.GetBaseItem().AllowInventoryStack);
Message.AppendBoolean(false);
Message.AppendInt32(-1);
Message.AppendBoolean(true);
Message.AppendInt32(-1);
}
示例9: Compose
internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
{
ServerMessage serverMessage = new ServerMessage(Outgoing.UnlockAchievementMessageComposer);
serverMessage.AppendUInt(Achievement.Id);
serverMessage.AppendInt32(Level);
serverMessage.AppendInt32(144);
serverMessage.AppendString(Achievement.GroupName + Level);
serverMessage.AppendInt32(PointReward);
serverMessage.AppendInt32(PixelReward);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(10);
serverMessage.AppendInt32(21);
serverMessage.AppendString(Level > 1 ? Achievement.GroupName + checked(Level - 1) : string.Empty);
serverMessage.AppendString(Achievement.Category);
serverMessage.AppendBoolean(true);
return serverMessage;
}
示例10: Compose
internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData, int TotalLevels, UserAchievement UserData)
{
ServerMessage serverMessage = new ServerMessage(Outgoing.AchievementProgressMessageComposer);
serverMessage.AppendUInt(Achievement.Id);
serverMessage.AppendInt32(TargetLevel);
serverMessage.AppendString(Achievement.GroupName + TargetLevel);
serverMessage.AppendInt32(TargetLevelData.Requirement);
serverMessage.AppendInt32(TargetLevelData.Requirement);
serverMessage.AppendInt32(TargetLevelData.RewardPixels);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(UserData != null ? UserData.Progress : 0);
serverMessage.AppendBoolean(UserData != null && UserData.Level >= TotalLevels);
serverMessage.AppendString(Achievement.Category);
serverMessage.AppendString(string.Empty);
serverMessage.AppendInt32(TotalLevels);
serverMessage.AppendInt32(0);
return serverMessage;
}
示例11: RemoveAllFurniture
internal List<RoomItem> RemoveAllFurniture(GameClient Session)
{
List<RoomItem> list = new List<RoomItem>();
RoomItem[] array = this.mFloorItems.Values.ToArray<RoomItem>();
for (int i = 0; i < array.Length; i++)
{
RoomItem roomItem = array[i];
roomItem.Interactor.OnRemove(Session, roomItem);
ServerMessage serverMessage = new ServerMessage(Outgoing.PickUpFloorItemMessageComposer);
serverMessage.AppendString(roomItem.Id + string.Empty);
serverMessage.AppendBoolean(false);
serverMessage.AppendInt32(0);
serverMessage.AppendUInt(roomItem.UserID);
this.room.SendMessage(serverMessage);
list.Add(roomItem);
}
RoomItem[] array2 = this.mWallItems.Values.ToArray<RoomItem>();
for (int j = 0; j < array2.Length; j++)
{
RoomItem roomItem2 = array2[j];
roomItem2.Interactor.OnRemove(Session, roomItem2);
ServerMessage serverMessage2 = new ServerMessage(Outgoing.PickUpWallItemMessageComposer);
serverMessage2.AppendString(roomItem2.Id + string.Empty);
serverMessage2.AppendUInt(roomItem2.UserID);
this.room.SendMessage(serverMessage2);
list.Add(roomItem2);
}
this.mWallItems.Clear();
this.mFloorItems.Clear();
this.mRemovedItems.Clear();
this.mMovedItems.Clear();
this.mAddedItems.Clear();
this.mRollers.QueueDelegate(new onCycleDoneDelegate(this.ClearRollers));
using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor.runFastQuery("UPDATE items SET room_id='0' WHERE room_id = " + this.room.RoomId);
}
this.room.GetGameMap().GenerateMaps(true);
this.room.GetGameMap().lazyWalkablePoints();
this.room.GetRoomUserManager().UpdateUserStatusses();
return list;
}
示例12: SerializeRoomTool
internal static ServerMessage SerializeRoomTool(RoomData Data)
{
Room room = CyberEnvironment.GetGame().GetRoomManager().GetRoom(Data.Id);
ServerMessage serverMessage = new ServerMessage(Outgoing.ModerationRoomToolMessageComposer);
serverMessage.AppendUInt(Data.Id);
serverMessage.AppendInt32(Data.UsersNow);
if (room != null)
{
serverMessage.AppendBoolean(room.GetRoomUserManager().GetRoomUserByHabbo(Data.Owner) != null);
}
else
{
serverMessage.AppendBoolean(false);
}
serverMessage.AppendInt32(room.OwnerId);
serverMessage.AppendString(Data.Owner);
serverMessage.AppendBoolean(room != null);
serverMessage.AppendString(Data.Name);
serverMessage.AppendString(Data.Description);
serverMessage.AppendInt32(Data.TagCount);
foreach (string current in Data.Tags)
{
serverMessage.AppendString(current);
}
serverMessage.AppendBoolean(false);
return serverMessage;
}
示例13: AddSaddle
//.........这里部分代码省略.........
{
if (num2 == 15)
{
num3 = 69;
}
else
{
if (num2 == 16)
{
num3 = 73;
}
}
}
}
pet.PetData.Race = num3.ToString();
using (IQueryAdapter queryreactor2 = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor2.runFastQuery(string.Concat(new object[]
{
"UPDATE bots_petdata SET race = '",
pet.PetData.Race,
"' WHERE id = ",
pet.PetData.PetId
}));
queryreactor2.runFastQuery("DELETE FROM items WHERE id=" + item.Id + " LIMIT 1");
goto IL_40C;
}
}
if (item.GetBaseItem().Name.Contains("horse_hairstyle"))
{
string s3 = item.GetBaseItem().Name.Split(new char[]
{
'_'
})[2];
int num4 = 100;
num4 += int.Parse(s3);
pet.PetData.PetHair = num4;
using (IQueryAdapter queryreactor3 = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor3.runFastQuery(string.Concat(new object[]
{
"UPDATE bots_petdata SET pethair = '",
pet.PetData.PetHair,
"' WHERE id = ",
pet.PetData.PetId
}));
queryreactor3.runFastQuery("DELETE FROM items WHERE id=" + item.Id + " LIMIT 1");
goto IL_40C;
}
}
if (item.GetBaseItem().Name.Contains("saddle"))
{
pet.PetData.HaveSaddle = true;
using (IQueryAdapter queryreactor4 = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor4.runFastQuery("UPDATE bots_petdata SET have_saddle = 1 WHERE id = " + pet.PetData.PetId);
queryreactor4.runFastQuery("DELETE FROM items WHERE id=" + item.Id + " LIMIT 1");
}
}
IL_40C:
ServerMessage serverMessage = new ServerMessage(Outgoing.SetRoomUserMessageComposer);
serverMessage.AppendInt32(1);
pet.Serialize(serverMessage, false);
room.SendMessage(serverMessage);
ServerMessage serverMessage2 = new ServerMessage(Outgoing.SerializePetMessageComposer);
serverMessage2.AppendInt32(pet.PetData.VirtualId);
serverMessage2.AppendUInt(pet.PetData.PetId);
serverMessage2.AppendUInt(pet.PetData.Type);
serverMessage2.AppendInt32(int.Parse(pet.PetData.Race));
serverMessage2.AppendString(pet.PetData.Color.ToLower());
if (pet.PetData.HaveSaddle)
{
serverMessage2.AppendInt32(2);
serverMessage2.AppendInt32(3);
serverMessage2.AppendInt32(4);
serverMessage2.AppendInt32(9);
serverMessage2.AppendInt32(0);
serverMessage2.AppendInt32(3);
serverMessage2.AppendInt32(pet.PetData.PetHair);
serverMessage2.AppendInt32(pet.PetData.HairDye);
serverMessage2.AppendInt32(3);
serverMessage2.AppendInt32(pet.PetData.PetHair);
serverMessage2.AppendInt32(pet.PetData.HairDye);
}
else
{
serverMessage2.AppendInt32(1);
serverMessage2.AppendInt32(2);
serverMessage2.AppendInt32(2);
serverMessage2.AppendInt32(pet.PetData.PetHair);
serverMessage2.AppendInt32(pet.PetData.HairDye);
serverMessage2.AppendInt32(3);
serverMessage2.AppendInt32(pet.PetData.PetHair);
serverMessage2.AppendInt32(pet.PetData.HairDye);
}
serverMessage2.AppendBoolean(pet.PetData.HaveSaddle);
serverMessage2.AppendBoolean(pet.RidingHorse);
room.SendMessage(serverMessage2);
}
}
示例14: tryLogin
internal bool tryLogin(string AuthTicket)
{
try
{
string ip = this.GetConnection().getIp();
byte b = 0;
UserData userData = UserDataFactory.GetUserData(AuthTicket, ip, out b);
bool result;
if (b == 1)
{
result = false;
return result;
}
if (b == 2)
{
result = false;
return result;
}
CyberEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.userID, userData.user.Username);
this.Habbo = userData.user;
userData.user.LoadData(userData);
string banReason = CyberEnvironment.GetGame().GetBanManager().GetBanReason(userData.user.Username, ip, this.MachineId);
if (!string.IsNullOrEmpty(banReason) || userData.user.Username == null)
{
this.SendNotifWithScroll(banReason);
using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor.setQuery("SELECT ip_last FROM users WHERE id=" + this.GetHabbo().Id + " LIMIT 1");
string @string = queryreactor.getString();
queryreactor.setQuery("SELECT COUNT(0) FROM bans_access WHERE user_id=" + this.Habbo.Id + " LIMIT 1");
int integer = queryreactor.getInteger();
if (integer > 0)
{
queryreactor.runFastQuery(string.Concat(new object[]
{
"UPDATE bans_access SET attempts = attempts + 1, ip='",
@string,
"' WHERE user_id=",
this.GetHabbo().Id,
" LIMIT 1"
}));
}
else
{
queryreactor.runFastQuery(string.Concat(new object[]
{
"INSERT INTO bans_access (user_id, ip) VALUES (",
this.GetHabbo().Id,
", '",
@string,
"')"
}));
}
}
result = false;
return result;
}
userData.user.Init(this, userData);
QueuedServerMessage queuedServerMessage = new QueuedServerMessage(this.Connection);
ServerMessage serverMessage = new ServerMessage(Outgoing.UniqueMachineIDMessageComposer);
serverMessage.AppendString(this.MachineId);
queuedServerMessage.appendResponse(serverMessage);
queuedServerMessage.appendResponse(new ServerMessage(Outgoing.AuthenticationOKMessageComposer));
if (this.Habbo != null)
{
ServerMessage serverMessage2 = new ServerMessage(Outgoing.HomeRoomMessageComposer);
serverMessage2.AppendUInt(this.Habbo.HomeRoom);
serverMessage2.AppendUInt(this.Habbo.HomeRoom);
queuedServerMessage.appendResponse(serverMessage2);
}
ServerMessage serverMessage3 = new ServerMessage(Outgoing.MinimailCountMessageComposer);
serverMessage3.AppendInt32(this.Habbo.MinimailUnreadMessages);
queuedServerMessage.appendResponse(serverMessage3);
ServerMessage serverMessage4 = new ServerMessage(Outgoing.FavouriteRoomsMessageComposer);
serverMessage4.AppendInt32(30);
serverMessage4.AppendInt32(userData.user.FavoriteRooms.Count);
object[] array = userData.user.FavoriteRooms.ToArray();
for (int i = 0; i < array.Length; i++)
{
uint i2 = (uint)array[i];
serverMessage4.AppendUInt(i2);
}
queuedServerMessage.appendResponse(serverMessage4);
ServerMessage rightsMessage = new ServerMessage(Outgoing.UserClubRightsMessageComposer);
rightsMessage.AppendInt32(userData.user.GetSubscriptionManager().HasSubscription ? 2 : 0);
rightsMessage.AppendUInt(userData.user.Rank);
rightsMessage.AppendInt32(0);
queuedServerMessage.appendResponse(rightsMessage);
ServerMessage serverMessage5 = new ServerMessage(Outgoing.EnableNotificationsMessageComposer);
serverMessage5.AppendBoolean(true);
serverMessage5.AppendBoolean(false);
queuedServerMessage.appendResponse(serverMessage5);
ServerMessage serverMessage6 = new ServerMessage(Outgoing.EnableTradingMessageComposer);
serverMessage6.AppendBoolean(true);
queuedServerMessage.appendResponse(serverMessage6);
//.........这里部分代码省略.........
示例15: SerializeClub
internal void SerializeClub()
{
GameClient client = this.GetClient();
ServerMessage serverMessage = new ServerMessage();
serverMessage.Init(Outgoing.SubscriptionStatusMessageComposer);
serverMessage.AppendString("club_habbo");
if (client.GetHabbo().GetSubscriptionManager().HasSubscription)
{
double num = (double)client.GetHabbo().GetSubscriptionManager().GetSubscription().ExpireTime;
double num2 = num - (double)CyberEnvironment.GetUnixTimestamp();
checked
{
int num3 = (int)Math.Ceiling(num2 / 86400.0);
int i = (int)Math.Ceiling(unchecked((double)CyberEnvironment.GetUnixTimestamp() - (double)client.GetHabbo().GetSubscriptionManager().GetSubscription().ActivateTime) / 86400.0);
int num4 = num3 / 31;
if (num4 >= 1)
{
num4--;
}
serverMessage.AppendInt32(num3 - num4 * 31);
serverMessage.AppendInt32(1);
serverMessage.AppendInt32(num4);
serverMessage.AppendInt32(1);
serverMessage.AppendBoolean(true);
serverMessage.AppendBoolean(true);
serverMessage.AppendInt32(i);
serverMessage.AppendInt32(i);
serverMessage.AppendInt32(10);
}
}
else
{
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(0);
serverMessage.AppendBoolean(false);
serverMessage.AppendBoolean(false);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(0);
serverMessage.AppendInt32(0);
}
client.SendMessage(serverMessage);
ServerMessage serverMessage2 = new ServerMessage(Outgoing.UserClubRightsMessageComposer);
serverMessage2.AppendInt32(this.GetSubscriptionManager().HasSubscription ? 2 : 0);
serverMessage2.AppendUInt(this.Rank);
serverMessage2.AppendInt32(0);
client.SendMessage(serverMessage2);
}