Compare commits
No commits in common. "main" and "fluent_nhibernate" have entirely different histories.
main
...
fluent_nhi
|
@ -5,5 +5,5 @@ namespace Tiger.Communication.Messages;
|
||||||
|
|
||||||
public interface IMessageHandler
|
public interface IMessageHandler
|
||||||
{
|
{
|
||||||
Task TryHandleAsync(GameSession gameSession, ClientMessage request);
|
Task TryHandleAsync(GameSession session, ClientMessage request);
|
||||||
}
|
}
|
|
@ -1,33 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Achievements;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Achievement;
|
|
||||||
|
|
||||||
public class RequestAchievementsMessageEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IAchievementManager _achievementManager;
|
|
||||||
|
|
||||||
public RequestAchievementsMessageEvent(IGameSessionManager gameSessionManager, IAchievementManager achievementManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_achievementManager = achievementManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.AchievementList;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new AchievementsScoreComposer(gameSession.Habbo.AchievementScore));
|
|
||||||
await gameSession.SendComposerAsync(new AchievementsComposer(_achievementManager.Achievements.Values,
|
|
||||||
gameSession.Habbo));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Catalog;
|
|
||||||
|
|
||||||
public class GetCatalogIndexEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly ICatalogueManager _catalogueManager;
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public GetCatalogIndexEvent(ICatalogueManager catalogueManager, IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_catalogueManager = catalogueManager;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.GetCatalogIndex;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var mode = request.ReadString();
|
|
||||||
|
|
||||||
var categories =
|
|
||||||
_catalogueManager.Pages.Values.Where(
|
|
||||||
p => p.Parent is null && p.Modes.Contains(mode.ToLower()) && p.MinRank <= gameSession.Habbo.Rank);
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new CatalogPagesListComposer(categories, mode));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Catalog;
|
|
||||||
|
|
||||||
public class GetCatalogPageEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly ICatalogueManager _catalogueManager;
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public GetCatalogPageEvent(ICatalogueManager catalogueManager, IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_catalogueManager = catalogueManager;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.GetCatalogPage;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var pageId = request.ReadInt32();
|
|
||||||
var offerId = request.ReadInt32();
|
|
||||||
var mode = request.ReadString();
|
|
||||||
|
|
||||||
if (!_catalogueManager.Pages.TryGetValue(pageId, out var page) || !page.Enabled ||
|
|
||||||
page.MinRank > gameSession.Habbo.Rank || !page.Modes.Contains(mode.ToLower()))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var featuredPages = page.Layout.Equals("frontpage4")
|
|
||||||
? _catalogueManager.FeaturedPages.Values
|
|
||||||
: new List<CatalogueFeaturedPage>();
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new CatalogPageMessageComposer(page, offerId, mode, featuredPages));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Catalog;
|
|
||||||
|
|
||||||
public class GetClubOffersMessageEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly ICatalogueManager _catalogueManager;
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public GetClubOffersMessageEvent(ICatalogueManager catalogueManager, IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_catalogueManager = catalogueManager;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.GetClubOffers;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentSubscription = gameSession.Habbo.GetActiveSubscription();
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new HabboClubOffersMessageComposer(
|
|
||||||
_catalogueManager.ClubOffers.Values.Where(co =>
|
|
||||||
co.DiscountExtension == currentSubscription is
|
|
||||||
{
|
|
||||||
MonthsLeft: 0, DaysInMonthLeft: <= 5 and > 0
|
|
||||||
}).ToList(), currentSubscription));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Catalog;
|
|
||||||
|
|
||||||
public class PurchaseFromCatalogEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly ICatalogueManager _catalogueManager;
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public PurchaseFromCatalogEvent(ICatalogueManager catalogueManager, IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_catalogueManager = catalogueManager;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.CatalogPurchase;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var pageId = request.ReadInt32();
|
|
||||||
var offerId = request.ReadInt32();
|
|
||||||
var extraData = request.ReadString();
|
|
||||||
var amount = request.ReadInt32();
|
|
||||||
|
|
||||||
if (amount < 0 || !_catalogueManager.Pages.TryGetValue(pageId, out var page))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (page.Layout.Equals("vip_buy"))
|
|
||||||
{
|
|
||||||
await _catalogueManager.PurchaseClubOffer(offerId, gameSession);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +1,20 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
using Tiger.Communication.Messages.Interfaces;
|
||||||
using Tiger.Communication.Messages.Outgoing.User.Data;
|
using Tiger.Communication.Messages.Outgoing.Handshake;
|
||||||
using Tiger.Communication.Messages.Types;
|
using Tiger.Communication.Messages.Types;
|
||||||
using Tiger.Networking.Game.Sessions;
|
using Tiger.Networking.Game.Sessions;
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Handshake;
|
namespace Tiger.Communication.Messages.Incoming.Handshake;
|
||||||
|
|
||||||
public class InfoRetrieveMessageEvent : IMessageEvent
|
public class InfoRetrieveEvent : IMessageEvent
|
||||||
{
|
{
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
private readonly IGameSessionManager _gameSessionManager;
|
||||||
|
|
||||||
public InfoRetrieveMessageEvent(IGameSessionManager gameSessionManager)
|
public InfoRetrieveEvent(IGameSessionManager gameSessionManager)
|
||||||
{
|
{
|
||||||
_gameSessionManager = gameSessionManager;
|
_gameSessionManager = gameSessionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserInfo;
|
public IncomingHeaders Header => IncomingHeaders.InfoRetrieveEvent;
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
||||||
{
|
{
|
||||||
if (gameSession.Habbo == null)
|
if (gameSession.Habbo == null)
|
||||||
|
@ -23,6 +23,6 @@ public class InfoRetrieveMessageEvent : IMessageEvent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new UserInfoComposer(gameSession.Habbo));
|
await gameSession.SendComposerAsync(new UserObjectMessageComposer(gameSession.Habbo));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
using Tiger.Communication.Messages.Interfaces;
|
||||||
|
using Tiger.Communication.Messages.Outgoing.Generic.Alerts;
|
||||||
|
using Tiger.Communication.Messages.Outgoing.Handshake;
|
||||||
|
using Tiger.Communication.Messages.Types;
|
||||||
|
using Tiger.Game.Habbos;
|
||||||
|
using Tiger.Game.Settings;
|
||||||
|
using Tiger.Networking.Game.Sessions;
|
||||||
|
using Tiger.Storage;
|
||||||
|
|
||||||
|
namespace Tiger.Communication.Messages.Incoming.Handshake;
|
||||||
|
|
||||||
|
public class SsoTicketEvent : IMessageEvent
|
||||||
|
{
|
||||||
|
private readonly IRepository<Habbo> _habboRepository;
|
||||||
|
private readonly IGameSessionManager _gameSessionManager;
|
||||||
|
private readonly ISettingManager _settingManager;
|
||||||
|
|
||||||
|
public SsoTicketEvent(IRepository<Habbo> habboRepository, IGameSessionManager gameSessionManager, ISettingManager settingManager)
|
||||||
|
{
|
||||||
|
_habboRepository = habboRepository;
|
||||||
|
_gameSessionManager = gameSessionManager;
|
||||||
|
_settingManager = settingManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IncomingHeaders Header => IncomingHeaders.SSoTicketEvent;
|
||||||
|
|
||||||
|
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
||||||
|
{
|
||||||
|
var sso = request.ReadString();
|
||||||
|
|
||||||
|
if (sso == null)
|
||||||
|
{
|
||||||
|
await _gameSessionManager.CloseAsync("Malformed packet", gameSession);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var habbo = await _habboRepository.FindOneByAsync(h => h.SsoTicket == sso);
|
||||||
|
|
||||||
|
if (habbo == null)
|
||||||
|
{
|
||||||
|
await _gameSessionManager.CloseAsync("User not found", gameSession);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gameSession.Habbo = habbo;
|
||||||
|
|
||||||
|
await gameSession.SendComposerAsync(new AuthenticationOkMessageComposer());
|
||||||
|
await gameSession.SendComposerAsync(new HabboBroadcastMessageComposer(
|
||||||
|
_settingManager.GetSetting<string>("welcome.message")
|
||||||
|
.Replace("{user}", gameSession.Habbo.Username)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Security;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Game.Settings;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Handshake;
|
|
||||||
|
|
||||||
public class SsoTicketMessageEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IRepository<Habbo> _habboRepository;
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly ISettingManager _settingManager;
|
|
||||||
private readonly ILogger<SsoTicketMessageEvent> _logger;
|
|
||||||
private readonly IAchievementManager _achievementManager;
|
|
||||||
|
|
||||||
public SsoTicketMessageEvent(IRepository<Habbo> habboRepository, IGameSessionManager gameSessionManager, ISettingManager settingManager, ILogger<SsoTicketMessageEvent> logger, IAchievementManager achievementManager)
|
|
||||||
{
|
|
||||||
_habboRepository = habboRepository;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_settingManager = settingManager;
|
|
||||||
_logger = logger;
|
|
||||||
_achievementManager = achievementManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.SecurityTicket;
|
|
||||||
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
var habbo = await _habboRepository.FindOneByAsync(h => h.SsoTicket == request.ReadString());
|
|
||||||
|
|
||||||
if (habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("User not found", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gameSession.Habbo = habbo;
|
|
||||||
gameSession.Habbo.LastLogin = DateTime.Now;
|
|
||||||
gameSession.Habbo.Online = true;
|
|
||||||
_habboRepository.SaveAsync(gameSession.Habbo);
|
|
||||||
|
|
||||||
if (DateTime.Now.Hour == 15)
|
|
||||||
{
|
|
||||||
_achievementManager.UpdateAchievementAsync("ACH_HappyHour", 1, gameSession);
|
|
||||||
}
|
|
||||||
|
|
||||||
_logger.LogInformation("{User} logged in", gameSession.Habbo.Username);
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new AuthenticatedComposer());
|
|
||||||
await gameSession.SendComposerAsync(new HabboBroadcastMessageComposer(
|
|
||||||
_settingManager.GetSetting<string>("welcome.message")
|
|
||||||
.Replace("{user}", gameSession.Habbo.Username)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,468 +2,490 @@ namespace Tiger.Communication.Messages.Incoming;
|
||||||
|
|
||||||
public enum IncomingHeaders : short
|
public enum IncomingHeaders : short
|
||||||
{
|
{
|
||||||
AchievementList = 219,
|
AcceptFriendEvent = 137,
|
||||||
Authentication = -1,
|
AcceptTradingEvent = 3863,
|
||||||
BotConfiguration = 1986,
|
AddAdminRightsToMemberEvent = 2894,
|
||||||
BotPickup = 3323,
|
AddFavouriteRoomEvent = 3817,
|
||||||
BotPlace = 1592,
|
AddItemToTradeEvent = 3107,
|
||||||
BotSkillSave = 2624,
|
AddItemsToTradeEvent = 1263,
|
||||||
GetClubOffers = 3285,
|
AddJukeboxDiskEvent = 753,
|
||||||
|
AddSpamWallPostItEvent = 3283,
|
||||||
|
AmbassadorAlertEvent = 2996,
|
||||||
|
AnswerPollEvent = 3505,
|
||||||
|
ApplySnapshotEvent = 3373,
|
||||||
|
ApproveMembershipRequestEvent = 3386,
|
||||||
|
ApproveNameEvent = 2109,
|
||||||
|
AssignRightsEvent = 808,
|
||||||
|
AvatarEffectActivatedEvent = 2959,
|
||||||
|
AvatarEffectSelectedEvent = 1752,
|
||||||
|
AvatarExpressionEvent = 2456,
|
||||||
|
BanUserWithDurationEvent = 1477,
|
||||||
|
BreedPetsEvent = 1638,
|
||||||
|
BuildersClubPlaceWallItemEvent = 2462,
|
||||||
|
BuildersClubQueryFurniCountEvent = 2529,
|
||||||
|
BuyMarketplaceOfferEvent = 1603,
|
||||||
|
CallForHelpEvent = 1691,
|
||||||
|
CallForHelpFromForumMessageEvent = 1412,
|
||||||
|
CallForHelpFromForumThreadEvent = 534,
|
||||||
|
CallForHelpFromImEvent = 2950,
|
||||||
|
CallForHelpFromPhotoEvent = 2492,
|
||||||
|
CanCreateRoomEvent = 2128,
|
||||||
|
CancelMarketplaceOfferEvent = 434,
|
||||||
|
CancelPetBreedingEvent = 2713,
|
||||||
|
CancelTypingEvent = 1474,
|
||||||
|
ChangeMottoEvent = 2228,
|
||||||
|
ChangePostureEvent = 2235,
|
||||||
|
ChangeUserNameEvent = 2977,
|
||||||
|
ChatEvent = 1314,
|
||||||
|
ChatReviewGuideDecidesOnOfferEvent = 3365,
|
||||||
|
ChatReviewGuideDetachedEvent = 2501,
|
||||||
|
ChatReviewGuideVoteEvent = 3961,
|
||||||
|
ChatReviewSessionCreateEvent = 3060,
|
||||||
|
CheckUserNameEvent = 3950,
|
||||||
|
ClientHelloEvent = 4000,
|
||||||
|
CloseIssueDefaultActionEvent = 2717,
|
||||||
|
CloseIssuesEvent = 2067,
|
||||||
|
CloseTradingEvent = 2551,
|
||||||
|
CommandBotEvent = 2624,
|
||||||
|
CompleteDiffieHandshakeEvent = 773,
|
||||||
|
CompostPlantEvent = 3835,
|
||||||
|
ConfirmAcceptTradingEvent = 2760,
|
||||||
|
ConfirmDeclineTradingEvent = 2341,
|
||||||
|
ConfirmPetBreedingEvent = 3382,
|
||||||
|
ControlYoutubeDisplayPlaybackEvent = 3005,
|
||||||
|
CraftEvent = 3591,
|
||||||
|
CraftSecretEvent = 1251,
|
||||||
|
CreateFlatEvent = 2752,
|
||||||
|
CreateGuildEvent = 230,
|
||||||
|
CreditFurniRedeemEvent = 3115,
|
||||||
|
CustomizeAvatarWithFurniEvent = 3374,
|
||||||
|
CustomizePetWithFurniEvent = 1328,
|
||||||
|
DanceEvent = 2080,
|
||||||
|
DeactivateGuildEvent = 1134,
|
||||||
|
DeclineFriendEvent = 2890,
|
||||||
|
DeleteFavouriteRoomEvent = 309,
|
||||||
|
DeleteRoomEvent = 532,
|
||||||
|
DeselectFavouriteHabboGroupEvent = 1820,
|
||||||
|
DiceOffEvent = 1533,
|
||||||
|
DropCarryItemEvent = 2814,
|
||||||
|
EditEventEvent = 3991,
|
||||||
|
EnterOneWayDoorEvent = 2765,
|
||||||
|
EventLogEvent = 3457,
|
||||||
|
FindNewFriendsEvent = 516,
|
||||||
|
FollowFriendEvent = 2970,
|
||||||
|
ForwardToSomeRoomEvent = 1703,
|
||||||
|
FriendFurniConfirmLockEvent = 3775,
|
||||||
|
Game2GetAccountGameStatusEvent = 11,
|
||||||
|
GameUnloadedEvent = 3207,
|
||||||
|
GetAchievementsEvent = 219,
|
||||||
|
GetBadgePointLimitsEvent = 1371,
|
||||||
|
GetBadgesEvent = 2769,
|
||||||
|
GetBannedUsersFromRoomEvent = 2267,
|
||||||
|
GetBonusRareInfoEvent = 957,
|
||||||
|
GetBotCommandConfigurationDataEvent = 1986,
|
||||||
|
GetBotInventoryEvent = 3848,
|
||||||
|
GetBundleDiscountRulesetEvent = 223,
|
||||||
|
GetCatalogIndexEvent = 1195,
|
||||||
|
GetCatalogPageEvent = 412,
|
||||||
|
GetCfhChatlogEvent = 211,
|
||||||
|
GetCfhStatusEvent = 2746,
|
||||||
GetClubGiftInfo = 487,
|
GetClubGiftInfo = 487,
|
||||||
GetCatalogIndex = 1195,
|
GetClubOffersEvent = 3285,
|
||||||
GetCatalogPage = 412,
|
GetCraftableProductsEvent = 633,
|
||||||
CatalogPurchase = 3492,
|
GetCraftingRecipeEvent = 1173,
|
||||||
CatalogPurchaseGift = 1411,
|
GetCraftingRecipesAvailableEvent = 3086,
|
||||||
GetProductOffer = 2594,
|
GetCreditsInfoEvent = 273,
|
||||||
ClientLatency = 295,
|
GetCurrentTimingCodeEvent = 2912,
|
||||||
ClientLatencyMeasure = 96,
|
GetCustomRoomFilterEvent = 1911,
|
||||||
ClientPolicy = 26979,
|
GetExtendedProfileEvent = 3265,
|
||||||
ClientPong = 2596,
|
GetFlatControllersEvent = 3385,
|
||||||
ClientToolbarToggle = 2313,
|
GetForumStatsEvent = 3149,
|
||||||
ClientVariables = 1053,
|
GetForumsListEvent = 873,
|
||||||
GetCurrentTimingCode = 2912,
|
GetFriendRequestsEvent = 2448,
|
||||||
DesktopView = 105,
|
GetFurnitureAliasesEvent = 3898,
|
||||||
GetBundleDiscountRuleset = 223,
|
GetGameListEvent = 741,
|
||||||
EventTracker = 3457,
|
GetGameStatusEvent = 3171,
|
||||||
FindNewFriends = 516,
|
GetGiftWrappingConfigurationEvent = 418,
|
||||||
FurnitureAliases = 3898,
|
GetGuestRoomEvent = 2230,
|
||||||
FurnitureFloorUpdate = 248,
|
GetGuideReportingStatusEvent = 3786,
|
||||||
FurnitureMultistate = 99,
|
GetGuildCreationInfoEvent = 798,
|
||||||
FurniturePickup = 3456,
|
GetGuildEditInfoEvent = 1004,
|
||||||
FurniturePlace = 1258,
|
GetGuildEditorDataEvent = 813,
|
||||||
FurniturePostitPlace = 2248,
|
GetGuildFurniContextMenuInfoEvent = 2651,
|
||||||
FurniturePostitSaveStickyPole = 3283,
|
GetGuildMembersEvent = 312,
|
||||||
FurnitureRandomstate = 3617,
|
GetGuildMembershipsEvent = 367,
|
||||||
FurnitureWallMultistate = 210,
|
GetHabboGroupBadgesEvent = 21,
|
||||||
FurnitureWallUpdate = 168,
|
GetHabboGroupDetailsEvent = 2991,
|
||||||
GamesInit = 2914,
|
GetIgnoredUsersEvent = 3878,
|
||||||
GamesList = 741,
|
GetItemDataEvent = 3964,
|
||||||
Acceptgameinvite = 3802,
|
GetJukeboxPlayListEvent = 1435,
|
||||||
Gameunloadedmessage = 3207,
|
GetLimitedOfferAppearingNextEvent = 410,
|
||||||
Getgameachievementsmessage = 2399,
|
GetMotdEvent = 1523,
|
||||||
Getgamestatusmessage = 3171,
|
GetMarketplaceCanMakeOfferEvent = 848,
|
||||||
Getusergameachievementsmessage = 389,
|
GetMarketplaceConfigurationEvent = 2597,
|
||||||
Joinqueuemessage = 1458,
|
GetMarketplaceItemStatsEvent = 3288,
|
||||||
Leavequeuemessage = 2384,
|
GetMarketplaceOffersEvent = 2407,
|
||||||
Resetresolutionachievementmessage = 3144,
|
GetMarketplaceOwnOffersEvent = 2105,
|
||||||
Getweeklygamerewardwinners = 1054,
|
GetMemberGuildItemCountEvent = 3593,
|
||||||
Game2Getaccountgamestatusmessage = 11,
|
GetMessagesEvent = 232,
|
||||||
Game2Checkgamedirectorystatusmessage = 3259,
|
GetModeratorRoomInfoEvent = 707,
|
||||||
Game2Exitgamemessage = 1445,
|
GetModeratorUserInfoEvent = 3295,
|
||||||
Game2Gamechatmessage = 2502,
|
GetNowPlayingEvent = 1325,
|
||||||
Game2Loadstagereadymessage = 2415,
|
GetOccupiedTilesEvent = 1687,
|
||||||
Game2Playagainmessage = 3196,
|
GetOfficialSongIdEvent = 3189,
|
||||||
Game2Requestfullstatusupdatemessage = 1598,
|
GetPendingCallsForHelpEvent = 3267,
|
||||||
Game2Getweeklyfriendsleaderboard = 1232,
|
GetPetCommandsEvent = 2161,
|
||||||
Game2Getweeklyleaderboard = 2565,
|
GetPetInfoEvent = 2934,
|
||||||
GetGiftWrappingConfig = 418,
|
GetPetInventoryEvent = 3095,
|
||||||
GroupAdminAdd = 2894,
|
GetPopularRoomTagsEvent = 826,
|
||||||
GroupAdminRemove = 722,
|
GetProductOfferEvent = 2594,
|
||||||
GroupCreateOptions = 798,
|
GetPromoArticlesEvent = 1827,
|
||||||
GroupFavorite = 3549,
|
GetRecyclerPrizesEvent = 398,
|
||||||
GetForumStats = 3149,
|
GetRecyclerStatusEvent = 1342,
|
||||||
GetForumThreads = 873,
|
GetRelationshipStatusInfoEvent = 2138,
|
||||||
GetForumsList = 436,
|
GetResolutionAchievementsEvent = 359,
|
||||||
GetForumMessages = 232,
|
GetRoomAdPurchaseInfoEvent = 1075,
|
||||||
GetForumThread = 3900,
|
GetRoomChatlogEvent = 2587,
|
||||||
GetUnreadForumsCount = 2908,
|
GetRoomEntryDataEvent = 2300,
|
||||||
ForumModerateMessage = 286,
|
GetRoomEntryTileEvent = 3559,
|
||||||
ForumModerateThread = 1397,
|
GetRoomSettingsEvent = 3129,
|
||||||
ForumPostMessage = 3529,
|
GetRoomVisitsEvent = 3526,
|
||||||
UpdateForumReadMarker = 1855,
|
GetSelectedBadgesEvent = 2091,
|
||||||
UpdateForumSettings = 2214,
|
GetSellablePetPalettesEvent = 1756,
|
||||||
ForumUpdateThread = 3045,
|
GetSongInfoEvent = 3082,
|
||||||
GroupInfo = 2991,
|
GetSoundSettingsEvent = 2388,
|
||||||
GroupDelete = 1134,
|
GetTalentTrackEvent = 196,
|
||||||
GroupMemberRemoveConfirm = 3593,
|
GetTalentTrackLevelEvent = 2127,
|
||||||
GroupMemberRemove = 593,
|
GetThreadsEvent = 436,
|
||||||
GroupMembers = 312,
|
GetUnreadForumsCountEvent = 2908,
|
||||||
GroupMemberships = 367,
|
GetUserChatlogEvent = 1391,
|
||||||
GroupRequest = 998,
|
GetUserEventCatsEvent = 1782,
|
||||||
GroupRequestAccept = 3386,
|
GetUserFlatCatsEvent = 3027,
|
||||||
GroupRequestDecline = 1894,
|
GetUserTagsEvent = 17,
|
||||||
GroupSettings = 1004,
|
GetWardrobeEvent = 2742,
|
||||||
GroupParts = 813,
|
GetWeeklyGameRewardEvent = 2914,
|
||||||
GroupBuy = 230,
|
GetWeeklyGameRewardWinnersEvent = 1054,
|
||||||
GroupSaveInformation = 3137,
|
GetYoutubeDisplayStatusEvent = 336,
|
||||||
GroupSaveBadge = 1991,
|
GuideSessionCreateEvent = 3338,
|
||||||
GroupSaveColors = 1764,
|
GuideSessionFeedbackEvent = 477,
|
||||||
GroupSavePreferences = 3435,
|
GuideSessionGetRequesterRoomEvent = 1052,
|
||||||
GroupBadges = 21,
|
GuideSessionGuideDecidesEvent = 1424,
|
||||||
GroupUnblockMember = 2864,
|
GuideSessionInviteRequesterEvent = 234,
|
||||||
GetBadgePointsLimits = 1371,
|
GuideSessionIsTypingEvent = 519,
|
||||||
Requestabadge = 3077,
|
GuideSessionMessageEvent = 3899,
|
||||||
Getisbadgerequestfulfilled = 1364,
|
GuideSessionOnDutyUpdateEvent = 1922,
|
||||||
ItemClothingRedeem = 3374,
|
GuideSessionReportEvent = 3969,
|
||||||
ItemColorWheelClick = 2144,
|
GuideSessionRequesterCancelsEvent = 291,
|
||||||
ItemDiceClick = 1990,
|
GuideSessionResolvedEvent = 887,
|
||||||
ItemDiceClose = 1533,
|
HabboSearchEvent = 1210,
|
||||||
ItemDimmerSave = 1648,
|
// HotelViewClaimBadgeRewardEvent = -1,
|
||||||
ItemDimmerSettings = 2813,
|
HotelViewRequestBadgeRewardEvent = 2318,
|
||||||
ItemDimmerToggle = 2296,
|
HotelViewRequestSecondsUntilEvent = 271,
|
||||||
ItemExchangeRedeem = 3115,
|
IgnoreUserEvent = 1117,
|
||||||
ItemPaint = 711,
|
InfoRetrieveEvent = 357,
|
||||||
SetObjectData = 3608,
|
InitDiffieHandshakeEvent = 3110,
|
||||||
ItemStackHelper = 3839,
|
JoinHabboGroupEvent = 998,
|
||||||
MarketplaceConfig = 2597,
|
JoinQueueEvent = 1458,
|
||||||
AcceptFriend = 137,
|
JukeBoxEventOne = 2304,
|
||||||
MessengerChat = 3567,
|
KickMemberEvent = 593,
|
||||||
DeclineFriend = 2890,
|
LatencyPingRequestEvent = 295,
|
||||||
FollowFriend = 3997,
|
LetUserInEvent = 1644,
|
||||||
MessengerFriends = 1523,
|
LookToEvent = 3301,
|
||||||
MessengerInit = 2781,
|
MakeOfferEvent = 3447,
|
||||||
MessengerRelationships = 2138,
|
MessengerInitEvent = 2781,
|
||||||
SetRelationshipStatus = 3768,
|
ModAlertEvent = 229,
|
||||||
RemoveFriend = 1689,
|
ModBanEvent = 2766,
|
||||||
RequestFriend = 3157,
|
ModKickEvent = 2582,
|
||||||
GetFriendRequests = 2448,
|
ModMessageEvent = 1840,
|
||||||
SendRoomInvite = 1276,
|
ModMuteEvent = 1945,
|
||||||
HabboSearch = 1210,
|
// ModToolRequestRoomUserChatlogEvent = -1,
|
||||||
FriendListUpdate = 1419,
|
ModToolSanctionEvent = 1392,
|
||||||
ModToolUserInfo = 3295,
|
// ModToolWarnEvent = -1,
|
||||||
GetUserFlatCats = 3027,
|
ModTradingLockEvent = 3742,
|
||||||
NavigatorInit = 2110,
|
ModerateMessageEvent = 286,
|
||||||
NavigatorSearch = 249,
|
ModerateRoomEvent = 3260,
|
||||||
NavigatorSearchClose = 1834,
|
ModerateThreadEvent = 1397,
|
||||||
NavigatorSearchOpen = 637,
|
ModeratorActionEvent = 3842,
|
||||||
NavigatorSearchSave = 2226,
|
MountPetEvent = 1036,
|
||||||
GetUserEventCats = 1782,
|
MoveAvatarEvent = 3320,
|
||||||
NavigatorSettingsSave = 3159,
|
MoveObjectEvent = 248,
|
||||||
NavigatorCategoryListMode = 1202,
|
MovePetEvent = 3449,
|
||||||
NavigatorDeleteSavedSearch = 1954,
|
MoveWallItemEvent = 168,
|
||||||
PetInfo = 2934,
|
MuteAllInRoomEvent = 3637,
|
||||||
PetPickup = 1581,
|
MyFavouriteRoomsSearchEvent = 2578,
|
||||||
PetPlace = 2647,
|
MyFriendsRoomsSearchEvent = 2266,
|
||||||
PetRespect = 3202,
|
MyGuildBasesSearchEvent = 39,
|
||||||
PetRide = 1036,
|
MyRoomHistorySearchEvent = 2264,
|
||||||
PetMove = 3449,
|
MyRoomRightsSearchEvent = 272,
|
||||||
PetOpenPackage = 3698,
|
MyRoomsSearchEvent = 2277,
|
||||||
PetSelected = 549,
|
NavigatorAddCollapsedCategoryEvent = 1834,
|
||||||
PetsBreed = 1638,
|
NavigatorAddSavedSearchEvent = 2226,
|
||||||
PetCancelBreeding = 2713,
|
NavigatorDeleteSavedSearchEvent = 1954,
|
||||||
PetConfirmBreeding = 3382,
|
NavigatorRemoveCollapsedCategoryEvent = 637,
|
||||||
GetPetTrainingPanel = 2161,
|
NavigatorSetSearchCodeViewModeEvent = 1202,
|
||||||
RecyclerPrizes = 398,
|
NewNavigatorInitEvent = 2110,
|
||||||
RecyclerStatus = 1342,
|
NewNavigatorSearchEvent = 249,
|
||||||
RecyclerItems = 2771,
|
NewUserExperienceGetGiftsEvent = 1822,
|
||||||
ReleaseVersion = 4000,
|
NewUserExperienceScriptProceedEvent = 1299,
|
||||||
CallForHelp = 1691,
|
OpenCampaignCalendarDoorEvent = 8809,
|
||||||
RoomAmbassadorAlert = 2996,
|
OpenCampaignCalendarDoorAsStaffEvent = 2507,
|
||||||
RoomBanGive = 1477,
|
OpenFlatConnectionEvent = 2312,
|
||||||
RoomBanList = 2267,
|
OpenPetPackageEvent = 3698,
|
||||||
RoomBanRemove = 992,
|
OpenTradingEvent = 1481,
|
||||||
RoomCreate = 2752,
|
PassCarryItemEvent = 2941,
|
||||||
RoomDelete = 532,
|
PickIssuesEvent = 15,
|
||||||
RoomDoorbell = 1644,
|
PickupObjectEvent = 3456,
|
||||||
RoomEnter = 2312,
|
PlaceBotEvent = 1592,
|
||||||
RoomFavorite = 3817,
|
PlaceObjectEvent = 1258,
|
||||||
RoomFavoriteRemove = 309,
|
PlacePetEvent = 2647,
|
||||||
CanCreateRoom = 2128,
|
PlacePostItEvent = 2248,
|
||||||
CancelRoomEvent = 2725,
|
PollRejectEvent = 1773,
|
||||||
EditRoomEvent = 3991,
|
PollStartEvent = 109,
|
||||||
CompetitionRoomSearch = 433,
|
PongEvent = 2596,
|
||||||
ForwardToRandomPromotedRoom = 10,
|
PopularRoomsSearchEvent = 2758,
|
||||||
ForwardToSomeRoom = 1703,
|
PostMessageEvent = 3529,
|
||||||
GetCategoriesWithUserCount = 3782,
|
PresentOpenEvent = 3558,
|
||||||
GetGuestRoom = 2230,
|
PublishPhotoEvent = 2068,
|
||||||
GetOfficialRooms = 1229,
|
PurchaseFromCatalogAsGiftEvent = 1411,
|
||||||
GetPopularRoomTags = 826,
|
PurchaseFromCatalogEvent = 3492,
|
||||||
GuildBaseSearch = 2930,
|
PurchasePhotoEvent = 2408,
|
||||||
MyFavouriteRoomsSearch = 2578,
|
PurchaseRoomAdEvent = 777,
|
||||||
MyFrequentRoomHistorySearch = 1002,
|
PurchaseTargetedOfferEvent = 1826,
|
||||||
MyFriendsRoomSearch = 2266,
|
PurchaseVipMembershipExtensionEvent = 3407,
|
||||||
MyGuildBasesSearch = 39,
|
QuitEvent = 105,
|
||||||
MyRecommendedRooms = 2537,
|
RateFlatEvent = 3582,
|
||||||
MyRoomHistorySearch = 2264,
|
RecycleItemsEvent = 2771,
|
||||||
MyRoomRightsSearch = 272,
|
RedeemMarketplaceOfferCreditsEvent = 2650,
|
||||||
MyRoomsSearch = 2277,
|
RedeemVoucherEvent = 339,
|
||||||
PopularRoomsSearch = 2758,
|
RejectMembershipRequestEvent = 1894,
|
||||||
RoomAdEventTabClicked = 2412,
|
ReleaseIssuesEvent = 1572,
|
||||||
RoomAdEventTabViewed = 2668,
|
RemoveAdminRightsFromMemberEvent = 722,
|
||||||
RoomAdSearch = 2809,
|
RemoveAllRightsEvent = 2683,
|
||||||
RoomTextSearch = 3943,
|
RemoveBotFromFlatEvent = 3323,
|
||||||
RoomsWhereMyFriendsAre = 1786,
|
RemoveFriendEvent = 1689,
|
||||||
RoomsWithHighestScoreSearch = 2939,
|
RemoveItemEvent = 3336,
|
||||||
SetRoomSessionTags = 3305,
|
RemoveItemFromTradeEvent = 3845,
|
||||||
UpdateRoomThumbnail = 2468,
|
RemoveJukeboxDiskEvent = 3050,
|
||||||
RoomKick = 1320,
|
RemoveOwnRoomRightsRoomEvent = 3182,
|
||||||
RoomLike = 3582,
|
RemovePetFromFlatEvent = 1581,
|
||||||
RoomModel = 2300,
|
RemoveRightsEvent = 2064,
|
||||||
GetOccupiedTiles = 1687,
|
RemoveSaddleFromPetEvent = 186,
|
||||||
GetRoomEntryTile = 3559,
|
RenderRoomEvent = 3226,
|
||||||
RoomModelSave = 875,
|
RenderRoomThumbnailEvent = 1982,
|
||||||
RoomMute = 3637,
|
RentableSpaceCancelRentEvent = 1667,
|
||||||
RoomMuteUser = 3485,
|
RentableSpaceRentEvent = 2946,
|
||||||
RoomRightsGive = 808,
|
// RequestAchievementConfigurationEvent = -1,
|
||||||
RoomRightsList = 3385,
|
RequestCameraConfigurationEvent = 796,
|
||||||
RoomRightsRemove = 2064,
|
RequestFriendEvent = 3157,
|
||||||
RoomRightsRemoveAll = 2683,
|
RequestFurniInventoryEvent = 3150,
|
||||||
RoomRightsRemoveOwn = 3182,
|
RequestFurniInventoryWhenNotInRoomEvent = 3500,
|
||||||
RoomSettings = 3129,
|
RequestRoomPropertySet = 711,
|
||||||
RoomSettingsSave = 1969,
|
RespectPetEvent = 3202,
|
||||||
RoomSettingsUpdateRoomCategoryAndTrade = 1265,
|
RespectUserEvent = 2694,
|
||||||
RoomStaffPick = 1918,
|
RoomDimmerChangeStateEvent = 2296,
|
||||||
RoomFilterWords = 1911,
|
RoomDimmerGetPresetsEvent = 2813,
|
||||||
RoomFilterWordsModify = 3001,
|
RoomDimmerSavePresetEvent = 1648,
|
||||||
Mysteryboxwaitingcanceledmessage = 2012,
|
RoomTextSearchEvent = 3943,
|
||||||
MysteryboxOpenTrophy = 3074,
|
RoomUserKickEvent = 1320,
|
||||||
SecurityMachine = 2490,
|
RoomUserMuteEvent = 3485,
|
||||||
SecurityTicket = 2419,
|
RoomsWhereMyFriendsAreSearchEvent = 1786,
|
||||||
Trade = 1481,
|
RoomsWithHighestScoreSearchEvent = 2939,
|
||||||
TradeAccept = 3863,
|
SSoTicketEvent = 2419,
|
||||||
TradeCancel = 2341,
|
SaveRoomSettingsEvent = 1969,
|
||||||
TradeClose = 2551,
|
SaveWardrobeOutfitEvent = 800,
|
||||||
TradeConfirm = 2760,
|
ScrGetKickbackInfoEvent = 869,
|
||||||
TradeItem = 3107,
|
ScrGetUserInfoEvent = 3166,
|
||||||
TradeItemRemove = 3845,
|
// SearchRoomsByTagEvent = -1,
|
||||||
TradeItems = 1263,
|
SelectClubGiftEvent = 2276,
|
||||||
TradeUnaccept = 1444,
|
SelectFavouriteHabboGroupEvent = 3549,
|
||||||
UnitAction = 2456,
|
SendMsgEvent = 3567,
|
||||||
UnitChat = 1314,
|
SendRoomInviteEvent = 1276,
|
||||||
UnitChatShout = 2085,
|
SetActivatedBadgesEvent = 644,
|
||||||
UnitChatWhisper = 1543,
|
SetChatPreferencesEvent = 1262,
|
||||||
UnitDance = 2080,
|
SetChatStylePreferenceEvent = 1030,
|
||||||
UnitDropHandItem = 2814,
|
SetClothingChangeDataEvent = 924,
|
||||||
UnitGiveHanditem = 2941,
|
SetCustomStackingHeightEvent = 3839,
|
||||||
UnitLook = 3301,
|
SetIgnoreRoomInvitesEvent = 1086,
|
||||||
UnitPosture = 2235,
|
SetItemDataEvent = 3666,
|
||||||
UnitSign = 1975,
|
SetMannequinFigureEvent = 2209,
|
||||||
UnitTyping = 1597,
|
SetMannequinNameEvent = 2850,
|
||||||
UnitTypingStop = 1474,
|
SetNewNavigatorWindowPreferencesEvent = 3159,
|
||||||
UnitWalk = 3320,
|
SetObjectDataEvent = 3608,
|
||||||
UserBadges = 2769,
|
SetRandomStateEvent = 3617,
|
||||||
UserBadgesCurrent = 2091,
|
SetRelationshipStatusEvent = 3768,
|
||||||
UserBadgesCurrentUpdate = 644,
|
SetRoomBackgroundColorDataEvent = 2880,
|
||||||
UserBots = 3848,
|
SetRoomCameraPreferencesEvent = 1461,
|
||||||
UserCurrency = 273,
|
SetSoundSettingsEvent = 1367,
|
||||||
UserEffectActivate = 2959,
|
SetTargetedOfferStateEvent = 2041,
|
||||||
UserEffectEnable = 1752,
|
SetYoutubeDisplayPlaylistEvent = 2069,
|
||||||
UserFigure = 2730,
|
ShoutEvent = 2085,
|
||||||
UserFurniture = 3150, // sent when in room
|
SignEvent = 1975,
|
||||||
Requestfurniinventorywhennotinroom = 3500, // sent when not in room
|
SpinWheelOfFortuneEvent = 2144,
|
||||||
UserHomeRoom = 1740,
|
StartTypingEvent = 1597,
|
||||||
UserInfo = 357,
|
SubmitRoomToCompetitionEvent = 2595,
|
||||||
UserMotto = 2228,
|
ThrowDiceEvent = 1990,
|
||||||
UserIgnored = 3878,
|
TogglePetBreedingPermissionEvent = 3379,
|
||||||
UserPets = 3095,
|
TogglePetRidingPermissionEvent = 1472,
|
||||||
UserProfile = 3265,
|
ToggleStaffPickEvent = 1918,
|
||||||
UserProfileByName = 2249,
|
UnacceptTradingEvent = 1444,
|
||||||
UserRespect = 2694,
|
UnbanUserFromRoomEvent = 992,
|
||||||
GetSoundSettings = 2388,
|
UnignoreUserEvent = 2061,
|
||||||
UserSettingsCamera = 1461,
|
UniqueIdEvent = 2490,
|
||||||
UserSettingsChatStyle = 1030,
|
UpdateActionEvent = 2281,
|
||||||
UserSettingsInvites = 1086,
|
UpdateConditionEvent = 3203,
|
||||||
UserSettingsOldChat = 1262,
|
UpdateFigureDataEvent = 2730,
|
||||||
UserSettingsVolume = 1367,
|
UpdateFloorPropertiesEvent = 875,
|
||||||
UserSubscription = 3166,
|
UpdateForumSettingsEvent = 2214,
|
||||||
GetWardrobe = 2742,
|
UpdateGuildBadgeEvent = 1991,
|
||||||
SaveWardrobeOutfit = 800,
|
UpdateGuildColorsEvent = 1764,
|
||||||
UserTags = 17,
|
UpdateGuildIdentityEvent = 3137,
|
||||||
PeerUsersClassification = 1160,
|
UpdateGuildSettingsEvent = 3435,
|
||||||
UserClassification = 2285,
|
UpdateHomeRoomEvent = 1740,
|
||||||
VisitUser = 2970,
|
UpdateRoomFilterEvent = 3001,
|
||||||
WiredActionSave = 2281,
|
UpdateThreadEvent = 3045,
|
||||||
WiredApplySnapshot = 3373,
|
UpdateTriggerEvent = 1520,
|
||||||
WiredConditionSave = 3203,
|
UpdateUiFlagsEvent = 2313,
|
||||||
WiredOpen = 768,
|
UseFurnitureEvent = 99,
|
||||||
WiredTriggerSave = 1520,
|
UseWallItemEvent = 210,
|
||||||
GetItemData = 3964,
|
VisitUserEvent = 3997,
|
||||||
OneWayDoorClick = 2765,
|
WhisperEvent = 1543,
|
||||||
RemoveWallItem = 3336,
|
AcceptGameInviteEvent = 3802,
|
||||||
SetItemData = 3666,
|
AcceptQuestEvent = 3604,
|
||||||
CatalogRedeemVoucher = 339,
|
ApproveAllMembershipRequestsEvent = 882,
|
||||||
RoomTonerApply = 2880,
|
BuildersClubPlaceRoomItemEvent = 1051,
|
||||||
FriendFurniConfirmLock = 3775,
|
BuyMarketplaceTokensEvent = 1866,
|
||||||
MannequinSaveName = 2850,
|
CallForHelpFromSelfieEvent = 2755,
|
||||||
MannequinSaveLook = 2209,
|
CancelEventEvent = 2725,
|
||||||
PresentOpenPresent = 3558,
|
CancelQuestEvent = 3133,
|
||||||
CatalogSelectVipGift = 2276,
|
ChangeEmailEvent = 3965,
|
||||||
UserIgnoreId = 3314,
|
ChangeQueueEvent = 3093,
|
||||||
UserIgnore = 1117,
|
CommunityGoalVoteEvent = 3536,
|
||||||
UserUnignore = 2061,
|
CompetitionRoomsSearchEvent = 433,
|
||||||
ModtoolRequestRoomInfo = 707,
|
DeletePendingCallsForHelpEvent = 3605,
|
||||||
ModtoolChangeRoomSettings = 3260,
|
DisconnectEvent = 2445,
|
||||||
ModtoolRequestUserChatlog = 1391,
|
ExtendRentOrBuyoutFurniEvent = 1071,
|
||||||
ModtoolRequestRoomChatlog = 2587,
|
ExtendRentOrBuyoutStripItemEvent = 2115,
|
||||||
ModtoolSanctionAlert = 229,
|
ForwardToACompetitionRoomEvent = 172,
|
||||||
ModtoolSanctionBan = 2766,
|
ForwardToARandomPromotedRoomEvent = 10,
|
||||||
ModtoolSanctionKick = 2582,
|
ForwardToRandomCompetitionRoomEvent = 865,
|
||||||
ModtoolSanctionTradelock = 3742,
|
FriendListUpdateEvent = 1419,
|
||||||
ModtoolAlertevent = 1840,
|
FriendRequestQuestCompleteEvent = 1148,
|
||||||
ModtoolSanctionMute = 1945,
|
Game2CheckGameDirectoryStatusEvent = 3259,
|
||||||
ModtoolRequestUserRooms = 3526,
|
Game2ExitGameEvent = 1445,
|
||||||
ModtoolRoomAlert = 3842,
|
Game2GameChatEvent = 2502,
|
||||||
ModtoolPreferences = 31,
|
Game2GetWeeklyFriendsLeaderboardEvent = 1232,
|
||||||
CloseIssueDefaultAction = 2717,
|
Game2GetWeeklyLeaderboardEvent = 2565,
|
||||||
CloseIssues = 2067,
|
Game2LoadStageReadyEvent = 2415,
|
||||||
DefaultSanction = 1681,
|
Game2PlayAgainEvent = 3196,
|
||||||
GetCfhChatlog = 211,
|
Game2RequestFullStatusUpdateEvent = 1598,
|
||||||
ModtoolSanction = 1392,
|
GetCatalogPageExpirationEvent = 742,
|
||||||
PickIssues = 15,
|
GetCatalogPageWithEarliestExpiryEvent = 3135,
|
||||||
ReleaseIssues = 1572,
|
GetCategoriesWithUserCountEvent = 3782,
|
||||||
ConvertGlobalRoomId = 314,
|
GetCommunityGoalEarnedPrizesEvent = 2688,
|
||||||
RequestSellItem = 848,
|
GetCommunityGoalHallOfFameEvent = 2167,
|
||||||
RequestMarketplaceItemStats = 3288,
|
GetCommunityGoalProgressEvent = 1145,
|
||||||
MarketplaceSellItem = 3447,
|
GetConcurrentUsersGoalProgressEvent = 1343,
|
||||||
MarketplaceRequestOwnItems = 2105,
|
GetConcurrentUsersRewardEvent = 3872,
|
||||||
MarketplaceTakeBackItem = 434,
|
GetDailyQuestEvent = 2486,
|
||||||
MarketplaceRedeemCredits = 2650,
|
GetDirectClubBuyAvailableEvent = 801,
|
||||||
MarketplaceRequestOffers = 2407,
|
GetEmailStatusEvent = 2557,
|
||||||
MarketplaceBuyOffer = 1603,
|
GetExtendedProfileByNameEvent = 2249,
|
||||||
MarketplaceBuyTokens = 1866,
|
GetFaqCategoryEvent = 3445,
|
||||||
CatalogRequesetPetBreeds = 1756,
|
GetFaqTextEvent = 1849,
|
||||||
ApproveName = 2109,
|
GetGameAchievementsEvent = 2399,
|
||||||
UnitGiveHanditemPet = 2768,
|
GetHabboBasicMembershipExtendOfferEvent = 603,
|
||||||
PetSupplement = 749,
|
GetInterstitialEvent = 2519,
|
||||||
FurnitureGroupInfo = 2651,
|
GetIsBadgeRequestFulfilledEvent = 1364,
|
||||||
AchievementResolutionOpen = 359,
|
GetIsOfferGiftableEvent = 1347,
|
||||||
UsePetProduct = 1328,
|
GetIsUserPartOfCompetitionEvent = 2077,
|
||||||
RemovePetSaddle = 186,
|
GetNextTargetedOfferEvent = 2487,
|
||||||
TogglePetRiding = 1472,
|
GetOfficialRoomsEvent = 1229,
|
||||||
TogglePetBreeding = 3379,
|
GetQuestsEvent = 3333,
|
||||||
UnseenResetCategory = 3493,
|
GetQuizQuestionsEvent = 1296,
|
||||||
UnseenResetItems = 2343,
|
GetSeasonalCalendarDailyOfferEvent = 3257,
|
||||||
CommunityGoalVoteComposer = 3536,
|
GetSeasonalQuestsOnlyEvent = 1190,
|
||||||
GetPromoArticles = 1827,
|
GetSoundMachinePlayListEvent = 3498,
|
||||||
AcceptQuest = 3604,
|
GetTargetedOfferEvent = 596,
|
||||||
ActivateQuest = 793,
|
GetThreadEvent = 3900,
|
||||||
CancelQuest = 3133,
|
GetUserGameAchievementsEvent = 389,
|
||||||
FriendRequestQuestComplete = 1148,
|
GiveSupplementToPetEvent = 749,
|
||||||
GetCommunityGoalEarnedPrizes = 2688,
|
GoToFlatEvent = 685,
|
||||||
GetCommunityGoalHallOfFame = 2167,
|
GuideAdvertisementReadEvent = 2455,
|
||||||
GetCommunityGoalProgress = 1145,
|
GuildBaseSearchEvent = 2930,
|
||||||
GetConcurrentUsersGoalProgress = 1343,
|
HarvestPetEvent = 1521,
|
||||||
GetConcurrentUsersReward = 3872,
|
IgnoreUserIdEvent = 3314,
|
||||||
GetDailyQuest = 2486,
|
InterstitialShownEvent = 1109,
|
||||||
GetQuests = 3333,
|
LagWarningReportEvent = 3847,
|
||||||
GetSeasonalQuestsOnly = 1190,
|
LatencyPingReportEvent = 96,
|
||||||
OpenQuestTracker = 2750,
|
LeaveQueueEvent = 2384,
|
||||||
RedeemCommunityGoalPrize = 90,
|
ModToolPreferencesEvent = 31,
|
||||||
RejectQuest = 2397,
|
MyFrequentRoomHistorySearchEvent = 1002,
|
||||||
StartCampaign = 1697,
|
MyRecommendedRoomsEvent = 2537,
|
||||||
GetBonusRareInfo = 957,
|
MysteryBoxWaitingCanceledEvent = 2012,
|
||||||
Craft = 3591,
|
OpenMysteryTrophyEvent = 3074,
|
||||||
CraftSecret = 1251,
|
OpenQuestTrackerEvent = 2750,
|
||||||
GetCraftableProducts = 633,
|
OpenWelcomeGiftEvent = 2638,
|
||||||
GetCraftingRecipe = 1173,
|
PassCarryItemToPetEvent = 2768,
|
||||||
GetCraftingRecipesAvailable = 3086,
|
PeerUsersClassificationEvent = 1160,
|
||||||
PhotoCompetition = 3959,
|
PerformanceLogEvent = 3230,
|
||||||
PublishPhoto = 2068,
|
PetSelectedEvent = 549,
|
||||||
PurchasePhoto = 2408,
|
PhotoCompetitionEvent = 3959,
|
||||||
RenderRoom = 3226,
|
PostQuizAnswersEvent = 3720,
|
||||||
RenderRoomThumbnail = 1982,
|
PurchaseBasicMembershipExtensionEvent = 2735,
|
||||||
RequestCameraConfiguration = 796,
|
RedeemCommunityGoalPrizeEvent = 90,
|
||||||
AddJukeboxDisk = 753,
|
RejectQuestEvent = 2397,
|
||||||
GetJukeboxPlaylist = 1435,
|
RentableSpaceStatusEvent = 872,
|
||||||
GetNowPlaying = 1325,
|
RequestABadgeEvent = 3077,
|
||||||
GetOfficialSongId = 3189,
|
ResetPhoneNumberStateEvent = 2741,
|
||||||
GetSongInfo = 3082,
|
ResetResolutionAchievementEvent = 3144,
|
||||||
GetSoundMachinePlaylist = 3498,
|
ResetUnseenItemIdsEvent = 3493,
|
||||||
GetUserSongDisks = 2304,
|
ResetUnseenItemsEvent = 2343,
|
||||||
RemoveJukeboxDisk = 3050,
|
RoomAdEventTabAdClickedEvent = 2412,
|
||||||
InterstitialShown = 1109,
|
RoomAdEventTabViewedEvent = 2668,
|
||||||
GetInterstitial = 2519,
|
RoomAdPurchaseInitiatedEvent = 2283,
|
||||||
ChangeUsername = 2977,
|
RoomAdSearchEvent = 2809,
|
||||||
CheckUsername = 3950,
|
RoomCompetitionInitEvent = 1334,
|
||||||
OpenCampaignCalendarDoorStaff= 3889,
|
RoomNetworkOpenConnectionEvent = 3736,
|
||||||
OpenCampaignCalendarDoor = 2257,
|
RoomUsersClassificationEvent = 2285,
|
||||||
BuildersClubPlaceRoomItem = 1051,
|
SearchFaqsEvent = 2031,
|
||||||
BuildersClubPlaceWallItem = 462,
|
SetPhoneNumberVerificationStatusEvent = 1379,
|
||||||
BuildersClubQueryFurniCount = 2529,
|
SetRoomSessionTagsEvent = 3305,
|
||||||
GetCatalogPageExpiration = 742,
|
ShopTargetedOfferViewedEvent = 3483,
|
||||||
GetCatalogPageWithEarliestExp = 3135,
|
StartCampaignEvent = 1697,
|
||||||
GetDirectClubBuyAvailable = 801,
|
TryPhoneNumberEvent = 790,
|
||||||
GetHabboBasicMembershipExtendOffer = 603,
|
UnblockGroupMemberEvent = 2864,
|
||||||
GetHabboClubExtendOffer = 2462,
|
UpdateForumReadMarkerEvent = 1855,
|
||||||
GetIsOfferGiftable = 1347,
|
UpdateRoomCategoryAndTradeSettingsEvent = 1265,
|
||||||
GetLimitedOfferAppearingNext = 410,
|
UpdateRoomThumbnailEvent = 2468,
|
||||||
GetNextTargetedOffer = 596,
|
VerifyCodeEvent = 2721,
|
||||||
GetRoomAdPurchaseInfo = 1075,
|
VersionCheckEvent = 1053,
|
||||||
GetSeasonalCalendarDailyOffer = 3257,
|
VoteForRoomEvent = 143,
|
||||||
GetTargetedOffer = 2487,
|
WelcomeGiftChangeEmailEvent = 66,
|
||||||
MarkCatalogNewAdditionsPageOpened = 2150,
|
UnknownSnowStormEvent6000 = 6000,
|
||||||
PurchaseBasicMembershipExtension = 2735,
|
UnknownSnowStormEvent6001 = 6001,
|
||||||
PurchaseRoomAd = 777,
|
UnknownSnowStormEvent6002 = 6002,
|
||||||
PurchaseTargetedOffer = 1826,
|
UnknownSnowStormEvent6003 = 6003,
|
||||||
PurchaseVipMembershipExtension = 3407,
|
UnknownSnowStormEvent6004 = 6004,
|
||||||
RoomAdPurchaseInitiated = 2283,
|
UnknownSnowStormEvent6005 = 6005,
|
||||||
SetTargettedOfferState = 2041,
|
UnknownSnowStormEvent6006 = 6006,
|
||||||
ShopTargetedOfferViewed = 3483,
|
UnknownSnowStormEvent6007 = 6007,
|
||||||
HelperTalentTrack = 196,
|
UnknownSnowStormEvent6008 = 6008,
|
||||||
TalentTrackGetLevel = 2127,
|
UnknownSnowStormEvent6009 = 6009,
|
||||||
ForwardToACompetitionRoom = 172,
|
UnknownSnowStormEvent6010 = 6010,
|
||||||
ForwardToASubmittableRoom = 1450,
|
UnknownSnowStormEvent6011 = 6011,
|
||||||
ForwardToRandomCompetitionRoom = 865,
|
SnowStormJoinQueueEvent = 6012,
|
||||||
GetIsUserPartOfCompetition = 2077,
|
UnknownSnowStormEvent6013 = 6013,
|
||||||
GetSecondsUntil = 271,
|
UnknownSnowStormEvent6014 = 6014,
|
||||||
RoomCompetitionInit = 1334,
|
UnknownSnowStormEvent6015 = 6015,
|
||||||
SubmitRoomToCompetition = 2595,
|
UnknownSnowStormEvent6016 = 6016,
|
||||||
VoteForRoom = 143,
|
UnknownSnowStormEvent6017 = 6017,
|
||||||
GetGift = 2436,
|
UnknownSnowStormEvent6018 = 6018,
|
||||||
ResetPhoneNumberState = 2741,
|
UnknownSnowStormEvent6019 = 6019,
|
||||||
SetPhoneNumberVerificationStatus = 1379,
|
UnknownSnowStormEvent6020 = 6020,
|
||||||
TryPhoneNumber = 790,
|
UnknownSnowStormEvent6021 = 6021,
|
||||||
VerifyCode = 2721,
|
UnknownSnowStormEvent6022 = 6022,
|
||||||
ControlYoutubeDisplayPlayback = 3005,
|
UnknownSnowStormEvent6023 = 6023,
|
||||||
GetYoutubeDisplayStatus = 336,
|
UnknownSnowStormEvent6024 = 6024,
|
||||||
SetYoutubeDisplayPlaylist = 2069,
|
UnknownSnowStormEvent6025 = 6025,
|
||||||
GoToFlat = 685,
|
SnowStormUserPickSnowballEvent = 6026,
|
||||||
ChangeQueue = 3093,
|
|
||||||
CallForHelpFromForumMessage = 1412,
|
|
||||||
CallForHelpFromForumThread = 534,
|
|
||||||
CallForHelpFromIm = 2950,
|
|
||||||
CallForHelpFromPhoto = 2492,
|
|
||||||
CallForHelpFromSelfie = 2755,
|
|
||||||
ChatReviewGuideDecides = 3365,
|
|
||||||
ChatReviewGuideDetached = 2501,
|
|
||||||
ChatReviewGuideVote = 3961,
|
|
||||||
ChatReviewSessionCreate = 3060,
|
|
||||||
DeletePendingCallsForHelp = 3605,
|
|
||||||
GetCfhStatus = 2746,
|
|
||||||
GetFaqCategory = 3445,
|
|
||||||
GetFaqText = 1849,
|
|
||||||
GetGuideReportingStatus = 3786,
|
|
||||||
GetPendingCallsForHelp = 3267,
|
|
||||||
GetQuizQuestions = 1296,
|
|
||||||
GuideSessionCreate = 3338,
|
|
||||||
GuideSessionFeedback = 477,
|
|
||||||
GuideSessionGetRequesterRoom = 1052,
|
|
||||||
GuideSessionGuideDecides = 1424,
|
|
||||||
GuideSessionInviteRequester = 234,
|
|
||||||
GuideSessionIsTyping = 519,
|
|
||||||
GuideSessionMessage = 3899,
|
|
||||||
GuideSessionOnDutyUpdate = 1922,
|
|
||||||
GuideSessionReport = 3969,
|
|
||||||
GuideSessionRequesterCancels = 291,
|
|
||||||
GuideSessionResolved = 887,
|
|
||||||
PostQuizAnswers = 3720,
|
|
||||||
SearchFaqs = 2031,
|
|
||||||
PollAnswer = 3505,
|
|
||||||
PollReject = 1773,
|
|
||||||
PollStart = 109,
|
|
||||||
PollVoteCounter = 6200,
|
|
||||||
Disconnect = 2445,
|
|
||||||
ScrGetKickbackInfo = 869,
|
|
||||||
CompostPlant = 3835,
|
|
||||||
HarvestPet = 1521,
|
|
||||||
SetClothingChangeData = 924,
|
|
||||||
GroupUnfavorite = 1820,
|
|
||||||
NewUserExperienceGetGifts = 1822,
|
|
||||||
NewUserExperienceScriptProceed = 1299,
|
|
||||||
HandshakeInitDiffie = 3110,
|
|
||||||
HandshakeCompleteDiffie = 773,
|
|
||||||
WelcomeOpenGift = 2638,
|
|
||||||
WelcomeGiftChangeEmail = 66,
|
|
||||||
EmailGetStatus = 2557,
|
|
||||||
EmailChange = 3965,
|
|
||||||
ApproveAllMembershipRequests = 882,
|
|
||||||
RentableSpaceCancelRent = 1667,
|
|
||||||
RentableSpaceRent = 2946,
|
|
||||||
RentableSpaceStatus = 872,
|
|
||||||
TrackingPerformanceLog = 3230,
|
|
||||||
TrackingLagWarningReport = 3847,
|
|
||||||
RoomDirectoryRoomNetworkOpenConnection = 3736,
|
|
||||||
RentableExtendRentOrBuyoutStripItem = 2115,
|
|
||||||
RentableExtendRentOrBuyoutFurni = 1071,
|
|
||||||
RentableGetRentOrBuyoutOffer = 2518,
|
|
||||||
}
|
}
|
|
@ -1,28 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Badges;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Inventory.Badges;
|
|
||||||
|
|
||||||
public class RequestBadgesEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public RequestBadgesEvent(IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserBadges;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new BadgesComposer(gameSession.Habbo.Badges));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.User.Data;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Inventory.Badges;
|
|
||||||
|
|
||||||
public class SetActivatedBadgesEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IRepository<Badge> _badgeRepository;
|
|
||||||
|
|
||||||
public SetActivatedBadgesEvent(IGameSessionManager gameSessionManager, IRepository<Badge> badgeRepository)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_badgeRepository = badgeRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserBadgesCurrentUpdate;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var wearingBadges = new Collection<Badge>();
|
|
||||||
var badgesToUpdate = new Dictionary<int, Badge>();
|
|
||||||
var current = gameSession.Habbo.Badges.Where(b => b.Slot != 0);
|
|
||||||
foreach (var currentBadge in current)
|
|
||||||
{
|
|
||||||
currentBadge.Slot = 0;
|
|
||||||
badgesToUpdate.Add(currentBadge.Id, currentBadge);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < 5; i++)
|
|
||||||
{
|
|
||||||
var slotId = request.ReadInt32();
|
|
||||||
var code = request.ReadString();
|
|
||||||
|
|
||||||
if (slotId is < 1 or > 5 || string.IsNullOrEmpty(code)) continue;
|
|
||||||
|
|
||||||
var badge = gameSession.Habbo.Badges.FirstOrDefault(b => b.Code == code);
|
|
||||||
|
|
||||||
if (badge == null) continue;
|
|
||||||
|
|
||||||
badge.Slot = slotId;
|
|
||||||
wearingBadges.Add(badge);
|
|
||||||
|
|
||||||
badgesToUpdate.TryAdd(badge.Id, badge);
|
|
||||||
}
|
|
||||||
|
|
||||||
await _badgeRepository.SaveManyAsync(badgesToUpdate.Values);
|
|
||||||
await gameSession.SendComposerAsync(new UserCurrentBadgesComposer(gameSession.Habbo.Id, wearingBadges));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Currency;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Inventory.Currency;
|
|
||||||
|
|
||||||
public class UserCurrencyEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
|
|
||||||
public UserCurrencyEvent(IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserCurrency;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new UserCreditsComposer(gameSession.Habbo.Credits));
|
|
||||||
await gameSession.SendComposerAsync(new UserCurrencyComposer(gameSession.Habbo.Activitypoints.Values));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Subscription;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Inventory.Subscription;
|
|
||||||
|
|
||||||
public class UserSubscriptionEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IAchievementManager _achievementManager;
|
|
||||||
|
|
||||||
public UserSubscriptionEvent(IGameSessionManager gameSessionManager, IAchievementManager achievementManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_achievementManager = achievementManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserSubscription;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_achievementManager.UpdateAchievementAsync("ACH_HC", ((gameSession.Habbo.GetPastSubscriptionDays() / 31)), gameSession);
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new UserSubscriptionComposer(gameSession.Habbo.GetActiveSubscription(),
|
|
||||||
gameSession.Habbo.GetPastSubscriptionDays()));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Landingview;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.LandingView;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Landingview;
|
|
||||||
|
|
||||||
public class GetPromoArticlesEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly ILandingViewManager _landingViewManager;
|
|
||||||
|
|
||||||
public GetPromoArticlesEvent(IGameSessionManager gameSessionManager, ILandingViewManager landingViewManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_landingViewManager = landingViewManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.GetPromoArticles;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new PromoArticlesMessageComposer(_landingViewManager.PromoArticles));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Rooms;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Navigator;
|
|
||||||
|
|
||||||
public class GetUserFlatCatsMessageEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IRoomManager _roomManager;
|
|
||||||
|
|
||||||
public GetUserFlatCatsMessageEvent(IRoomManager roomManager, IGameSessionManager gameSessionManager)
|
|
||||||
{
|
|
||||||
_roomManager = roomManager;
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.GetUserFlatCats;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new UserFlatCatsComposer(_roomManager.PrivateCategories.Values,
|
|
||||||
gameSession.Habbo.Rank));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Navigator;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorInitEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly INavigatorManager _navigatorManager;
|
|
||||||
|
|
||||||
public NavigatorInitEvent(IGameSessionManager gameSessionManager, INavigatorManager navigatorManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_navigatorManager = navigatorManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.NavigatorInit;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new NavigatorMetadataComposer(_navigatorManager.NavigatorViews.Values));
|
|
||||||
await gameSession.SendComposerAsync(new NavigatorCollapsedComposer());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Navigator;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorSearchEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly INavigatorManager _navigatorManager;
|
|
||||||
|
|
||||||
public NavigatorSearchEvent(IGameSessionManager gameSessionManager, INavigatorManager navigatorManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_navigatorManager = navigatorManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.NavigatorSearch;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_navigatorManager.NavigatorViews.TryGetValue(request.ReadString(), out var navigatorView)) return;
|
|
||||||
var qry = request.ReadString();
|
|
||||||
|
|
||||||
var message = new ServerMessage((short)OutgoingHeaders.NavigatorSearch);
|
|
||||||
message.AppendString(navigatorView.Code);
|
|
||||||
message.AppendString(qry);
|
|
||||||
await navigatorView.Compose(message, gameSession.Habbo, qry);
|
|
||||||
await gameSession.SendMessageAsync(message);
|
|
||||||
|
|
||||||
// await gameSession.SendComposerAsync(new NavigatorSearchComposer(navigatorView, request.ReadString(), gameSession.Habbo));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.User.Data;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.User.Data;
|
|
||||||
|
|
||||||
public class UserCurrentBadgesEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IRepository<Badge> _badgeRepository;
|
|
||||||
|
|
||||||
public UserCurrentBadgesEvent(IGameSessionManager gameSessionManager, IRepository<Badge> badgeRepository)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_badgeRepository = badgeRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserBadgesCurrent;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var habboId = request.ReadInt32();
|
|
||||||
|
|
||||||
var badges = await _badgeRepository.FindByAsync(b => b.Habbo.Id == habboId && b.Slot > 0);
|
|
||||||
await gameSession.SendComposerAsync(new UserCurrentBadgesComposer(habboId, badges.ToList()));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Avatar;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Game.Figuredata;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.User.Data;
|
|
||||||
|
|
||||||
public class UserFigureEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IFigureDataManager _figureDataManager;
|
|
||||||
private readonly IRepository<Habbo> _habboRepository;
|
|
||||||
private readonly IAchievementManager _achievementManager;
|
|
||||||
|
|
||||||
public UserFigureEvent(IGameSessionManager gameSessionManager, IFigureDataManager figureDataManager, IRepository<Habbo> habboRepository, IAchievementManager achievementManager)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_figureDataManager = figureDataManager;
|
|
||||||
_habboRepository = habboRepository;
|
|
||||||
_achievementManager = achievementManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserFigure;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
if (gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var gender = request.ReadString().ToUpper();
|
|
||||||
var figure = request.ReadString();
|
|
||||||
|
|
||||||
if ((gender != "M" && gender != "F") || (figure == gameSession.Habbo.Figure && gender == gameSession.Habbo.Gender.ToUpper()) /*||
|
|
||||||
!_figureDataManager.ValidateFigure(figure, gender, gameSession.Habbo)*/)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gameSession.Habbo.Figure = figure;
|
|
||||||
gameSession.Habbo.Gender = gender;
|
|
||||||
_habboRepository.SaveAsync(gameSession.Habbo);
|
|
||||||
|
|
||||||
_achievementManager.UpdateAchievementAsync("ACH_AvatarLooks", 1, gameSession);
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new FigureUpdateComposer(figure, gender));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.User.Data;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Incoming.User.Data;
|
|
||||||
|
|
||||||
public class UserProfileEvent : IMessageEvent
|
|
||||||
{
|
|
||||||
private readonly IGameSessionManager _gameSessionManager;
|
|
||||||
private readonly IRepository<Habbo> _habboRepository;
|
|
||||||
|
|
||||||
public UserProfileEvent(IGameSessionManager gameSessionManager, IRepository<Habbo> habboRepository)
|
|
||||||
{
|
|
||||||
_gameSessionManager = gameSessionManager;
|
|
||||||
_habboRepository = habboRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IncomingHeaders Header => IncomingHeaders.UserProfile;
|
|
||||||
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
||||||
{
|
|
||||||
var habbo = await _habboRepository.FindAsync(request.ReadInt32());
|
|
||||||
|
|
||||||
if (habbo == null) return;
|
|
||||||
|
|
||||||
await gameSession.SendComposerAsync(new UserProfileComposer(habbo));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -27,20 +27,20 @@ public class MessageHandler : IMessageHandler
|
||||||
|
|
||||||
public async Task TryHandleAsync(GameSession session, ClientMessage request)
|
public async Task TryHandleAsync(GameSession session, ClientMessage request)
|
||||||
{
|
{
|
||||||
if (request.Header == -1)
|
if (request.Header == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_messageEvents.TryGetValue(request.Header, out var messageEvent))
|
if (_messageEvents.TryGetValue(request.Header.Value, out var messageEvent))
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Handling header ID {Header} on class {Class}", request.Header, messageEvent.GetType());
|
_logger.LogInformation("Handling header ID {Header} on class {Class}", request.Header.Value, messageEvent.GetType());
|
||||||
|
|
||||||
await messageEvent.HandleAsync(session, request);
|
await messageEvent.HandleAsync(session, request);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Unregistered header {Header} {Name}", request.Header, _messageNames.TryGetValue(request.Header, out var messageName) ? messageName : string.Empty);
|
_logger.LogWarning("Unregistered header {Header} {Name}", request.Header.Value, _messageNames.TryGetValue(request.Header.Value, out var messageName) ? messageName : string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,23 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Avatar;
|
|
||||||
|
|
||||||
public class FigureUpdateComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly string _figure;
|
|
||||||
private readonly string _gender;
|
|
||||||
|
|
||||||
public FigureUpdateComposer(string figure, string gender)
|
|
||||||
{
|
|
||||||
_figure = figure;
|
|
||||||
_gender = gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserFigure;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendString(_figure);
|
|
||||||
message.AppendString(_gender);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
|
|
||||||
public class CatalogPageMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly CataloguePage _page;
|
|
||||||
private readonly int _offerId;
|
|
||||||
private readonly string _mode;
|
|
||||||
private readonly ICollection<CatalogueFeaturedPage> _featuredPages;
|
|
||||||
|
|
||||||
public CatalogPageMessageComposer(CataloguePage page, int offerId, string mode,
|
|
||||||
ICollection<CatalogueFeaturedPage> featuredPages)
|
|
||||||
{
|
|
||||||
_page = page;
|
|
||||||
_offerId = offerId;
|
|
||||||
_mode = mode;
|
|
||||||
_featuredPages = featuredPages;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.CatalogPage;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_page.Id);
|
|
||||||
message.AppendString(_mode);
|
|
||||||
message.AppendString(_page.Layout);
|
|
||||||
message.AppendInt32(_page.Images.Count);
|
|
||||||
|
|
||||||
foreach (var image in _page.Images)
|
|
||||||
{
|
|
||||||
message.AppendString(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
message.AppendInt32(_page.Texts.Count);
|
|
||||||
|
|
||||||
foreach (var text in _page.Texts)
|
|
||||||
{
|
|
||||||
message.AppendString(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
message.AppendInt32(0);
|
|
||||||
message.AppendInt32(_offerId);
|
|
||||||
message.AppendBoolean(_page.SeasonalCurrency);
|
|
||||||
message.AppendInt32(_featuredPages.Count);
|
|
||||||
|
|
||||||
foreach (var featuredPage in _featuredPages)
|
|
||||||
{
|
|
||||||
message.AppendInt32(featuredPage.SlotId);
|
|
||||||
message.AppendString(featuredPage.Caption);
|
|
||||||
message.AppendString(featuredPage.Image);
|
|
||||||
message.AppendInt32((int)featuredPage.Type);
|
|
||||||
switch (featuredPage.Type)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
case CatalogueFeaturedPageType.PageName:
|
|
||||||
case CatalogueFeaturedPageType.ProductName:
|
|
||||||
message.AppendString(featuredPage.Data);
|
|
||||||
break;
|
|
||||||
case CatalogueFeaturedPageType.PageId:
|
|
||||||
message.AppendInt32(int.TryParse(featuredPage.Data, out var pageId) ? pageId : -1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
message.AppendInt32((int)(DateTime.Now - featuredPage.Expire).TotalSeconds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
|
|
||||||
public class CatalogPagesListComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly IEnumerable<CataloguePage> _pages;
|
|
||||||
private readonly string _mode;
|
|
||||||
|
|
||||||
public CatalogPagesListComposer(IEnumerable<CataloguePage> pages, string mode)
|
|
||||||
{
|
|
||||||
_pages = pages;
|
|
||||||
_mode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.CatalogPageList;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendBoolean(true);
|
|
||||||
message.AppendInt32(0);
|
|
||||||
message.AppendInt32(-1);
|
|
||||||
message.AppendString("root");
|
|
||||||
message.AppendString(string.Empty);
|
|
||||||
message.AppendInt32(0);
|
|
||||||
message.AppendInt32(_pages.Count());
|
|
||||||
|
|
||||||
foreach (var page in _pages)
|
|
||||||
{
|
|
||||||
SerializeNode(page, message);
|
|
||||||
}
|
|
||||||
|
|
||||||
message.AppendBoolean(false);
|
|
||||||
message.AppendString(_mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SerializeNode(CataloguePage page, ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendBoolean(page.Visible);
|
|
||||||
message.AppendInt32(page.Icon);
|
|
||||||
message.AppendInt32(page.Id);
|
|
||||||
message.AppendString(page.InternalName);
|
|
||||||
message.AppendString(page.Name);
|
|
||||||
message.AppendInt32(0);
|
|
||||||
message.AppendInt32(page.Children.Count);
|
|
||||||
|
|
||||||
foreach (var child in page.Children)
|
|
||||||
{
|
|
||||||
SerializeNode(child, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Catalogue;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
|
|
||||||
public class HabboClubOffersMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<ClubOffer> _clubOffers;
|
|
||||||
private readonly HabboSubscription? _habboSubscription;
|
|
||||||
|
|
||||||
public HabboClubOffersMessageComposer(ICollection<ClubOffer> clubOffers, HabboSubscription? habboSubscription)
|
|
||||||
{
|
|
||||||
_clubOffers = clubOffers;
|
|
||||||
_habboSubscription = habboSubscription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.ClubOffers;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_clubOffers.Count);
|
|
||||||
|
|
||||||
foreach (var clubOffer in _clubOffers)
|
|
||||||
{
|
|
||||||
var end = _habboSubscription is not null
|
|
||||||
? _habboSubscription.Expires.AddDays(clubOffer.Days)
|
|
||||||
: DateTime.Now.AddMonths(1);
|
|
||||||
message.AppendInt32(clubOffer.Id);
|
|
||||||
message.AppendString(clubOffer.Name);
|
|
||||||
message.AppendBoolean(false); // does absolutely NOTHING
|
|
||||||
message.AppendInt32(clubOffer.PriceCredits);
|
|
||||||
message.AppendInt32(clubOffer.PriceActivitypoints);
|
|
||||||
message.AppendInt32(clubOffer.ActivitypointsType);
|
|
||||||
message.AppendBoolean(true); // always vip
|
|
||||||
message.AppendInt32(0); // months
|
|
||||||
message.AppendInt32(clubOffer.Days); // extra days
|
|
||||||
message.AppendBoolean(true); // gift-able
|
|
||||||
message.AppendInt32(0); // days left after purchase
|
|
||||||
message.AppendInt32(end.Year);
|
|
||||||
message.AppendInt32(end.Month);
|
|
||||||
message.AppendInt32(end.Day);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
|
|
||||||
public class NotEnoughBalanceMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly bool _notEnoughCredits;
|
|
||||||
private readonly bool _notEnoughActivityPoints;
|
|
||||||
private readonly int _activityPointsType;
|
|
||||||
|
|
||||||
public NotEnoughBalanceMessageComposer(bool notEnoughCredits, bool notEnoughActivityPoints, int activityPointsType)
|
|
||||||
{
|
|
||||||
_notEnoughCredits = notEnoughCredits;
|
|
||||||
_notEnoughActivityPoints = notEnoughActivityPoints;
|
|
||||||
_activityPointsType = activityPointsType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.NotEnoughBalance;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendBoolean(_notEnoughCredits);
|
|
||||||
message.AppendBoolean(_notEnoughActivityPoints);
|
|
||||||
message.AppendInt32(_activityPointsType);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
using Tiger.Communication.Messages.Interfaces;
|
||||||
using Tiger.Communication.Messages.Types;
|
using Tiger.Communication.Messages.Types;
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Notifications;
|
namespace Tiger.Communication.Messages.Outgoing.Generic.Alerts;
|
||||||
|
|
||||||
public class HabboBroadcastMessageComposer : IMessageComposer
|
public class HabboBroadcastMessageComposer : IMessageComposer
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ public class HabboBroadcastMessageComposer : IMessageComposer
|
||||||
_welcomeMessage = welcomeMessage;
|
_welcomeMessage = welcomeMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.GenericAlert;
|
public OutgoingHeaders Header => OutgoingHeaders.HabboBroadcastMessageComposer;
|
||||||
public void Compose(ServerMessage message)
|
public void Compose(ServerMessage message)
|
||||||
{
|
{
|
||||||
message.AppendString(_welcomeMessage);
|
message.AppendString(_welcomeMessage);
|
|
@ -1,11 +1,11 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
using Tiger.Communication.Messages.Interfaces;
|
||||||
using Tiger.Communication.Messages.Types;
|
using Tiger.Communication.Messages.Types;
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Security;
|
namespace Tiger.Communication.Messages.Outgoing.Handshake;
|
||||||
|
|
||||||
public class AuthenticatedComposer : IMessageComposer
|
public class AuthenticationOkMessageComposer : IMessageComposer
|
||||||
{
|
{
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.Authenticated;
|
public OutgoingHeaders Header => OutgoingHeaders.AuthenticationOkMessageComposer;
|
||||||
|
|
||||||
public void Compose(ServerMessage message)
|
public void Compose(ServerMessage message)
|
||||||
{
|
{
|
|
@ -3,21 +3,21 @@ using Tiger.Communication.Messages.Interfaces;
|
||||||
using Tiger.Communication.Messages.Types;
|
using Tiger.Communication.Messages.Types;
|
||||||
using Tiger.Game.Habbos;
|
using Tiger.Game.Habbos;
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.User.Data;
|
namespace Tiger.Communication.Messages.Outgoing.Handshake;
|
||||||
|
|
||||||
public class UserInfoComposer : IMessageComposer
|
public class UserObjectMessageComposer : IMessageComposer
|
||||||
{
|
{
|
||||||
private readonly Habbo _habbo;
|
private readonly Habbo _habbo;
|
||||||
|
|
||||||
public UserInfoComposer(Habbo habbo)
|
public UserObjectMessageComposer(Habbo habbo)
|
||||||
{
|
{
|
||||||
_habbo = habbo;
|
_habbo = habbo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserInfo;
|
public OutgoingHeaders Header => OutgoingHeaders.UserObjectComposer;
|
||||||
public void Compose(ServerMessage message)
|
public void Compose(ServerMessage message)
|
||||||
{
|
{
|
||||||
message.AppendInt32(_habbo.Id);
|
message.AppendUInt32(_habbo.Id);
|
||||||
message.AppendString(_habbo.Username);
|
message.AppendString(_habbo.Username);
|
||||||
message.AppendString(_habbo.Figure);
|
message.AppendString(_habbo.Figure);
|
||||||
message.AppendString(_habbo.Gender);
|
message.AppendString(_habbo.Gender);
|
|
@ -1,40 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Achievements;
|
|
||||||
|
|
||||||
public class AchievementComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly Achievement _achievement;
|
|
||||||
private readonly HabboAchievement _habboAchievement;
|
|
||||||
|
|
||||||
public AchievementComposer(Achievement achievement, HabboAchievement habboAchievement)
|
|
||||||
{
|
|
||||||
_achievement = achievement;
|
|
||||||
_habboAchievement = habboAchievement;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.AchievementProgressed;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
var targetLevel = _habboAchievement.Level == _achievement.Levels.Count
|
|
||||||
? _habboAchievement.Level
|
|
||||||
: _habboAchievement.Level + 1;
|
|
||||||
|
|
||||||
message.AppendInt32(_achievement.Id);
|
|
||||||
message.AppendInt32(targetLevel);
|
|
||||||
message.AppendString($"{_achievement.Badge}{targetLevel}");
|
|
||||||
message.AppendInt32(_habboAchievement.Progress);
|
|
||||||
message.AppendInt32(_achievement.Levels[targetLevel].ProgressNeeded);
|
|
||||||
message.AppendInt32(_achievement.Levels[targetLevel].RewardAmount);
|
|
||||||
message.AppendInt32(_achievement.Levels[targetLevel].RewardType);
|
|
||||||
message.AppendInt32(_habboAchievement.Progress);
|
|
||||||
message.AppendBoolean(_habboAchievement.Level >= _achievement.Levels.Count);
|
|
||||||
message.AppendString(_achievement.Category);
|
|
||||||
message.AppendString(string.Empty);
|
|
||||||
message.AppendInt32(_achievement.Levels.Count);
|
|
||||||
message.AppendInt32(_habboAchievement.Level >= _achievement.Levels.Count ? 1 : 0);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Achievements;
|
|
||||||
|
|
||||||
public class AchievementsComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<Achievement> _achievements;
|
|
||||||
private readonly Habbo _habbo;
|
|
||||||
|
|
||||||
public AchievementsComposer(ICollection<Achievement> achievements, Habbo habbo)
|
|
||||||
{
|
|
||||||
_achievements = achievements;
|
|
||||||
_habbo = habbo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.AchievementList;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_achievements.Count);
|
|
||||||
|
|
||||||
foreach (var achievement in _achievements)
|
|
||||||
{
|
|
||||||
var targetLevel = 1;
|
|
||||||
|
|
||||||
if (_habbo.Achievements.TryGetValue(achievement.Id, out var habboAchievement))
|
|
||||||
targetLevel = habboAchievement.Level == achievement.Levels.Count
|
|
||||||
? habboAchievement.Level
|
|
||||||
: habboAchievement.Level + 1;
|
|
||||||
|
|
||||||
message.AppendInt32(achievement.Id);
|
|
||||||
message.AppendInt32(targetLevel);
|
|
||||||
message.AppendString($"{achievement.Badge}{targetLevel}");
|
|
||||||
message.AppendInt32(habboAchievement?.Progress ?? 0);
|
|
||||||
message.AppendInt32(achievement.Levels[targetLevel].ProgressNeeded);
|
|
||||||
message.AppendInt32(achievement.Levels[targetLevel].RewardAmount);
|
|
||||||
message.AppendInt32(achievement.Levels[targetLevel].RewardType);
|
|
||||||
message.AppendInt32(habboAchievement?.Progress ?? 0);
|
|
||||||
message.AppendBoolean((habboAchievement?.Level ?? 0) >= achievement.Levels.Count);
|
|
||||||
message.AppendString(achievement.Category);
|
|
||||||
message.AppendString(string.Empty);
|
|
||||||
message.AppendInt32(achievement.Levels.Count);
|
|
||||||
message.AppendInt32((habboAchievement?.Level ?? 0) >= achievement.Levels.Count ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
message.AppendString(string.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Achievements;
|
|
||||||
|
|
||||||
public class AchievementsScoreComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly int _score;
|
|
||||||
|
|
||||||
public AchievementsScoreComposer(int score)
|
|
||||||
{
|
|
||||||
_score = score;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserAchievementScore;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_score);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Badges;
|
|
||||||
|
|
||||||
public class BadgesComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly IReadOnlyList<Badge> _badges;
|
|
||||||
|
|
||||||
public BadgesComposer(IEnumerable<Badge>? badges)
|
|
||||||
{
|
|
||||||
_badges = badges != null ? badges.ToList() : new List<Badge>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserBadges;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_badges.Count);
|
|
||||||
|
|
||||||
foreach (var badge in _badges)
|
|
||||||
{
|
|
||||||
message.AppendInt32(badge.Id);
|
|
||||||
message.AppendString(badge.Code);
|
|
||||||
}
|
|
||||||
|
|
||||||
var wearingBadges = _badges.Where(b => b.Slot > 0).ToList();
|
|
||||||
|
|
||||||
message.AppendInt32(wearingBadges.Count);
|
|
||||||
|
|
||||||
foreach (var wearingBadge in wearingBadges)
|
|
||||||
{
|
|
||||||
message.AppendInt32(wearingBadge.Slot);
|
|
||||||
message.AppendString(wearingBadge.Code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Currency;
|
|
||||||
|
|
||||||
public class UserCreditsComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly int _credits;
|
|
||||||
|
|
||||||
public UserCreditsComposer(int credits)
|
|
||||||
{
|
|
||||||
_credits = credits;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserCredits;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendString($"{_credits}.0");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Currency;
|
|
||||||
|
|
||||||
public class UserCurrencyComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<Activitypoints> _activitypoints;
|
|
||||||
|
|
||||||
public UserCurrencyComposer(ICollection<Activitypoints> activitypoints)
|
|
||||||
{
|
|
||||||
_activitypoints = activitypoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserCurrency;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_activitypoints.Count);
|
|
||||||
|
|
||||||
foreach (var activitypoint in _activitypoints)
|
|
||||||
{
|
|
||||||
message.AppendInt32(activitypoint.Type);
|
|
||||||
message.AppendInt32(activitypoint.Amount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Inventory.Subscription;
|
|
||||||
|
|
||||||
public class UserSubscriptionComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly HabboSubscription? _habboSubscription;
|
|
||||||
private readonly int _pastSubscriptionDays;
|
|
||||||
|
|
||||||
public UserSubscriptionComposer(HabboSubscription? habboSubscription, int pastSubscriptionDays)
|
|
||||||
{
|
|
||||||
_habboSubscription = habboSubscription;
|
|
||||||
_pastSubscriptionDays = pastSubscriptionDays;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserSubscription;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendString(_habboSubscription?.SubscriptionType ?? string.Empty);
|
|
||||||
message.AppendInt32(_habboSubscription?.DaysInMonthLeft ?? 0);
|
|
||||||
message.AppendInt32(_habboSubscription?.MonthsLeft ?? 0);
|
|
||||||
message.AppendInt32(0); // periods subscribed ahead but why is this different than above?
|
|
||||||
message.AppendInt32(0); // response type
|
|
||||||
message.AppendBoolean(_pastSubscriptionDays > 0);
|
|
||||||
message.AppendBoolean(true); // vip but always vip?
|
|
||||||
message.AppendInt32(0); // past club days but is always vip so below is used
|
|
||||||
message.AppendInt32(_pastSubscriptionDays);
|
|
||||||
message.AppendInt32((int)(_habboSubscription?.MinutesLeft ?? 0));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Landingview;
|
|
||||||
|
|
||||||
public class PromoArticlesMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<PromoArticle> _promoArticles;
|
|
||||||
|
|
||||||
public PromoArticlesMessageComposer(ICollection<PromoArticle> promoArticles)
|
|
||||||
{
|
|
||||||
_promoArticles = promoArticles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.PromoArticles;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_promoArticles.Count);
|
|
||||||
|
|
||||||
foreach (var promoArticle in _promoArticles)
|
|
||||||
{
|
|
||||||
message.AppendInt32(promoArticle.Id);
|
|
||||||
message.AppendString(promoArticle.Title);
|
|
||||||
message.AppendString(promoArticle.BodyText);
|
|
||||||
message.AppendString(promoArticle.ButtonText);
|
|
||||||
message.AppendInt32((int)promoArticle.LinkType);
|
|
||||||
message.AppendString(promoArticle.LinkContent);
|
|
||||||
message.AppendString(promoArticle.ImageUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorCollapsedComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.NavigatorCollapsed;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(1);
|
|
||||||
message.AppendString("official");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorMetadataComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<INavigatorView> _navigatorViews;
|
|
||||||
|
|
||||||
public NavigatorMetadataComposer(ICollection<INavigatorView> navigatorViews)
|
|
||||||
{
|
|
||||||
_navigatorViews = navigatorViews;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.NavigatorMetadata;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_navigatorViews.Count);
|
|
||||||
|
|
||||||
foreach (var navigatorView in _navigatorViews)
|
|
||||||
{
|
|
||||||
message.AppendString(navigatorView.Code);
|
|
||||||
message.AppendInt32(0); // saved searches
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorSearchComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly INavigatorView _navigatorView;
|
|
||||||
private readonly string _query;
|
|
||||||
private readonly Habbo _habbo;
|
|
||||||
|
|
||||||
public NavigatorSearchComposer(INavigatorView navigatorView, string query, Habbo habbo)
|
|
||||||
{
|
|
||||||
_navigatorView = navigatorView;
|
|
||||||
_query = query;
|
|
||||||
_habbo = habbo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.NavigatorSearch;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendString(_navigatorView.Code);
|
|
||||||
message.AppendString(_query);
|
|
||||||
_navigatorView.Compose(message, _habbo, _query).Wait();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Navigator;
|
|
||||||
|
|
||||||
public class UserFlatCatsComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly ICollection<RoomPrivateCategory> _privateCategories;
|
|
||||||
private readonly int _rank;
|
|
||||||
|
|
||||||
public UserFlatCatsComposer(ICollection<RoomPrivateCategory> privateCategories, int rank)
|
|
||||||
{
|
|
||||||
_privateCategories = privateCategories;
|
|
||||||
_rank = rank;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.NavigatorCategories;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_privateCategories.Count);
|
|
||||||
|
|
||||||
foreach (var privateCategory in _privateCategories)
|
|
||||||
{
|
|
||||||
message.AppendInt32(privateCategory.Id);
|
|
||||||
message.AppendString(privateCategory.Name);
|
|
||||||
message.AppendBoolean(privateCategory.MinRank <= _rank);
|
|
||||||
message.AppendBoolean(true); // automatic?
|
|
||||||
message.AppendString(""); // automatic category key?
|
|
||||||
message.AppendString(""); // global category key?
|
|
||||||
message.AppendBoolean(privateCategory.MinRank >= 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
|
|
||||||
public class AchievementNotificationMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly HabboAchievement _habboAchievement;
|
|
||||||
private readonly int _badgeId;
|
|
||||||
|
|
||||||
public AchievementNotificationMessageComposer(HabboAchievement habboAchievement, int badgeId)
|
|
||||||
{
|
|
||||||
_habboAchievement = habboAchievement;
|
|
||||||
_badgeId = badgeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.AchievementNotification;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_habboAchievement.Achievement.Id);
|
|
||||||
message.AppendInt32(_habboAchievement.Level);
|
|
||||||
message.AppendInt32(_badgeId);
|
|
||||||
message.AppendString($"{_habboAchievement.Achievement.Badge}{_habboAchievement.Level}");
|
|
||||||
message.AppendInt32(0); // points?
|
|
||||||
message.AppendInt32(_habboAchievement.Achievement.Levels[_habboAchievement.Level].RewardAmount);
|
|
||||||
message.AppendInt32(_habboAchievement.Achievement.Levels[_habboAchievement.Level].RewardType);
|
|
||||||
message.AppendInt32(_habboAchievement.Achievement.Levels[_habboAchievement.Level].Points);
|
|
||||||
message.AppendInt32(_habboAchievement.Achievement.Id);
|
|
||||||
message.AppendString(_habboAchievement.Level > 1 ? $"{_habboAchievement.Achievement.Badge}{_habboAchievement.Level - 1}" : string.Empty);
|
|
||||||
message.AppendString(_habboAchievement.Achievement.Category);
|
|
||||||
message.AppendBoolean(true);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
|
|
||||||
public class ActivityPointNotificationMessageComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly int _amount;
|
|
||||||
private readonly int _amountChanged;
|
|
||||||
private readonly int _type;
|
|
||||||
|
|
||||||
public ActivityPointNotificationMessageComposer(int amount, int amountChanged, int type)
|
|
||||||
{
|
|
||||||
_amount = amount;
|
|
||||||
_amountChanged = amountChanged;
|
|
||||||
_type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.ActivityPointNotification;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_amount);
|
|
||||||
message.AppendInt32(_amountChanged);
|
|
||||||
message.AppendInt32(_type);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,475 +1,507 @@
|
||||||
namespace Tiger.Communication.Messages.Outgoing;
|
namespace Tiger.Communication.Messages.Outgoing;
|
||||||
|
|
||||||
public enum OutgoingHeaders : short
|
public enum OutgoingHeaders
|
||||||
{
|
{
|
||||||
AchievementList = 305,
|
AcceptFriendResultComposer = 896,
|
||||||
Authenticated = 2491,
|
AccountPreferencesComposer = 513,
|
||||||
Authentication = -1,
|
AccountSafetyLockStatusChangeMessageComposer = 1243,
|
||||||
AvailabilityStatus = 2033,
|
AchievementComposer = 2107,
|
||||||
BuildersClubExpired = 1452,
|
AchievementResolutionCompletedMessageComposer = 740,
|
||||||
ClubOffers = 2405,
|
AchievementResolutionProgressMessageComposer = 3370,
|
||||||
CatalogPage = 804,
|
AchievementResolutionsMessageComposer = 66,
|
||||||
CatalogPageList = 1032,
|
AchievementsComposer = 305,
|
||||||
CatalogPurchaseOk = 869,
|
AchievementsScoreComposer = 1968,
|
||||||
CatalogPurchaseError = 1404,
|
ActivityPointsMessageComposer = 2018,
|
||||||
CatalogPurchaseNotAllowed = 3770,
|
ApproveNameMessageComposer = 1503,
|
||||||
ProductOffer = 3388,
|
AuthenticationOkMessageComposer = 2491,
|
||||||
LimitedSoldOut = 377,
|
AvailabilityStatusMessageComposer = 2033,
|
||||||
CatalogPublished = 1866,
|
AvailabilityTimeMessageComposer = 600,
|
||||||
CfhResultMessage = 3635,
|
AvatarEffectActivatedMessageComposer = 1959,
|
||||||
ClientLatency = 10,
|
AvatarEffectAddedMessageComposer = 2867,
|
||||||
ClientPing = 3928,
|
AvatarEffectExpiredMessageComposer = 2228,
|
||||||
DesktopCampaign = 1745,
|
AvatarEffectMessageComposer = 1167,
|
||||||
DesktopNews = 286,
|
AvatarEffectSelectedMessageComposer = 3473,
|
||||||
DesktopView = 122,
|
AvatarEffectsMessageComposer = 340,
|
||||||
BundleDiscountRuleset = 2347,
|
BadgePointLimitsComposer = 2501,
|
||||||
FirstLoginOfDay = 793,
|
BadgeReceivedComposer = 2493,
|
||||||
FurnitureAliases = 1723,
|
BadgesComposer = 717,
|
||||||
FurnitureData = 2547,
|
BannedUsersFromRoomComposer = 1869,
|
||||||
FurnitureFloor = 1778,
|
BonusRareInfoMessageComposer = 1533,
|
||||||
FurnitureFloorAdd = 1534,
|
BotAddedToInventoryComposer = 1352,
|
||||||
FurnitureFloorRemove = 2703,
|
BotCommandConfigurationComposer = 1618,
|
||||||
FurnitureFloorUpdate = 3776,
|
BotErrorComposer = 639,
|
||||||
FurnitureItemdata = 2202,
|
BotForceOpenContextMenuComposer = 296,
|
||||||
FurnitureState = 2376,
|
BotInventoryComposer = 3086,
|
||||||
FurnitureGroupContextMenuInfo = 3293,
|
BotReceivedMessageComposer = 3684,
|
||||||
FurniturePostitStickyPoleOpen = 2366,
|
BotRemovedFromInventoryComposer = 233,
|
||||||
GameCenterAchievements = 2265,
|
BotSkillListUpdateComposer = 69,
|
||||||
GameCenterGameList = 222,
|
BuildersClubFurniCountMessageComposer = 3828,
|
||||||
GameCenterStatus = 2893,
|
BuildersClubSubscriptionStatusMessageComposer = 1452,
|
||||||
GameCenterInArenaQueue = 872,
|
BundleDiscountRulesetMessageComposer = 2347,
|
||||||
GameCenterStopCounter = 3191,
|
CallForHelpDisabledNotifyMessageComposer = 1651,
|
||||||
GameCenterUserLeftGame = 3138,
|
CallForHelpPendingCallsDeletedMessageComposer = 77,
|
||||||
GameCenterDirectoryStatus = 2246,
|
CallForHelpPendingCallsMessageComposer = 1121,
|
||||||
GameCenterStartingGameFailed = 2142,
|
CallForHelpReplyMessageComposer = 3796,
|
||||||
GameCenterJoiningFailed = 1730,
|
CallForHelpResultMessageComposer = 3635,
|
||||||
Gamestatusmessage = 3805,
|
CameraPublishStatusMessageComposer = 2057,
|
||||||
Gameachievements = 1689,
|
CameraPurchaseOkMessageComposer = 2783,
|
||||||
Gameinvite = 904,
|
CameraSnapshotMessageComposer = 463,
|
||||||
Joiningqueuefailed = 3035,
|
CameraStorageUrlMessageComposer = 3696,
|
||||||
Joinedqueuemessage = 2260,
|
CampaignCalendarDataMessageComposer = 2531,
|
||||||
Leftqueue = 1477,
|
CampaignCalendarDoorOpenedMessageComposer = 2551,
|
||||||
LoadGameUrl = 2624,
|
CanCreateRoomComposer = 378,
|
||||||
Loadgame = 3654,
|
CanCreateRoomEventComposer = 2599,
|
||||||
Unloadgame = 1715,
|
CantConnectMessageComposer = 899,
|
||||||
Achievementresolutioncompleted = 740,
|
CarryObjectMessageComposer = 1474,
|
||||||
Achievementresolutionprogress = 3370,
|
CatalogPageExpirationComposer = 2668,
|
||||||
Achievementresolutions = 66,
|
CatalogPageMessageComposer = 804,
|
||||||
GenericAlert = 3801,
|
CatalogPagesListComposer = 1032,
|
||||||
ModeratorMessage = 2030,
|
CatalogPageWithEarliestExpiryMessageComposer = 2515,
|
||||||
GenericError = 1600,
|
CatalogPublishedMessageComposer = 1866,
|
||||||
GiftWrapperConfig = 2234,
|
CategoriesWithVisitorCountComposer = 1455,
|
||||||
GroupBadges = 2402,
|
CfhChatlogComposer = 607,
|
||||||
GroupCreateOptions = 2159,
|
CfhSanctionMessageComposer = 2782,
|
||||||
GroupForumData = 3011,
|
CfhTopicsInitComposer = 325,
|
||||||
GroupForumList = 3001,
|
ChangeEmailResultComposer = 1815,
|
||||||
GroupForumThreads = 1073,
|
ChangeUserNameResultMessageEvent = 118,
|
||||||
GroupForumPost = 2049,
|
ChatMessageComposer = 1446,
|
||||||
GroupForumPostThread = 1862,
|
ChatReviewSessionDetachedMessageComposer = 30,
|
||||||
GroupForumThreadMessages = 509,
|
ChatReviewSessionOfferedToGuideMessageComposer = 735,
|
||||||
GroupForumUnreadCount = 2379,
|
ChatReviewSessionResultsMessageComposer = 3276,
|
||||||
GroupForumUpdateMessage = 324,
|
ChatReviewSessionStartedMessageComposer = 143,
|
||||||
GroupForumUpdateThread = 2528,
|
ChatReviewSessionVotingStatusMessageComposer = 1829,
|
||||||
GroupInfo = 1702,
|
CheckUserNameResultMessageComposer = 563,
|
||||||
GroupList = 420,
|
CitizenshipVipOfferPromoEnabledComposer = 2278,
|
||||||
GroupMember = 265,
|
CloseConnectionMessageComposer = 122,
|
||||||
GroupMembers = 1200,
|
ClubGiftInfoComposer = 619,
|
||||||
GroupMembersRefresh = 2445,
|
ClubGiftNotificationComposer = 2188,
|
||||||
GroupMemberRemoveConfirm = 1876,
|
ClubGiftSelectedComposer = 659,
|
||||||
GroupPurchased = 2808,
|
CollapsedCategoriesComposer = 1543,
|
||||||
GroupSettings = 3965,
|
CommunityGoalEarnedPrizesMessageComposer = 3319,
|
||||||
GroupBadgeParts = 2238,
|
CommunityGoalHallOfFameMessageComposer = 3005,
|
||||||
GroupMembershipRequested = 1180,
|
CommunityGoalProgressMessageComposer = 2525,
|
||||||
GroupDetailsChanged = 1459,
|
CommunityGoalVoteMessageComposer = 1435,
|
||||||
GroupHabboJoinFailed = 762,
|
CompetitionEntrySubmitResultComposer = 1177,
|
||||||
GuildEditFailed = 3988,
|
CompetitionRoomsDataMessageComposer = 3954,
|
||||||
GuildMemberMgmtFailed = 818,
|
CompetitionStatusMessageComposer = 133,
|
||||||
ItemDimmerSettings = 2710,
|
CompetitionVotingInfoMessageComposer = 3506,
|
||||||
ItemStackHelper = 2816,
|
CompleteDiffieHandshakeComposer = 3885,
|
||||||
ItemWall = 1369,
|
ConcurrentUsersGoalProgressMessageComposer = 2737,
|
||||||
ItemWallAdd = 2187,
|
ConfirmBreedingRequestComposer = 634,
|
||||||
ItemWallRemove = 3208,
|
ConfirmBreedingResultComposer = 1625,
|
||||||
ItemWallUpdate = 2009,
|
ConvertedRoomIdComposer = 1331,
|
||||||
MarketplaceConfig = 1823,
|
CraftableProductsComposer = 1000,
|
||||||
MessengerAcceptFriends = 896,
|
CraftingRecipeComposer = 2774,
|
||||||
MessengerChat = 1587,
|
CraftingRecipesAvailableComposer = 2124,
|
||||||
MessengerFindFriends = 1210,
|
CraftingResultComposer = 618,
|
||||||
MessengerFollowFailed = 3048,
|
CreditBalanceComposer = 3475,
|
||||||
MessengerFriendNotification = 3082,
|
CurrentTimingCodeMessageComposer = 1745,
|
||||||
MessengerFriends = 3130,
|
CustomUserNotificationMessageComposer = 909,
|
||||||
MessengerInit = 1605,
|
DanceMessageComposer = 2233,
|
||||||
MessengerInstanceMessageError = 3359,
|
DiceValueMessageComposer = 3431,
|
||||||
MessengerInvite = 3870,
|
DirectSmsClubBuyAvailableMessageComposer = 195,
|
||||||
MessengerInviteError = 462,
|
DisconnectReasonComposer = 4000,
|
||||||
MessengerMessageError = 892,
|
DoorbellMessageComposer = 2309,
|
||||||
MessengerMinimailCount = 2803,
|
ElementPointerMessageComposer = 1787,
|
||||||
MessengerMinimailNew = 1911,
|
EmailStatusResultComposer = 612,
|
||||||
MessengerRelationships = 2016,
|
EpicPopupMessageComposer = 3945,
|
||||||
MessengerRequest = 2219,
|
ErrorReportComposer = 1004,
|
||||||
MessengerRequestError = 892,
|
ExpressionMessageComposer = 1631,
|
||||||
MessengerRequests = 280,
|
ExtendedProfileChangedMessageComposer = 876,
|
||||||
MessengerSearch = 973,
|
ExtendedProfileMessageComposer = 3898,
|
||||||
MessengerUpdate = 2800,
|
FaqCategoriesMessageComposer = 2756,
|
||||||
ModerationReportDisabled = 1651,
|
FaqCategoryMessageComposer = 2819,
|
||||||
ModerationTool = 2696,
|
FaqClientFaqsMessageComposer = 2492,
|
||||||
ModerationUserInfo = 2866,
|
FaqSearchResultsMessageComposer = 1551,
|
||||||
MotdMessages = 2035,
|
FaqTextMessageComposer = 3292,
|
||||||
NavigatorCategories = 1562,
|
FavoriteMembershipUpdateMessageComposer = 3403,
|
||||||
NavigatorCollapsed = 1543,
|
FavouriteChangedComposer = 2524,
|
||||||
NavigatorEventCategories = 3244,
|
FavouritesComposer = 151,
|
||||||
NavigatorLifted = 3104,
|
FigureSetIdsComposer = 1450,
|
||||||
NavigatorMetadata = 3052,
|
FigureUpdateComposer = 2429,
|
||||||
NavigatorOpenRoomCreator = 2064,
|
FindFriendsProcessResultComposer = 1210,
|
||||||
NavigatorSearch = 2690,
|
FlatAccessDeniedMessageComposer = 878,
|
||||||
NavigatorSearches = 3984,
|
FlatAccessibleMessageComposer = 3783,
|
||||||
NavigatorSettings = 518,
|
FlatControllerAddedComposer = 2088,
|
||||||
ThumbnailUpdateResult = 1927,
|
FlatControllerRemovedComposer = 1327,
|
||||||
CanCreateRoom = 378,
|
FlatControllersComposer = 1284,
|
||||||
CategoriesWithVisitorCount = 1455,
|
FlatCreatedComposer = 1304,
|
||||||
CompetitionRoomsData = 3954,
|
FloodControlMessageComposer = 566,
|
||||||
ConvertedRoomId = 1331,
|
FloorHeightMapComposer = 1301,
|
||||||
GuestRoomSearchResult = 52,
|
FollowFriendFailedComposer = 3048,
|
||||||
NotificationList = 1992,
|
ForumDataMessageComposer = 3011,
|
||||||
NotificationOfferRewardDelivered = 2125,
|
ForumsListMessageComposer = 3001,
|
||||||
NotificationSimpleAlert = 5100,
|
FriendFurniCancelLockMessageComposer = 770,
|
||||||
NotificationElementPointer = 1787,
|
FriendFurniOtherLockConfirmedMessageComposer = 382,
|
||||||
PetFigureUpdate = 1924,
|
FriendFurniStartConfirmationMessageComposer = 3753,
|
||||||
PetInfo = 2901,
|
FriendListFragmentMessageComposer = 3130,
|
||||||
PetTrainingPanel = 1164,
|
FriendListUpdateComposer = 2800,
|
||||||
PetLevelUpdate = 2824,
|
FriendNotificationComposer = 3082,
|
||||||
PetScratchFailed = 1130,
|
FriendRequestsComposer = 280,
|
||||||
PetOpenPackageRequested = 2380,
|
FurniListAddOrUpdateComposer = 104,
|
||||||
PetOpenPackageResult = 546,
|
FurniListComposer = 994,
|
||||||
PetBreeding = 1746,
|
FurniListInvalidateComposer = 3151,
|
||||||
PetConfirmBreedingResult = 1625,
|
FurniListRemoveComposer = 159,
|
||||||
PetGoToBreedingNestFailure = 2621,
|
FurniRentOrBuyoutOfferMessageComposer = 35,
|
||||||
PetNestBreedingSuccess = 2527,
|
FurnitureAliasesMessageComposer = 1723,
|
||||||
PetConfirmBreedingRequest = 634,
|
Game2AccountGameStatusMessageComposer = 2893,
|
||||||
PetBreedingResult = 1553,
|
Game2GameDirectoryStatusMessageComposer = 2246,
|
||||||
RecyclerPrizes = 3164,
|
Game2InArenaQueueMessageComposer = 872,
|
||||||
RecyclerStatus = 3433,
|
Game2JoiningGameFailedMessageComposer = 1730,
|
||||||
RecyclerFinished = 468,
|
Game2StopCounterMessageComposer = 2233,
|
||||||
RoomBanList = 1869,
|
Game2UserLeftGameMessageComposer = 2383,
|
||||||
RoomBanRemove = 3429,
|
Game2WeeklyFriendsLeaderboardComposer = 2270,
|
||||||
RoomCreated = 1304,
|
Game2WeeklyLeaderboardComposer = 2196,
|
||||||
RoomDoorbell = 2309,
|
GameAchievementsMessageComposer = 1689,
|
||||||
RoomDoorbellAccepted = 3783,
|
GameInviteMessageComposer = 904,
|
||||||
RoomDoorbellRejected = 878,
|
GameListMessageComposer = 222,
|
||||||
RoomEnter = 758,
|
GamePlayerValueMessageComposer = 2324,
|
||||||
RoomEnterError = 899,
|
GameStatusMessageComposer = 3805,
|
||||||
RoomForward = 160,
|
GenericErrorComposer = 1600,
|
||||||
RoomHeightMap = 2753,
|
GetGuestRoomResultComposer = 687,
|
||||||
RoomHeightMapUpdate = 558,
|
GiftReceiverNotFoundComposer = 1517,
|
||||||
RoomInfo = 687,
|
GiftWrappingConfigurationComposer = 2234,
|
||||||
RoomInfoOwner = 749,
|
GotMysteryBoxPrizeMessageComposer = 3712,
|
||||||
RoomModel = 1301,
|
GoToBreedingNestFailureComposer = 2621,
|
||||||
RoomModelBlockedTiles = 3990,
|
GroupDetailsChangedMessageComposer = 1459,
|
||||||
RoomModelDoor = 1664,
|
GroupMembershipRequestedMessageComposer = 1180,
|
||||||
RoomModelName = 2031,
|
GuestRoomSearchResultComposer = 52,
|
||||||
RoomMuted = 2533,
|
GuideOnDutyStatusMessageComposer = 1548,
|
||||||
RoomMuteUser = 826,
|
GuideReportingStatusMessageComposer = 3463,
|
||||||
RoomPaint = 2454,
|
GuideSessionAttachedMessageComposer = 1591,
|
||||||
RoomPromotion = 2274,
|
GuideSessionDetachedMessageComposer = 138,
|
||||||
RoomQueueStatus = 2208,
|
GuideSessionEndedMessageComposer = 1456,
|
||||||
RoomRights = 780,
|
GuideSessionErrorMessageComposer = 673,
|
||||||
RoomRightsClear = 2392,
|
GuideSessionInvitedToGuideRoomMessageComposer = 219,
|
||||||
RoomRightsList = 1284,
|
GuideSessionMessageMessageComposer = 841,
|
||||||
RoomRightsListAdd = 2088,
|
GuideSessionPartnerIsTypingComposer = 1016,
|
||||||
RoomRightsListRemove = 1327,
|
GuideSessionRequesterRoomMessageComposer = 1847,
|
||||||
RoomRightsOwner = 339,
|
GuideSessionStartedComposer = 3209,
|
||||||
RoomRolling = 3207,
|
GuideTicketCreationResultMessageComposer = 3285,
|
||||||
RoomScore = 482,
|
GuideTicketResolutionMessageComposer = 2674,
|
||||||
RoomSettings = 1498,
|
GuildCreatedMessageComposer = 2808,
|
||||||
RoomSettingsChat = 1191,
|
GuildCreationInfoMessageComposer = 2159,
|
||||||
RoomSettingsSave = 948,
|
GuildEditFailedMessageComposer = 3988,
|
||||||
RoomSettingsSaveError = 1555,
|
GuildEditInfoMessageComposer = 3965,
|
||||||
RoomInfoUpdated = 3297,
|
GuildEditorDataMessageComposer = 2238,
|
||||||
RoomSpectator = 1033,
|
GuildForumThreadsComposer = 1073,
|
||||||
RoomThickness = 3547,
|
GuildFurniContextMenuInfoMessageComposer = 3293,
|
||||||
RoomGetFilterWords = 2937,
|
GuildMemberFurniCountInHqMessageComposer = 1876,
|
||||||
RoomMessageNotification = 1634,
|
GuildMemberMgmtFailedMessageComposer = 818,
|
||||||
RoomPopularTagsResult = 2012,
|
GuildMembersComposer = 1200,
|
||||||
InfoFeedEnable = 3284,
|
GuildMembershipRejectedMessageComposer = 2445,
|
||||||
SecurityMachine = 1488,
|
GuildMembershipsMessageComposer = 420,
|
||||||
MysteryBoxKeys = 2833,
|
GuildMembershipUpdatedMessageComposer = 265,
|
||||||
Gotmysteryboxprizemessage = 3712,
|
HabboAchievementNotificationMessageComposer = 806,
|
||||||
Cancelmysteryboxwaitmessage = 596,
|
HabboActivityPointNotificationMessageComposer = 2275,
|
||||||
Showmysteryboxwaitmessage = 3201,
|
HabboBroadcastMessageComposer = 3801,
|
||||||
TradeAccepted = 2568,
|
HabboClubExtendOfferMessageComposer = 3964,
|
||||||
TradeClosed = 1373,
|
HabboClubOffersMessageComposer = 2405,
|
||||||
TradeCompleted = 1001,
|
HabboGroupBadgesMessageComposer = 2402,
|
||||||
TradeConfirmation = 2720,
|
HabboGroupDeactivatedMessageComposer = 3129,
|
||||||
TradeListItem = 2024,
|
HabboGroupDetailsMessageComposer = 1702,
|
||||||
TradeNotOpen = 3128,
|
HabboGroupJoinFailedMessageComposer = 762,
|
||||||
TradeOpen = 2505,
|
HabboSearchResultComposer = 973,
|
||||||
TradeOpenFailed = 217,
|
HabboWayQuizComposer1 = 3379,
|
||||||
TradeOtherNotAllowed = 1254,
|
HandItemReceivedMessageComposer = 354,
|
||||||
TradeYouNotAllowed = 3058,
|
HeightMapComposer = 2753,
|
||||||
TradeNoSuchItem = 2873,
|
HeightMapUpdateMessageComposer = 558,
|
||||||
Unit = 374,
|
HotelClosedAndOpensComposer = 3728,
|
||||||
UnitChangeName = 2182,
|
HotelClosesAndWillOpenAtComposer = 2771,
|
||||||
UnitChat = 1446,
|
HotelMergeNameChangeComposer = 1663,
|
||||||
UnitChatShout = 1036,
|
HotelViewCatalogPageExpiringComposer = 690,
|
||||||
UnitChatWhisper = 2704,
|
HotelViewCustomTimerComposer = -1,
|
||||||
UnitDance = 2233,
|
HotelWillCloseInMinutesComposer = 1050,
|
||||||
UnitEffect = 1167,
|
IdentityAccountsComposer = 3523,
|
||||||
UnitExpression = 1631,
|
IgnoredUsersMessageComposer = 126,
|
||||||
UnitHandItem = 1474,
|
IgnoreResultMessageComposer = 207,
|
||||||
UnitIdle = 1797,
|
InClientLinkMessageComposer = 2023,
|
||||||
UnitInfo = 3920,
|
InfoFeedEnableMessageComposer = 3284,
|
||||||
UnitNumber = 2324,
|
InitCameraMessageComposer = 3878,
|
||||||
UnitRemove = 2661,
|
InitDiffieHandshakeComposer = 1347,
|
||||||
UnitStatus = 1640,
|
InstantMessageErrorComposer = 3359,
|
||||||
UnitTyping = 1717,
|
InterstitialMessageComposer = 1808,
|
||||||
UnseenItems = 2103,
|
IsBadgeRequestFulfilledComposer = 2998,
|
||||||
UserAchievementScore = 1968,
|
IsFirstLoginOfDayComposer = 793,
|
||||||
UserBadges = 717,
|
IsOfferGiftableMessageComposer = 761,
|
||||||
UserBadgesAdd = 2493,
|
IssueCloseNotificationMessageComposer = 934,
|
||||||
UserBadgesCurrent = 1087,
|
IssueDeletedMessageComposer = 3192,
|
||||||
UserBotRemove = 233,
|
IssueInfoMessageComposer = 3609,
|
||||||
UserBots = 3086,
|
IssuePickFailedMessageComposer = 3150,
|
||||||
UserChangeName = 118,
|
IsUserPartOfCompetitionMessageComposer = 3841,
|
||||||
UserClothing = 1450,
|
ItemAddMessageComposer = 2187,
|
||||||
UserCredits = 3475,
|
ItemDataUpdateMessageComposer = 2202,
|
||||||
UserCurrency = 2018,
|
ItemRemoveMessageComposer = 3208,
|
||||||
ActivityPointNotification = 2275,
|
ItemsComposer = 1369,
|
||||||
UserEffects = 340,
|
ItemUpdateMessageComposer = 2009,
|
||||||
UserFavoriteRoom = 2524,
|
JoinedQueueMessageComposer = 2260,
|
||||||
UserFavoriteRoomCount = 151,
|
JoiningQueueFailedMessageComposer = 3035,
|
||||||
UserFigure = 2429,
|
JukeBoxPlaylistFullMessageComposer = 105,
|
||||||
UserFurniture = 994,
|
JukeboxSongDisksMessageComposer = 34,
|
||||||
UserFurnitureAdd = 104,
|
LatencyPingResponseMessageComposer = 10,
|
||||||
UserFurniturePostitPlaced = 1501,
|
LeftQueueMessageComposer = 1477,
|
||||||
UserFurnitureRefresh = 3151,
|
LimitedEditionSoldOutComposer = 377,
|
||||||
UserFurnitureRemove = 159,
|
LimitedOfferAppearingNextMessageComposer = 44,
|
||||||
UserHomeRoom = 2875,
|
LoadGameMessageComposer = 3654,
|
||||||
RoomEventCancel = 3479,
|
LoadGameUrlMessageComposer = 2624,
|
||||||
RoomEvent = 1840,
|
MaintenanceStatusMessageComposer = 1350,
|
||||||
UserIgnored = 126,
|
MarketplaceBuyOfferResultComposer = 2032,
|
||||||
UserIgnoredResult = 207,
|
MarketplaceCancelOfferResultComposer = 3264,
|
||||||
UserInfo = 2725,
|
MarketplaceCanMakeOfferResult = 54,
|
||||||
UserOutfits = 3315,
|
MarketplaceConfigurationComposer = 1823,
|
||||||
UserPerks = 2586,
|
MarketplaceItemStatsComposer = 725,
|
||||||
UserPermissions = 411,
|
MarketplaceMakeOfferResult = 1359,
|
||||||
UserPetAdd = 2101,
|
MarketplaceOffersComposer = 680,
|
||||||
UserPetRemove = 3253,
|
MarketPlaceOwnOffersComposer = 3884,
|
||||||
UserPets = 3522,
|
MessengerErrorComposer = 892,
|
||||||
UserProfile = 3898,
|
MessengerInitComposer = 1605,
|
||||||
UserRespect = 2815,
|
MiniMailNewMessageComposer = 1911,
|
||||||
UserSanctionStatus = 3679,
|
MiniMailUnreadCountComposer = 2803,
|
||||||
UserSettings = 513,
|
ModeratorActionResultMessageComposer = 2335,
|
||||||
UserSubscription = 954,
|
ModeratorCautionComposer = 1890,
|
||||||
UserWardrobePage = 3315,
|
ModeratorInitMessageComposer = 2696,
|
||||||
UserClassification = 966,
|
ModeratorMessageComposer = 2030,
|
||||||
GetUserTags = 1255,
|
ModeratorRoomInfoComposer = 1333,
|
||||||
WiredAction = 1434,
|
ModeratorToolPreferencesComposer = 1576,
|
||||||
WiredCondition = 1108,
|
ModeratorUserInfoComposer = 2866,
|
||||||
WiredError = 156,
|
MOtdNotificationComposer = 2035,
|
||||||
WiredOpen = 1830,
|
MuteAllInRoomComposer = 2533,
|
||||||
WiredReward = 178,
|
MysteryBoxClosingComposer = 596,
|
||||||
WiredSave = 1155,
|
MysteryBoxKeysMessageComposer = 2833,
|
||||||
WiredTrigger = 383,
|
MysteryBoxStartComposer = 3201,
|
||||||
PlayingGame = 448,
|
NavigatorLiftedRoomsComposer = 3104,
|
||||||
FurnitureState2 = 3431,
|
NavigatorMetaDataComposer = 3052,
|
||||||
RemoveBotFromInventory = 233,
|
NavigatorSavedSearchesComposer = 3984,
|
||||||
AddBotToInventory = 1352,
|
NavigatorSearchResultBlocksComposer = 2690,
|
||||||
AchievementProgressed = 2107,
|
NavigatorSettingsComposer = 2875,
|
||||||
ModtoolRoomInfo = 1333,
|
NestBreedingSuccessComposer = 2527,
|
||||||
ModtoolUserChatlog = 3377,
|
NewConsoleMessageComposer = 1587,
|
||||||
ModtoolRoomChatlog = 3434,
|
NewFriendRequestComposer = 2219,
|
||||||
ModtoolVisitedRoomsUser = 1752,
|
NewNavigatorPreferencesComposer = 518,
|
||||||
ModeratorActionResult = 2335,
|
NewUserExperienceGiftOfferComposer = 3575,
|
||||||
IssueDeleted = 3192,
|
NewUserExperienceNotCompleteComposer = 3639,
|
||||||
IssueInfo = 3609,
|
NoobnessLevelMessageComposer = 3738,
|
||||||
IssuePickFailed = 3150,
|
NoOwnedRoomsAlertMessageComposer = 2064,
|
||||||
CfhChatlog = 607,
|
NoSuchFlatComposer = 84,
|
||||||
ModeratorToolPreferences = 1576,
|
NotEnoughBalanceMessageComposer = 3914,
|
||||||
LovelockFurniStart = 3753,
|
NotificationDialogMessageComposer = 1992,
|
||||||
LovelockFurniFriendComfirmed = 382,
|
NowPlayingMessageComposer = 469,
|
||||||
LovelockFurniFinished = 770,
|
ObjectAddMessageComposer = 1534,
|
||||||
GiftReceiverNotFound = 1517,
|
ObjectDataUpdateMessageComposer = 2547,
|
||||||
GiftOpened = 56,
|
ObjectRemoveMessageComposer = 2703,
|
||||||
FloodControl = 566,
|
ObjectsDataUpdateMessageComposer = 1453,
|
||||||
RemainingMute = 826,
|
ObjectsMessageComposer = 1778,
|
||||||
UserEffectList = 340,
|
ObjectUpdateMessageComposer = 3776,
|
||||||
UserEffectListAdd = 2867,
|
OfferRewardDeliveredMessageComposer = 2125,
|
||||||
UserEffectListRemove = 2228,
|
OfficialRoomsComposer = 2726,
|
||||||
UserEffectActivate = 1959,
|
OfficialSongIdMessageComposer = 1381,
|
||||||
AvatarEffectSelected = 3473,
|
OneWayDoorStatusMessageComposer = 2376,
|
||||||
ClubGiftInfo = 619,
|
OpenComposer = 1830,
|
||||||
RedeemVoucherError = 714,
|
OpenConnectionMessageComposer = 758,
|
||||||
RedeemVoucherOk = 3336,
|
OpenPetPackageRequestedMessageComposer = 2380,
|
||||||
InClientLink = 2023,
|
OpenPetPackageResultMessageComposer = 546,
|
||||||
BotCommandConfiguration = 1618,
|
PerkAllowancesComposer = 2586,
|
||||||
BotSkillListUpdate = 69,
|
PetAddedToInventoryComposer = 2101,
|
||||||
BotForceOpenContextMenu = 296,
|
PetBreedingComposer = 1746,
|
||||||
HandItemReceived = 354,
|
PetBreedingResultComposer = 1553,
|
||||||
PetPlacingError = 2913,
|
PetExperienceComposer = 2156,
|
||||||
BotError = 639,
|
PetFigureUpdateComposer = 1924,
|
||||||
MarketplaceSellItem = 54,
|
PetInfoMessageComposer = 2901,
|
||||||
MarketplaceItemStats = 725,
|
PetInventoryComposer = 3522,
|
||||||
MarketplaceOwnItems = 3884,
|
PetLevelNotificationComposer = 859,
|
||||||
MarketplaceCancelSale = 3264,
|
PetLevelUpdateComposer = 2824,
|
||||||
MarketplaceItemPosted = 1359,
|
PetPlacingErrorComposer = 2913,
|
||||||
MarketplaceItemsSearched = 680,
|
PetReceivedMessageComposer = 1111,
|
||||||
MarketplaceAfterOrderStatus = 2032,
|
PetRemovedFromInventoryComposer = 3253,
|
||||||
CatalogReceivePetBreeds = 3331,
|
PetRespectFailedComposer = 1130,
|
||||||
CatalogApproveNameResult = 1503,
|
PetRespectNotificationComposer = 2788,
|
||||||
ObjectsDataUpdate = 1453,
|
PetStatusUpdateComposer = 1907,
|
||||||
PetExperience = 2156,
|
PetSupplementedNotificationComposer = 3441,
|
||||||
CommunityGoalVoteEvent = 1435,
|
PetTrainingPanelComposer = 1164,
|
||||||
PromoArticles = 286,
|
PhoneCollectionStateMessageComposer = 2890,
|
||||||
CommunityGoalEarnedPrizes = 3319,
|
PingMessageComposer = 3928,
|
||||||
CommunityGoalProgress = 2525,
|
PlayListMessageComposer = 1748,
|
||||||
ConcurrentUsersGoalProgress = 2737,
|
PlayListSongAddedMessageComposer = 1140,
|
||||||
QuestDaily = 1878,
|
PollContentsComposer = 2997,
|
||||||
QuestCancelled = 3027,
|
PollErrorComposer = 662,
|
||||||
QuestCompleted = 949,
|
PollOfferComposer = 3785,
|
||||||
CommunityGoalHallOfFame = 3005,
|
PopularRoomTagsResultComposer = 2012,
|
||||||
EpicPopup = 3945,
|
PostItPlacedComposer = 1501,
|
||||||
SeasonalQuests = 1122,
|
PostMessageMessageComposer = 2049,
|
||||||
Quests = 3625,
|
PostThreadMessageComposer = 1862,
|
||||||
Quest = 230,
|
PresentOpenedMessageComposer = 56,
|
||||||
BonusRareInfo = 1533,
|
ProductOfferComposer = 3388,
|
||||||
CraftableProducts = 1000,
|
PromoArticlesMessageComposer = 286,
|
||||||
CraftingRecipe = 2774,
|
PurchaseErrorMessageComposer = 1404,
|
||||||
CraftingRecipesAvailable = 2124,
|
PurchaseNotAllowedMessageComposer = 3770,
|
||||||
CraftingResult = 618,
|
PurchaseOkMessageComposer = 869,
|
||||||
CameraPublishStatus = 2057,
|
QuestCancelledMessageComposer = 3027,
|
||||||
CameraPurchaseOk = 2783,
|
QuestCompletedMessageComposer = 949,
|
||||||
CameraStorageUrl = 3696,
|
QuestDailyMessageComposer = 1878,
|
||||||
CameraSnapshot = 463,
|
QuestionAnsweredComposer = 2589,
|
||||||
CompetitionStatus = 133,
|
QuestionComposer = 2665,
|
||||||
InitCamera = 3878,
|
QuestionFinishedComposer = 1066,
|
||||||
ThumbnailStatus = 3595,
|
QuestionInfoComposer = -1,
|
||||||
AchievementNotification = 806,
|
QuestMessageComposer = 230,
|
||||||
ClubGiftNotification = 2188,
|
QuestsMessageComposer = 3625,
|
||||||
InterstitialMessage = 1808,
|
QuizDataMessageComposer = 2927,
|
||||||
RoomAdError = 1759,
|
QuizResultsMessageComposer = 2772,
|
||||||
AvailabilityTime = 600,
|
RecyclerFinishedComposer = 468,
|
||||||
HotelClosedAndOpens = 3728,
|
RecyclerPrizesComposer = 3164,
|
||||||
HotelClosesAndOpensAt = 2771,
|
RecyclerStatusComposer = 3433,
|
||||||
HotelWillCloseMinutes = 1050,
|
RelationshipStatusInfoComposer = 2016,
|
||||||
HotelMaintenance = 1350,
|
RemainingMutePeriodComposer = 826,
|
||||||
JukeboxPlaylistFull = 105,
|
RentableSpaceRentFailedMessageComposer = 1868,
|
||||||
JukeboxSongDisks = 34,
|
RentableSpaceRentOkMessageComposer = 2046,
|
||||||
NowPlaying = 469,
|
RentableSpaceStatusMessageComposer = 3559,
|
||||||
OfficialSongId = 1381,
|
RequestSpamWallPostItMessageComposer = 2366,
|
||||||
Playlist = 1748,
|
RestoreClientMessageComposer = 426,
|
||||||
PlaylistSongAdded = 1140,
|
RoomAdErrorComposer = 1759,
|
||||||
TraxSongInfo = 3365,
|
RoomAdPurchaseInfoComposer = 2468,
|
||||||
UserSongDisksInventory = 2602,
|
RoomChatlogComposer = 3434,
|
||||||
CheckUserName = 563,
|
RoomChatSettingsMessageComposer = 1191,
|
||||||
CfhSanction = 2782,
|
RoomDimmerPresetsComposer = 2710,
|
||||||
CfhTopics = 325,
|
RoomEntryInfoComposer = -1,
|
||||||
CfhSanctionStatus = 2221,
|
RoomEntryInfoMessageComposer = 749,
|
||||||
CampaignCalendarData = 2531,
|
RoomEntryTileMessageComposer = 1664,
|
||||||
CampaignCalendarDoorOpened = 2551,
|
RoomEventCancelComposer = 3479,
|
||||||
BuildersClubFurniCount = 3828,
|
RoomEventComposer = 1840,
|
||||||
BuildersClubSubscription = 1452,
|
RoomFilterSettingsMessageComposer = 2937,
|
||||||
CatalogPageExpiration = 2668,
|
RoomFloorThicknessUpdatedComposer = 3786,
|
||||||
CatalogEarliestExpiry = 2515,
|
RoomForwardMessageComposer = 160,
|
||||||
ClubGiftSelected = 659,
|
RoomInfoUpdatedComposer = 3297,
|
||||||
TargetOfferNotFound = 1237,
|
RoomInviteComposer = 3870,
|
||||||
TargetOffer = 119,
|
RoomInviteErrorComposer = 462,
|
||||||
DirectSmsClubBuy = 195,
|
RoomMessageNotificationMessageComposer = 1634,
|
||||||
RoomAdPurchase = 2468,
|
RoomOccupiedTilesMessageComposer = 3990,
|
||||||
NotEnoughBalance = 3914,
|
RoomPropertyMessageComposer = 2454,
|
||||||
LimitedOfferAppearingNext = 44,
|
RoomQueueStatusMessageComposer = 2208,
|
||||||
IsOfferGiftable = 761,
|
RoomRatingComposer = 482,
|
||||||
ClubExtendedOffer = 3964,
|
RoomReadyMessageComposer = 2031,
|
||||||
SeasonalCalendarOffer = 1889,
|
RoomSettingsDataComposer = 1498,
|
||||||
CompetitionEntrySubmit = 1177,
|
RoomSettingsErrorComposer = 2897,
|
||||||
CompetitionVotingInfo = 3506,
|
RoomSettingsSavedComposer = 948,
|
||||||
CompetitionTimingCode = 1745,
|
RoomSettingsSaveErrorComposer = 1555,
|
||||||
CompetitionUserPartOf = 3841,
|
RoomThumbnailUpdateResultComposer = 1927,
|
||||||
CompetitionNoOwnedRooms = 2064,
|
RoomUserQuestionAnsweredComposer = -1,
|
||||||
CompetitionSecondsUntil = 3926,
|
RoomUserRespectComposer = 2815,
|
||||||
BadgePointLimits = 2501,
|
RoomVisitsComposer = 1752,
|
||||||
BadgeRequestFulfilled = 2998,
|
RoomVisualizationSettingsComposer = 3547,
|
||||||
HelperTalentTrack = 3406,
|
SanctionStatusComposer = 2221,
|
||||||
TalentTrackLevel = 1203,
|
ScrSendKickbackInfoMessageComposer = 3277,
|
||||||
TalentTrackLevelUp = 638,
|
ScrSendUserInfoComposer = 954,
|
||||||
UserBanned = 1683,
|
SeasonalCalendarDailyOfferMessageComposer = 1889,
|
||||||
BotReceived = 3684,
|
SeasonalQuestsMessageComposer = 1122,
|
||||||
PetLevelNotification = 859,
|
SecondsUntilMessageComposer = 3926,
|
||||||
PetReceived = 1111,
|
SellablePetPalettesMessageComposer = 3331,
|
||||||
ModerationCaution = 1890,
|
ShoutMessageComposer = 1036,
|
||||||
YoutubeControlVideo = 1554,
|
ShowEnforceRoomCategoryDialogComposer = 3896,
|
||||||
YoutubeDisplayPlaylists = 1112,
|
SleepMessageComposer = 1797,
|
||||||
YoutubeDisplayVideo = 1411,
|
SlideObjectBundleMessageComposer = 3207,
|
||||||
CfhDisabledNotify = 1651,
|
Str16258Composer = 1660,
|
||||||
Question = 2665,
|
Str16667Composer = 3099,
|
||||||
PollContents = 2997,
|
Str17054Composer = 416,
|
||||||
PollError = 662,
|
TalentLevelUpComposer = 638,
|
||||||
PollOffer = 3785,
|
TalentTrackLevelMessageEvent = 1203,
|
||||||
PollRoomResult = 5201,
|
TalentTrackMessageComposer = 3406,
|
||||||
PollStartRoom = 5200,
|
TargetedOfferComposer = 119,
|
||||||
QuestionAnswered = 2589,
|
TargetedOfferNotFoundComposer = 1237,
|
||||||
QuestionFinished = 1066,
|
ThreadMessagesMessageComposer = 509,
|
||||||
CfhPendingCalls = 1121,
|
ThumbnailStatusMessageComposer = 3595,
|
||||||
GuideOnDutyStatus = 1548,
|
TradeCloseWindowComposer = 1001,
|
||||||
GuideSessionAttached = 1591,
|
TradeCompleteComposer = 2369,
|
||||||
GuideSessionDetached = 138,
|
TradingAcceptComposer = 2568,
|
||||||
GuideSessionEnded = 1456,
|
TradingCloseComposer = 1373,
|
||||||
GuideSessionError = 673,
|
TradingConfirmationComposer = 2720,
|
||||||
GuideSessionInvitedToGuideRoom = 219,
|
TradingItemListComposer = 2024,
|
||||||
GuideSessionMessage = 841,
|
TradingNoSuchItemComposer = 2873,
|
||||||
GuideSessionPartnerIsTyping = 1016,
|
TradingNotOpenComposer = 3128,
|
||||||
GuideSessionRequesterRoom = 1847,
|
TradingOpenComposer = 2505,
|
||||||
GuideSessionStarted = 3209,
|
TradingOpenFailedComposer = 217,
|
||||||
GuideTicketCreationResult = 3285,
|
TradingOtherNotAllowedComposer = 1254,
|
||||||
GuideTicketResolution = 2674,
|
TradingYouAreNotAllowedComposer = 3058,
|
||||||
GuideReportingStatus = 3463,
|
TraxSongInfoMessageComposer = 3365,
|
||||||
HotelMergeNameChange = 1663,
|
TryPhoneNumberResultMessageComposer = 800,
|
||||||
IssueCloseNotification = 934,
|
TryVerificationCodeResultMessageComposer = 91,
|
||||||
QuizData = 2927,
|
UniqueMachineIdComposer = 1488,
|
||||||
QuizResults = 2772,
|
Unknowncomposer1188 = 1437,
|
||||||
CfhPendingCallsDeleted = 77,
|
UnloadGameMessageComposer = 1715,
|
||||||
CfhReply = 3796,
|
UnreadForumsCountMessageComposer = 2379,
|
||||||
ChatReviewSessionDetached = 30,
|
UnseenItemsComposer = 2103,
|
||||||
ChatReviewSessionOfferedToGuide = 735,
|
UpdateMessageMessageComposer = 324,
|
||||||
ChatReviewSessionResults = 3276,
|
UpdateStackHeightTileHeightComposer = 2816,
|
||||||
ChatReviewSessionStarted = 143,
|
UpdateThreadMessageComposer = 2528,
|
||||||
ChatReviewSessionVotingStatus = 1829,
|
UseObjectMessageComposer = 1774,
|
||||||
ScrSendKickbackInfo = 3277,
|
UserBadgesComposer = 1087,
|
||||||
PetStatus = 1907,
|
UserBannedMessageComposer = 1683,
|
||||||
GroupDeactivate = 3129,
|
UserBcLimitsComposer = -1,
|
||||||
PetRespected = 2788,
|
UserChangeMessageComposer = 3920,
|
||||||
PetSupplement = 3441,
|
UserChatlogComposer = 3377,
|
||||||
NoobnessLevel = 3738,
|
UserClassificationMessageComposer = 966,
|
||||||
DisconnectReason = 4000,
|
UserEventCatsComposer = 3244,
|
||||||
CanCreateRoomEvent = 2599,
|
UserFlatCatsComposer = 1562,
|
||||||
FavoriteGroupUdpate = 3403,
|
UserGameAchievementsMessageComposer = 2265,
|
||||||
NoSuchFlat = 84,
|
UserNameChangedMessageComposer = 2182,
|
||||||
RoomSettingsError = 2897,
|
UserObjectComposer = 2725,
|
||||||
ShowEnforceRoomCategory = 3896,
|
UserRemoveMessageComposer = 2661,
|
||||||
CustomUserNotification = 909,
|
UserRightsMessageComposer = 411,
|
||||||
NewUserExperienceGiftOffer = 3575,
|
UsersComposer = 374,
|
||||||
RestoreClient = 426,
|
UserSongDisksInventoryMessageComposer = 2602,
|
||||||
FireworkChargeData = 5210,
|
UserTagsMessageComposer = 1255,
|
||||||
NewUserExperienceNotComplete = 3639,
|
UserTypingMessageComposer = 1717,
|
||||||
ConnectionError = 1004,
|
UserUnbannedFromRoomComposer = 3429,
|
||||||
AccountSafetyLockStatusChange = 1243,
|
UserUpdateComposer = 1640,
|
||||||
PhoneCollectionState = 2890,
|
VoucherRedeemErrorMessageComposer = 714,
|
||||||
PhoneTryNumberResult = 800,
|
VoucherRedeemOkMessageComposer = 3336,
|
||||||
PhoneTryVerificationCodeResult = 91,
|
WardrobeMessageComposer = 3315,
|
||||||
ExtendedProfileChanged = 876,
|
WeeklyCompetitiveFriendsLeaderboardComposer = 3560,
|
||||||
WelcomeGiftChangeEmailResult = 2293,
|
WeeklyCompetitiveLeaderboardComposer = 3512,
|
||||||
WelcomeGiftStatus = 2707,
|
WeeklyGameRewardComposer = 2641,
|
||||||
HandshakeInitDiffie = 1347,
|
WeeklyGameRewardWinnersComposer = 3097,
|
||||||
HandshakeCompleteDiffie = 3885,
|
WelcomeGiftChangeEmailResultComposer = 2293,
|
||||||
RentableSpaceRentOk = 2046,
|
WelcomeGiftStatusComposer = 2707,
|
||||||
RentableSpaceStatus = 3559,
|
WhisperMessageComposer = 2704,
|
||||||
RentableSpaceRentFailed = 1868,
|
WiredConditionDataComposer = 1108,
|
||||||
EmailStatus = 612,
|
WiredEffectDataComposer = 1434,
|
||||||
ChangeEmailResult = 1815,
|
WiredRewardResultMessageComposer = 178,
|
||||||
WeeklyGameReward = 2641,
|
WiredSavedComposer = 1155,
|
||||||
WeeklyGameRewardWinners = 3097,
|
WiredTriggerDataComposer = 383,
|
||||||
WeeklyCompetitiveLeaderboard = 3512,
|
WiredValidationErrorComposer = 156,
|
||||||
WeeklyCompetitiveFriendsLeaderboard = 3560,
|
YouAreControllerMessageComposer = 780,
|
||||||
WeeklyGame2FriendsLeaderboard = 2270,
|
YouAreNotControllerMessageComposer = 2392,
|
||||||
WeeklyGame2Leaderboard = 2196,
|
YouAreOwnerMessageComposer = 339,
|
||||||
RentableFurniRentOrBuyoutOffer = 35,
|
YouArePlayingGameMessageComposer = 448,
|
||||||
HandshakeIdentityAccount = 3523,
|
YouAreSpectatorMessageEvent = 1033,
|
||||||
|
YoutubeControlVideoMessageComposer = 1554,
|
||||||
|
YoutubeDisplayPlaylistsComposer = 1112,
|
||||||
|
YoutubeDisplayVideoMessageComposer = 1411,
|
||||||
|
SnowStormGameStartedComposer = 5000,
|
||||||
|
SnowStormQuePositionComposer = 5001,
|
||||||
|
SnowStormStartBlockTickerComposer = 5002,
|
||||||
|
SnowStormStartLobbyCounterComposer = 5003,
|
||||||
|
SnowStormUnusedAlertGenericComposer = 5004,
|
||||||
|
SnowStormLongDataComposer = 5005,
|
||||||
|
SnowStormGameEndedComposer = 5006,
|
||||||
|
SnowStormQuePlayerAddedComposer = 5008,
|
||||||
|
SnowStormPlayAgainComposer = 5009,
|
||||||
|
SnowStormGamesLeftComposer = 5010,
|
||||||
|
SnowStormQuePlayerRemovedComposer = 5011,
|
||||||
|
SnowStormGamesInformationComposer = 5012,
|
||||||
|
SnowStormLongData2Composer = 5013,
|
||||||
|
UnusedSnowstorm5014 = 5014,
|
||||||
|
SnowStormGameStatusComposer = 5015,
|
||||||
|
SnowStormFullGameStatusComposer = 5016,
|
||||||
|
SnowStormOnStageStartComposer = 5017,
|
||||||
|
SnowStormIntializeGameArenaViewComposer = 5018,
|
||||||
|
SnowStormRejoinPreviousRoomComposer = 5019,
|
||||||
|
UnknownSnowstorm5020 = 5020,
|
||||||
|
SnowStormLevelDataComposer = 5021,
|
||||||
|
SnowStormOnGameEndingComposer = 5022,
|
||||||
|
SnowStormUserChatMessageComposer = 5023,
|
||||||
|
SnowStormOnStageRunningComposer = 5024,
|
||||||
|
SnowStormOnStageEndingComposer = 5025,
|
||||||
|
SnowStormIntializedPlayersComposer = 5026,
|
||||||
|
SnowStormOnPlayerExitedArenaComposer = 5027,
|
||||||
|
SnowStormGenericErrorComposer = 5028,
|
||||||
|
SnowStormUserRematchedComposer = 5029
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.User.Data;
|
|
||||||
|
|
||||||
public class UserCurrentBadgesComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly int _habboId;
|
|
||||||
private readonly ICollection<Badge> _badges;
|
|
||||||
|
|
||||||
public UserCurrentBadgesComposer(int habboId, ICollection<Badge> badges)
|
|
||||||
{
|
|
||||||
_habboId = habboId;
|
|
||||||
_badges = badges;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserBadgesCurrent;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_habboId);
|
|
||||||
message.AppendInt32(_badges.Count);
|
|
||||||
|
|
||||||
foreach (var badge in _badges)
|
|
||||||
{
|
|
||||||
message.AppendInt32(badge.Slot);
|
|
||||||
message.AppendString(badge.Code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
using System.Globalization;
|
|
||||||
using Tiger.Communication.Messages.Interfaces;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Communication.Messages.Outgoing.User.Data;
|
|
||||||
|
|
||||||
public class UserProfileComposer : IMessageComposer
|
|
||||||
{
|
|
||||||
private readonly Habbo _habbo;
|
|
||||||
|
|
||||||
public UserProfileComposer(Habbo habbo)
|
|
||||||
{
|
|
||||||
_habbo = habbo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OutgoingHeaders Header => OutgoingHeaders.UserProfile;
|
|
||||||
public void Compose(ServerMessage message)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_habbo.Id);
|
|
||||||
message.AppendString(_habbo.Username);
|
|
||||||
message.AppendString(_habbo.Figure);
|
|
||||||
message.AppendString(_habbo.Motto);
|
|
||||||
message.AppendString(_habbo.AccountCreated.ToString(CultureInfo.CurrentCulture));
|
|
||||||
message.AppendInt32(_habbo.AchievementScore);
|
|
||||||
message.AppendInt32(0); // friend count
|
|
||||||
message.AppendBoolean(false); // is friend
|
|
||||||
message.AppendBoolean(false); // friend request sent
|
|
||||||
message.AppendBoolean(_habbo.Online);
|
|
||||||
message.AppendInt32(0); // groups
|
|
||||||
message.AppendInt32((int)(_habbo.LastLogin == null ? 0 : (DateTime.Now - _habbo.LastLogin.Value).TotalSeconds));
|
|
||||||
message.AppendBoolean(true); // open but why would it not open?
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@ public class ClientMessage
|
||||||
private readonly byte[] _packet;
|
private readonly byte[] _packet;
|
||||||
private int _readerIndex;
|
private int _readerIndex;
|
||||||
|
|
||||||
public short Header { get; }
|
public short? Header { get; }
|
||||||
|
|
||||||
public ClientMessage(byte[] packet)
|
public ClientMessage(byte[] packet)
|
||||||
{
|
{
|
||||||
|
@ -17,42 +17,42 @@ public class ClientMessage
|
||||||
Header = ReadInt16();
|
Header = ReadInt16();
|
||||||
}
|
}
|
||||||
|
|
||||||
public short ReadInt16()
|
public short? ReadInt16()
|
||||||
{
|
{
|
||||||
var raw = ReadBytes(2);
|
var raw = ReadBytes(2);
|
||||||
|
|
||||||
if (raw.Length != 2) return -1;
|
if (raw.Length != 2) return null;
|
||||||
|
|
||||||
return ByteUtils.GetInt16(raw);
|
return ByteUtils.GetInt16(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ReadInt32()
|
public int? ReadInt32()
|
||||||
{
|
{
|
||||||
var raw = ReadBytes(4);
|
var raw = ReadBytes(4);
|
||||||
|
|
||||||
if (raw.Length != 4) return -1;
|
if (raw.Length != 4) return null;
|
||||||
|
|
||||||
return ByteUtils.GetInt32(raw);
|
return ByteUtils.GetInt32(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ReadBoolean()
|
public bool? ReadBoolean()
|
||||||
{
|
{
|
||||||
if (_packet.Length - _readerIndex == 0) return false;
|
if (_packet.Length - _readerIndex == 0) return null;
|
||||||
|
|
||||||
var result = _packet[_readerIndex];
|
var result = _packet[_readerIndex];
|
||||||
_readerIndex++;
|
_readerIndex++;
|
||||||
return result == 1;
|
return result == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadString()
|
public string? ReadString()
|
||||||
{
|
{
|
||||||
var strlen = ReadInt16();
|
var strlen = ReadInt16();
|
||||||
|
|
||||||
if (strlen == -1) return string.Empty;
|
if (strlen == null) return null;
|
||||||
|
|
||||||
var raw = ReadBytes(strlen);
|
var raw = ReadBytes(strlen.Value);
|
||||||
|
|
||||||
return raw.Length != strlen ? string.Empty : Encoding.UTF8.GetString(raw);
|
return raw.Length != strlen ? null : Encoding.UTF8.GetString(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] ReadBytes(int amount)
|
private byte[] ReadBytes(int amount)
|
||||||
|
|
|
@ -21,6 +21,11 @@ public class ServerMessage
|
||||||
{
|
{
|
||||||
_packet.AddRange(ByteUtils.Int32ToArray(value));
|
_packet.AddRange(ByteUtils.Int32ToArray(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AppendUInt32(uint value)
|
||||||
|
{
|
||||||
|
_packet.AddRange(ByteUtils.UInt32ToArray(value));
|
||||||
|
}
|
||||||
|
|
||||||
public void AppendBoolean(bool value)
|
public void AppendBoolean(bool value)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,9 +0,0 @@
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public class Achievement
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Badge { get; set; } = null!;
|
|
||||||
public virtual string Category { get; set; } = null!;
|
|
||||||
public virtual IDictionary<int, AchievementLevel> Levels { get; set; } = new Dictionary<int, AchievementLevel>();
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public class AchievementLevel
|
|
||||||
{
|
|
||||||
public virtual Achievement Achievement { get; set; } = null!;
|
|
||||||
public virtual int Level { get; set; }
|
|
||||||
public virtual int RewardAmount { get; set; }
|
|
||||||
public virtual int RewardType { get; set; }
|
|
||||||
public virtual int Points { get; set; }
|
|
||||||
public virtual int ProgressNeeded { get; set; }
|
|
||||||
|
|
||||||
public override bool Equals(object? obj)
|
|
||||||
{
|
|
||||||
if (obj is not AchievementLevel other)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return Achievement.Id == other.Achievement.Id && Level == other.Level;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
unchecked
|
|
||||||
{
|
|
||||||
var hash = 17;
|
|
||||||
hash = hash * 23 + Achievement.Id.GetHashCode();
|
|
||||||
hash = hash * 23 + Level.GetHashCode();
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public class AchievementLevelMap : ClassMap<AchievementLevel>
|
|
||||||
{
|
|
||||||
public AchievementLevelMap()
|
|
||||||
{
|
|
||||||
Table("achievement_levels");
|
|
||||||
LazyLoad();
|
|
||||||
CompositeId()
|
|
||||||
.KeyProperty(al => al.Level, "level")
|
|
||||||
.KeyReference(al => al.Achievement, "achievement_id");
|
|
||||||
Map(al => al.RewardAmount).Column("reward_amount").Not.Nullable();
|
|
||||||
Map(al => al.RewardType).Column("reward_type").Not.Nullable();
|
|
||||||
Map(al => al.ProgressNeeded).Column("progress_needed").Not.Nullable();
|
|
||||||
Map(al => al.Points).Column("points").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,117 +0,0 @@
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Achievements;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public class AchievementManager : IAchievementManager
|
|
||||||
{
|
|
||||||
private readonly IRepository<Achievement> _achievementRepository;
|
|
||||||
private readonly ILogger<IAchievementManager> _logger;
|
|
||||||
private readonly IRepository<Badge> _badgesRepository;
|
|
||||||
private readonly IRepository<Habbo> _habboRepository;
|
|
||||||
|
|
||||||
public AchievementManager(IRepository<Achievement> achievementRepository, ILogger<IAchievementManager> logger, IRepository<Badge> badgesRepository, IRepository<Habbo> habboRepository)
|
|
||||||
{
|
|
||||||
_achievementRepository = achievementRepository;
|
|
||||||
_logger = logger;
|
|
||||||
_badgesRepository = badgesRepository;
|
|
||||||
_habboRepository = habboRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDictionary<string, Achievement> Achievements { get; private set; } = new Dictionary<string, Achievement>();
|
|
||||||
|
|
||||||
public async Task LoadAchievementsAsync()
|
|
||||||
{
|
|
||||||
Achievements = (await _achievementRepository.FindByAsync()).ToDictionary(a => a.Badge, a => a);
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} Achievements", Achievements.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task UpdateAchievementAsync(string achievementName, int progress, GameSession session)
|
|
||||||
{
|
|
||||||
if (session.Habbo is null) return;
|
|
||||||
|
|
||||||
if (!Achievements.TryGetValue(achievementName, out var achievement)) return;
|
|
||||||
|
|
||||||
if (progress == 0) return;
|
|
||||||
|
|
||||||
if (!session.Habbo.Achievements.TryGetValue(achievement.Id, out var habboAchievement))
|
|
||||||
{
|
|
||||||
habboAchievement = new HabboAchievement()
|
|
||||||
{
|
|
||||||
Level = 0,
|
|
||||||
Progress = 0,
|
|
||||||
Achievement = achievement,
|
|
||||||
Habbo = session.Habbo
|
|
||||||
};
|
|
||||||
|
|
||||||
session.Habbo.Achievements.Add(achievement.Id, habboAchievement);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (habboAchievement.Level == achievement.Levels.Count) return;
|
|
||||||
|
|
||||||
var targetLevel = habboAchievement.Level + 1;
|
|
||||||
var achievementLevel = achievement.Levels[targetLevel];
|
|
||||||
|
|
||||||
habboAchievement.Progress += progress;
|
|
||||||
|
|
||||||
if (habboAchievement.Progress >= achievementLevel.ProgressNeeded)
|
|
||||||
{
|
|
||||||
habboAchievement.Level++;
|
|
||||||
|
|
||||||
Badge badge;
|
|
||||||
|
|
||||||
if (habboAchievement.Level == 1)
|
|
||||||
{
|
|
||||||
badge = new Badge
|
|
||||||
{
|
|
||||||
Habbo = session.Habbo,
|
|
||||||
Code = $"{achievement.Badge}1"
|
|
||||||
};
|
|
||||||
session.Habbo.Badges.Add(badge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var currentBadge =
|
|
||||||
session.Habbo.Badges.SingleOrDefault(b =>
|
|
||||||
b.Code == $"{achievement.Badge}{habboAchievement.Level - 1}");
|
|
||||||
|
|
||||||
if (currentBadge != null)
|
|
||||||
{
|
|
||||||
currentBadge.Code = $"{achievement.Badge}{habboAchievement.Level - 1}";
|
|
||||||
badge = currentBadge;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
badge = new Badge
|
|
||||||
{
|
|
||||||
Habbo = session.Habbo,
|
|
||||||
Code = $"{achievement.Badge}1"
|
|
||||||
};
|
|
||||||
session.Habbo.Badges.Add(badge);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
session.Habbo.AchievementScore += achievementLevel.Points;
|
|
||||||
|
|
||||||
if (achievementLevel.RewardAmount > 0)
|
|
||||||
{
|
|
||||||
session.Habbo.UpdateCurrency(achievementLevel.RewardType, achievementLevel.RewardAmount);
|
|
||||||
session.SendComposerAsync(new ActivityPointNotificationMessageComposer(session.Habbo.Activitypoints[achievementLevel.RewardType].Amount, achievementLevel.RewardAmount, achievementLevel.RewardType));
|
|
||||||
}
|
|
||||||
|
|
||||||
// session.CurrentRoom?.SendMessage(new UserChangeMessageComposer(session.RoomUser.VirtualId, session.User));
|
|
||||||
|
|
||||||
session.SendComposerAsync(new AchievementsScoreComposer(session.Habbo.AchievementScore));
|
|
||||||
session.SendComposerAsync(new AchievementNotificationMessageComposer(habboAchievement, badge.Id));
|
|
||||||
}
|
|
||||||
|
|
||||||
_habboRepository.SaveAsync(session.Habbo);
|
|
||||||
|
|
||||||
await session.SendComposerAsync(new AchievementComposer(achievement, habboAchievement));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public class AchievementMap : ClassMap<Achievement>
|
|
||||||
{
|
|
||||||
public AchievementMap()
|
|
||||||
{
|
|
||||||
Table("achievements");
|
|
||||||
LazyLoad();
|
|
||||||
Id(a => a.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(a => a.Badge).Column("badge").Not.Nullable();
|
|
||||||
Map(a => a.Category).Column("category").Not.Nullable();
|
|
||||||
HasMany(a => a.Levels).AsMap(al => al.Level).Cascade.All();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
public interface IAchievementManager
|
|
||||||
{
|
|
||||||
IDictionary<string, Achievement> Achievements { get; }
|
|
||||||
Task LoadAchievementsAsync();
|
|
||||||
Task UpdateAchievementAsync(string achievementName, int progress, GameSession session);
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class CatalogueFeaturedPage
|
|
||||||
{
|
|
||||||
public virtual int SlotId { get; set; }
|
|
||||||
public virtual string Image { get; set; } = null!;
|
|
||||||
public virtual string Caption { get; set; } = null!;
|
|
||||||
public virtual CatalogueFeaturedPageType Type { get; set; }
|
|
||||||
public virtual DateTime Expire { get; set; }
|
|
||||||
public virtual string Data { get; set; } = null!;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class CatalogueFeaturedPageMap : ClassMap<CatalogueFeaturedPage>
|
|
||||||
{
|
|
||||||
public CatalogueFeaturedPageMap()
|
|
||||||
{
|
|
||||||
Table("catalogue_featured_pages");
|
|
||||||
Id(fp => fp.SlotId).Column("slot_id").GeneratedBy.Identity();
|
|
||||||
Map(fp => fp.Image).Column("image").Not.Nullable();
|
|
||||||
Map(fp => fp.Caption).Column("caption").Not.Nullable();
|
|
||||||
Map(fp => fp.Type).CustomType<int>().Column("type").Not.Nullable();
|
|
||||||
Map(fp => fp.Expire).Column("expire").Not.Nullable();
|
|
||||||
Map(fp => fp.Data).Column("data").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public enum CatalogueFeaturedPageType
|
|
||||||
{
|
|
||||||
PageName,
|
|
||||||
PageId,
|
|
||||||
ProductName
|
|
||||||
}
|
|
|
@ -1,122 +0,0 @@
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Catalog;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Currency;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Inventory.Subscription;
|
|
||||||
using Tiger.Communication.Messages.Outgoing.Notifications;
|
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class CatalogueManager : ICatalogueManager
|
|
||||||
{
|
|
||||||
private readonly IRepository<CataloguePage> _pagesRepository;
|
|
||||||
private readonly ILogger<ICatalogueManager> _logger;
|
|
||||||
private readonly IRepository<CatalogueFeaturedPage> _featuredPagesRepository;
|
|
||||||
private readonly IRepository<ClubOffer> _clubOfferRepository;
|
|
||||||
private readonly IRepository<HabboSubscription> _habboSubscriptionRepository;
|
|
||||||
private readonly IAchievementManager _achievementManager;
|
|
||||||
|
|
||||||
public IDictionary<int, CataloguePage> Pages { get; private set; }
|
|
||||||
public IDictionary<int, CatalogueFeaturedPage> FeaturedPages { get; private set; }
|
|
||||||
public IDictionary<int, ClubOffer> ClubOffers { get; private set; }
|
|
||||||
|
|
||||||
public CatalogueManager(IRepository<CataloguePage> pagesRepository, ILogger<ICatalogueManager> logger,
|
|
||||||
IRepository<CatalogueFeaturedPage> featuredPagesRepository, IRepository<ClubOffer> clubOfferRepository,
|
|
||||||
IRepository<HabboSubscription> habboSubscriptionRepository, IAchievementManager achievementManager)
|
|
||||||
{
|
|
||||||
_pagesRepository = pagesRepository;
|
|
||||||
_logger = logger;
|
|
||||||
_featuredPagesRepository = featuredPagesRepository;
|
|
||||||
_clubOfferRepository = clubOfferRepository;
|
|
||||||
_habboSubscriptionRepository = habboSubscriptionRepository;
|
|
||||||
_achievementManager = achievementManager;
|
|
||||||
Pages = new Dictionary<int, CataloguePage>();
|
|
||||||
FeaturedPages = new Dictionary<int, CatalogueFeaturedPage>();
|
|
||||||
ClubOffers = new Dictionary<int, ClubOffer>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task LoadPagesAsync()
|
|
||||||
{
|
|
||||||
Pages = (await _pagesRepository.FindByAsync()).ToDictionary(p => p.Id, p => p);
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} catalogue pages", Pages.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task LoadFeaturedPagesAsync()
|
|
||||||
{
|
|
||||||
FeaturedPages = (await _featuredPagesRepository.FindByAsync())
|
|
||||||
.ToDictionary(p => p.SlotId, p => p);
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} catalogue featured pages", FeaturedPages.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task LoadClubOffersAsync()
|
|
||||||
{
|
|
||||||
ClubOffers = (await _clubOfferRepository.FindByAsync())
|
|
||||||
.ToDictionary(co => co.Id);
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} club offers", ClubOffers.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task PurchaseClubOffer(int offerId, GameSession gameSession)
|
|
||||||
{
|
|
||||||
if (!ClubOffers.TryGetValue(offerId, out var clubOffer) || gameSession.Habbo == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var tooShortOnCoins = clubOffer.PriceCredits > 0 && clubOffer.PriceCredits > gameSession.Habbo.Credits;
|
|
||||||
var tooShortOnActivityPoints = clubOffer.PriceActivitypoints > 0 && clubOffer.PriceActivitypoints >
|
|
||||||
gameSession.Habbo.GetActivityPoints(clubOffer.ActivitypointsType);
|
|
||||||
|
|
||||||
if (tooShortOnCoins || tooShortOnActivityPoints)
|
|
||||||
{
|
|
||||||
await gameSession.SendComposerAsync(new NotEnoughBalanceMessageComposer(tooShortOnCoins,
|
|
||||||
tooShortOnActivityPoints, clubOffer.ActivitypointsType));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clubOffer.PriceCredits > 0)
|
|
||||||
{
|
|
||||||
gameSession.Habbo.Credits -= clubOffer.PriceCredits;
|
|
||||||
gameSession.SendComposerAsync(new UserCreditsComposer(gameSession.Habbo.Credits));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clubOffer.PriceActivitypoints > 0)
|
|
||||||
{
|
|
||||||
gameSession.Habbo.UpdateCurrency(clubOffer.ActivitypointsType, -clubOffer.PriceActivitypoints);
|
|
||||||
gameSession.SendComposerAsync(new ActivityPointNotificationMessageComposer(
|
|
||||||
gameSession.Habbo.GetActivityPoints(clubOffer.ActivitypointsType), -clubOffer.PriceActivitypoints,
|
|
||||||
clubOffer.ActivitypointsType));
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentSubscription = gameSession.Habbo.GetActiveSubscription();
|
|
||||||
|
|
||||||
if (currentSubscription != null)
|
|
||||||
{
|
|
||||||
currentSubscription.Expires = currentSubscription.Expires.AddDays(clubOffer.Days);
|
|
||||||
currentSubscription.Habbo.Credits -= clubOffer.PriceCredits;
|
|
||||||
currentSubscription.Habbo.UpdateCurrency(clubOffer.ActivitypointsType, -clubOffer.PriceActivitypoints);
|
|
||||||
_habboSubscriptionRepository.SaveAsync(currentSubscription);
|
|
||||||
gameSession.SendComposerAsync(new UserSubscriptionComposer(currentSubscription,
|
|
||||||
gameSession.Habbo.GetPastSubscriptionDays()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var subscription = new HabboSubscription
|
|
||||||
{
|
|
||||||
Expires = DateTime.Now.AddDays(clubOffer.Days),
|
|
||||||
SubscriptionType = "habbo_club",
|
|
||||||
Started = DateTime.Now,
|
|
||||||
Habbo = gameSession.Habbo
|
|
||||||
};
|
|
||||||
_habboSubscriptionRepository.SaveAsync(subscription);
|
|
||||||
gameSession.SendComposerAsync(new UserSubscriptionComposer(subscription,
|
|
||||||
gameSession.Habbo.GetPastSubscriptionDays()));
|
|
||||||
_achievementManager.UpdateAchievementAsync("ACH_HC", 1, gameSession);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class CataloguePage
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Name { get; set; } = null!;
|
|
||||||
public virtual string InternalName { get; set; } = null!;
|
|
||||||
public virtual string Layout { get; set; } = null!;
|
|
||||||
public virtual bool Visible { get; set; }
|
|
||||||
public virtual bool Enabled { get; set; }
|
|
||||||
public virtual int Icon { get; set; }
|
|
||||||
public virtual int MinRank { get; set; }
|
|
||||||
public virtual CataloguePage? Parent { get; set; }
|
|
||||||
public virtual IList<CataloguePage> Children { get; set; } = new List<CataloguePage>();
|
|
||||||
public virtual IList<string> Images { get; set; } = new List<string>();
|
|
||||||
public virtual IList<string> Texts { get; set; } = new List<string>();
|
|
||||||
public virtual bool SeasonalCurrency { get; set; }
|
|
||||||
public virtual IList<string> Modes { get; set; } = new List<string>();
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class CataloguePageMap : ClassMap<CataloguePage>
|
|
||||||
{
|
|
||||||
public CataloguePageMap()
|
|
||||||
{
|
|
||||||
Table("catalogue_pages");
|
|
||||||
LazyLoad();
|
|
||||||
Id(c => c.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(c => c.Name).Column("name").Not.Nullable();
|
|
||||||
Map(c => c.InternalName).Column("internal_name").Not.Nullable();
|
|
||||||
Map(c => c.Layout).Column("layout").Not.Nullable();
|
|
||||||
Map(c => c.Visible).Column("visible").Not.Nullable();
|
|
||||||
Map(c => c.Enabled).Column("enabled").Not.Nullable();
|
|
||||||
Map(c => c.Icon).Column("icon").Not.Nullable();
|
|
||||||
Map(c => c.MinRank).Column("min_rank").Not.Nullable();
|
|
||||||
References(x => x.Parent).Column("parent_id").Nullable();
|
|
||||||
HasMany(x => x.Children).KeyColumn("parent_id").Inverse().Cascade.AllDeleteOrphan();
|
|
||||||
Map(c => c.Images).CustomType<StringListTypeConverter>();
|
|
||||||
Map(c => c.Texts).CustomType<StringListTypeConverter>();
|
|
||||||
Map(c => c.SeasonalCurrency).Column("seasonal_currency").Not.Nullable();
|
|
||||||
Map(c => c.Modes).CustomType<StringListTypeConverter>();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class ClubOffer
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Name { get; set; } = null!;
|
|
||||||
public virtual int PriceCredits { get; set; }
|
|
||||||
public virtual int PriceActivitypoints { get; set; }
|
|
||||||
public virtual int ActivitypointsType { get; set; }
|
|
||||||
public virtual int Days { get; set; }
|
|
||||||
public virtual bool DiscountExtension { get; set; }
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public class ClubOfferMap : ClassMap<ClubOffer>
|
|
||||||
{
|
|
||||||
public ClubOfferMap()
|
|
||||||
{
|
|
||||||
Table("catalogue_club_offers");
|
|
||||||
Id(co => co.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(co => co.Name).Column("name").Not.Nullable();
|
|
||||||
Map(co => co.PriceCredits).Column("price_credits").Not.Nullable();
|
|
||||||
Map(co => co.PriceActivitypoints).Column("price_activitypoints").Not.Nullable();
|
|
||||||
Map(co => co.ActivitypointsType).Column("activitypoints_type").Not.Nullable();
|
|
||||||
Map(co => co.Days).Column("days").Not.Nullable();
|
|
||||||
Map(co => co.DiscountExtension).Column("discount_extension").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
using Tiger.Networking.Game.Sessions;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Catalogue;
|
|
||||||
|
|
||||||
public interface ICatalogueManager
|
|
||||||
{
|
|
||||||
public IDictionary<int, CataloguePage> Pages { get; }
|
|
||||||
public IDictionary<int, CatalogueFeaturedPage> FeaturedPages { get; }
|
|
||||||
public IDictionary<int, ClubOffer> ClubOffers { get; }
|
|
||||||
Task LoadPagesAsync();
|
|
||||||
Task LoadFeaturedPagesAsync();
|
|
||||||
Task LoadClubOffersAsync();
|
|
||||||
Task PurchaseClubOffer(int offerId, GameSession gameSession);
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class Color
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public int Index { get; set; }
|
|
||||||
public int Club { get; set; }
|
|
||||||
public bool Selectable { get; set; }
|
|
||||||
public string HexCode { get; set; } = null!;
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class Figuredata
|
|
||||||
{
|
|
||||||
public List<Palette> Palettes { get; set; } = new();
|
|
||||||
public List<SetType> SetTypes { get; set; } = new();
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class FiguredataManager : IFigureDataManager
|
|
||||||
{
|
|
||||||
private readonly Figuredata? _figuredata;
|
|
||||||
|
|
||||||
public FiguredataManager()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_figuredata = JsonConvert.DeserializeObject<Figuredata>(File.ReadAllText("FigureData.json"));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ValidateFigure(string newFigure, string newGender, Habbo habbo)
|
|
||||||
{
|
|
||||||
if (_figuredata is null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var parts = newFigure.Split('.');
|
|
||||||
|
|
||||||
foreach (var part in parts)
|
|
||||||
{
|
|
||||||
if (!part.Contains('-'))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var subParts = part.Split('-');
|
|
||||||
var setType = _figuredata.SetTypes.SingleOrDefault(st => st.Type == subParts[0]);
|
|
||||||
|
|
||||||
if (setType is null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var palette = _figuredata.Palettes.SingleOrDefault(p => p.Id == setType.PaletteId);
|
|
||||||
|
|
||||||
if (palette is null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var set = setType.Sets.SingleOrDefault(s => s.Id == int.Parse(subParts.Length >= 2 ? subParts[1] : "-1"));
|
|
||||||
|
|
||||||
if (set is null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// TODO: Check if is club
|
|
||||||
// TODO: Check for buyable clothes
|
|
||||||
|
|
||||||
if (set.Gender.ToUpper() != newGender)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (set.Colorable && subParts.Length < 3)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!set.Colorable) continue;
|
|
||||||
|
|
||||||
var paletteColor1 = palette.Colors.SingleOrDefault(c => c.Id == int.Parse(subParts[2]));
|
|
||||||
|
|
||||||
if (paletteColor1 is null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (subParts.Length == 3) continue;
|
|
||||||
|
|
||||||
var paletteColor2 = palette.Colors.SingleOrDefault(c => c.Id == int.Parse(subParts[3]));
|
|
||||||
|
|
||||||
if (paletteColor2 is null)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public interface IFigureDataManager
|
|
||||||
{
|
|
||||||
bool ValidateFigure(string newFigure, string newGender, Habbo habbo);
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class Palette
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public List<Color> Colors { get; set; } = new();
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class Part
|
|
||||||
{
|
|
||||||
public bool Colorable { get; set; }
|
|
||||||
public int ColorIndex { get; set; }
|
|
||||||
public uint Id { get; set; }
|
|
||||||
public int Index { get; set; }
|
|
||||||
public string Type { get; set; } = null!;
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class Set
|
|
||||||
{
|
|
||||||
public int Club { get; set; }
|
|
||||||
public bool Colorable { get; set; }
|
|
||||||
public string Gender { get; set; } = null!;
|
|
||||||
public int Id { get; set; }
|
|
||||||
public bool Preselectable { get; set; }
|
|
||||||
public bool Selectable { get; set; }
|
|
||||||
public bool Sellable { get; set; }
|
|
||||||
public List<Part> Parts { get; set; } = new();
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Figuredata;
|
|
||||||
|
|
||||||
public class SetType
|
|
||||||
{
|
|
||||||
public string Type { get; set; } = null!;
|
|
||||||
[JsonProperty("mandatory_f_0")]
|
|
||||||
public bool MandatoryF0 { get; set; }
|
|
||||||
[JsonProperty("mandatory_f_1")]
|
|
||||||
public bool MandatoryF1 { get; set; }
|
|
||||||
[JsonProperty("mandatory_m_0")]
|
|
||||||
public bool MandatoryM0 { get; set; }
|
|
||||||
[JsonProperty("mandatory_m_1")]
|
|
||||||
public bool MandatoryM1 { get; set; }
|
|
||||||
public int PaletteId { get; set; }
|
|
||||||
public List<Set> Sets { get; set; } = new();
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class Activitypoints
|
|
||||||
{
|
|
||||||
public virtual Habbo Habbo { get; set; } = null!;
|
|
||||||
public virtual int Type { get; set; }
|
|
||||||
public virtual int Amount { get; set; }
|
|
||||||
|
|
||||||
public override bool Equals(object? obj)
|
|
||||||
{
|
|
||||||
if (obj is not Activitypoints other)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return Habbo.Id == other.Habbo.Id && Type == other.Type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
unchecked
|
|
||||||
{
|
|
||||||
var hash = 17;
|
|
||||||
hash = hash * 23 + Habbo.Id.GetHashCode();
|
|
||||||
hash = hash * 23 + Type.GetHashCode();
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class ActivitypointsMap : ClassMap<Activitypoints>
|
|
||||||
{
|
|
||||||
public ActivitypointsMap()
|
|
||||||
{
|
|
||||||
Table("habbo_activitypoints");
|
|
||||||
LazyLoad();
|
|
||||||
CompositeId()
|
|
||||||
.KeyProperty(h => h.Type, "type")
|
|
||||||
.KeyReference(h => h.Habbo, "habbo_id");
|
|
||||||
Map(h => h.Amount).Column("amount").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class Badge
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual Habbo Habbo { get; set; } = null!;
|
|
||||||
public virtual string Code { get; set; } = null!;
|
|
||||||
public virtual int Slot { get; set; }
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class BadgeMap : ClassMap<Badge>
|
|
||||||
{
|
|
||||||
public BadgeMap()
|
|
||||||
{
|
|
||||||
Table("habbo_badges");
|
|
||||||
LazyLoad();
|
|
||||||
Id(b => b.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
References(b => b.Habbo).Column("habbo_id").Not.Nullable();
|
|
||||||
Map(b => b.Code).Column("code").Not.Nullable();
|
|
||||||
Map(b => b.Slot).Column("slot").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ namespace Tiger.Game.Habbos;
|
||||||
|
|
||||||
public class Habbo
|
public class Habbo
|
||||||
{
|
{
|
||||||
public virtual int Id { get; set; }
|
public virtual uint Id { get; set; }
|
||||||
public virtual string Username { get; set; } = null!;
|
public virtual string Username { get; set; } = null!;
|
||||||
public virtual string Email { get; set; } = null!;
|
public virtual string Email { get; set; } = null!;
|
||||||
public virtual DateTime AccountCreated { get; set; }
|
public virtual DateTime AccountCreated { get; set; }
|
||||||
|
@ -10,60 +10,11 @@ public class Habbo
|
||||||
public virtual string Motto { get; set; } = null!;
|
public virtual string Motto { get; set; } = null!;
|
||||||
public virtual string Figure { get; set; } = null!;
|
public virtual string Figure { get; set; } = null!;
|
||||||
public virtual string Gender { get; set; } = null!;
|
public virtual string Gender { get; set; } = null!;
|
||||||
public virtual int Rank { get; set; }
|
public virtual byte Rank { get; set; }
|
||||||
public virtual int Credits { get; set; }
|
public virtual uint Credits { get; set; }
|
||||||
public virtual bool Online { get; set; }
|
public virtual bool Online { get; set; }
|
||||||
public virtual int HomeRoom { get; set; }
|
public virtual uint HomeRoom { get; set; }
|
||||||
public virtual int AchievementScore { get; set; }
|
public virtual uint AchievementScore { get; set; }
|
||||||
public virtual int? GroupId { get; set; }
|
public virtual uint? GroupId { get; set; }
|
||||||
public virtual string? SsoTicket { get; set; }
|
public virtual string? SsoTicket { get; set; }
|
||||||
public virtual IDictionary<int, Activitypoints> Activitypoints { get; set; } = new Dictionary<int, Activitypoints>();
|
|
||||||
public virtual ICollection<Badge> Badges { get; set; } = new List<Badge>();
|
|
||||||
|
|
||||||
public virtual IDictionary<int, HabboAchievement> Achievements { get; set; } = new Dictionary<int, HabboAchievement>();
|
|
||||||
public virtual ICollection<HabboSubscription> Subscriptions { get; set; } = new List<HabboSubscription>();
|
|
||||||
|
|
||||||
public virtual int GetActivityPoints(int type)
|
|
||||||
{
|
|
||||||
return Activitypoints.TryGetValue(type, out var activityPoints) ? activityPoints.Amount : 0;
|
|
||||||
}
|
|
||||||
public virtual void UpdateCurrency(int type, int amount)
|
|
||||||
{
|
|
||||||
if (!Activitypoints.ContainsKey(type))
|
|
||||||
{
|
|
||||||
Activitypoints.Add(type, new Activitypoints
|
|
||||||
{
|
|
||||||
Habbo = this,
|
|
||||||
Amount = amount,
|
|
||||||
Type = type
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Activitypoints[type].Amount += amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual HabboSubscription? GetActiveSubscription()
|
|
||||||
{
|
|
||||||
return Subscriptions.Where(s => s.Expires > DateTime.Now).MaxBy(s => s.Expires);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual int GetPastSubscriptionDays()
|
|
||||||
{
|
|
||||||
int totalDays = 0;
|
|
||||||
|
|
||||||
foreach (var subscription in Subscriptions)
|
|
||||||
{
|
|
||||||
if(subscription.Expires < DateTime.Now) // If subscription has ended
|
|
||||||
{
|
|
||||||
totalDays += (subscription.Expires - subscription.Started).Days;
|
|
||||||
}
|
|
||||||
else if(subscription.Started < DateTime.Now) // If subscription is ongoing
|
|
||||||
{
|
|
||||||
totalDays += (DateTime.Now - subscription.Started).Days;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return totalDays;
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
using Tiger.Game.Achievements;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class HabboAchievement
|
|
||||||
{
|
|
||||||
public virtual Habbo Habbo { get; set; } = null!;
|
|
||||||
public virtual Achievement Achievement { get; set; } = null!;
|
|
||||||
public virtual int Level { get; set; }
|
|
||||||
public virtual int Progress { get; set; }
|
|
||||||
|
|
||||||
public override bool Equals(object? obj)
|
|
||||||
{
|
|
||||||
if (obj is not HabboAchievement other)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return Habbo.Id == other.Habbo.Id && Achievement.Id == other.Achievement.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
unchecked
|
|
||||||
{
|
|
||||||
var hash = 17;
|
|
||||||
hash = hash * 23 + Habbo.Id.GetHashCode();
|
|
||||||
hash = hash * 23 + Achievement.Id.GetHashCode();
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class HabboAchievementMap : ClassMap<HabboAchievement>
|
|
||||||
{
|
|
||||||
public HabboAchievementMap()
|
|
||||||
{
|
|
||||||
Table("habbo_achievements");
|
|
||||||
LazyLoad();
|
|
||||||
CompositeId()
|
|
||||||
.KeyReference(ha => ha.Habbo, "habbo_id")
|
|
||||||
.KeyReference(ha => ha.Achievement, "achievement_id");
|
|
||||||
Map(ha => ha.Level).Column("level").Not.Nullable();
|
|
||||||
Map(ha => ha.Progress).Column("progress").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -23,18 +23,5 @@ public class HabboMap : ClassMap<Habbo>
|
||||||
Map(h => h.AchievementScore).Column("achievement_score").Not.Nullable();
|
Map(h => h.AchievementScore).Column("achievement_score").Not.Nullable();
|
||||||
Map(h => h.GroupId).Column("group_id").Nullable();
|
Map(h => h.GroupId).Column("group_id").Nullable();
|
||||||
Map(h => h.SsoTicket).Column("sso_ticket").Nullable();
|
Map(h => h.SsoTicket).Column("sso_ticket").Nullable();
|
||||||
HasMany(h => h.Activitypoints).AsMap(a => a.Type).Inverse().Cascade.All();
|
|
||||||
HasMany(h => h.Badges).Inverse().Cascade.All();
|
|
||||||
HasMany(x => x.Achievements)
|
|
||||||
.Table("habbo_achievements")
|
|
||||||
.KeyColumn("habbo_id")
|
|
||||||
.Component(comp =>
|
|
||||||
{
|
|
||||||
comp.Map(x => x.Level);
|
|
||||||
comp.Map(x => x.Progress);
|
|
||||||
})
|
|
||||||
.AsMap("achievement_id")
|
|
||||||
.Cascade.All();
|
|
||||||
HasMany(h => h.Subscriptions).Cascade.All().Inverse();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class HabboSubscription
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual Habbo Habbo { get; set; } = null!;
|
|
||||||
public virtual string SubscriptionType { get; set; }= null!;
|
|
||||||
public virtual DateTime Started { get; set; }
|
|
||||||
public virtual DateTime Expires { get; set; }
|
|
||||||
|
|
||||||
public virtual int DaysInMonthLeft => (int)(Expires - DateTime.Now).TotalDays % 31;
|
|
||||||
public virtual int MonthsLeft => (int)(Expires - DateTime.Now).TotalDays / 31;
|
|
||||||
public virtual double MinutesLeft => (Expires - DateTime.Now).TotalMinutes;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
public class HabboSubscriptionMap : ClassMap<HabboSubscription>
|
|
||||||
{
|
|
||||||
public HabboSubscriptionMap()
|
|
||||||
{
|
|
||||||
Table("habbo_subscriptions");
|
|
||||||
LazyLoad();
|
|
||||||
Id(hs => hs.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(hs => hs.SubscriptionType).Column("subscription_type").Not.Nullable();
|
|
||||||
Map(hs => hs.Started).Column("started").Not.Nullable();
|
|
||||||
Map(hs => hs.Expires).Column("expires").Not.Nullable();
|
|
||||||
References(x => x.Habbo).Column("habbo_id").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
namespace Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
public interface ILandingViewManager
|
|
||||||
{
|
|
||||||
ICollection<PromoArticle> PromoArticles { get; }
|
|
||||||
Task LoadPromoArticlesAsync();
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
public class LandingViewManager : ILandingViewManager
|
|
||||||
{
|
|
||||||
private readonly IRepository<PromoArticle> _promoArticleRepository;
|
|
||||||
private readonly ILogger<ILandingViewManager> _logger;
|
|
||||||
|
|
||||||
public LandingViewManager(IRepository<PromoArticle> promoArticleRepository, ILogger<ILandingViewManager> logger)
|
|
||||||
{
|
|
||||||
_promoArticleRepository = promoArticleRepository;
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICollection<PromoArticle> PromoArticles { get; private set; } = new List<PromoArticle>();
|
|
||||||
|
|
||||||
public async Task LoadPromoArticlesAsync()
|
|
||||||
{
|
|
||||||
PromoArticles = (await _promoArticleRepository.FindByAsync()).ToList();
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} promo articles", PromoArticles.Count);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
namespace Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
public class PromoArticle
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Title { get; set; } = null!;
|
|
||||||
public virtual string BodyText { get; set; } = null!;
|
|
||||||
public virtual string ButtonText { get; set; } = null!;
|
|
||||||
public virtual PromoArticleLinkType LinkType { get; set; }
|
|
||||||
public virtual string LinkContent { get; set; } = null!;
|
|
||||||
public virtual string ImageUrl { get; set; } = null!;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
namespace Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
public enum PromoArticleLinkType
|
|
||||||
{
|
|
||||||
LinkTypeUrl = 0,
|
|
||||||
LinkTypeInternal = 1,
|
|
||||||
LinkTypeNoLink = 2
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
|
|
||||||
namespace Tiger.Game.LandingView;
|
|
||||||
|
|
||||||
public class PromoArticleMap : ClassMap<PromoArticle>
|
|
||||||
{
|
|
||||||
public PromoArticleMap()
|
|
||||||
{
|
|
||||||
Table("landing_promo_articles");
|
|
||||||
Id(pa => pa.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(pa => pa.Title).Column("title").Not.Nullable();
|
|
||||||
Map(pa => pa.BodyText).Column("body_text").Not.Nullable();
|
|
||||||
Map(pa => pa.ButtonText).Column("button_text").Not.Nullable();
|
|
||||||
Map(pa => pa.LinkType).CustomType<int>().Column("link_type").Not.Nullable();
|
|
||||||
Map(pa => pa.LinkContent).Column("link_content").Not.Nullable();
|
|
||||||
Map(pa => pa.ImageUrl).Column("image_url").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
using Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Navigator;
|
|
||||||
|
|
||||||
public interface INavigatorManager
|
|
||||||
{
|
|
||||||
IDictionary<string, INavigatorView> NavigatorViews { get; }
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
using Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Navigator;
|
|
||||||
|
|
||||||
public class NavigatorManager : INavigatorManager
|
|
||||||
{
|
|
||||||
public IDictionary<string, INavigatorView> NavigatorViews { get; }
|
|
||||||
|
|
||||||
public NavigatorManager(IEnumerable<INavigatorView> navigatorViews)
|
|
||||||
{
|
|
||||||
NavigatorViews = navigatorViews.ToDictionary(n => n.Code);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
public interface INavigatorView
|
|
||||||
{
|
|
||||||
string Code { get; }
|
|
||||||
Task Compose(ServerMessage message, Habbo habbo, string query);
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
using Tiger.Game.Rooms;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
public class MyWorldView : INavigatorView
|
|
||||||
{
|
|
||||||
private readonly IRepository<Room> _roomRepository;
|
|
||||||
|
|
||||||
private const int OwnRoomsType = 0;
|
|
||||||
private const int FavoriteRoomsType = 1;
|
|
||||||
private const int GroupRoomsType = 2;
|
|
||||||
private const int VisitedRoomsType = 3;
|
|
||||||
private const int FriendRoomsType = 4;
|
|
||||||
private const int RightsRoomType = 5;
|
|
||||||
|
|
||||||
public string Code => "myworld_view";
|
|
||||||
|
|
||||||
private readonly IDictionary<string, int> _categories = new Dictionary<string, int>
|
|
||||||
{
|
|
||||||
{"My Rooms", OwnRoomsType},
|
|
||||||
{"My Favorite Rooms", FavoriteRoomsType},
|
|
||||||
{"My Groups", GroupRoomsType},
|
|
||||||
{"My Room Visit History", VisitedRoomsType},
|
|
||||||
{"My Friends' Rooms", FriendRoomsType},
|
|
||||||
{"Rooms Where I Have Rights", RightsRoomType}
|
|
||||||
};
|
|
||||||
|
|
||||||
public MyWorldView(IRepository<Room> roomRepository)
|
|
||||||
{
|
|
||||||
_roomRepository = roomRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Compose(ServerMessage message, Habbo habbo, string query)
|
|
||||||
{
|
|
||||||
message.AppendInt32(_categories.Count);
|
|
||||||
|
|
||||||
foreach (var (category, type) in _categories)
|
|
||||||
{
|
|
||||||
message.AppendString(category);
|
|
||||||
message.AppendString(category);
|
|
||||||
message.AppendInt32(0); // action?
|
|
||||||
message.AppendBoolean(false); // closed?
|
|
||||||
message.AppendInt32(0); // mode?
|
|
||||||
|
|
||||||
var rooms = await GetRoomsByType(habbo, type);
|
|
||||||
|
|
||||||
message.AppendInt32(rooms.Count);
|
|
||||||
|
|
||||||
foreach (var room in rooms)
|
|
||||||
{
|
|
||||||
room.Serialize(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<ICollection<Room>> GetRoomsByType(Habbo habbo, int type)
|
|
||||||
{
|
|
||||||
return type switch
|
|
||||||
{
|
|
||||||
OwnRoomsType => (await _roomRepository.FindByAsync(r => r.Owner == habbo)).ToList(),
|
|
||||||
_ => new Collection<Room>()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Navigator.Views;
|
|
||||||
|
|
||||||
public class OfficialView : INavigatorView
|
|
||||||
{
|
|
||||||
public string Code => "official_view";
|
|
||||||
public async Task Compose(ServerMessage message, Habbo habbo, string query)
|
|
||||||
{
|
|
||||||
message.AppendInt32(0);
|
|
||||||
await Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
namespace Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
public interface IRoomManager
|
|
||||||
{
|
|
||||||
IDictionary<int, RoomPrivateCategory> PrivateCategories { get; }
|
|
||||||
IDictionary<int, RoomModel> RoomModels { get; }
|
|
||||||
Task LoadPrivateCategoriesAsync();
|
|
||||||
Task LoadRoomModels();
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
namespace Tiger.Game.Rooms.Mapping.Tiles;
|
|
||||||
|
|
||||||
public class RoomTile
|
|
||||||
{
|
|
||||||
public int X { get; set; }
|
|
||||||
public int Y { get; set; }
|
|
||||||
public double Height { get; set; }
|
|
||||||
public RoomTileState TileState { get; set; }
|
|
||||||
|
|
||||||
public RoomTile(int x, int y, double height, RoomTileState tileState)
|
|
||||||
{
|
|
||||||
X = x;
|
|
||||||
Y = y;
|
|
||||||
Height = height;
|
|
||||||
TileState = tileState;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
namespace Tiger.Game.Rooms.Mapping.Tiles;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Empty and Unavailable can be set in both the RoomTile and RoomPoint.
|
|
||||||
/// RoomTile belongs to the Model (the tile is either unavailable or empty)
|
|
||||||
/// RoomPoint belongs to the Grid (the tile has multiple states based on once actors and items are added)
|
|
||||||
/// </summary>
|
|
||||||
public enum RoomTileState
|
|
||||||
{
|
|
||||||
Empty,
|
|
||||||
Unavailable,
|
|
||||||
HasWalkableStackableItem,
|
|
||||||
WalkBlockedByItem,
|
|
||||||
StackBlockedByItem,
|
|
||||||
TileLockedByItem,
|
|
||||||
BlockedByUser
|
|
||||||
}
|
|
|
@ -1,131 +0,0 @@
|
||||||
using Tiger.Communication.Messages.Types;
|
|
||||||
using Tiger.Game.Habbos;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
public class Room
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Name { get; set; } = null!;
|
|
||||||
public virtual string Description { get; set; } = null!;
|
|
||||||
public virtual int ModelId { get; set; }
|
|
||||||
public virtual string Password { get; set; } = null!;
|
|
||||||
public virtual string State { get; set; } = null!;
|
|
||||||
public virtual int UsersIn { get; set; }
|
|
||||||
public virtual int UsersMax { get; set; }
|
|
||||||
public virtual int Score { get; set; }
|
|
||||||
public virtual string Floor { get; set; } = null!;
|
|
||||||
public virtual string Wallpaper { get; set; } = null!;
|
|
||||||
public virtual string Landscape { get; set; } = null!;
|
|
||||||
public virtual int WallThickness { get; set; }
|
|
||||||
public virtual int WallHeight { get; set; }
|
|
||||||
public virtual int FloorThickness { get; set; }
|
|
||||||
public virtual string MoodlightData { get; set; } = null!;
|
|
||||||
public virtual IList<string> Tags { get; set; } = new List<string>();
|
|
||||||
public virtual bool IsPublic { get; set; }
|
|
||||||
public virtual bool IsStaffPicked { get; set; }
|
|
||||||
public virtual bool AllowOtherPets { get; set; }
|
|
||||||
public virtual bool AllowOtherPetsEat { get; set; }
|
|
||||||
public virtual bool AllowWalkthrough { get; set; }
|
|
||||||
public virtual bool HideWalls { get; set; }
|
|
||||||
public virtual int ChatMode { get; set; }
|
|
||||||
public virtual int ChatWeight { get; set; }
|
|
||||||
public virtual int ChatSpeed { get; set; }
|
|
||||||
public virtual int ChatHearingDistance { get; set; }
|
|
||||||
public virtual int ChatProtection { get; set; }
|
|
||||||
public virtual bool OverrideModel { get; set; }
|
|
||||||
public virtual int WhoCanMute { get; set; }
|
|
||||||
public virtual int WhoCanKick { get; set; }
|
|
||||||
public virtual int WhoCanBan { get; set; }
|
|
||||||
public virtual int RollerSpeed { get; set; }
|
|
||||||
public virtual bool Promoted { get; set; }
|
|
||||||
public virtual int TradeMode { get; set; }
|
|
||||||
public virtual bool MoveDiagonally { get; set; }
|
|
||||||
public virtual bool JukeboxActive { get; set; }
|
|
||||||
public virtual bool HideWired { get; set; }
|
|
||||||
public virtual bool IsForSale { get; set; }
|
|
||||||
public virtual Habbo? Owner { get; set; }
|
|
||||||
public virtual RoomPrivateCategory Category { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual int StateNumber => State switch
|
|
||||||
{
|
|
||||||
"locked" => 1,
|
|
||||||
"password" => 2,
|
|
||||||
"invisible" => 3,
|
|
||||||
_ => 0
|
|
||||||
};
|
|
||||||
|
|
||||||
public virtual int Base
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var @base = 0;
|
|
||||||
|
|
||||||
// if (Guild != null)
|
|
||||||
// {
|
|
||||||
// @base += 2;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (Promoted)
|
|
||||||
// {
|
|
||||||
// @base += 4;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!IsPublic)
|
|
||||||
{
|
|
||||||
@base += 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsPublic && AllowOtherPets)
|
|
||||||
{
|
|
||||||
@base += 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
return @base;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Serialize(ServerMessage response)
|
|
||||||
{
|
|
||||||
response.AppendInt32(Id);
|
|
||||||
response.AppendString(Name);
|
|
||||||
|
|
||||||
if (IsPublic)
|
|
||||||
{
|
|
||||||
response.AppendInt32(0);
|
|
||||||
response.AppendString(string.Empty);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
response.AppendInt32(Owner?.Id ?? 0);
|
|
||||||
response.AppendString(Owner?.Username ?? string.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
response.AppendInt32(StateNumber);
|
|
||||||
response.AppendInt32(UsersIn);
|
|
||||||
response.AppendInt32(UsersMax);
|
|
||||||
response.AppendString(Description);
|
|
||||||
response.AppendInt32(0);
|
|
||||||
response.AppendInt32(Score);
|
|
||||||
response.AppendInt32(0);
|
|
||||||
response.AppendInt32(Category.Id);
|
|
||||||
|
|
||||||
response.AppendInt32(Tags.Count);
|
|
||||||
|
|
||||||
foreach (var tag in Tags)
|
|
||||||
{
|
|
||||||
response.AppendString(tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
response.AppendInt32(Base);
|
|
||||||
|
|
||||||
// if (Guild != null)
|
|
||||||
// {
|
|
||||||
// response.AppendInt32(Guild.Id);
|
|
||||||
// response.WriteString(Guild.Name);
|
|
||||||
// response.WriteString(Guild.Badge);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// TODO: Promotion
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
public class RoomManager : IRoomManager
|
|
||||||
{
|
|
||||||
private readonly IRepository<RoomPrivateCategory> _roomPrivateCategoryRepository;
|
|
||||||
private readonly IRepository<RoomModel> _roomModelRepository;
|
|
||||||
private readonly ILogger<IRoomManager> _logger;
|
|
||||||
|
|
||||||
public IDictionary<int, RoomPrivateCategory> PrivateCategories { get; private set; }
|
|
||||||
public IDictionary<int, RoomModel> RoomModels { get; private set; }
|
|
||||||
|
|
||||||
public RoomManager(IRepository<RoomPrivateCategory> roomPrivateCategoryRepository,
|
|
||||||
IRepository<RoomModel> roomModelRepository, ILogger<IRoomManager> logger)
|
|
||||||
{
|
|
||||||
_roomPrivateCategoryRepository = roomPrivateCategoryRepository;
|
|
||||||
_roomModelRepository = roomModelRepository;
|
|
||||||
_logger = logger;
|
|
||||||
|
|
||||||
PrivateCategories = new Dictionary<int, RoomPrivateCategory>();
|
|
||||||
RoomModels = new Dictionary<int, RoomModel>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task LoadPrivateCategoriesAsync()
|
|
||||||
{
|
|
||||||
PrivateCategories =
|
|
||||||
(await _roomPrivateCategoryRepository.FindByAsync()).ToDictionary(rpc => rpc.Id);
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded {Count} private room categories", PrivateCategories.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task LoadRoomModels()
|
|
||||||
{
|
|
||||||
RoomModels = (await _roomModelRepository.FindByAsync()).ToDictionary(rpc => rpc.Id);
|
|
||||||
|
|
||||||
foreach (var model in RoomModels.Values)
|
|
||||||
{
|
|
||||||
model.Parse();
|
|
||||||
}
|
|
||||||
|
|
||||||
_logger.LogInformation("Loaded and parsed {Count} room models", RoomModels.Count);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
using FluentNHibernate.Mapping;
|
|
||||||
using Tiger.Storage;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
public class RoomMap : ClassMap<Room>
|
|
||||||
{
|
|
||||||
public RoomMap()
|
|
||||||
{
|
|
||||||
Table("rooms");
|
|
||||||
Id(x => x.Id).Column("id").GeneratedBy.Identity();
|
|
||||||
Map(x => x.Name).Column("name").Not.Nullable();
|
|
||||||
Map(x => x.Description).Column("description").Not.Nullable();
|
|
||||||
Map(x => x.ModelId).Column("model_id").Not.Nullable();
|
|
||||||
Map(x => x.Password).Column("password").Nullable();
|
|
||||||
Map(x => x.State).Column("state").Not.Nullable();
|
|
||||||
Map(x => x.UsersIn).Column("users_in").Not.Nullable();
|
|
||||||
Map(x => x.UsersMax).Column("users_max").Not.Nullable();
|
|
||||||
Map(x => x.Score).Column("score").Not.Nullable();
|
|
||||||
Map(x => x.Floor).Column("floor").Not.Nullable();
|
|
||||||
Map(x => x.Wallpaper).Column("wallpaper").Not.Nullable();
|
|
||||||
Map(x => x.Landscape).Column("landscape").Not.Nullable();
|
|
||||||
Map(x => x.WallThickness).Column("wall_thickness").Not.Nullable();
|
|
||||||
Map(x => x.WallHeight).Column("wall_height").Not.Nullable();
|
|
||||||
Map(x => x.FloorThickness).Column("floor_thickness").Not.Nullable();
|
|
||||||
Map(x => x.MoodlightData).Column("moodlight_data").Nullable();
|
|
||||||
Map(x => x.Tags).Column("tags").CustomType<StringListTypeConverter>().Nullable();
|
|
||||||
Map(x => x.IsPublic).Column("is_public").Not.Nullable();
|
|
||||||
Map(x => x.IsStaffPicked).Column("is_staff_picked").Not.Nullable();
|
|
||||||
Map(x => x.AllowOtherPets).Column("allow_other_pets").Not.Nullable();
|
|
||||||
Map(x => x.AllowOtherPetsEat).Column("allow_other_pets_eat").Not.Nullable();
|
|
||||||
Map(x => x.AllowWalkthrough).Column("allow_walkthrough").Not.Nullable();
|
|
||||||
Map(x => x.HideWalls).Column("hide_walls").Not.Nullable();
|
|
||||||
Map(x => x.ChatMode).Column("chat_mode").Not.Nullable();
|
|
||||||
Map(x => x.ChatWeight).Column("chat_weight").Not.Nullable();
|
|
||||||
Map(x => x.ChatSpeed).Column("chat_speed").Not.Nullable();
|
|
||||||
Map(x => x.ChatHearingDistance).Column("chat_hearing_distance").Not.Nullable();
|
|
||||||
Map(x => x.ChatProtection).Column("chat_protection").Not.Nullable();
|
|
||||||
Map(x => x.OverrideModel).Column("override_model").Not.Nullable();
|
|
||||||
Map(x => x.WhoCanMute).Column("who_can_mute").Not.Nullable();
|
|
||||||
Map(x => x.WhoCanKick).Column("who_can_kick").Not.Nullable();
|
|
||||||
Map(x => x.WhoCanBan).Column("who_can_ban").Not.Nullable();
|
|
||||||
Map(x => x.RollerSpeed).Column("roller_speed").Not.Nullable();
|
|
||||||
Map(x => x.Promoted).Column("promoted").Not.Nullable();
|
|
||||||
Map(x => x.TradeMode).Column("trade_mode").Not.Nullable();
|
|
||||||
Map(x => x.MoveDiagonally).Column("move_diagonally").Not.Nullable();
|
|
||||||
Map(x => x.JukeboxActive).Column("jukebox_active").Not.Nullable();
|
|
||||||
Map(x => x.HideWired).Column("hide_wired").Not.Nullable();
|
|
||||||
Map(x => x.IsForSale).Column("is_for_sale").Not.Nullable();
|
|
||||||
References(x => x.Owner).Column("owner_id").Nullable();
|
|
||||||
References(x => x.Category).Column("category_id").Not.Nullable();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
using Tiger.Game.Rooms.Mapping.Tiles;
|
|
||||||
|
|
||||||
namespace Tiger.Game.Rooms;
|
|
||||||
|
|
||||||
public class RoomModel
|
|
||||||
{
|
|
||||||
public virtual int Id { get; set; }
|
|
||||||
public virtual string Name { get; set; } = null!;
|
|
||||||
public virtual int DoorX { get; set; }
|
|
||||||
public virtual int DoorY { get; set; }
|
|
||||||
public virtual int DoorDirection { get; set; }
|
|
||||||
public virtual string Heightmap { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual (int X, int Y) MapSize { get; set; }
|
|
||||||
|
|
||||||
public virtual RoomTile[,] RoomTiles { get; set; }
|
|
||||||
|
|
||||||
public virtual void Parse()
|
|
||||||
{
|
|
||||||
var raw = Heightmap.Replace("\r\n", "\r").Split('\r');
|
|
||||||
|
|
||||||
MapSize = (raw[0].Length, raw.Length);
|
|
||||||
|
|
||||||
RoomTiles = new RoomTile[MapSize.X, MapSize.Y];
|
|
||||||
|
|
||||||
for (var y = 0; y < MapSize.Y; y++)
|
|
||||||
{
|
|
||||||
for (var x = 0; x < MapSize.X; x++)
|
|
||||||
{
|
|
||||||
if (double.TryParse(raw[y][x].ToString(), out var height))
|
|
||||||
{
|
|
||||||
RoomTiles[x, y] = new RoomTile(x, y, height, RoomTileState.Empty);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RoomTiles[x, y] = new RoomTile(x, y, 0, RoomTileState.Unavailable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue