/////////////////////// /////////////////////// MOD LOADER SERVER SECTION /////////////////////// /// <summary> /// The information sent to the server will be processed here! /// </summary> /// <param name="Data"></param> /// <param name="SocketX"></param> public static void ProcessData(byte[] Data, Socket SocketX) { // Get the message type. SonicHeroes.Networking.Client_Functions.Message_Type Message_Type = (SonicHeroes.Networking.Client_Functions.Message_Type)Data[0]; switch (Message_Type) { case Client_Functions.Message_Type.Client_Call_Start_Controller_Server: Start_Controller_Listener_Server(); break; case Client_Functions.Message_Type.Client_Call_Send_Message: Console.WriteLine(GetCurrentTime() + Encoding.ASCII.GetString(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1))); SocketX.Send(new byte[1] { (byte)SonicHeroes.Networking.Client_Functions.Message_Type.Reply_Okay }); break; // Send okay! break; case Client_Functions.Message_Type.Client_Call_Get_Controller: int Controller_ID = BitConverter.ToInt32(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1), 0); Return_Controller_Status(SocketX, Controller_ID); break; case Client_Functions.Message_Type.Client_Call_Subscribe_DLL_Function: Subscribe_Hook_Handler(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1), SocketX, false); break; case Client_Functions.Message_Type.Client_Call_Call_Subscribed_Function: Call_Hook_Handler(SocketX, BitConverter.ToInt32(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1), 0)); break; case Client_Functions.Message_Type.Client_Call_Check_Address_Hook_State: Subscribe_Hook_Handler(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1), SocketX, true); break; case Client_Functions.Message_Type.Client_Call_Assemble_x86_Mnemonics: Compile_X86_Mnemonics(SonicHeroes.Misc.SonicHeroes_Miscallenous.Get_Byte_Range_From_Array(Data, Data.Length - 1, 1), SocketX); break; } }