Project Mango.

Brad

Moderator
Staff member
Messages
2,242
Likes
918
#1

Mango Emulator for Habbo revision PRODUCTION-201802201205-141713395​

HI all,

As some will know I started working on Mango around 1 year ago, but I abandoned it when I got too busy and never really thought about continuing it until recently. If you don't know what Mango is you can find the link to the original release below. First off, credits go to @Sledmore, for starting this off (this is not the one he started before he released his PlusEmu) & of course, to the original creators of Mango. This is currently a solo project & I hope to release this as a solid Emulator.

Red = Not Started.
Yellow = In Progress.
Green = Live.

  • Navigator
  • Messenger
  • Catalog
  • Pets
  • Bots
  • Item handling.
  • Trading.
  • Wired.
  • Moderation.
PHP:
using Mango.Communication.Sessions;
using Mango.Catalog;

namespace Mango.Communication.Packets.Incoming.Catalog
{
    class PurchaseFromCatalogEvent : IPacketEvent
    {
        public void parse(Session session, ClientPacket packet)
        {
            if (session == null || session.GetPlayer() == null)
                return;

            int PageId = packet.PopWiredInt();
            int ItemId = packet.PopWiredInt();
            string Data = packet.PopString();
            int Amount = packet.PopInt();

            if (!Mango.GetServer().GetCatalogManager().TryGetPage(PageId, out CatalogPage Page))
                return;

            if (!Page.Visible || (Page.MinRank > session.GetPlayer().Rank))
                return;

            Page.PageType.OnPurchase(session, Page, ItemId, Data, Amount);       
        }   
    }
}
PHP:
using Mango.Players;
using Mango.Rooms.AI.Bots;
using Mango.Rooms.AI.Pets;
using Mango.Rooms.AI.Pets.Interfaces;
using Mango.Rooms.Bots;
using Mango.Rooms.Bots.Interfaces;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Concurrent;
using System.Data;

namespace Mango.Rooms.AI
{
   class AIManager
    {
        private ConcurrentDictionary<int, Pet> _pets = null;
        public ConcurrentDictionary<int, Bot> _bots = null;

        private readonly BotComponent botComponent = null;
        private readonly PetComponent petComponent = null;
        public readonly RoomInstance roomInstance = null;

        public AIManager()
        {

            this._bots = new ConcurrentDictionary<int, Bot>();
            this._pets = new ConcurrentDictionary<int, Pet>();
        
            this.InitializeBots();
            this.InitializePets();

            this.botComponent = new BotComponent(_bots);
            this.petComponent = new PetComponent(_pets);

        }

        public void InitializePets()
        {
            if (this._pets.Count > 0)
                this._pets.Clear();

            using (var DbCon = Mango.GetServer().GetDatabaseManager().GetQueryReactor())
            {

                DbCon.SetQuery("SELECT `id`, `race`, `name` FROM `pets`;");
                DataTable Pets = DbCon.getTable();
                if (Pets != null)
                {
                    foreach (DataRow Reader in Pets.Rows)
                    {
                        {
                            int Id = Convert.ToInt32(Reader["id"]);
                            int Race = Convert.ToInt32(Reader["race"]);
                            string Name = Convert.ToString(Reader["name"]);
                            IPetType Type = PetType.GetPetTypeFromPetRaceId(Race);
                          
                            if (!this._pets.ContainsKey(Id))
                            {
                                this._pets.TryAdd(Id, new Pet(Id, Name, Type));
                            }
                        }
                    }
                }

            }
        }

        public void InitializeBots()
        {
            if (this._bots.Count > 0)
                this._bots.Clear();

            using (var DbCon = Mango.GetServer().GetDatabaseManager().GetQueryReactor())
            {
              
                DbCon.SetQuery("SELECT `id`, `room_id`, `user_id`, `name`, `motto`, `figure`, `gender`,`ai_type` FROM `bots`;");
                DataTable Bots = DbCon.getTable();
                if(Bots != null)
                {               
                    foreach (DataRow Reader in Bots.Rows)
                    {

                        int Id = Convert.ToInt32(Reader["id"]);
                        int RoomId = Convert.ToInt32(Reader["room_id"]);
                        int UserId = Convert.ToInt32(Reader["user_id"]);
                        string Name = Convert.ToString(Reader["name"]);
                        string Motto = Convert.ToString(Reader["motto"]);
                        string Figure = Convert.ToString(Reader["figure"]);
                        string Gender = Convert.ToString(Reader["gender"]);
                        BotType Type = BotTypes.GetBotTypesFromString(Convert.ToString(Reader["ai_type"]));

                        if (!this._bots.ContainsKey(Id))
                        {                           
                            this._bots.TryAdd(Id, new Bot(Id, RoomId, UserId, Name, Motto, Figure, Gender, Type));
                        }
                    }
                }
            }
        }

        public BotComponent GetBotComponent()
        {
            return botComponent;
        }

        public PetComponent GetPetComponent()
        {
            return petComponent;
        }



        public void Dispose()
        {
            _bots.Clear();
            _pets.Clear();

            _bots = null;
            _pets = null;
        }
    }
}
There will be a URL for open testing shortly.

Original Release: [ To view this link you must register here. ]
 
Last edited:

Lotus

Legacy, it's all anyone leaves behind.
Messages
1,529
Likes
445
#10

Mango Emulator for Habbo revision PRODUCTION-201802201205-141713395​

HI all,

As some will know I started working on Mango around 1 year ago, but I abandoned it when I got too busy and never really thought about continuing it until recently. If you don't know what Mango is you can find the link to the original release below. First off, credits go to @Sledmore, for starting this off (this is not the one he started before he released his PlusEmu) & of course, to the original creators of Mango. This is currently a solo project & I hope to release this as a solid Emulator.

Red = Not Started.
Yellow = In Progress.
Green = Live.

  • Navigator
  • Messenger
  • Catalog
  • Pets
  • Bots
  • Item handling.
  • Trading.
  • Wired.
  • Moderation.
PHP:
using Mango.Communication.Sessions;
using Mango.Catalog;

namespace Mango.Communication.Packets.Incoming.Catalog
{
    class PurchaseFromCatalogEvent : IPacketEvent
    {
        public void parse(Session session, ClientPacket packet)
        {
            if (session == null || session.GetPlayer() == null)
                return;

            int PageId = packet.PopWiredInt();
            int ItemId = packet.PopWiredInt();
            string Data = packet.PopString();
            int Amount = packet.PopInt();

            if (!Mango.GetServer().GetCatalogManager().TryGetPage(PageId, out CatalogPage Page))
                return;

            if (!Page.Visible || (Page.MinRank > session.GetPlayer().Rank))
                return;

            Page.PageType.OnPurchase(session, Page, ItemId, Data, Amount);      
        }  
    }
}
PHP:
using Mango.Players;
using Mango.Rooms.AI.Bots;
using Mango.Rooms.AI.Pets;
using Mango.Rooms.AI.Pets.Interfaces;
using Mango.Rooms.Bots;
using Mango.Rooms.Bots.Interfaces;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Concurrent;
using System.Data;

namespace Mango.Rooms.AI
{
   class AIManager
    {
        private ConcurrentDictionary<int, Pet> _pets = null;
        public ConcurrentDictionary<int, Bot> _bots = null;

        private readonly BotComponent botComponent = null;
        private readonly PetComponent petComponent = null;
        public readonly RoomInstance roomInstance = null;

        public AIManager()
        {

            this._bots = new ConcurrentDictionary<int, Bot>();
            this._pets = new ConcurrentDictionary<int, Pet>();
       
            this.InitializeBots();
            this.InitializePets();

            this.botComponent = new BotComponent(_bots);
            this.petComponent = new PetComponent(_pets);

        }

