Reconnect System Main 5.2 - Source Mu - Mu Server Files
 

Noticias:

SMF - Just Installed!

Menú principal

Reconnect System Main 5.2

Publicado por Dakosmu, Oct 10, 2023, 11:07 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Dakosmu

Reconnect System Main 5.2



I took the code from s6 and adapted it for 5.2. I do not guarantee that I did everything correctly, so if you see an error, write about it here. I don't know who originally wrote this for s6 so I don't know who to give creditos to. I'll add them if you tell me who they are.

This code works with NEW_PROTOCOL_SYSTEM disabled !!!!


And so here are the instructions. You should only add lines that end with //Add. And also don't forget to add #include "Reconnect.h" in the files that you added the code.


Open file   ZzzScene.cpp

Function bool RenderMainScene()

Code: [Select]
g_pPartyManager->Render();
g_pNewUISystem->Render();
BeginBitmap();
g_pReconnect->ReconnectMainProc();  //Add
RenderInfomation();

Function void MainScene(HDC hDC)

Code: [Select]
if(EnableSocket && SceneFlag==MAIN_SCENE)
   {
      if( SocketClient.GetSocket()==INVALID_SOCKET)
      {
         if (g_pReconnect->s_Data.ReconnectStatus != g_pReconnect->RECONNECT_STATUS_RECONNECT)  //Add
         {  //Add
            static BOOL s_bClosed = FALSE;
            if (!s_bClosed)
            {
               s_bClosed = TRUE;
               g_ErrorReport.Write("> Connection closed. ");
               g_ErrorReport.WriteCurrentTime();
               SEASON3B::CreateMessageBox(MSGBOX_LAYOUT_CLASS(SEASON3B::CServerLostMsgBoxLayout));
            }
         }  //Add
      }
   }


Open file  LoginWin.cpp

Function void CLoginWin::RequestLogin()

Code: [Select]
   if (unicode::_strlen(szID) <= 0)
      CUIMng::Instance().PopUpMsgWin(MESSAGE_INPUT_ID);
   else if (unicode::_strlen(szPass) <= 0)
      CUIMng::Instance().PopUpMsgWin(MESSAGE_INPUT_PASSWORD);
   else
   {
      if (CurrentProtocolState == RECEIVE_JOIN_SERVER_SUCCESS)
      {
         memcpy(g_pReconnect->s_Data.ReconnectAccount, szID, 11);  //Add
         memcpy(g_pReconnect->s_Data.ReconnectPassword, szPass, 11);  //Add



Open file WSctlc.cpp

Function BOOL CWsctlc::Close()

Code: [Select]
if ( m_bGame)
   {
      if (SceneFlag == MAIN_SCENE && g_pReconnect->CheckSocketPort(m_socket) == true)  //Add
      {  //Add
         g_pReconnect->ReconnectOnCloseSocket();  //Add
      }  //Add

      g_bGameServerConnected = FALSE;
   }

Open file WSclient.cpp

Code: [Select]
BOOL CreateSocket(char *IpAddr, unsigned short Port)
   {
   g_pReconnect->ReconnectCreateConnection(IpAddr, Port);  //Add

   BOOL bResult = TRUE;


Code: [Select]
   void ReceiveCharacterList( BYTE *ReceiveBuffer )
   {
   InitGuildWar();
   g_pReconnect->ReconnectOnCharacterList();  //Add


Code: [Select]
   BOOL ReceiveLogOut(BYTE *ReceiveBuffer, BOOL bEncrypted)
   {
   LogOut = false;
   LPPHEADER_DEFAULT_SUBCODE Data = (LPPHEADER_DEFAULT_SUBCODE)ReceiveBuffer;

   g_pReconnect->ReconnectOnCloseClient(Data->Value);  //Add

   switch(Data->Value)


Code: [Select]
   BOOL ReceiveJoinMapServer(BYTE *ReceiveBuffer, BOOL bEncrypted)
   {
   g_pReconnect->ReconnectOnCharacterInfo();  //Add
   MouseLButton = false;


Code: [Select]
   void ReceiveChangeMapServerInfo(BYTE* ReceiveBuffer)
   {
    LPPHEADER_MAP_CHANGESERVER_INFO Data = (LPPHEADER_MAP_CHANGESERVER_INFO)ReceiveBuffer;

   g_pReconnect->ReconnectOnMapServerMove(Data->m_vSvrInfo.m_szMapSvrIpAddress, Data->m_vSvrInfo.m_wMapSvrPort);  //Add


Code: [Select]
   void ReceiveChangeMapServerResult ( BYTE* ReceiveBuffer )
   {
    LPPHEADER_DEFAULT Data = (LPPHEADER_DEFAULT)ReceiveBuffer;

   g_pReconnect->ReconnectOnMapServerMoveAuth(Data->Value);  //Add


Code: [Select]
   BOOL TranslateProtocol( int HeadCode, BYTE *ReceiveBuffer, int Size, BOOL bEncrypted)
   {
      case 0xF1:              
      {
         LPPHEADER_DEFAULT_SUBCODE Data = (LPPHEADER_DEFAULT_SUBCODE)ReceiveBuffer;
         switch( Data->SubCode )
         {
         case 0x00: //receive join server
                ReceiveJoinServer(ReceiveBuffer);
            break;
         case 0x01: //receive log in
                //AddDebugText(ReceiveBuffer,Size);
            g_pReconnect->ReconnectOnConnectAccount(Data->Value);  //Add

            switch(Data->Value)

Open file NewUICustomMessageBox.cpp

Code: [Select]
CALLBACK_RESULT SEASON3B::CSystemMenuMsgBox::GameOverBtnDown(class CNewUIMessageBoxBase* pOwner, const leaf::xstreambuf& xParam)
{
   if (g_pReconnect->s_Data.ReconnectStatus == g_pReconnect->RECONNECT_STATUS_RECONNECT)  //Add
   {  //Add
      g_pReconnect->s_Data.ReconnectStatus = g_pReconnect->RECONNECT_STATUS_DISCONNECT;  //Add
   }  //Add

You require the following to view this post content:
  • You require a post count of at least 1, you need another 1 posts.
Bon Dia

z0lik


KRDB


🡱 🡳
Real Time Web Analytics