Skip to content

Instantly share code, notes, and snippets.

@LeonanCarvalho
Last active June 16, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeonanCarvalho/4681f543399924d093524fa8ac0ec8bb to your computer and use it in GitHub Desktop.
Save LeonanCarvalho/4681f543399924d093524fa8ac0ec8bb to your computer and use it in GitHub Desktop.
//FROM gameserver/server.jar!/l2/gameserver/network/l2/c2s/CharacterSelected.class
protected void runImpl() {
//...
if (Config.ALT_LIMIT_HWID_WINDOW != 0 && !StringUtils.isEmpty(var1.getHwid())) {
//You could simple check if the account is premium and byypass here...
int hwidCount = 0;
Iterator AllPlayers = GameObjectsStorage.getAllPlayersForIterate().iterator();
while(AllPlayers.hasNext()) {
Player tPlayer = (Player)AllPlayers.next();
if (tPlayer != null && !tPlayer.isLogoutStarted()) {
GameClient tGClient = tPlayer.getNetConnection();
//Or....
//ByPass premium from window verification, or check if the bonus service allows to bypass, or window extra counting, something else
//Some configs could be implemented
if(!tPlayer.isPremiumWindow()){ //TODO: Implement on Player Class the method isPremiumWindow() bool or someting else as did on startBonusTask method
if (tGClient != null && tGClient.isConnected() && StringUtils.equals(PlayerGameClient.getHwid(), tGClient.getHwid())) {
++hwidCount;
}
}
}
}
if (hwidCount >= Config.ALT_LIMIT_HWID_WINDOW) {
this.sendPacket(new ExShowScreenMessage("The number of windows is limited by " + Config.ALT_LIMIT_HWID_WINDOW + " HWID", 10000, ScreenMessageAlign.TOP_CENTER, true));
this.sendPacket(ActionFail.STATIC);
return;
}
}
//..
@LeonanCarvalho
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment