[V9] [R38] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Page 2 of 9 FirstFirst 123456789 LastLast
Results 16 to 30 of 124
  1. #16
    what a twat is this hat? saamus is offline
    Alpha MaleRank
    Sep 2011 Join Date
    /etc/rc.localLocation
    2,208Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]


    RaGEZONE Recommends

    RaGEZONE Recommends

    I can hear, I can hear the nostalgia coming.

    Wasn't you some months ago also developing an v35 Emulator? Or was @Quackster? I don't remember.

    Aurora it's a name of a Magibogi Emulator. Actually it was takedown by the creators.: https://github.com/aura-project/aura

    Sad.

  2. #17
    Member Amariconao is offline
    MemberRank
    Nov 2011 Join Date
    62Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Glaceon View Post
    I won't use LINQ too much, just for Fluent NHibernate (as I guess it uses LINQ somehow itself).

    PHP Code:
     public OfficialRoomsComposer(IList<FrontpageItemfrontpageItems)
                : 
    base(450)
            {
                
    AppendVL64(0);
                
    AppendVL64(frontpageItems.Count);

                foreach (
    FrontpageItem item in frontpageItems)
                {
                    
    AppendString(item.Name);
                    
    AppendString(item.Description);
                    
    AppendVL64(item.Size);
                    
    AppendString(item.Name);
                    
    AppendString(item.Image);
                    
    AppendVL64(0);
                    
    AppendVL64(item.Type);

                    if (
    item.Type == 1)
                        
    AppendString(item.Tag);
                }
            } 
    At least I'm not using LINQ for for(each) loops as that will drop loads of performances. (no comment about the 0, I have to make rooms yet so no user count of something yet).

    ALSO: In my old source I got past room loading too, just the annoyance is that shockwave and flash are a bit different in it. That's why I focus on Flash first xp)
    Don't know why u put that name but revise the name "OfficialRoomsComposer", i think "SerializePageItems" is better :p

  3. #18
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Amariconao View Post
    Don't know why u put that name but revise the name "OfficialRoomsComposer", i think "SerializePageItems" is better :p
    _events[450] = com.sulake.habbo.communication.messages.incoming.navigator.OfficialRoomsEvent;

    This is SWF wise. This is a composer in emulator. I keep the same names.

    Quote Originally Posted by saamus View Post
    I can hear, I can hear the nostalgia coming.

    Wasn't you some months ago also developing an v35 Emulator? Or was @Quackster? I don't remember.

    Aurora it's a name of a Magibogi Emulator. Actually it was takedown by the creators.: https://github.com/aura-project/aura

    Sad.
    It was me (it was R38), though I accidentally deleted the virtual machine it was on. Sad story. Now I have it on Github though.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  4. #19
    Member Amariconao is offline
    MemberRank
    Nov 2011 Join Date
    62Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Dont know why... OfficialRoomsEvent for item serializing... Were they drunk when write that?

    PD: Good luck with ur project bro, u can do it perfect ;)

  5. #20
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Amariconao View Post
    Dont know why... OfficialRoomsEvent for item serializing... Were they drunk when write that?

    PD: Good luck with ur project bro, u can do it perfect ;)
    No.

    https://pastebin.com/T57CzCHN

    I think these names are correct. I keep the same names as Habbo did. SerializePageItems doesn't even tell you which packet it is.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  6. #21
    what a twat is this hat? saamus is offline
    Alpha MaleRank
    Sep 2011 Join Date
    /etc/rc.localLocation
    2,208Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Glaceon View Post
    _events[450] = com.sulake.habbo.communication.messages.incoming.navigator.OfficialRoomsEvent;

    This is SWF wise. This is a composer in emulator. I keep the same names.



    It was me (it was R38), though I accidentally deleted the virtual machine it was on. Sad story. Now I have it on Github though.
    You did wha.... Anyways, good luck on this project :D

  7. #22
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by saamus View Post
    You did wha.... Anyways, good luck on this project :D
    This happens when I get annoyed because my computer is full of shit and I remove without thinking. Thanks anyways.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  8. #23
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    A few things happened:

    - Catalogue deals work now, you can make packages of furniture. Maybe database wise and code wise it can be improved.
    - The emulator doesn't use NHibernate anymore since @spreedblood found it too hard and I found joins annoying.
    - The database uses foreign keys and better collations (utf8mb4_general_ci mostly which is like utf8_general_ci but better) .
    - Updated DotNetty to latest version on Nuget.



    Thanks to @spreedblood for writing the database stuff and part of the controllers and the entity classes.

    PHP Code:
    using System;
    using System.Collections.Concurrent;

    namespace 
    AuroraEmu.Database.Pool
    {
        public class 
    ObjectPool<T>
        {
            private 
    ConcurrentBag<T_objects;
            private 
    Func<T_objectGenerator;

            public 
    ObjectPool(Func<TobjectGenerator)
            {
                if (
    objectGenerator == null) throw new ArgumentNullException("objectGenerator");
                
    _objects = new ConcurrentBag<T>();
                
    _objectGenerator objectGenerator;
            }

            public 
    T GetObject()
            {
                
    T item;
                if (
    _objects.TryTake(out item)) return item;
                return 
    _objectGenerator();
            }

            public 
    void PutObject(T item)
            {
                
    _objects.Add(item);
            }
        }

    PHP Code:
    using AuroraEmu.Database.Pool;
    using MySql.Data.MySqlClient;
    using System;
    using System.Data;

    namespace 
    AuroraEmu.Database
    {
        public class 
    DatabaseConnection IDisposable
        
    {
            private 
    readonly ObjectPool<DatabaseConnectionobjectPool;

            private 
    MySqlConnection connection;
            private 
    MySqlCommand command;

            private 
    MySqlTransaction transaction;

            public 
    DatabaseConnection(string connectionStringObjectPool<DatabaseConnectionpool)
            {
                
    objectPool pool;
                
    connection = new MySqlConnection(connectionString);
                
    command connection.CreateCommand();
            }

            public 
    void Open()
            {
                if(
    connection.State == ConnectionState.Open)
                {
                    throw new 
    InvalidOperationException("Connection is already opened...");
                }
                
    connection.Open();
            }

            public 
    bool IsOpen()
            {
                return 
    connection.State == ConnectionState.Open;
            }

            
    /// <summary>
            /// Adds a parameter to the MySqlCommand.
            /// </summary>
            /// <param name="parameter">The parameter with prefixed with an '@'</param>
            /// <param name="value">The value of the parameter.</param>
            
    public void AddParameter(string parameterobject value)
            {
                
    command.Parameters.AddWithValue(parametervalue);
            }
            
            public 
    void SetQuery(string query)
            {
                
    command.CommandText query;
            }

            
    /// <summary>
            /// Executes a query.
            /// </summary>
            /// <returns>The number of rows affected.</returns>
            
    public int Execute()
            {
                try
                {
                    return 
    command.ExecuteNonQuery();
                }
                catch (
    MySqlException ex)
                {
                    
    Engine.Logger.Error("MySQL Error: "ex);

                    return -
    1;
                }
                finally
                {
                    
    command.CommandText string.Empty;
                    
    command.Parameters.Clear();
                }
            }

            public 
    DataSet GetDataSet()
            {
                try
                {
                    
    DataSet dataSet = new DataSet();

                    
    using (MySqlDataAdapter adapter = new MySqlDataAdapter(command))
                    {
                        
    adapter.Fill(dataSet);
                    }

                    return 
    dataSet;
                }
                catch (
    Exception ex)
                {
                    
    Engine.Logger.Error("MySQL Error: "ex);

                    return 
    null;
                }
            }

            public 
    DataTable GetTable()
            {
                try
                {
                    
    DataTable dataTable = new DataTable();

                    
    using (MySqlDataAdapter adapter = new MySqlDataAdapter(command))
                    {
                        
    adapter.Fill(dataTable);
                    }

                    return 
    dataTable;
                }
                catch (
    Exception ex)
                {
                    
    Engine.Logger.Error("MySQL Error: "ex);

                    return 
    null;
                }
            }

            public 
    DataRow GetRow()
            {
                try
                {
                    
    DataRow row null;
                    
    DataSet dataSet GetDataSet();

                    if (
    dataSet != null && dataSet.Tables.Count && dataSet.Tables[0].Rows.Count == 1)
                    {
                        
    row dataSet.Tables[0].Rows[0];
                    }

                    return 
    row;
                }
                catch (
    Exception ex)
                {
                    
    Engine.Logger.Error("MySQL Error: "ex);

                    return 
    null;
                }
            }

            
    /// <summary>
            /// Executes an 'insert'-query. Instead of 'Execute', it returns the inserted ID rather than the amount of affected rows.
            /// </summary>
            /// <returns>The inserted ID.</returns>
            
    public int Insert()
            {
                try
                {
                    
    command.ExecuteNonQuery();

                    return (int)
    command.LastInsertedId;
                }
                catch (
    MySqlException ex)
                {
                    
    Engine.Logger.Error("MySQL Error: "ex);

                    return -
    1;
                }
                finally
                {
                    
    command.CommandText string.Empty;
                    
    command.Parameters.Clear();
                }
            }

            public 
    void BeginTransaction()
            {
                
    transaction connection.BeginTransaction();
            }

            public 
    void Commit()
            {
                if (
    transaction == null)
                    throw new 
    InvalidOperationException("Transaction hasn't started yet.");
                
    transaction.Commit();
            }

            public 
    void Rollback()
            {
                if (
    transaction == null)
                    throw new 
    InvalidOperationException("Transaction hasn't started yet.");
                
    transaction.Rollback();
            }

            public 
    void Dispose()
            {
                if(
    IsOpen())
                {
                    
    connection.Close();
                }

                if(
    transaction != null)
                {
                    
    transaction.Dispose();
                }

                if(
    command != null)
                {
                    
    command.Dispose();
                }
            }
        }

    PHP Code:
     public Player GetPlayerById(int id)
            {
                
    Player player;

                if (
    playersById.TryGetValue(idout player))
                    return 
    player;

                
    DataRow result null;

                
    using (DatabaseConnection dbClient DatabaseManager.GetInstance().GetConnection())
                {
                    
    dbClient.SetQuery("SELECT id, username, password, email, gender, figure, motto, coins, pixels, rank, home_room, sso_ticket FROM players WHERE id = @id;");
                    
    dbClient.AddParameter("@id"id);
                    
    dbClient.Open();

                    
    result dbClient.GetRow();
                }

                if (
    result != null)
                {
                    
    player = new Player(result);
                    
    playersById.TryAdd(player.Idplayer);

                    return 
    player;
                }

                return 
    null;
            } 
    I'm pretty sure most code can be cleaned up even more, but to be honest I'm cba to do it now.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  9. #24
    Deep thoughts [V9] [R38] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net] Joopie is offline
    SubscriberRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,578Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    I'm not sure what is worse... a so called god class or making a instance of it static..

    What about dependency injection?

  10. #25
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Joopie View Post
    I'm not sure what is worse... a so called god class or making a instance of it static..

    What about dependency injection?
    Don't blame me about the way it's done now, with the bla.GetInstance() stuff, @spreedblood is completely responsible for it. It was his idea and he changed all that stuff.

    But, what way would you recommend?
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  11. #26
    Deep thoughts [V9] [R38] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net] Joopie is offline
    SubscriberRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,578Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Glaceon View Post
    Don't blame me about the way it's done now, with the bla.GetInstance() stuff, @spreedblood is completely responsible for it. It was his idea and he changed all that stuff.

    But, what way would you recommend?
    And when someone in my project group does something wrong it is not my fault. Sadly it does not work like that. In this project you two are working together. If you do not like his changes, you should have declined it. Ofcourse, vice versa. Saying "it is not me, he did it" is just wrong. I hope you have learned to never point a finger to someone else.

    What I recommend? I suggest you read my previous post again.

  12. #27
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by Joopie View Post
    And when someone in my project group does something wrong it is not my fault. Sadly it does not work like that. In this project you two are working together. If you do not like his changes, you should have declined it. Ofcourse, vice versa. Saying "it is not me, he did it" is just wrong. I hope you have learned to never point a finger to someone else.

    What I recommend? I suggest you read my previous post again.
    True. However I did not do research into this, and because it seemed like he did I just assumed what he was telling me was right; however, you are right about that.

    I'll try and look into dependency injection.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  13. #28
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    8,816Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Why dont you skip the catalog part and go straight to loading rooms? Yeah I know its cool to have something that already works on the hotelview but rooms is what habbo is about. This is the kind of George dev structure you apply for any emulator. :p:

    Next up is messenger and modtools along with the inventory and purse. Haha :)"
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#0063

  14. #29
    Veteran Glaceon is offline
    SubscriberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,205Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Quote Originally Posted by The General View Post
    Why dont you skip the catalog part and go straight to loading rooms? Yeah I know its cool to have something that already works on the hotelview but rooms is what habbo is about. This is the kind of George dev structure you apply for any emulator. :p:

    Next up is messenger and modtools along with the inventory and purse. Haha :)"
    Funny thing. One, purse? Purse is just one packet unless you mean something else than purse. Modtools won't be done until everything else is finished. Messenger is in progress but not by me but by @spreedblood. As a mMy Home My Profile Messages atter of fact, I just wanted to have the catalogue listing and pages done first and then focus on navigator. When navigator is mostly finished, I'll move over to room entry.

    Now, just accept the way I'm working. And if you don't like it: you can use a magical keyboard combination which contains an ALT and a F4. Have a good day Wesley.
    https://aurora-dev.com/ - https://worldofmrjosh.com

    No matter how much you fall down, you can always reach your destination by standing up again.

  15. #30
    Im Back! PythoneX12 is offline
    True MemberRank
    Sep 2010 Join Date
    601Posts

    Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

    Omg very nice, Question i have is, What made you go backwards? Jw(Y)
    [SIGPIC][/SIGPIC]




Advertisement