public void GetResponse(Response Response) { Response.AppendRawInt32(GetRoom().OwnerId); Response.AppendChar(2); Response.AppendRawInt32(RoomId); Response.AppendChar(2); Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(GetRoom().OwnerId)); Response.AppendInt32(CategoryId); Response.AppendStringWithBreak(Name); Response.AppendStringWithBreak(Description); Response.AppendStringWithBreak(Started.ToShortTimeString()); Response.AppendInt32(Tags.Count); Tags.ToList().ForEach(Response.AppendStringWithBreak); }
public Response GetButtonData() { Response Response = new Response(126); Response.AppendBoolean(true); Response.AppendBoolean(false); Response.AppendBoolean(false); Response.AppendInt32(-1); Response.AppendChar(2); Response.AppendInt32(GetButtonTreeAmount(-1)); var SortedFirst = from pag in PagesForTree(-1) orderby pag.OrderId ascending select pag; foreach (ShopPage Page in SortedFirst) { Page.GetButtonData(Response); var SortedLast = from pag in PagesForTree(Page.Id) orderby pag.OrderId ascending select pag; foreach (ShopPage TreePage in SortedLast) { TreePage.GetButtonData(Response); } } return Response; }
public void Drop() { Response EndResponse = new Response(370); EndResponse.AppendRawInt32(-1); EndResponse.AppendChar(2); GetRoom().GetRoomEngine().BroadcastResponse(EndResponse); GetRoom().Event = null; BrickEngine.GetProgressReactor().GetCollector().Finialize(this); }
public void GetResponse(Response Response, int UserId) { Response.AppendInt32(-1); Response.AppendInt32(BrickEngine.GetStreamHandler().GetPrimairStreamIndexer(StreamType)); Response.AppendRawInt32(HabboId); Response.AppendChar(2); Response.AppendStringWithBreak(GetUsername()); Response.AppendStringWithBreak(GetGender().ToLower()); if (StreamType.Equals(StreamType.AchievedAchievement)) { Response.AppendStringWithBreak("http://www.habbo.com/habbo-imaging/badge/" + AchievedItem.ToString() + ".png"); } else { Response.AppendStringWithBreak(BrickEngine.GetConfigureFile().CallStringKey("site.link") + "/habbo-imaging/avatar/" + GetLook() + ".gif"); } Response.AppendInt32(BrickEngine.GetConvertor().ObjectToInt32(RunningTime.TotalMinutes)); if (StreamType.Equals(StreamType.MadeFriends)) { Response.AppendInt32(BrickEngine.GetStreamHandler().GetFriendState(UserId, AchievedItemId)); } else { Response.AppendInt32(BrickEngine.GetStreamHandler().GetSecondairStreamIndexer(StreamType)); } Response.AppendBoolean(true); Response.AppendBoolean(true); if (StreamType.Equals(StreamType.RatedRoom) || StreamType.Equals(StreamType.MadeFriends)) { Response.AppendRawInt32(AchievedItemId); Response.AppendChar(2); if (StreamType.Equals(StreamType.MadeFriends)) { Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(AchievedItemId)); } else { Response.AppendStringWithBreak(AchievedItem.ToString()); } } else { Response.AppendStringWithBreak(AchievedItem.ToString()); } }
public void GetResponse(Client Client, Response Response) { var AchievedQuests = Client.GetUser().Quests; var CategoryQuests = BrickEngine.GetQuestReactor().OrderQuestsForCategory(Id); Response.AppendStringWithBreak(Name.ToLower()); if (!AchievedQuests.ContainsKey(Id)) { Response.AppendInt32(0); } else { Response.AppendInt32(AchievedQuests[Id]); } Response.AppendInt32(CategoryQuests.Count); Response.AppendInt32(0); // Pixels Type - Reward if (AchievedCategory(Client) || BrickEngine.GetQuestReactor().GetQuestForCategory(Client, Id) == null) { Response.AppendInt32(0); Response.AppendBoolean(false); Response.AppendChar(2); Response.AppendChar(2); Response.AppendInt32(0); Response.AppendChar(2); Response.AppendInt32(0); Response.AppendInt32(0); } else { BrickEngine.GetQuestReactor().GetQuestForCategory(Client, Id).GetResponse(Client, Response); } Response.AppendBoolean(false); }
public void GetExternalResponse(Response Response) { Response.AppendInt32(Id); Response.AppendStringWithBreak(GetBaseItem().InternalName); Response.AppendBoolean(true); Response.AppendBoolean(false); Response.AppendBoolean(false); Response.AppendBoolean(true); Response.AppendStringWithBreak(GetBaseItem().InternalType.ToLower()); Response.AppendInt32(GetBaseItem().SpriteId); Response.AppendChar(2); Response.AppendBoolean(true); Response.AppendInt32(-1); Response.AppendInt32((MemberType == Items.MemberType.VIP) ? 2 : 1); }
public Response GetFavoriteRooms(Client Client) { Response Response = new Response(451); Response.AppendInt32(6); Response.AppendChar(2); var List = BrickEngine.GetRoomReactor().GetFavoriteRooms(Client); Response.AppendInt32(List.Count); foreach (VirtualRoom Room in List) { Room.GetNavigatorResponse(Response, false); } return Response; }
public Response GetEventRoomsResponse(int Category) { Response Response = new Response(451); Response.AppendInt32(12); Response.AppendRawInt32(Category); Response.AppendChar(2); var List = BrickEngine.GetRoomReactor().GetEventRooms(Category); Response.AppendInt32(List.Count); foreach (VirtualRoom Room in List) { Room.GetNavigatorResponse(Response, true); } return Response; }
public Response GetPurchaseResponse() { Response Response = new Response(67); Response.AppendInt32(BaseId); Response.AppendStringWithBreak(GetBaseItem().InternalName); Response.AppendInt32(0); Response.AppendInt32(0); Response.AppendInt32(0); Response.AppendInt32(1); Response.AppendStringWithBreak(GetBaseItem().InternalType.ToLower()); Response.AppendInt32(GetBaseItem().SpriteId); Response.AppendChar(2); Response.AppendInt32(1); Response.AppendInt32(-1); Response.AppendInt32(0); Response.AppendChar(2); return Response; }
public void GetOwnResponse(Response Response) { int ItemState = State; if (Expired) { ItemState = 3; } Response.AppendInt32(Id); Response.AppendInt32(ItemState); Response.AppendInt32(GetBaseItem().InternalType.ToLower().Equals("s") ? 1 : 2); Response.AppendInt32(GetBaseItem().SpriteId); Response.AppendChar(2); Response.AppendInt32(CreditsRequestTot); Response.AppendInt32(MinutesLeft); Response.AppendInt32(GetBaseItem().SpriteId); }
public void HandleIncomingItemPickUp(Item Item, VirtualRoomUser User) { // Handling Messages (FIRST, to avoid laggys) Response Response = new Response(); if (Item.GetBaseItem().InternalType.ToLower().Equals("s")) { Response.Initialize(94); } else { Response.Initialize(84); } Response.AppendRawInt32(Item.Id); Response.AppendChar(2); Response.AppendBoolean(false); BroadcastResponse(Response); Item.GetTrigger().OnRemove(Item, User); if (Item.GetBaseItem().ExternalType.ToLower().Equals("default")) { Item.ExtraData = "0"; // Update Info & MySQL using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("UPDATE items SET room_id = '0', extra_data = '0',point_wall = '' WHERE id = @itemid LIMIT 1"); Reactor.AddParam("itemid", Item.Id); Reactor.ExcuteQuery(); } } else { // Update Info & MySQL using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("UPDATE items SET room_id = '0', point_wall = '' WHERE id = @itemid LIMIT 1"); Reactor.AddParam("itemid", Item.Id); Reactor.ExcuteQuery(); } } }
public void GetSecondairResponse(Client Client) { Response PasteLink = new Response(166); PasteLink.AppendStringWithBreak("/client/private/" + Id + "/id"); Client.SendResponse(PasteLink); Response ModelParams = new Response(69); ModelParams.AppendStringWithBreak(ModelParam.ToLower()); ModelParams.AppendInt32(Id); Client.SendResponse(ModelParams); Response Environment = new Response(); if (!Wallpaper.Equals("0.0")) { Environment.Initialize(46); Environment.AppendStringWithBreak("wallpaper"); Environment.AppendStringWithBreak(Wallpaper); } if (!Floor.Equals("0.0")) { Environment.Initialize(46); Environment.AppendStringWithBreak("floor"); Environment.AppendStringWithBreak(Floor); } Environment.Initialize(46); Environment.AppendStringWithBreak("landscape"); Environment.AppendStringWithBreak(Landscape); Environment.Initialize(345); if (GetRoomEngine().HasRights(Client.GetUser().HabboId, RightsType.Founder) || Client.GetUser().VotedRooms.Contains(Id)) { Environment.AppendInt32(Rating); } else { Environment.AppendInt32(-1); } Environment.Initialize(370); if (Event != null) { Event.GetResponse(Environment); } else { Environment.AppendRawInt32(-1); Environment.AppendChar(2); } Client.SendResponse(Environment); }
public Response GetPrivateResponse() { Response Response = new Response(221); Response.AppendInt32(PrivateCategorys.Count); var Sorted = (from cat in PrivateCategorys.Values.ToList() orderby cat.Id ascending select cat).ToList(); foreach (PrivateCategory Category in Sorted) { if (Category.Id > 0) { Response.AppendBoolean(true); } Response.AppendInt32(Category.Id); Response.AppendStringWithBreak(Category.Name); } Response.AppendChar(2); return Response; }
public void GiveRespect() { Respect++; if (IsInRoom) { Response Response = new Response(606); Response.AppendInt32(Respect); Response.AppendInt32(UserId); Response.AppendInt32(Id); Response.AppendStringWithBreak(Name); Response.AppendBoolean(false); Response.AppendInt32(10); Response.AppendBoolean(false); Response.AppendInt32(-2); Response.AppendBoolean(true); Response.AppendChar(2); GetRoom().GetRoomEngine().BroadcastResponse(Response); } GiveExpirience(10); using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("UPDATE user_pets SET respect = respect + 1 WHERE id = @petid LIMIT 1"); Reactor.AddParam("petid", Id); Reactor.ExcuteQuery(); } }
public Response GetPurchaseResponse(Boolean SpecialItem) { Response Response = new Response(67); GetResponse(Response, SpecialItem); Response.AppendChar(2); return Response; }
public Response GetStatusMessage(int TargetId, UserCache Cache, Boolean CameOnline) { Response Response = new Response(13); var Groups = GetGroups(TargetId); Response.AppendInt32(Groups.Count); foreach (FriendGroup Group in Groups) { Response.AppendInt32(Group.Id); Response.AppendStringWithBreak(Group.Name); } Response.AppendInt32(1); Response.AppendBoolean(false); Response.AppendInt32(Cache.HabboId); Response.AppendStringWithBreak(Cache.Username); Response.AppendBoolean(true); Response.AppendBoolean(CameOnline); Response.AppendBoolean(CameOnline ? Cache.IsInRoom && Cache.EnableFollow : false); Response.AppendStringWithBreak(CameOnline ? Cache.Look : string.Empty); Response.AppendInt32(GetCategoryForFriendId(TargetId, Cache.HabboId)); Response.AppendStringWithBreak(CameOnline ? BrickEngine.GetUserReactor().GetMotto(Cache.HabboId) : string.Empty); Response.AppendStringWithBreak(CameOnline ? string.Empty : BrickEngine.GetUserReactor().GetLastVisit(Cache.HabboId)); Response.AppendChar(2); Response.AppendChar(2); return Response; }
public void GetSearchForHabboId(int HabboId, Response Response, int SearcherId) { if (HasFriend(SearcherId, HabboId)) { GetFriend(SearcherId, HabboId).GetSearchResponse(Response); } else { Boolean Online = BrickEngine.GetUserReactor().IsOnline(HabboId); Response.AppendInt32(HabboId); Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(HabboId)); Response.AppendStringWithBreak(Online ? BrickEngine.GetUserReactor().GetMotto(HabboId) : string.Empty); Response.AppendBoolean(Online ? BrickEngine.GetSocketShield().GetSocketClientByHabboId(HabboId).GetClient().GetUser().IsInRoom : false); Response.AppendBoolean(Online); Response.AppendChar(2); Response.AppendBoolean(false); Response.AppendStringWithBreak(Online ? BrickEngine.GetUserReactor().GetLook(HabboId) : string.Empty); Response.AppendStringWithBreak(Online ? string.Empty : BrickEngine.GetUserReactor().GetLastVisit(HabboId)); Response.AppendChar(2); } }
public Response GetAchievedResponse(int HabboId, Boolean Achievement, string Info) { Response Response = new Response(833); Response.AppendRawInt32(HabboId); Response.AppendChar(2); Response.AppendBoolean(Achievement); Response.AppendStringWithBreak(Info); return Response; }
public Response GetTriggerResponse() { Response Response = new Response(); if (GetBaseItem().InternalType.ToLower().Equals("s")) { Response.Initialize(88); Response.AppendRawInt32(Id); Response.AppendChar(2); Response.AppendStringWithBreak(ExtraData); } else { Response.Initialize(85); GetRoomResponse(Response); } return Response; }
public void GetRoomResponse(Response Response) { if (GetBaseItem().InternalType.ToLower().Equals("s")) { Response.AppendInt32(Id); } else { Response.AppendRawInt32(Id); Response.AppendChar(2); } Response.AppendInt32(GetBaseItem().SpriteId); if (GetBaseItem().InternalType.ToLower().Equals("s")) { Response.AppendInt32(Point.X); Response.AppendInt32(Point.Y); Response.AppendInt32(Rotation); Response.AppendStringWithBreak(Point.Z.ToString().Replace(',', '.')); Response.AppendBoolean(false); } else { Response.AppendStringWithBreak(WallPoint); } Response.AppendStringWithBreak(ExtraData); // if Sticky (split(' ')); if (GetBaseItem().InternalType.ToLower().Equals("s")) { Response.AppendInt32(-1); } Response.AppendBoolean(false); // Enable Button (Use); }
public void GetInventoryResponse(Response Response) { Response.AppendInt32(Id); Response.AppendStringWithBreak(GetBaseItem().InternalType.ToUpper()); Response.AppendInt32(Id); Response.AppendInt32(GetBaseItem().SpriteId); if (GetBaseItem().InternalName.ToLower().Contains("a2") || GetBaseItem().InternalName.ToLower().Contains("floor")) { Response.AppendInt32(3); } else if (GetBaseItem().InternalName.ToLower().Contains("wallpaper")) { Response.AppendInt32(2); } else if (GetBaseItem().InternalName.ToLower().Contains("landscape")) { Response.AppendInt32(4); } else if (!GetBaseItem().InternalType.ToLower().Equals("s")) { Response.AppendInt32(0); } else { Response.AppendInt32(1); } Response.AppendStringWithBreak(ExtraData); Response.AppendBoolean(GetBaseItem().EnableRecycle); Response.AppendBoolean(GetBaseItem().EnableTrade); Response.AppendBoolean(GetBaseItem().EnableInterventoryStack); Response.AppendBoolean(GetBaseItem().EnableAuction); Response.AppendInt32(-1); if (GetBaseItem().InternalType.ToLower().Equals("s")) { Response.AppendChar(2); Response.AppendInt32(0); } }
public void GetResponse(Response Response) { Response.AppendInt32(Id); Response.AppendInt32(State); Response.AppendInt32(GetBaseItem().InternalType.ToLower().Equals("s") ? 1 : 2); Response.AppendInt32(GetBaseItem().SpriteId); Response.AppendChar(2); Response.AppendInt32(CreditsRequestTot); Response.AppendInt32(GetBaseItem().SpriteId); Response.AppendInt32(BrickEngine.GetMarketplaceReactor().GetCreditsRequestAverageForSpriteId(GetBaseItem().SpriteId)); Response.AppendInt32(TotOfferCount); }
public void GetSerializeResponse(int CategoryId, Response Response) { Response.AppendInt32(HabboId); Response.AppendStringWithBreak(Username); Response.AppendBoolean(true); Response.AppendBoolean(IsAlive); Response.AppendBoolean(InRoom); Response.AppendStringWithBreak(Look); Response.AppendInt32(CategoryId); Response.AppendStringWithBreak(Motto); Response.AppendStringWithBreak(LastVisit); Response.AppendChar(2); Response.AppendChar(2); }
public void GetResponse(Response Response) { Response.AppendInt32(HabboId); if (!IsPet) { Response.AppendStringWithBreak(GetClient().GetUser().Username); Response.AppendStringWithBreak(GetClient().GetUser().Motto); Response.AppendStringWithBreak(GetClient().GetUser().Look); } else { PetInfo Info = BrickEngine.GetPetReactor().GetPetInfo(HabboId); Response.AppendStringWithBreak(Info.Name); Response.AppendChar(2); Response.AppendStringWithBreak(Info.GetLook); } Response.AppendInt32(VirtualId); Response.AppendInt32(Point.X); Response.AppendInt32(Point.Y); Response.AppendStringWithBreak(Point.Z.ToString().Replace(",", ".")); if (!IsPet) { Response.AppendInt32(2); Response.AppendInt32(1); Response.AppendStringWithBreak(GetClient().GetUser().Gender.ToLower()); Response.AppendInt32(-1); Response.AppendInt32(-1); Response.AppendInt32(-1); Response.AppendChar(2); Response.AppendInt32(GetClient().GetUser().AchievementScore); } else { Response.AppendInt32(4); Response.AppendInt32(2); Response.AppendInt32(11); } }
public Response GetResponseForUser(Client Client) { Response Response = new Response(451); Response.AppendInt32(4); Response.AppendChar(2); var List = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).ToList(); Response.AppendInt32(List.Count); foreach (VirtualRoom Room in List) { Room.GetNavigatorResponse(Response, false); } return Response; }
private void AboutMessage(Client Client, List<string> Params) { Response Response = new Response(808); Response.AppendStringWithBreak("BrickEmulator [C#]"); Response.AppendStringWithBreak("This hotel is proudly powered by BrickEmulator, the advanced Habbo Hotel emulator."); Response.AppendChar(10); Response.AppendChar(10); Response.AppendStringWithBreak("http://forum.ragezone.com/f331/brickemulator-c-pooling-sockets-scratch-770243/"); Client.SendResponse(Response); }
public void GetNavigatorResponse(Response Response, Boolean AllowEvents) { Response.AppendInt32(Id); Response.AppendBoolean(AllowEvents); Response.AppendStringWithBreak((AllowEvents) ? Event.Name : Name); Response.AppendStringWithBreak(BrickEngine.GetUserReactor().GetUsername(OwnerId)); Response.AppendInt32(DoorState); Response.AppendInt32(RoomUserAmount); Response.AppendInt32(LimitUsers); Response.AppendStringWithBreak((AllowEvents) ? Event.Description : Description); Response.AppendBoolean(false); Response.AppendBoolean(BrickEngine.GetNavigatorManager().GetPrivateCategory(CategoryId).EnableTrading); Response.AppendInt32(Rating); Response.AppendInt32((AllowEvents) ? Event.CategoryId : CategoryId); if (AllowEvents) { Response.AppendString(Event.Started.ToShortTimeString()); } Response.AppendChar(2); Response.AppendInt32((AllowEvents) ? Event.Tags.Count : Tags.Count); if (AllowEvents) { Event.Tags.ToList().ForEach(Response.AppendStringWithBreak); } else { Tags.ToList().ForEach(Response.AppendStringWithBreak); } Icon.GetResponse(Response); Response.AppendBoolean(true); Response.AppendBoolean(false); }
public Response GetResponse(Client Client) { Response Response = new Response(436); Response.AppendInt32(CoupledAchievements); var SortedCategorys = (from Cat in AchievementsCategorys.Values.ToList() orderby Cat.OrderId ascending select Cat).ToList(); foreach (AchievementCategory Category in SortedCategorys) { var SortedAchievements = (from Ach in GetAchievementsForCategory(Category.Id) orderby Ach.OrderId ascending select Ach).ToList(); foreach (Achievement Achievement in SortedAchievements) { Achievement.GetResponse(Response, Client); } } Response.AppendChar(2); return Response; }
public void GetUserParams(Client Client, Request Request) { Response Response = new Response(5); Response.AppendRawInt32(Client.GetUser().HabboId); Response.AppendChar(2); Response.AppendStringWithBreak(Client.GetUser().Username); Response.AppendStringWithBreak(Client.GetUser().Look); Response.AppendStringWithBreak(Client.GetUser().Gender.ToUpper()); Response.AppendStringWithBreak(Client.GetUser().Motto); Response.AppendStringWithBreak(""); Response.AppendBoolean(true); Response.AppendInt32(Client.GetUser().RespectGained); Response.AppendInt32(Client.GetUser().RespectLeft); Response.AppendInt32(Client.GetUser().RespectLeftPets); Response.AppendBoolean(Client.GetUser().EnabledFriendStream); // StartFriendStreamAuto <3 Client.SendResponse(Response); }
public void HandleIncomingItemPickUp(Item Item, iPoint OldPlace, iPoint NewPlace, int OldRotation, int Rotation, VirtualRoomUser User) { // Handling Messages (FIRST, to avoid laggys) Response Response = new Response(); if (Item.GetBaseItem().InternalType.ToLower().Equals("s")) { Response.Initialize(94); } else { Response.Initialize(84); } Response.AppendRawInt32(Item.Id); Response.AppendChar(2); Response.AppendBoolean(false); BroadcastResponse(Response); GenerateMatrix(); UpdateUsersOnPoint(OldPlace); foreach (iPoint Point in BrickEngine.GetItemReactor().GetAffectedPoints(OldPlace, Item.GetBaseItem().LengthY, Item.GetBaseItem().LengthX, OldRotation)) { UpdateUsersOnPoint(Point); } Item.GetTrigger().OnRemove(Item, User); if (Item.GetBaseItem().ExternalType.ToLower().Equals("default")) { Item.ExtraData = "0"; // Update Info & MySQL using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("UPDATE items SET room_id = '0', extra_data = '0', point_x = @x, point_y = @y, point_z = @z, rotation = @rot WHERE id = @itemid LIMIT 1"); Reactor.AddParam("itemid", Item.Id); Reactor.AddParam("x", NewPlace.X); Reactor.AddParam("y", NewPlace.Y); Reactor.AddParam("z", NewPlace.Z.ToString().Replace(',', '.')); Reactor.AddParam("rot", Rotation); Reactor.ExcuteQuery(); } } else { // Update Info & MySQL using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("UPDATE items SET room_id = '0', point_x = @x, point_y = @y, point_z = @z, rotation = @rot WHERE id = @itemid LIMIT 1"); Reactor.AddParam("itemid", Item.Id); Reactor.AddParam("x", NewPlace.X); Reactor.AddParam("y", NewPlace.Y); Reactor.AddParam("z", NewPlace.Z.ToString().Replace(',', '.')); Reactor.AddParam("rot", Rotation); Reactor.ExcuteQuery(); } } }