        public void InitializePets()
        {
            if (this._pets.Count > 0)
                this._pets.Clear();

            using (var DbCon = Mango.GetServer().GetDatabaseManager().GetQueryReactor())
            {

                DbCon.SetQuery("SELECT `id`, `race`, `name` FROM `pets`;");
                DataTable Pets = DbCon.getTable();
                if (Pets != null)
                {
                    foreach (DataRow Reader in Pets.Rows)
                    {
                        {
                            int Id = Convert.ToInt32(Reader["id"]);
                            int Race = Convert.ToInt32(Reader["race"]);
                            string Name = Convert.ToString(Reader["name"]);
                            IPetType Type = PetType.GetPetTypeFromPetRaceId(Race);
                         
                            if (!this._pets.ContainsKey(Id))
                            {
                                this._pets.TryAdd(Id, new Pet(Id, Name, Type));
                            }
                        }
                    }
                }

            }
        }

        public void InitializeBots()
        {
            if (this._bots.Count > 0)
                this._bots.Clear();

            using (var DbCon = Mango.GetServer().GetDatabaseManager().GetQueryReactor())
            {
             
                DbCon.SetQuery("SELECT `id`, `room_id`, `user_id`, `name`, `motto`, `figure`, `gender`,`ai_type` FROM `bots`;");
                DataTable Bots = DbCon.getTable();
                if(Bots != null)
                {              
                    foreach (DataRow Reader in Bots.Rows)
                    {

                        int Id = Convert.ToInt32(Reader["id"]);
                        int RoomId = Convert.ToInt32(Reader["room_id"]);
                        int UserId = Convert.ToInt32(Reader["user_id"]);
                        string Name = Convert.ToString(Reader["name"]);
                        string Motto = Convert.ToString(Reader["motto"]);
                        string Figure = Convert.ToString(Reader["figure"]);
                        string Gender = Convert.ToString(Reader["gender"]);
                        BotType Type = BotTypes.GetBotTypesFromString(Convert.ToString(Reader["ai_type"]));

                        if (!this._bots.ContainsKey(Id))
                        {                          
                            this._bots.TryAdd(Id, new Bot(Id, RoomId, UserId, Name, Motto, Figure, Gender, Type));
                        }
                    }
                }
            }
        }

        public BotComponent GetBotComponent()
        {
            return botComponent;
        }

        public PetComponent GetPetComponent()
        {
            return petComponent;
        }



        public void Dispose()
        {
            _bots.Clear();
            _pets.Clear();

            _bots = null;
            _pets = null;
        }
    }
}
There will be a URL for open testing shortly.

Original Release: [ To view this link you must register here. ]
lol I forgot i even posted a release thread for this wtf I been looking for a copy forever too LMAO!

good luck Brad fam cant wait to see the outcome!
 

Brad

Moderator
Staff member
Messages
2,242
Likes
918
#11
A few updates.
  • Implemented a new PathFinder Credits to @Damien.
  • Improved Users Data to a much more simpler format which corresponds with UserStats.
  • Implement a Notification System, each notif type being easier to recognize.
  • Bot & Pet data handling has been improved.
  • Started Wired Handling.

Not a lot has been done, been busy with work but I don't plan on finishing this anytime soon.
 

Brad

Moderator
Staff member
Messages
2,242
Likes
918
#15
Hi, sorry for the lack of updates been busy with work lately.

I plan to have a open beta for a few days in the upcoming weeks, just to test User Interaction, Item Handling & the Messenger. I will post the URL here once ready.
 

Lotus

Legacy, it's all anyone leaves behind.
Messages
1,529
Likes
445
#19
@Brad can we use the Emulator to create a own Habbo Retro? And will it be able to use it for a german Retro?
Upon Release you'll be able to create your own Habbo Retro with the Emulator & SWFs provided for it. You'll need to translate commands & flash texts, etc, In-order to use it for a German Retro.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top