Author Topic: Files Source Registro By OBBY Season 6  (Read 7580 times)

dakosmu on: July 10, 2023, 05:32:23 PM

  • Global Moderator
  • Newbie
  • *****
  • Posts: 9
    • View Profile
Source  Registro en Main, JoinServer, Gameserver By OBBY Season 6





les compartos la guia completa para agregar el sistema de Registro en Main... Recuerden que las todas las beses no son iguales...

Espero que les funciones a todos  rebote


Protocol.h

Code: [Select]
typedef struct
{
  #pragma pack(1)
  PSBMSG_HEAD Header;
  char lpszID[10];
  char lpszPass[20];
  char lpszPCode[20];
  char lpszEmail[50];
  DWORD TickCount;
  BYTE Versión[5];
  Serie BYTE[16];
  #pragma pack()
} PBMSG_REGISTER_ACCOUNT, * LPPBMSG_REGISTER_ACCOUNT;


Protocol.cpp

Code: [Select]
#include "LoginMainWin.h"
Code: [Select]
// Dentro de:

case 0xF1:
        switch(((lpMsg[0 ]==0xC1)?lpMsg[3]:lpMsg[4]))
        {
                                .
            .
            .
                  .
            caso 0x12:
            g_pLoginMainWin.ReciveCreateAccount(((lpMsg[0]==0xC1)?lpMsg[4]:lpMsg[5]));
            romper;
        }
        break;


Interface.cpp


Code: [Select]
// Agregar Seccion IMAGEN

// AutoLogin / Register
  LoadBitmapA("Custom\\Desig\\login_auto.tga", 531141, GL_NEAREST, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\login_auto.tga", 531141, GL_NEAREST, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\Login.tga", 71621, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\1.tga", 71622, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\2.tga", 71623, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\3.tga", 71624, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\4.tga", 71625, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\5.tga", 71626, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\6.tga", 71627, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\8.tga", 71629, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\9.tga", 71630, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\10.tga", 71630, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\login_back.tga", 71631, GL_LINEAR, GL_CLAMP, 1, 0);
  LoadBitmapA("Personalizado\\Diseño\\reloadcap.jpg", 71632, GL_LINEAR, GL_CLAMP, 1, 0);


Main.cpp

Code: [Select]
#include "LoginMainWin.h"
#include "AutoLoginWin.h"

Code: [Select]
// Agregar dentro de:

extern "C" _declspec(dllexport) void EntryProc() / / Aceptar
{     
//
//
//
//
   
      g_pLoginMainWin.Init(); // Inicio de sesión automático / Registro
      AutoLogin.Load(); // Auto Login / Register
   
}


Seguimos con SRC JOINSERVE

stdafx.h

Code: [Select]
// Abajo de

#define JOINSERVER_VERSION

// Agregar:

#define OBBY 1

JoinServerProtocol.cpp
Code: [Select]
// Abajo de :

      caso 0x30:
        GJExternalDisconnectAccountRecv((SDHP_EXTERNAL_DISCONNECT_ACCOUNT_RECV*)lpMsg,index);
        romper;

// Agregar:

#if(OBBY)
      case 0x40:
        GJRegisterAccountRecv((SDHP_REGISTER_ACCOUNT_SEND*)lpMsg,index);
        romper;
#endif

Code: [Select]
// Abajo de:

  gLog.Output(LOG_ACCOUNT,"[AccountInfo] Cuenta conectada (Cuenta: %s, IpAddress: %s, GameServerCode: %d)",AccountInfo.Account,AccountInfo. Dirección IP, Información de la cuenta. Código del servidor del juego);
}

// Agregar:

