Advertisement
Bluur

DualBox Olympiad

Jan 12th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.44 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. Index: java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java
  3. ===================================================================
  4. --- java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java    (revision 1)
  5. +++ java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameTask.java    (working copy)
  6. @@ -187,6 +187,12 @@
  7.                  // Game start, port players to arena
  8.                  case GAME_STARTED:
  9.                  {
  10. +                    if (_game.checkDualbox())
  11. +                    {
  12. +                        _state = GameState.CLEANUP;
  13. +                        break;
  14. +                    }
  15. +                    
  16.                      if (!startGame())
  17.                      {
  18.                          _state = GameState.GAME_STOPPED;
  19. Index: java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java
  20. ===================================================================
  21. --- java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java    (revision 1)
  22. +++ java/net/sf/l2j/gameserver/model/olympiad/AbstractOlympiadGame.java    (working copy)
  23. @@ -430,4 +430,6 @@
  24.      protected abstract int getDivider();
  25.      
  26.      protected abstract int[][] getReward();
  27. +    
  28. +    protected abstract boolean checkDualbox();
  29.  }
  30. \ No newline at end of file
  31. Index: java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java
  32. ===================================================================
  33. --- java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java    (revision 1)
  34. +++ java/net/sf/l2j/gameserver/model/olympiad/OlympiadGameNormal.java    (working copy)
  35. @@ -513,6 +513,22 @@
  36.      }
  37.      
  38. +    @Override
  39. +    protected boolean checkDualbox()
  40. +    {
  41. +        String ip1 = _playerOne.player.getClient().getConnection().getInetAddress().getHostAddress();
  42. +        String ip2 = _playerTwo.player.getClient().getConnection().getInetAddress().getHostAddress();
  43. +        
  44. +        if (ip1.equals(ip2))
  45. +        {
  46. +            _playerOne.player.sendMessage("[Duabox Protection]: Seu adversario [" + _playerTwo.player.getName() + "] possui o mesmo ip que o seu!");
  47. +            _playerTwo.player.sendMessage("[Duabox Protection]: Seu adversario [" + _playerOne.player.getName() + "] possui o mesmo ip que o seu!");
  48. +            return true;
  49. +        }
  50. +        
  51. +        return false;
  52. +    }
  53.    
  54.     @Override
  55.      public final void resetDamage()
  56.      {
  57.          _damageP1 = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement