54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
|
using System.Collections;
|
||
|
using Tiger.Communication.Messages.Types;
|
||
|
using Tiger.Game.Habbos;
|
||
|
|
||
|
namespace Tiger.Game.Navigator.Views;
|
||
|
|
||
|
public class MyWorldView : INavigatorView
|
||
|
{
|
||
|
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()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public void 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 = GetRoomsByType(habbo, type);
|
||
|
|
||
|
message.AppendInt32(rooms.Count); // TODO: Rooms, this will ALWAYS return 0.
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private ICollection GetRoomsByType(Habbo habbo, int type)
|
||
|
{
|
||
|
return new List<object>();
|
||
|
}
|
||
|
}
|