#if(OBBY)
void GJRegisterAccountRecv(SDHP_REGISTER_ACCOUNT_SEND* lpMsg,int index)
{
  SDHP_CONNECT_ACCOUNT_SEND pMsg;

  pMsg.header.set(0x40,sizeof(pMsg));

  pMsj.index = lpMsg->index;
 
  memcpy(pMsg.cuenta,lpMsg->cuenta,tamaño(pMsg.cuenta));

  pMsg.result = CREATE_ACCOUNT_FAIL_ID;

  if(CheckTextSyntax(lpMsg->cuenta,tamaño(lpMsg->cuenta)) == 0)
  {
      pMsg.result = CREATE_ACCOUNT_FAIL_RESIDENT;
      gSocketManager.DataSend(índice,(BYTE*)&pMsg,pMsg.header.size);
      LogAdd(LOG_RED,"Cuenta %s Registrar falla en la sintaxis!");
      devolver;
  }

    if(gAccountManager.GetAccountCount() >=
#if PROTECT_STATE
        gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType]
#else
        MAX_ACCOUNT
#endif
        )
  if(gAccountManager.GetAccountCount() >= gJoinServerMaxAccount[gProtect.m_AuthInfo.PackageType][gProtect.m_AuthInfo.PlanType])
  {
      pMsg.result = CREATE_ACCOUNT_FAIL_RESIDENT;
      gSocketManager.DataSend(índice,(BYTE*)&pMsg,pMsg.header.size);
      LogAdd(LOG_RED,"Error en el registro de la cuenta %s, ¡¡¡CONEXIÓN!!!");
      devolver;
  }
  if(MD5Encryption == 0)
  {
      if(gQueryManager.ExecQuery("SELECT memb__pwd FROM MEMB_INFO WHERE memb___id='%s' COLLATE Latin1_General_BIN",lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
      {
        gQueryManager.Cerrar();
        if (gQueryManager.ExecQuery("INSERT INTO dbo.MEMB_INFO(memb___id, memb__pwd, memb_name, sno__numb, mail_addr, mail_chek, block_code, ctl1_code) VALORES ('%s', '%s', '%s', '%s' , '%s', 1, 0, 1)",
            lpMsg->cuenta,
            lpMsg->contraseña,
            "JoinServer",
            lpMsg->código personal,
            lpMsg->Email) == TRUE)
        {
            gQueryManager.Close();
            pMsg.result = CREAR_CUENTA_ÉXITO;
            gLog.Output(LOG_ACCOUNT, "[AccountInfo] Cuenta creada (Cuenta: %s, Contraseña: %s )", lpMsg->cuenta, lpMsg->contraseña);
        }
      }
      else
      {
        pMsg.result = CREATE_ACCOUNT_FAIL_ID;
        gQueryManager.Cerrar();
      }
  }
  else
  {
      if(gQueryManager.ExecQuery("SELECT memb__pwd FROM MEMB_INFO WHERE memb___id='%s'",lpMsg->account) == 0 || gQueryManager.Fetch() == SQL_NO_DATA) { gQueryManager.Close(
      )
        ;
        if (gQueryManager.ExecQuery("INSERT INTO dbo.MEMB_INFO(memb___id, memb__pwd, memb_name, sno__numb, mail_addr, mail_chek, block_code, ctl1_code) VALORES ('%s', '%s', '%s', '%s' , '%s', 1, 0, 1)",
            lpMsg->cuenta,
            lpMsg->contraseña,
            "JoinServer",
            lpMsg->códigopersonal,



            pMsg.result = CREAR_CUENTA_ÉXITO;
            gLog.Output(LOG_ACCOUNT, "[AccountInfo] Cuenta creada (Cuenta: %s, Contraseña: %s )", lpMsg->cuenta, lpMsg->contraseña);
        }
      }
      else
      {
        pMsg.result = CREATE_ACCOUNT_FAIL_ID;
        gQueryManager.Cerrar();
      }
   
  }
  gSocketManager.DataSend(índice,(BYTE*)&pMsg,pMsg.header.size);
}
#endif


JoinServerProtocol.h

Code: [Select]
//Abajo de
#pragma once

//Agregar Esto

#define CREATE_ACCOUNT_FAIL_ID 0
#define CREATE_ACCOUNT_SUCCESS 1
#define CREATE_ACCOUNT_FAIL_RESIDENT 2

Code: [Select]
// Abajo de:
char IpAddress[16];
};

// Agregar:

#if(OBBY)
struct SDHP_REGISTER_ACCOUNT_SEND
{
  PBMSG_HEAD header; // C1:01
  índice de PALABRA;
  cuenta char[11];
  contraseña de char[11];
  char código personal[11];
  char Correo electrónico[50];
};
#endif [code]

[code] // Abajo de:

void GJAccountLockSaveRecv(SDHP_LOCK_SAVE_RECV* lpMsg,int index);

// Agregar:

#if(OBBY)
void GJRegisterAccountRecv(SDHP_REGISTER_ACCOUNT_SEND* lpMsg,int index);
#endif



Seguimos con SRC GAMERSERVE

stdafx.h
Code: [Select]
// Agregar:

#define OBBY 1

JSProtocol.cpp

Code: [Select]
// Abajo de:

      case 0x30:
        JGAccountAlreadyConnectedRecv((SDHP_ACCOUNT_ALREADY_CONNECTED_RECV*)lpMsg);
        romper;
       
// Agregar:

#if(OBBY)
      case 0x40:
        JGRegisterAccountRecv((SDHP_CONNECT_ACCOUNT_RECV*)lpMsg);
        romper;
#endif


Code: [Select]
// Abajo de:

void JGServerInfoRecv(SDHP_JOIN_SERVER_INFO_RECV* lpMsg) // OK
{

}

// Agregar:

#if(OBBY)
void JGRegisterAccountRecv(SDHP_CONNECT_ACCOUNT_RECV* lpMsg) // OK
{
  if(OBJECT_RANGE( lpMsg->index) == 0)
  {
      volver;
  }

  if((gObj[lpMsg->index].LoginMessageSend--) == 0)
  {
      CloseClient(lpMsg->index);
      devolver;
  }

  if(gObj[lpMsg->index].Connected != OBJECT_CONNECTED)
  {
      GJDisconnectAccountSend(lpMsg->index,lpMsg->account,gObj[lpMsg->index].IpAddr);
      devolver;
  }

  GCRegisterAccountSend(lpMsg->índice, lpMsg->resultado);
  devolver;
}
#endif [code]


[code]// Abajo de:

gJoinServerConnection.DataSend((BYTE*)&pMsg,pMsg.header.size);
}

