Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2020, 10:53 AM
Shodai82
Sarnak
 
Join Date: May 2015
Posts: 43
Default Example - Alternate IP Restriction Approach

On UltimateEQ I've had max ip set to 3 for a long time now. While it works mostly as expected, the way the logic is implemented in the eqemu source (as far as I understand it), when a player logs out/disconnects/leaves the world, there is often a lag time that will not allow you to log in another character. This usually presents itself as "You have been disconnected" when trying to log in during this scenario. To work around this I implemented the following in global_player, event_enterzone (after updating max ips to -1 in the rules table):


HTML Code:
    if($zoneid != 344 && $zoneid != 151) { #exempt zones
    	if (!$client->GetGM()) {
    		my @exemptAccounts = ("###");

    		if (!grep{$_ eq $client->AccountName()} @exemptAccounts) {
			    my @clist = $entity_list->GetClientList();
			    my $ipCount = 0;
			    my @playerNames = ();

				foreach my $n (@clist) {
					if ($n->GetIP() == $client->GetIP()) {
						$ipCount = $ipCount + 1;
						push @playerNames, $n->GetCleanName();
					}
				}

				if ($ipCount > 3) {
					$client->WorldKick();
					foreach my $playerName (@playerNames) {
						my $currentClient = $entity_list->GetClientByName($playerName);
						$currentClient->Message(5, "Your client count exceeded the maximum amount per ip address (3). The client was disconnected.");
					}
				}
			}
		}
	}
Hopefully this is helpful for some. There are some enhancements you could do, such as querying the world instead of the current zones entity_list, but for my purposes (preventing mass zergs of players on content), it works quite well.
Reply With Quote
  #2  
Old 03-17-2020, 11:50 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

Awesome. Now if only I could figure out how to rewrite it to work globally and check ip_exemptions table

I do like the concept of having an exempt zone though. People can pile their chars into hub zones for buffs and stuff without restriction.
__________________
Clumsy's World: Resurgence [2019-Present]
Clumsy's World 2.0 [2014-2016]
Clumsy's World [2006-2012]
Reply With Quote
  #3  
Old 03-17-2020, 12:23 PM
Shodai82
Sarnak
 
Join Date: May 2015
Posts: 43
Default

I initially did exactly that. Using event_connect and event_disconnect (or enterzone) you can get the character ip, write it to a custom table via perl DBI, then just query that table. The downside to this is performance implications at scale and that I do not believe event_disconnect is triggered on server shutdown (I wasn't willing to test this live, haha). Of course you could always purge the table on startup.
Reply With Quote
  #4  
Old 02-03-2021, 05:02 PM
theoneptd
Fire Beetle
 
Join Date: May 2010
Posts: 10
Default

Something really needs to be done. If a server allows only 3 per IP, and one of your characters crash while zoning (which happens often in emu) you have to sit there and wait for the timeout before you can get past the character select screen.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:37 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3