Resolved HWID or IP Lock On Log Off?

NovemberFalls

Vassal
Customer
Howdy,

Prefacing this by saying I saw this post, though it doesnt quite achieve what I was hoping, nor did I see it as fully resolved.

I am looking for someone to help me implement, or show me where I find the following.

- Help Implementing:
On Character log off a HWID or Public IP lock for X amount of time

- Help me find:
Where can I find a log in event or a log off event? The information is already being stored in the account_logs table, I just need to implement a quick on log in check the account, pull either (or both), the HWID / Public IP, and valididate it against incoming public IP / HWID (come to think of it, I only see the account_log for successfull connections... I don't see failed, so I dont know where incoming events are).

The goal is to help fight this constant relog meta, of people sharing accounts and buffing one another while logging in and out of chars.

I would welcome learning how to build an extension containing this as well, or paying for lessons etc.
 
Howdy,

Prefacing this by saying I saw this post, though it doesnt quite achieve what I was hoping, nor did I see it as fully resolved.

I am looking for someone to help me implement, or show me where I find the following.

- Help Implementing:
On Character log off a HWID or Public IP lock for X amount of time

- Help me find:
Where can I find a log in event or a log off event? The information is already being stored in the account_logs table, I just need to implement a quick on log in check the account, pull either (or both), the HWID / Public IP, and valididate it against incoming public IP / HWID (come to think of it, I only see the account_log for successfull connections... I don't see failed, so I dont know where incoming events are).

The goal is to help fight this constant relog meta, of people sharing accounts and buffing one another while logging in and out of chars.

I would welcome learning how to build an extension containing this as well, or paying for lessons etc.
I'm building a custom extension right now for that reason that ppl share accs to feed olympiad and etc.
 
You can't. I'm making the tests all alone. Soon the script will be ready. I just need more time because I am working on donate system now.
I can help you with the donate system + panel on a webpage. I stood up stripe pretty quickly, about 2 hours. It also delivers an in game item (I am using a coin I made called donation coin).
 
Howdy,

Prefacing this by saying I saw this post, though it doesnt quite achieve what I was hoping, nor did I see it as fully resolved.

I am looking for someone to help me implement, or show me where I find the following.

- Help Implementing:
On Character log off a HWID or Public IP lock for X amount of time

- Help me find:
Where can I find a log in event or a log off event? The information is already being stored in the account_logs table, I just need to implement a quick on log in check the account, pull either (or both), the HWID / Public IP, and valididate it against incoming public IP / HWID (come to think of it, I only see the account_log for successfull connections... I don't see failed, so I dont know where incoming events are).

The goal is to help fight this constant relog meta, of people sharing accounts and buffing one another while logging in and out of chars.

I would welcome learning how to build an extension containing this as well, or paying for lessons etc.
I don't quite understand why specifically on logut, if it can be done on login immediately. And remove it after the specified time.
I don't understand your idea at all. Okay, the player logged in, they are blocked by HWID, let's say the player is not with a different HWID - naturally, they couldn't. Let's say you have a 30-minute timer, what happens if someone with a different HWID logs into this character after 31 minutes?
Your technical specification lacks consistency. Put all the pieces together in your head and write what you need, IN SIMPLE WORDS! The simpler you explain, the more correctly and clearly your task will be performed.

I'm on the final stage. Currently I'm using paypal and binance for now. I'm just finishing now the ext.jar part.
View attachment 7405
I will block you if you don't stop confusing the Market section with the DEVELOPMENT section!!! This is not a sales section.

Here, people give advice or write code directly!
 
I don't quite understand why specifically on logut, if it can be done on login immediately. And remove it after the specified time.
I don't understand your idea at all. Okay, the player logged in, they are blocked by HWID, let's say the player is not with a different HWID - naturally, they couldn't. Let's say you have a 30-minute timer, what happens if someone with a different HWID logs into this character after 31 minutes?
Your technical specification lacks consistency. Put all the pieces together in your head and write what you need, IN SIMPLE WORDS! The simpler you explain, the more correctly and clearly your task will be performed.
Let me explain it a different way.

All I am looking for is a timer that locks the HWID on character logout for X amount of time, where X is determined by us. The goal is not to permanetly lock the HWID, its to enable account sharing but to discourage account sharing for buffing.

Many CP's and clans share accounts, and thats fine, but to me it goes against the initial point of lineage and main buffers to enable this multi relog culture. I don't want to stop clan leader account sharing for example, but buffing account sharing.
 
Let me explain it a different way.

All I am looking for is a timer that locks the HWID on character logout for X amount of time, where X is determined by us. The goal is not to permanetly lock the HWID, its to enable account sharing but to discourage account sharing for buffing.

Many CP's and clans share accounts, and thats fine, but to me it goes against the initial point of lineage and main buffers to enable this multi relog culture. I don't want to stop clan leader account sharing for example, but buffing account sharing.
Java:
package services;

import l2.gameserver.listener.actor.player.OnPlayerEnterListener;
import l2.gameserver.listener.actor.player.OnPlayerExitListener;
import l2.gameserver.model.Player;
import l2.gameserver.model.actor.listener.CharListenerList;
import l2.gameserver.network.l2.GameClient;
import l2.gameserver.network.l2.components.CustomMessage;
import l2.gameserver.network.l2.s2c.NpcHtmlMessage;
import l2.gameserver.scripts.Functions;
import l2.gameserver.scripts.ScriptFile;
import org.apache.commons.lang3.StringUtils;

/**
 * Protection against rapid HWID changes on the account.
 * - Upon login: save HWID, check cooldown
 * - Upon logout: save logout time
 */
public class HWIDWatcherService extends Functions implements ScriptFile, OnPlayerEnterListener, OnPlayerExitListener
{
  private static final String VAR_HWID = "hwid_watcher_hwid";
  private static final String VAR_LOGOUT_TIME = "hwid_watcher_logout";

  // Cooldown 30 min
  private static final long COOLDOWN = 30 * 60 * 1000L;

  @Override
  public void onPlayerEnter(Player player)
  {
    GameClient con = player.getNetConnection();
    if(con == null)
    {
      return;
    }

    String currentHwid = con.getHwid();
    if(StringUtils.isBlank(currentHwid))
    {
      return;
    }

    String savedHwid = player.getVar(VAR_HWID);
    long lastLogout = player.getVarLong(VAR_LOGOUT_TIME, 0);

    if(savedHwid == null)
    {
      player.setVar(VAR_HWID, currentHwid, -1);
      return;
    }

    if(StringUtils.equalsIgnoreCase(savedHwid, currentHwid))
    {
      return;
    }

    if(lastLogout == 0)
    {
      blockPlayer(player, COOLDOWN);
      return;
    }

    long passed = System.currentTimeMillis() - lastLogout;

    if(passed < COOLDOWN)
    {
      blockPlayer(player, COOLDOWN - passed);
    }
    else
    {
      player.setVar(VAR_HWID, currentHwid, -1);
    }
  }

  @Override
  public void onPlayerExit(Player player)
  {
    player.setVar(VAR_LOGOUT_TIME, System.currentTimeMillis(), -1);
  }

  private void blockPlayer(Player player, long timeLeft)
  {
    long minutes = (timeLeft / 60000) + 1;

    player.block();
    player.sitDown(null);

    player.sendMessage(new CustomMessage("hwid.change.cooldown", player).addNumber(minutes));

    NpcHtmlMessage html = new NpcHtmlMessage(0);
    html.setFile("scripts/services/hwid_change_cooldown.htm");
    html.replace("%minutes%", String.valueOf(minutes));
    player.sendPacket(html);
  }

  @Override
  public void onLoad()
  {
    CharListenerList.addGlobal(this);
  }

  @Override
  public void onReload() {}

  @Override
  public void onShutdown() {}
}
HTML scripts/services/hwid_change_cooldown.htm:
Code:
<html><body>
<center>
<br><br>
<font color="LEVEL">Attention!</font><br><br>
An account transfer has been detected.<br>
This character will be available for login in <font color="LEVEL">%minutes%</font> minutes.<br><br>
</center>
</body></html>
Strings data/strings:
Code:
data/strings/strings_en.properties
hwid.change.cooldown=Account transfer detected. Please wait {0} minutes.
data/stings/strings_ru.properties
hwid.change.cooldown=Обноружена передача аккаунта. Подождите {0} минут.
 
Last edited:
Let me explain it a different way.

All I am looking for is a timer that locks the HWID on character logout for X amount of time, where X is determined by us. The goal is not to permanetly lock the HWID, its to enable account sharing but to discourage account sharing for buffing.

Many CP's and clans share accounts, and thats fine, but to me it goes against the initial point of lineage and main buffers to enable this multi relog culture. I don't want to stop clan leader account sharing for example, but buffing account sharing.
The script will work without issues.
But how are you going to control that someone logged in on the main character (not a buffer)?
next / For example, there are 9 people, and 2 of them are playing as PP and SWS. And they suddenly lose electricity or have another issue.
Now those 7 people will have to wait your X amount of time in order to log into the character?
And then we also get the situation where, when the real owner of the character returns, he also will not be able to log in for X time, because you came up with such a “cool” idea!

And so on… And this is just the first thing that came to my mind. In reality, there will probably be many more problems with this approach.
 
The script will work without issues.
But how are you going to control that someone logged in on the main character (not a buffer)?
next / For example, there are 9 people, and 2 of them are playing as PP and SWS. And they suddenly lose electricity or have another issue.
Now those 7 people will have to wait your X amount of time in order to log into the character?
And then we also get the situation where, when the real owner of the character returns, he also will not be able to log in for X time, because you came up with such a “cool” idea!

And so on… And this is just the first thing that came to my mind. In reality, there will probably be many more problems with this approach.
Yes — this is intended behavior.

There is no perfect way to fight the relog meta without introducing trade-offs. In my view, this approach is still preferable to permanently HWID-locking characters at creation, because it introduces a time variable instead of a hard restriction.

The goal is not to block account sharing entirely. Clan leaders, crafters, and shared utility characters are still possible. The goal is to actively discourage rapid relogging purely for buffing, which undermines main buffers and encourages alt-army gameplay.

The examples you mentioned (disconnects, power loss, the owner returning later) are valid — but they are acceptable side effects of a system designed to reduce abuse, not eliminate it entirely. Any anti-relog system that actually works will inconvenience someone at some point.

What this specifically targets is the widespread practice of a small number of people rotating many characters across time zones to simulate larger groups. This has happened on every server — for example, the EU/NA rotation setups that allowed a handful of players to outperform much larger groups. That behavior consistently pushes the most organized or no-life setups far ahead of the rest of the server.

This system doesn’t eliminate that completely — nor is it meant to. If a group wants to designate a single relogger to manage buffs, that’s fine. What it does is raise the cost of doing it at scale, while keeping legitimate account sharing possible.

The only stricter alternative would be permanent HWID locks on character creation, which I explicitly do not want, as it breaks too many legitimate clan workflows.

You may disagree with the approach — that’s fair — but the trade-offs are intentional and aligned with the design goals.
 
Back
Top