// Agregar:

#if(OBBY)
void GJRegisterAccountSend(int aIndex,char* cuenta,char* contraseña,char* código personal,char* Email)
{
  SDHP_REGISTER_ACCOUNT_SEND pMsj;

  pMsg.header.set(0x40,sizeof(pMsg));

  pMsg.index = aIndex;

  memcpy(pMsg.cuenta,cuenta,tamaño(pMsg.cuenta));

  memcpy(pMsg.contraseña,contraseña,tamaño(pMsg.contraseña));

  memcpy(pMsg.personalcode,personalcode,sizeof(pMsg.personalcode));

  memcpy(pMsg.Email,Email,sizeof(pMsg.Email));

  gJoinServerConnection.DataSend((BYTE*)&pMsg,pMsg.header.size);
}
#endif [code]


JSProtocol.h

[code]// Abajo de:

char IpAddress[16];
};

// Agregar:

#if(OBBY)
struct SDHP_REGISTER_ACCOUNT_SEND
{
  PBMSG_HEAD header; // C1:01
  índice de PALABRA;
  cuenta char[11];
  contraseña de char[11];
  char código personal[11];
  char Correo electrónico[50];
};
#endif


Code: [Select]
// Abajo de:

void GJAccountLockSaveSend(int aIndex,int Lock);

// Agregar:

#if(OBBY)
void JGRegisterAccountRecv(SDHP_CONNECT_ACCOUNT_RECV* lpMsg);
void GJRegisterAccountSend(int aIndex,char* cuenta,char* contraseña,char* código personal,char* IpAddress);
#endif

Protocol.cpp
Code: [Select]
// Abajo de:

            case 0x02:
              CGCloseClientRecv((PMSG_CLOSE_CLIENT_RECV*)lpMsg,aIndex);
              romper;

// Agregar:
#if(OBBY)
            caso 0x12:
              CGRegisterAccountRecv((PMSG_REGISTER_ACCOUNT_RECV*)lpMsg,aIndex);
              devolver;
