Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Group Forums
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Ghost" data-source="post: 415084" data-attributes="member: 18103"><p>\Communication\Packets\Incoming\Groups\GetForumsListDataEvent.cs</p><p>[CODE]</p><p>using Plus.Communication.Packets.Outgoing;</p><p>using Plus.Communication.Packets.Outgoing.Groups;</p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.HabboHotel.Groups.Forums;</p><p>using System;</p><p>using Plus.Database.Interfaces;</p><p>using System.Collections.Generic;</p><p>using System.Data;</p><p></p><p>namespace Plus.Communication.Packets.Incoming.Groups</p><p>{</p><p> class GetForumsListDataEvent : IPacketEvent</p><p> {</p><p> public void Parse(GameClient Session, ClientPacket Packet)</p><p> {</p><p> var int1 = Packet.PopInt();</p><p> var int2 = Packet.PopInt();</p><p> int int3 = Packet.PopInt();</p><p></p><p> var forums = new List<GroupForum>();</p><p> DataTable table;</p><p></p><p> switch (int1)</p><p> {</p><p> case 2:</p><p> var Forums = PlusEnvironment.GetGame().GetGroupForumManager().GetForumsByUserId(Session.GetHabbo().Id);</p><p></p><p> if (Forums.Count - 1 >= int2)</p><p> {</p><p> Forums = Forums.GetRange(int2, Math.Min(int3, Forums.Count));</p><p> }</p><p></p><p> Session.SendPacket(new ForumsListDataComposer(Forums, Session, int1, int2, int3));</p><p> return;</p><p></p><p> case 0:</p><p> using (IQueryAdapter adap = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> adap.SetQuery("SELECT g.id FROM groups as g INNER JOIN group_forums_thread_posts as posts, group_forums_threads as threads WHERE posts.thread_id = threads.id AND @now - posts.`timestamp`<= @Sdays AND threads.forum_id = g.id GROUP BY g.id ORDER BY posts.`timestamp` DESC LIMIT @Index, @LiMiT");</p><p> adap.AddParameter("limit", int3);</p><p> adap.AddParameter("index", int2);</p><p> adap.AddParameter("now", (int)PlusEnvironment.GetUnixTimestamp());</p><p> adap.AddParameter("sdays", (60 * 60 * 24 * 7));</p><p> table = adap.GetTable();</p><p> }</p><p></p><p> foreach (DataRow Row in table.Rows)</p><p> {</p><p> GroupForum forum;</p><p> if (PlusEnvironment.GetGame().GetGroupForumManager().TryGetForum(Convert.ToInt32(Row["id"]), out forum))</p><p> forums.Add(forum);</p><p> }</p><p></p><p> break;</p><p></p><p> case 1:</p><p> using (IQueryAdapter adap = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> adap.SetQuery("SELECT g.id FROM groups as g INNER JOIN group_forums_thread_views as v, group_forums_threads as threads WHERE v.thread_id = threads.id AND threads.forum_id = g.id AND @now - v.`timestamp` <= @Sdays GROUP BY g.id ORDER BY v.`timestamp` DESC LIMIT @Index, @LiMiT");</p><p> adap.AddParameter("limit", int3);</p><p> adap.AddParameter("index", int2);</p><p> adap.AddParameter("now", (int)PlusEnvironment.GetUnixTimestamp());</p><p> adap.AddParameter("sdays", (60 * 60 * 24 * 7));</p><p></p><p> table = adap.GetTable();</p><p> }</p><p></p><p> foreach (DataRow Row in table.Rows)</p><p> {</p><p> GroupForum forum;</p><p></p><p> if (PlusEnvironment.GetGame().GetGroupForumManager().TryGetForum(Convert.ToInt32(Row["id"]), out forum))</p><p> forums.Add(forum);</p><p> }</p><p></p><p> break;</p><p> }</p><p></p><p> Session.SendPacket(new ForumsListDataComposer(forums, Session, int1, int2, int3));</p><p> }</p><p></p><p> }</p><p></p><p>}[/CODE]</p><p>Does your GetForumsListDataEvent.cs Look like that?</p></blockquote><p></p>
[QUOTE="Ghost, post: 415084, member: 18103"] \Communication\Packets\Incoming\Groups\GetForumsListDataEvent.cs [CODE] using Plus.Communication.Packets.Outgoing; using Plus.Communication.Packets.Outgoing.Groups; using Plus.HabboHotel.GameClients; using Plus.HabboHotel.Groups.Forums; using System; using Plus.Database.Interfaces; using System.Collections.Generic; using System.Data; namespace Plus.Communication.Packets.Incoming.Groups { class GetForumsListDataEvent : IPacketEvent { public void Parse(GameClient Session, ClientPacket Packet) { var int1 = Packet.PopInt(); var int2 = Packet.PopInt(); int int3 = Packet.PopInt(); var forums = new List<GroupForum>(); DataTable table; switch (int1) { case 2: var Forums = PlusEnvironment.GetGame().GetGroupForumManager().GetForumsByUserId(Session.GetHabbo().Id); if (Forums.Count - 1 >= int2) { Forums = Forums.GetRange(int2, Math.Min(int3, Forums.Count)); } Session.SendPacket(new ForumsListDataComposer(Forums, Session, int1, int2, int3)); return; case 0: using (IQueryAdapter adap = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { adap.SetQuery("SELECT g.id FROM groups as g INNER JOIN group_forums_thread_posts as posts, group_forums_threads as threads WHERE posts.thread_id = threads.id AND @now - posts.`timestamp`<= @Sdays AND threads.forum_id = g.id GROUP BY g.id ORDER BY posts.`timestamp` DESC LIMIT @Index, @LiMiT"); adap.AddParameter("limit", int3); adap.AddParameter("index", int2); adap.AddParameter("now", (int)PlusEnvironment.GetUnixTimestamp()); adap.AddParameter("sdays", (60 * 60 * 24 * 7)); table = adap.GetTable(); } foreach (DataRow Row in table.Rows) { GroupForum forum; if (PlusEnvironment.GetGame().GetGroupForumManager().TryGetForum(Convert.ToInt32(Row["id"]), out forum)) forums.Add(forum); } break; case 1: using (IQueryAdapter adap = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { adap.SetQuery("SELECT g.id FROM groups as g INNER JOIN group_forums_thread_views as v, group_forums_threads as threads WHERE v.thread_id = threads.id AND threads.forum_id = g.id AND @now - v.`timestamp` <= @Sdays GROUP BY g.id ORDER BY v.`timestamp` DESC LIMIT @Index, @LiMiT"); adap.AddParameter("limit", int3); adap.AddParameter("index", int2); adap.AddParameter("now", (int)PlusEnvironment.GetUnixTimestamp()); adap.AddParameter("sdays", (60 * 60 * 24 * 7)); table = adap.GetTable(); } foreach (DataRow Row in table.Rows) { GroupForum forum; if (PlusEnvironment.GetGame().GetGroupForumManager().TryGetForum(Convert.ToInt32(Row["id"]), out forum)) forums.Add(forum); } break; } Session.SendPacket(new ForumsListDataComposer(forums, Session, int1, int2, int3)); } } }[/CODE] Does your GetForumsListDataEvent.cs Look like that? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Group Forums
Top