Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Help autenticar AuthServer + GameServer  (Visto 1651 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline lcthesecond Posteado: July 21, 2020, 10:15:42 AM | Modificado: July 23, 2020, 11:24:56 AM by lcthesecond

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 33
  • Gracias recibida: 244
  • 00
Ola amigos da TSM.
Estou estudando C++ e escolhi usar a Source do Louis Emulator Season 6 UP 13 para me ajudar a aprender.
Estou estudando o sistema de autenticação com o AuthServer da MuEmu que existe nos files X-Team MuEmu aqui no Forum.

Tenho o seguinte set UP

Windows Server 2016
SQL Server 2014
CS, DS, JS, GS (Louis Emu UP13 Source)
AuthServer (MuEmu X-team)
Sistema de Licença PHP para AuthServer com DataBase

- Ativei sistema de licença no GS, Compilei o AuthServer. fiz "Restore"da DataBase.

- Ligo o AuthServer Sem Erros.

- Quando Ligo o GS ele não autentica. Estou tendo erro a partir do #6 (Customer Name Validation)

Ao analisar o processo pelo código e pela DataBase cheguei a conclusão que o GS manda os dados (Data_SEND) e o AuthServer recebe os dados (Data_Recv)

O AuthServer salva os dados em LOG.

Porem ao retornar o com os dados AuthServer --> GameServer
O GameServer não consegue comparar os dados ( strcmp != 0) em Protect.cpp

Code: [Select]

if(strcmp(this->m_AuthInfo.CustomerName,gServerInfo.m_CustomerName) != 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(6);
return;
}


Se alguém ja resolveu esse problema e estiver disposto a me ensinar. Eu agradeço.

Obrigado.



UPDATE 23/07/2020

Obrigado a quem tentou me ajudar,

Consegui solucionar o problema.
Não consegui descobrir exatamente o que estava errado.

Porem. Peguei os arquivos Protect.cpp e Proteção.h originais da MuEmu. 
Adaptei as opções de Error Message igual tinha no Sistema UP 13 do Louis
e voltou a funcionar.

Talvez nessa update do Louis ele tenha mudado algo quando desabilitou a Protect.


Obrigado.

Gracias:


Offline djagripnos #1 Posteado: July 21, 2020, 10:46:38 AM

  • MAESTRO

  • US. DE HONOR

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 824
  • Gracias recibida: 27496
  • gr
@lcthesecond This problem I have fixed is an issue with ip + port ;)


Offline lcthesecond #2 Posteado: July 21, 2020, 11:03:11 AM

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 33
  • Gracias recibida: 244
  • 00
@lcthesecond This problem I have fixed is an issue with ip + port ;)

Hum... Au vi apenas config de IP e Porta antes do Data_Send no GS.
Porem como ele estava mandando pro Auth, nao pensei que seria isso.

Existem algun outro lugar para checar IP e Porta?

Obrigado.


Offline djagripnos #3 Posteado: July 21, 2020, 11:13:30 AM

  • MAESTRO

  • US. DE HONOR

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 824
  • Gracias recibida: 27496
  • gr

Offline lcthesecond #4 Posteado: July 21, 2020, 11:45:37 AM | Modificado: July 21, 2020, 11:48:03 AM by lcthesecond

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 33
  • Gracias recibida: 244
  • 00
https://tuservermu.com.ve/index.php?topic=23734.msg117460#msg117460

Este foi a DB que eu baixei.

Porem minha duvida vem devido ao meu código em protect.cpp


Code: [Select]

if(this->ConnectToAuthServer(this->GetEncryptedString(gProtectString3,sizeof(gProtectString3)),1256) == 0) // Auth Server IP
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(1);
return;
}

if(this->AuthServerDataSend(ServerType) == 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(2);
return;
}

if(recv(this->m_socket,(char*)&this->m_AuthInfo,sizeof(this->m_AuthInfo),0) != sizeof(SDHP_AUTH_SERVER_DATA_RECV))
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(3);
return;
}

if(this->m_AuthInfo.EncKey != this->m_EncKey)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(4);
return;
}

