Ir para conteúdo
  • Cadastre-se
  • 0

negativo é pra remover?


chris500

Pergunta

Ola to compilando um codigo anti duplica items. e to nessa parte... Que ta NEGATIVO ( - ) É PRA EU REMOVE DO MEU CLIENTE??? ESSA MINHA DUVIDA!

 

  1. - public void addGameServerLogin(String account, L2GameClient client)
  2. - {
  3. - _accountsInGameServer.put(account, client);
  4. - }
  5. + public boolean addGameServerLogin(String account, L2GameClient client)
  6. + {
  7. + L2GameClient savedClient = _accountsInGameServer.get(account);
  8. +
  9. + if (savedClient != null) {
  10. + if (savedClient.isDetached()) {
  11. + if (Config.DEBUG)
  12. + _log.info("Old Client was disconnected: Offline or OfflineMode --> Login Again");
  13. + ((FastMap<String, L2GameClient>) _accountsInGameServer).put(account, client);
  14. + return true;
  15. + }
  16. + if (Config.DEBUG)
  17. + _log.info("Old Client was online --> Close Old Client Connection");
  18. + savedClient.closeNow();
  19. + _accountsInGameServer.remove(account);
  20. + return false;
  21. + }
  22. + if (Config.DEBUG)
  23. + _log.info("Client was not online --> New Client Connection");
  24. + ((FastMap<String, L2GameClient>) _accountsInGameServer).put(account, client);
  25. + return true;
  26. + }
  27. public void sendAccessLevel(String account, int level)
  28. {
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts recomendados


Visitante
Este tópico está impedido de receber novos posts.




×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.