#endif

Code: [Select]
// Abajo de:

GJConnectAccountSend(aIndex, cuenta, contraseña, lpObj->IpAddr);
  }

#endif
}

// Agregar:

#if(OBBY)
void CGRegisterAccountRecv(PMSG_REGISTER_ACCOUNT_RECV* lpMsg,int aIndex)
{
  LPOBJ lpObj = &gObj[aIndex];

  if(lpObj->Connected != OBJECT_CONNECTED)
  {
      CloseClient(aIndex);
      devolver;
  }

  if(memcmp(gServerInfo.m_ServerVersion,lpMsg->ClientVersion,sizeof(lpMsg->ClientVersion)) != 0)
  {
      GCConnectAccountSend(aIndex,6);
      devolver;
  }

  if(memcmp(gServerInfo.m_ServerSerial,lpMsg->ClientSerial,sizeof(lpMsg->ClientSerial)) != 0)
  {
      GCConnectAccountSend(aIndex,6);
      devolver;
  }

  if(lpObj->LoginMessageSend == 0)
  {
      lpObj->LoginMessageSend++;
      lpObj->LoginMessageCount++;
      lpObj->ConnectTickCount = GetTickCount();
      lpObj->ClientTickCount = lpMsg->TickCount;
      lpObj->ServerTickCount = GetTickCount();

      cuenta char[11] = {0};

      PacketArgumentDecrypt(cuenta,lpMsg->cuenta,(tamañode(cuenta)-1));

      char contraseña[11] = {0};

      PacketArgumentDecrypt(contraseña,lpMsg->contraseña,(tamañode(contraseña)-1));

      char CódigoPersonal[11] = {0};

      PacketArgumentDecrypt(PersonalCode,lpMsg->PersonalCode,(sizeof(PersonalCode)-1));

      char Correo electrónico personal[50] = {0};

      PacketArgumentDecrypt(Correo electrónico personal, lpMsg->szEmail, (tamaño de (Correo electrónico personal)-1));

      lpObj->MapServerMoveRequest = 0;
      lpObj->ÚltimoCódigoServidor = -1;
      lpObj->DestMap = -1;
      lpObj->DestX = 0;
      lpObj->DestY = 0;

      GJRegisterAccountSend(aIndex,cuenta,contraseña,PersonalCode, PersonalEmail);
  }
}
#endif [code]


[code]// Abajo de:

DataSend(aIndex,(BYTE*)&pMsg,pMsg.header.size);
}

// Agregar:

#if(OBBY)
void GCRegisterAccountSend(int aIndex,BYTE result) // OK
{
  PMSG_CONNECT_ACCOUNT_SEND pMsg;

  pMsg.header.set(0xF1,0x12,sizeof(pMsg));

  pMsj.resultado = resultado;

  DataSend(aIndex,(BYTE*)&pMsg,pMsg.header.size);
}
#endif

Protocol.h

Code: [Select]
// Abajo de:

BYTE ClientSerial[16];
  #pragma pack()
  #endif
};

// Agregar:

#if(OBBY)
struct PMSG_REGISTER_ACCOUNT_RECV
{
  #pragma pack(1)
  PSBMSG_HEAD header; // C3:F1:01
  cuenta char[10];
  contraseña char[20];
  char CódigoPersonal[20];
  char szEmail[50];
  DWORD TickCount;
  BYTE ClientVersion[5];
  BYTE ClientSerial[16];
  #paquete pragmático()
};
#endif
Code: [Select]
// Abajo de:

  void CGReqCastleHuntZoneEntrance(PMSG_REQ_MOVE_TO_CASTLE_HUNTZONE * aRecv, int iIndex);

// Agregar:

#if(OBBY)
  void GCRegisterAccountSend(int aIndex,BYTE result);
  void CGRegisterAccountRecv(PMSG_REGISTER_ACCOUNT_RECV* lpMsg,int aIndex);
#endif



Creditos
OBBY
« Last Edit: July 10, 2023, 05:35:15 PM by Matias »