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

Quests::Custom Custom Quests here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 03:15 PM.


 

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