Sorry, if I post in wrong place, I could not find a more suitable.
Some teams add offline trade restore function in their servers.
I tried transfer this function from L2Dream то l2jserver, but encountered the problem.
Server loads the character. When player tries enter to this account, client reports, that account is in use, but server doesn't kick "oflline character" and player can't login.
Server loads charactes, using following code in Gameserver.java for testing puproses:
Code: Select all
L2GameClient client = new L2GameClient(new MMOConnection<L2GameClient>(_selectorThread));client.setConnection(null);Integer id=12345678;client.setCharSelection(id);L2PcInstance p = client.loadCharFromDisk(0);client.setAccountName("testtest");p.spawnMe();p.setOnlineStatus(true);p.restoreEffects();p.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);p.broadcastUserInfo();p.closeNetConnection();
i also change method in L2PcInstance
Code: Select all
public String getAccountName() { if (getClient() == null || getClient().isDetached()) //return "disconnected"; return "testtest"; return getClient().getAccountName(); }

Maybe someone gives me advice about this trouble?