Offline Shops ip

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Offline Shops ip

Post by Attila »

Hi
How can i make it that offline shops not be counted
I have Maximum number of players per IP 5
but if i put 2 offline shops to server i can put only 3 online charts.
how can i make it i can log 5 charts to game and still got ofline shops at the server.
thanks
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

Some Help here please :eh:
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Offline Shops ip

Post by LasTravel »

Dont count detached clients from the same ip.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

LasTravel wrote:Dont count detached clients from the same ip.
can you tell me how do I do that :eh:
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Offline Shops ip

Post by LasTravel »

Show me your code and I'll tell you how to change it.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

LasTravel wrote:Show me your code and I'll tell you how to change it.
thanks
But If you can tell me what code you want to see from me?
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

Attila wrote:
LasTravel wrote:Show me your code and I'll tell you how to change it.
thanks
But If you can tell me what code you want to see from me?
Someone tell me wat to need to change this
HorridoJoho
L2j Senior Developer
L2j Senior Developer
Posts: 795
Joined: Sun Aug 14, 2005 11:27 am

Re: Offline Shops ip

Post by HorridoJoho »

LasTravel means you have to do this in java. Instead of counting all players which are returned by L2World#getAllPlayers(), you need to loop through the array returned by L2World#getAllPlayers() and only count the players with a network connection. Something like

Code: Select all

L2PcInstance[] worldPlayers = L2World.getInstance().getAllPlayers();
int actualOnlinePlayers = 0;
for (L2PcInstance worldPlayer : worldPlayers)
{
	if (!worldPlayer.getConnection().isDetached())
	{
	    ++actualOnlinePlayers;
	}
}
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

HorridoJoho wrote:LasTravel means you have to do this in java. Instead of counting all players which are returned by L2World#getAllPlayers(), you need to loop through the array returned by L2World#getAllPlayers() and only count the players with a network connection. Something like

Code: Select all

L2PcInstance[] worldPlayers = L2World.getInstance().getAllPlayers();
int actualOnlinePlayers = 0;
for (L2PcInstance worldPlayer : worldPlayers)
{
	if (!worldPlayer.getConnection().isDetached())
	{
	    ++actualOnlinePlayers;
	}
}
Sorry but were do i need to change this ?
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

HorridoJoho wrote:LasTravel means you have to do this in java. Instead of counting all players which are returned by L2World#getAllPlayers(), you need to loop through the array returned by L2World#getAllPlayers() and only count the players with a network connection. Something like

Code: Select all

L2PcInstance[] worldPlayers = L2World.getInstance().getAllPlayers();
int actualOnlinePlayers = 0;
for (L2PcInstance worldPlayer : worldPlayers)
{
	if (!worldPlayer.getConnection().isDetached())
	{
	    ++actualOnlinePlayers;
	}
}
Someone can explain what i need to do please :eh:
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

help how do i make this work :eh:
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

can someone tell me how i can do this
I really don't not how I how I do this

Please help

thanks
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: Offline Shops ip

Post by LasTravel »

You have an example at this post, no one will do it for you.
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

LasTravel wrote:You have an example at this post, no one will do it for you.

i don't no were do i made to change it
where do need to look to what file
What is the file name ?
Attila
Posts: 441
Joined: Mon May 05, 2014 10:15 am

Re: Offline Shops ip

Post by Attila »

LasTravel wrote:You have an example at this post, no one will do it for you.
In what java file i need to look can you tell me were please :eh:
Post Reply