User/License Agreement at game launch

Salty Mike

hella salty
VIP
Неукротимое пламя
Сообщения
349
Розыгрыши
0
Решения
4
Репутация
163
Реакции
137
Баллы
1 438
Хроники
  1. Salvation
Исходники
Присутствуют
Сборка
L2-Ro
I have the following issue:
- When I log in, the game shows me the License window, as instructed by the core.
- However, it only works when I click ACCEPT with the MOUSE.
- If I press ENTER on the KEYBOARD, nothing happens. The client gets stuck and I have to press DECLINE and log back in again.
I am sure the issue is in the java, and not the client, because it works just fine when I use another core.
In fact, I have gone through this other core and reworked the entire process of the first core to be identical to the second one and it still does not fix the issue.

Does anybody know how to fix that, or point me to the file responsible for this?


Below is some of the code I've gone through. Notice the first if (Config.SHOW_LICENCE) in bold, it plays no role in this, as far as I could tell, because I added the IF statement myself in an effort to resolve the issue.

Java:
public SessionKey(int loginOK1, int loginOK2, int playOK1, int playOK2)
{
   _playOkID1 = playOK1;
   _playOkID2 = playOK2;
   _loginOkID1 = loginOK1;
   _loginOkID2 = loginOK2;

   int hashCode = playOK1;
   hashCode *= 17;
   hashCode += playOK2;
   hashCode *= 37;
   [B]if (Config.SHOW_LICENCE)[/B] {
      hashCode += loginOK1;
      hashCode *= 51;
      hashCode += loginOK2;
   }

   _hashCode = hashCode;
}

Java:
final SessionKey skey = (SessionKey) o;
if (Config.SHOW_LICENCE)
   return skey.checkLoginPair(_loginOkID1, _loginOkID2);
return true;

Java:
public boolean checkLoginPair(int loginOk1, int loginOk2)
{
   return _loginOkID1 == loginOk1 && _loginOkID2 == loginOk2;
}


EDIT: I forgot to add one more relevant piece of code in the RequestAuthLogin packet.

Java:
client.setAuthed(true);
client.setLogin(user);
client.setAccount(account);
client.setSessionKey(session.getSessionKey());
client.setState(LoginClientState.AUTHED);

if (Config.SHOW_LICENCE)
{
   client.sendPacket(new LoginOk(getClient().getSessionKey()));
}
else
{
   getClient().sendPacket(new ServerList(account));
}
 
Последнее редактирование:
Назад
Сверху Снизу