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:And put down that 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]; }Open DreamPathfinder.cs and find this:Code:internal double GetMapHeight(int X, int Y) { return this.double_2[X, Y]; }and replace it with this:Code:if (point2.InUse && point2.CanWalk && Height.GetState(point2.X, point2.Y) - state < 2.0)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:
And put down that this:Code:namespace Phoenix.Net { internal sealed class AntiDDosSystem {
Next find 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);And put down that this:Code:if (AntiDDosSystem.smethod_2(text) > 10 && text != "127.0.0.1" && !LicenseTools.bool_0)
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:
Replace SocketsListener.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 SocketsManager.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 { } } } }
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 :)







