pcIp,hop1,hop2,hop3,hop3 <- How to?
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 112
- Joined: Sat Apr 19, 2008 10:45 am
pcIp,hop1,hop2,hop3,hop3 <- How to?
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
hi everyone,
i was wondering how i could get pcIp,hop1,hop2,hop3,hop4 using a L2PcInstance into a script.
I don't wanna access the DB to get this information and i would like to do it using a L2PcInstance...
I saw this methods are used inside PlayerTracert.java but i'm not sure how to get this information from a L2PcInstance...
Any clue?
» Find Revision
L2J Revision Number:
L2JDP Revision Number:
hi everyone,
i was wondering how i could get pcIp,hop1,hop2,hop3,hop4 using a L2PcInstance into a script.
I don't wanna access the DB to get this information and i would like to do it using a L2PcInstance...
I saw this methods are used inside PlayerTracert.java but i'm not sure how to get this information from a L2PcInstance...
Any clue?
- Szponiasty
- Advanced User
- Posts: 557
- Joined: Mon Apr 21, 2008 1:31 pm
- Location: Eastern Poland
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
If nothing changed in freya, you will have to implement that yourself. As I recall you can get that in EnterWorld.java. So just add fields to L2PcInstance and in EnterWorld add assigning values for that fields. Add public getter for them in L2PcInstance and you can use it in scripts.
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
- JIV
- L2j Veteran
- Posts: 1882
- Joined: Sun Jan 06, 2008 8:17 pm
- Location: Slovakia
- Contact:
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
com.l2jserver.gameserver.network.L2GameClient.getTrace()
- Szponiasty
- Advanced User
- Posts: 557
- Joined: Mon Apr 21, 2008 1:31 pm
- Location: Eastern Poland
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
Yup. Sorry, I've forgot about that.JIV wrote:com.l2jserver.gameserver.network.L2GameClient.getTrace()
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
-
- Posts: 112
- Joined: Sat Apr 19, 2008 10:45 am
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
a big kiss!JIV wrote:com.l2jserver.gameserver.network.L2GameClient.getTrace()
Testing right now i'll let you know

-
- Posts: 112
- Joined: Sat Apr 19, 2008 10:45 am
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
well... i can't find a way to use it...
in this class are stored the methods i need.
the issue is that this methods must be called on a PlayerTracert object type...i have no idea on how to recall them from a L2PcInstance since i can't find any method like "getPlayerTracert" or anything like that...
I tried to create a PlayerTracert
But the data should be a byte[] as specified in the class constructor
The getTrace() method in the class you suggested me returns a int[][] and i'm not sure if they can be used...
Can you enlight me a little bit more?
Code: Select all
com.l2jserver.loginserver.gameserverpackets.PlayerTracert
Code: Select all
public String getPcIp() { return _pcIp; } /** * @return Returns 1st Traceroute Hop. */ public String getFirstHop() { return _hop1; } /** * @return Returns 2nd Traceroute Hop. */ public String getSecondHop() { return _hop2; } /** * @return Returns 3rd Traceroute Hop. */ public String getThirdHop() { return _hop3; } /** * @return Returns 4th Traceroute Hop. */ public String getFourthHop() { return _hop4; }
I tried to create a PlayerTracert
Code: Select all
PlayerTracert plt = new PlayerTracert(data);
Code: Select all
public PlayerTracert(byte[] decrypt) { super(decrypt); _account = readS(); _pcIp = readS(); _hop1 = readS(); _hop2 = readS(); _hop3 = readS(); _hop4 = readS(); }
Can you enlight me a little bit more?
- Szponiasty
- Advanced User
- Posts: 557
- Joined: Mon Apr 21, 2008 1:31 pm
- Location: Eastern Poland
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
Code: Select all
int[][] tracert = activeChar.getClient().getTrace(); for (int i=0; i < 5; i++) activeChar.sendMessage("route step "+(i+1)+" - "+tracert[i][0]+"."+tracert[i][1]+"."+tracert[i][2]+"."+tracert[i][3]);/** also check eg:* - activeChar.getClient().getConnection().....*/
Last edited by Szponiasty on Tue Dec 07, 2010 11:27 pm, edited 1 time in total.
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
-
- Posts: 112
- Joined: Sat Apr 19, 2008 10:45 am
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
I attached the screenshot of the message i receive.
I'm pretty sure i need to use that encrypted data and use it in the PlayerTracert argument
How should i do that? Creating an array of bytes and appending the printed results into it?
Thanks for the amazing suggestion
EDIT
seems like loginserveer packages cannot be imported...
gives me this error
I'm pretty sure i need to use that encrypted data and use it in the PlayerTracert argument
Code: Select all
1. public PlayerTracert(byte[] the_data_printed_in_the_chat) 2. { 3. super(decrypt); 4. _account = readS(); 5. _pcIp = readS(); 6. _hop1 = readS(); 7. _hop2 = readS(); 8. _hop3 = readS(); 9. _hop4 = readS(); 10. }
Thanks for the amazing suggestion

EDIT
seems like loginserveer packages cannot be imported...
Code: Select all
import com.l2jserver.loginserver.gameserverpackets.PlayerTracert;
Code: Select all
1. ERROR in /AntiDualBox.java (at line 16) import com.l2jserver.loginserver.gameserverpackets.PlayerTracert; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^The import com.l2jserver.loginserver.gameserverpackets.PlayerTracert cannot be resolved----------2. ERROR in /AntiDualBox.java (at line 36) player.sendMessage(ptc.getFirstHop()); ^^^^^^^^^^^The method getFirstHop() is undefined for the type PlayerTracert
You do not have the required permissions to view the files attached to this post.
- Szponiasty
- Advanced User
- Posts: 557
- Joined: Mon Apr 21, 2008 1:31 pm
- Location: Eastern Poland
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
Read my post above. You have complete and working code for that.
And don't use com.l2jserver.loginserver.gameserverpackets.PlayerTracert;...
//EDIT: Sry - my mistake
Corrected code above.
And don't use com.l2jserver.loginserver.gameserverpackets.PlayerTracert;...
//EDIT: Sry - my mistake

And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
- JIV
- L2j Veteran
- Posts: 1882
- Joined: Sun Jan 06, 2008 8:17 pm
- Location: Slovakia
- Contact:
Re: pcIp,hop1,hop2,hop3,hop3 <- How to?
i think there is admin command //tracert or something like that.