for(int n=4;n < sizeof(SDHP_AUTH_SERVER_DATA_RECV);n++)
{
((BYTE*)&this->m_AuthInfo)[n] += 0xDA;
((BYTE*)&this->m_AuthInfo)[n] ^= this->m_AuthInfo.EncKey+0x25;
}


if(this->m_AuthInfo.Status != AUTH_SERVER_STATUS_SUCCESS-1)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(5);
return;
}

if(strcmp(this->m_AuthInfo.CustomerName,gServerInfo.m_CustomerName) != 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(6);
return;
}

if(this->GetComputerHardwareId() == 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(7);
return;
}

if(strcmp(this->m_AuthInfo.CustomerHardwareId,this->m_ComputerHardwareId) != 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(8);
return;
}

if(this->m_AuthInfo.PackageType < GAMESERVER_CLIENTE_UPDATE)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(9);
return;
}
// Auth Server Test

if(this->m_AuthInfo.PlanType < GAMESERVER_CLIENTE_PREMIUM)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(10);
return;
}




Como pode ver no meu código.

Meu erro é a partir do ERRO #6

Eu consigo fazer a conexão entre GameServer - > AuthServer


Problema esta quando ele compara as STRING

Gracias:


Offline walkeny #5 Posteado: February 01, 2021, 11:22:23 PM

  • 0 puntos por ventas
  • *
  • Rank: Experto
  • Posts: 168
  • Gracias recibida: 1057
  • ni
https://tuservermu.com.ve/index.php?topic=23734.msg117460#msg117460

Este foi a DB que eu baixei.

Porem minha duvida vem devido ao meu código em protect.cpp


Code: [Select]

if(this->ConnectToAuthServer(this->GetEncryptedString(gProtectString3,sizeof(gProtectString3)),1256) == 0) // Auth Server IP
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(1);
return;
}

if(this->AuthServerDataSend(ServerType) == 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(2);
return;
}

if(recv(this->m_socket,(char*)&this->m_AuthInfo,sizeof(this->m_AuthInfo),0) != sizeof(SDHP_AUTH_SERVER_DATA_RECV))
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(3);
return;
}

if(this->m_AuthInfo.EncKey != this->m_EncKey)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(4);
return;
}

for(int n=4;n < sizeof(SDHP_AUTH_SERVER_DATA_RECV);n++)
{
((BYTE*)&this->m_AuthInfo)[n] += 0xDA;
((BYTE*)&this->m_AuthInfo)[n] ^= this->m_AuthInfo.EncKey+0x25;
}


if(this->m_AuthInfo.Status != AUTH_SERVER_STATUS_SUCCESS-1)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(5);
return;
}

if(strcmp(this->m_AuthInfo.CustomerName,gServerInfo.m_CustomerName) != 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(6);
return;
}

if(this->GetComputerHardwareId() == 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(7);
return;
}

if(strcmp(this->m_AuthInfo.CustomerHardwareId,this->m_ComputerHardwareId) != 0)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(8);
return;
}

if(this->m_AuthInfo.PackageType < GAMESERVER_CLIENTE_UPDATE)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(9);
return;
}
// Auth Server Test

if(this->m_AuthInfo.PlanType < GAMESERVER_CLIENTE_PREMIUM)
{
closesocket(this->m_socket);
this->m_socket = INVALID_SOCKET;
this->ErrorMessageBox(10);
return;
}




Como pode ver no meu código.

Meu erro é a partir do ERRO #6

Eu consigo fazer a conexão entre GameServer - > AuthServer


Problema esta quando ele compara as STRING

Você conseguiu resolver porque o AuthServer não envia os dados para o Gameserver?, Ou melhor, porque aparece o erro # 6?


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
803 Views
Last post August 08, 2018, 01:58:14 PM
by Gaboo;
4 Replies
2932 Views
Last post July 26, 2019, 06:27:49 PM
by -Rastaa.TSM☢
2 Replies
1024 Views
Last post May 14, 2019, 10:09:31 AM
by paladium
36 Replies
5891 Views
Last post November 09, 2022, 02:00:16 AM
by boybudz321
26 Replies
5478 Views
Last post June 21, 2023, 02:05:33 AM
by AZURE