Phoenix emulator new features & fixes

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    cool Phoenix emulator new features & fixes

    Hello! I have worked phoenix emulator many months and now time to release something

    >>> !!!THIS IS NOT MY PHOENIX EMULATOR EDIT RELEASE THREAD!!! <<<

    Pathfinder bug:
    Spoiler:

    Open HeightInfo.cs and find this:
    Code:
    internal double GetState(int x, int y)
    {
        if ((x >= this.mMaxX) || (x < 0))
        {
            return 0.0;
        }
        if ((y >= this.mMaxY) || (y < 0))
        {
            return 0.0;
        }
        return this.mMap[x, y];
    }
    And put down that this:
    Code:
    internal double GetMapHeight(int X, int Y)
    {
        return this.double_2[X, Y];
    }
    Open DreamPathfinder.cs and find this:
    Code:
    if (point2.InUse && point2.CanWalk && Height.GetState(point2.X, point2.Y) - state < 2.0)
    and replace it with this:
    Code:
    if (point2.InUse && point2.CanWalk && Height.GetState(point2.X, point2.Y) - state <= 2.0 + Height.GetMapHeight(pInfo.Point.X, pInfo.Point.Y))


    Anti DDOS automatic peerblock ip blacklist:
    Spoiler:

    Open AntiDDosSystem.cs and find this:
    Code:
    namespace Phoenix.Net
    {
        internal sealed class AntiDDosSystem
        {
    And put down that this:
    Code:
    public static IntPtr HWND_BROADCAST = new IntPtr(0xffff);
    
    
    [DllImport("user32.dll", CharSet = CharSet.Unicode)]
    static extern uint RegisterWindowMessage(string lpProcName);
    
    
    [DllImport("user32.dll")]
    private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
    Next find this:
    Code:
    if (AntiDDosSystem.smethod_2(text) > 10 && text != "127.0.0.1" && !LicenseTools.bool_0)
    And put down that this:
    Code:
    Process[] peerblockrunning = Process.GetProcessesByName("peerblock");
    if (peerblockrunning.Length == 0)
    {
    }
    else
    {
        Console.ForegroundColor = ConsoleColor.Blue;
        Console.WriteLine("PeerBlock is running! Adding IP to PeerBlock blacklist!");
        Console.ForegroundColor = ConsoleColor.White;
        using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"ddos.p2p", true))
        {
            file.Write("DDoS IP:" + text + "-" + text + "\n");
        }
        uint msg = RegisterWindowMessage("PeerBlockLoadLists");
        SendMessage(HWND_BROADCAST, msg, IntPtr.Zero, IntPtr.Zero);
    }


    100% CPU fix (Maybe but i think so):
    Spoiler:

    Replace SocketsConnection.cs with this:
    Code:
    using System;
    using System.Net.Sockets;
    using System.Text;
    using System.Net;
    using Phoenix.Util;
    using Phoenix.Messages;
    namespace Phoenix.Net
    {
        public sealed class Message1 : Socket, IDisposable
        {
            public delegate void GDelegate0(ref byte[] Data);
            private bool bool_0 = false;
            private readonly uint uint_0;
            private byte[] byte_0;
            private AsyncCallback asyncCallback_0;
            private AsyncCallback asyncCallback_1;
            private Message1.GDelegate0 gdelegate0_0;
            private string string_0;
            public uint UInt32_0
            {
                get
                {
                    return this.uint_0;
                }
            }
            public string String_0
            {
                get
                {
                    return this.string_0;
                }
            }
            public Message1(uint uint_1, SocketInformation socketInformation_0) : base(socketInformation_0)
            {
                this.uint_0 = uint_1;
                this.string_0 = base.RemoteEndPoint.ToString().Split(new char[]
                {
                    ':'
                })[0];
            }
            internal void method_0(Message1.GDelegate0 gdelegate0_1)
            {
                this.byte_0 = new byte[1024];
                this.asyncCallback_0 = new AsyncCallback(this.method_7);
                this.asyncCallback_1 = new AsyncCallback(this.method_3);
                this.gdelegate0_0 = gdelegate0_1;
                this.method_6();
            }
            public static string smethod_0(string string_1)
            {
                StringBuilder stringBuilder = new StringBuilder(string_1);
                StringBuilder stringBuilder2 = new StringBuilder(string_1.Length);
                for (int i = 0; i < string_1.Length; i++)
                {
                    char c = stringBuilder[i];
                    c ^= '\u0081';
                    stringBuilder2.Append(c);
                }
                return stringBuilder2.ToString();
            }
            internal void method_1()
            {
                try
                {
                    this.Shutdown(SocketShutdown.Both);
                    this.Close();
                    this.Dispose();
                    Phoenix.GetGame().GetClientManager().method_9(this.uint_0);
                }
                catch
                {
                }
            }
            internal void SendData(byte[] byte_1)
            {
                if (!this.bool_0)
                {
                    try
                    {
                        base.BeginSend(byte_1, 0, byte_1.Length, SocketFlags.None, this.asyncCallback_1, this);
                    }
                    catch
                    {
                        Phoenix.GetGame().GetClientManager().method_5(this);
                    }
                }
            }
            private void method_3(IAsyncResult iasyncResult_0)
            {
                if (!this.bool_0)
                {
                    try
                    {
                        base.EndSend(iasyncResult_0);
                    }
                    catch
                    {
                        this.method_1();
                    }
                }
            }
            public void method_4(string string_1)
            {
                this.SendData(Phoenix.GetDefaultEncoding().GetBytes(string_1));
            }
            public void SendMessage(ServerMessage Message)
            {
                if (Message != null)
                {
                    this.SendData(Message.GetBytes());
                }
            }
            private void method_6()
            {
                if (!this.bool_0)
                {
                    try
                    {
                        base.BeginReceive(this.byte_0, 0, 1024, SocketFlags.None, this.asyncCallback_0, this);
                    }
                    catch
                    {
                        this.method_1();
                    }
                }
            }
            private void method_7(IAsyncResult iasyncResult_0)
            {
                if (!this.bool_0)
                {
                    try
                    {
                        int num = 0;
                        try
                        {
                            num = base.EndReceive(iasyncResult_0);
                        }
                        catch
                        {
                            this.method_1();
                            return;
                        }
                        if (num > 0)
                        {
                            byte[] array = ByteUtility.ChompBytes(this.byte_0, 0, num);
                            this.method_8(ref array);
                            this.method_6();
                        }
                        else
                        {
                            this.method_1();
                        }
                    }
                    catch
                    {
                        this.method_1();
                    }
                }
            }
            private void method_8(ref byte[] byte_1)
            {
                if (this.gdelegate0_0 != null)
                {
                    this.gdelegate0_0(ref byte_1);
                }
            }
            public new void Dispose()
            {
                this.method_9(true);
                GC.SuppressFinalize(this);
            }
            private void method_9(bool bool_1)
            {
                if (!this.bool_0 && bool_1)
                {
                    this.bool_0 = true;
                    try
                    {
                        base.Shutdown(SocketShutdown.Both);
                        base.Close();
                        base.Dispose();
                    }
                    catch
                    {
                    }
                    Array.Clear(this.byte_0, 0, this.byte_0.Length);
                    this.byte_0 = null;
                    this.asyncCallback_0 = null;
                    this.gdelegate0_0 = null;
                    Phoenix.smethod_14().method_6(this.uint_0);
                    AntiDDosSystem.smethod_3(this.string_0);
                    if (Phoenix.GetConfig().data["emu.messages.connections"] == "1")
                    {
                        Console.WriteLine(string.Concat(new object[]
                        {
                            ">> Connection Dropped [",
                            this.uint_0,
                            "] from [",
                            this.String_0,
                            "]"
                        }));
                    }
                }
            }
        }
    }
    Replace SocketsListener.cs with this:
    Code:
    using System;
    using System.Diagnostics;
    using System.Net;
    using System.Net.Sockets;
    using Phoenix.Core;
    namespace Phoenix.Net
    {
        internal sealed class Class114
        {
            private const int int_0 = 1;
            private Socket socket_0;
            private bool bool_0;
            private AsyncCallback asyncCallback_0;
            private int int_1;
            private SocketsManager class113_0;
            public bool Boolean_0
            {
                get
                {
                    return this.Boolean_0;
                }
            }
            public Class114(string string_0, int int_2, SocketsManager class113_1)
            {
                this.int_1 = Process.GetCurrentProcess().Id;
                this.socket_0 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                IPEndPoint localEP = new IPEndPoint(IPAddress.Parse(Phoenix.GetConfig().data["game.tcp.bindip"]), int_2);
                this.socket_0.Bind(localEP);
                this.socket_0.Listen(1000);
                this.asyncCallback_0 = new AsyncCallback(this.method_4);
                this.class113_0 = class113_1;
                AntiDDosSystem.smethod_0(20000);
                Logging.WriteLine("Listening for connections on port: " + int_2);
            }
            public void method_0()
            {
                if (!this.bool_0)
                {
                    this.bool_0 = true;
                    this.socket_0.BeginAccept(this.asyncCallback_0, this.socket_0);
                }
            }
            public void method_1()
            {
                if (this.bool_0)
                {
                    this.bool_0 = false;
                    try
                    {
                        this.socket_0.Close();
                    }
                    catch
                    {
                    }
                    Console.WriteLine("Listener -> Stopped!");
                }
            }
            public void method_2()
            {
                this.method_1();
                this.socket_0 = null;
                this.class113_0 = null;
            }
            private void method_3()
            {
                try
                {
                    this.socket_0.BeginAccept(this.asyncCallback_0, this.socket_0);
                }
                catch
                {
                }
            }
            private void method_4(IAsyncResult iasyncResult_0)
            {
                if (this.bool_0)
                {
                    try
                    {
                        int num = this.class113_0.method_4();
                        if (num > -1)
                        {
                            Socket socket = ((Socket)iasyncResult_0.AsyncState).EndAccept(iasyncResult_0);
                            if (AntiDDosSystem.smethod_1(socket))
                            {
                                this.class113_0.method_5(socket.DuplicateAndClose(this.int_1), num);
                            }
                            else
                            {
                                try
                                {
                                    socket.Shutdown(SocketShutdown.Both);
                                    socket.Close();
                                    socket.Dispose();
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Logging.LogException("[TCPListener.OnRequest]: Could not handle new connection request: " + ex.ToString());
                    }
                    finally
                    {
                        this.method_3();
                    }
                }
            }
            internal void method_5()
            {
                this.bool_0 = false;
                try
                {
                    this.socket_0.Shutdown(SocketShutdown.Both);
                    this.socket_0.Close();
                    this.socket_0.Dispose();
                }
                catch
                {
                }
            }
        }
    }
    Replace SocketsManager.cs with this:
    Code:
    using System;
    using System.Net.Sockets;
    using Phoenix.Core;
    namespace Phoenix.Net
    {
        internal sealed class SocketsManager
        {
            private Message1[] Message1_0;
            private Class114 class114_0;
            public int Int32_0
            {
                get
                {
                    int num = 0;
                    for (int i = 0; i < this.Message1_0.Length; i++)
                    {
                        if (this.Message1_0[i] != null)
                        {
                            num++;
                        }
                    }
                    return num;
                }
            }
            public SocketsManager(string string_0, int int_0, int int_1)
            {
                this.Message1_0 = new Message1[int_1];
                this.class114_0 = new Class114(string_0, int_0, this);
            }
            public void method_0()
            {
                for (int i = 0; i < this.Message1_0.Length; i++)
                {
                    if (this.Message1_0[i] != null)
                    {
                        this.Message1_0[i].Shutdown(SocketShutdown.Both);
                        this.Message1_0[i].Close();
                        this.Message1_0[i].Dispose();
                    }
                }
                this.Message1_0 = null;
                this.class114_0 = null;
            }
            public bool method_1(uint uint_0)
            {
                return this.Message1_0[(int)((UIntPtr)uint_0)] != null;
            }
            public Message1 method_2(uint uint_0)
            {
                return this.Message1_0[(int)((UIntPtr)uint_0)];
            }
            public Class114 method_3()
            {
                return this.class114_0;
            }
            internal int method_4()
            {
                return Array.IndexOf<Message1>(this.Message1_0, null);
            }
            internal void method_5(SocketInformation socketInformation_0, int int_0)
            {
                Message1 Message = new Message1(Convert.ToUInt32(int_0), socketInformation_0);
                this.Message1_0[int_0] = Message;
                Phoenix.GetGame().GetClientManager().method_8((uint)int_0, ref Message);
                if (Phoenix.GetConfig().data["emu.messages.connections"] == "1")
                {
                    Logging.WriteLine(string.Concat(new object[]
                    {
                        ">> Connection [",
                        int_0,
                        "] from [",
                        Message.String_0,
                        "]"
                    }));
                }
            }
            internal void method_6(uint uint_0)
            {
                this.Message1_0[(int)((UIntPtr)uint_0)] = null;
            }
            internal void method_7()
            {
                this.class114_0.method_5();
                for (int i = 0; i < this.Message1_0.Length; i++)
                {
                    if (this.Message1_0[i] != null)
                    {
                        this.Message1_0[i].Shutdown(SocketShutdown.Both);
                        this.Message1_0[i].Close();
                        this.Message1_0[i].Dispose();
                    }
                }
            }
        }
    }


    More coming soon :)
    Last edited by Juniori; 01-02-14 at 01:16 PM. Reason: Added 100% cpu bug fix


  2. #2
    Valued Member iTzScronnie is offline
    MemberRank
    Sep 2013 Join Date
    104Posts

    Re: Phoenix emulator new features & fixes

    how is this a release? Its just a fix for now

  3. #3
    Member ruflesbpt is offline
    MemberRank
    Jun 2011 Join Date
    live:ajdaudioLocation
    70Posts

    Re: Phoenix emulator new features & fixes

    Quote Originally Posted by iTzScronnie View Post
    how is this a release? Its just a fix for now
    Tomorrow, there will be a release of a version.

  4. #4
    Enthusiast Yorktown is offline
    MemberRank
    Jan 2014 Join Date
    FinlandLocation
    43Posts

    Re: Phoenix emulator new features & fixes

    Oh, that changelog looks lovely, can't wait you to release this ^-^

  5. #5
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    Re: Phoenix emulator new features &amp; fixes

    Quote Originally Posted by ruflesbpt View Post
    tomorrow, there will be a release of a version.
    Quote Originally Posted by yorktown View Post
    oh, that changelog looks lovely, can't wait you to release this ^-^
    Ths is not my phoenix emulator edit release thread! Only some new features and fixes to phoenix emulator

  6. #6
    Valued Member Andre96 is offline
    MemberRank
    Dec 2011 Join Date
    The NetherlandsLocation
    103Posts

    Re: Phoenix emulator new features & fixes

    Is there fixed that you could walk over furni with heigh stack_height?

  7. #7
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    Re: Phoenix emulator new features & fixes

    Quote Originally Posted by Andre96 View Post
    Is there fixed that you could walk over furni with heigh stack_height?
    What you mean?

  8. #8
    Valued Member Andre96 is offline
    MemberRank
    Dec 2011 Join Date
    The NetherlandsLocation
    103Posts

    Re: Phoenix emulator new features & fixes

    When you want to walk on furni with stack_height: 4 you can't walk over it when he is walk able could you fix it in this emulator

  9. #9
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    Re: Phoenix emulator new features & fixes

    Quote Originally Posted by Andre96 View Post
    When you want to walk on furni with stack_height: 4 you can't walk over it when he is walk able could you fix it in this emulator
    I maked to my phoenix edit "HeightOverride" and if you put it to 1 it overrides height :P I dont place all fixes to here and its only avaible on my emulator. Only all very useaful fixes and new features i add to this thread :P Later releasing my emulator with source.

  10. #10
    Valued Member Andre96 is offline
    MemberRank
    Dec 2011 Join Date
    The NetherlandsLocation
    103Posts

    Re: Phoenix emulator new features & fixes

    Are you going to make all the wired?

  11. #11
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    Re: Phoenix emulator new features & fixes

    Quote Originally Posted by Andre96 View Post
    Are you going to make all the wired?
    Yes, but this is not my phoenix emulator edit thread so stop off-topic.

  12. #12
    Account Upgraded | Title Enabled! Joe Richardson is offline
    MemberRank
    Feb 2013 Join Date
    485Posts

    Re: Phoenix emulator new features & fixes

    Got my hopes up thinking this was the emulator you were working on. Oh well. I'd love to get the trax fix.

  13. #13
    Member ruflesbpt is offline
    MemberRank
    Jun 2011 Join Date
    live:ajdaudioLocation
    70Posts

    Re: Phoenix emulator new features & fixes

    fix 100% cpu and socket ? please?

  14. #14
    is it me or is it just .. duckietm is offline
    MemberRank
    Oct 2010 Join Date
    339Posts

    Re: Phoenix emulator new features & fixes

    Here is the full 100% Fix for : Stacking, walking over furni sit / lay on furni until Height 6 (you can set the height to any number !

    HeightInfo.cs
    PHP Code:
    using System;
    namespace 
    Phoenix.HabboHotel.Pathfinding
    {
        
    internal struct HeightInfo
        
    {
            private 
    double[,] mMap;
            private 
    double[,] double_1;
            private 
    double[,] double_2;
            private 
    int mMaxX;
            private 
    int mMaxY;
            public 
    HeightInfo(int MaxXint MaxYdouble[,] Mapdouble[,] double_4double[,] double_5)
            {
                
    this.mMap Map;
                
    this.double_2 double_4;
                
    this.double_1 double_5;
                
    this.mMaxX MaxX;
                
    this.mMaxY MaxY;
            }
            
    internal double GetState(int MaxXint MaxY)
            {
                
    double result;
                if ((
    MaxX >= this.mMaxX) || (MaxX 0))
                {
                    
    result =  0.0;
                }
                else
                {
                    if ((
    MaxY >= this.mMaxY) || (MaxY 0))
                    {
                    
    result =  0.0;
                    }
                    else
                    {
                    if (
    this.double_2[MaxXMaxY] > this.mMap[MaxXMaxY] && this.double_1[MaxXMaxY] == 0.0)
                            {
                                
    result this.double_2[MaxXMaxY];
                            }
                            else
                            {
                                if (
    this.double_1[MaxXMaxY] == 0.0)
                                {
                                    
    result this.mMap[MaxXMaxY];
                                }
                                else
                                {
                                    
    result this.double_1[MaxXMaxY];
                                }
                            }
                         }
                       }
                return 
    result;
            }
        }

    Dreampathfinder.cs
    PHP Code:
    using System;
    namespace 
    Phoenix.HabboHotel.Pathfinding
    {
        
    internal sealed class DreamPathfinder
        
    {

            private static 
    SquarePoint GetClosetSqare(SquareInformation pInfoHeightInfo Heightbool bool_0)
            {
                
    double getDistance pInfo.Point.GetDistance;
                
    SquarePoint result pInfo.Point;
                
    double state Height.GetState(pInfo.Point.XpInfo.Point.Y);
                for (
    int i 08i++)
                {
                    
    SquarePoint point2 pInfo.Pos(i);
                    if (
    point2.InUse && point2.CanWalk && Height.GetState(point2.Xpoint2.Y) - state 6.0)
                    {
                        
    double num4 point2.GetDistance;
                        if (
    getDistance num4)
                        {
                            
    getDistance num4;
                            
    result point2;
                        }
                    }
                }
                return 
    result;
            }
            
    internal static double GetDistance(int x1int y1int x2int y2)
            {
                return 
    Math.Sqrt(Math.Pow((double)(x1 x2), 2.0) + Math.Pow((double)(y1 y2), 2.0));
            }

            
    internal static SquarePoint GetNextStep(int pUserXint pUserYint pUserTargetXint pUserTargetYbyte[,] pGameMapdouble[,] pHeightdouble[,] double_1double[,] double_2int MaxXint MaxYbool pUserOverridebool pDiagonal)
            {
                
    ModelInfo pMap = new ModelInfo(MaxXMaxYpGameMap);
                
    SquarePoint pTarget = new SquarePoint(pUserTargetXpUserTargetYpUserTargetXpUserTargetYpMap.GetState(pUserTargetXpUserTargetY), pUserOverride);
                if (
    pUserX == pUserTargetX && pUserY == pUserTargetY)
                {
                    return 
    pTarget;
                }
                
    SquareInformation pInfo = new SquareInformation(pUserXpUserYpTargetpMappUserOverridepDiagonal);
                return 
    DreamPathfinder.GetClosetSqare(pInfo, new HeightInfo(MaxXMaxYpHeightdouble_1double_2), pDiagonal);
            }
        }

    Where you she the line :
    if (point2.InUse && point2.CanWalk && Height.GetState(point2.X, point2.Y) - state < 6.0)

    That is where you can change the max height for walk / sit etc. on furni !

  15. #15
    Valued Member Juniori is offline
    MemberRank
    Dec 2013 Join Date
    104Posts

    Re: Phoenix emulator new features & fixes

    My version is too 100%? :D



Page 1 of 2 12 LastLast

Advertisement