Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-20-2018, 10:25 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Here's some database call example syntax for you to work with, this should work out of box from a vanilla install of EQEmu Server

Code:
$query = "SELECT
	COUNT(id) as count
	FROM
	character_data
	WHERE
	(character_data.last_login > UNIX_TIMESTAMP() - 600)
	and zone_instance = ?";

$ex = plugin::LoadMysql()->prepare($query);
$ex->execute($realm_instance);
while (@row = $ex->fetchrow_array()){
    return $row[0];
}
Here are some other examples too to help you out

Code:
#::: Guild Online Messages :: Only for mains
if ($uguild_id > 0) {
	$query = "
		SELECT
		guild_members.char_id
		FROM
		guild_members
		WHERE alt = 0
		and char_id = ?
	";
	$ex = plugin::LoadMysql()->prepare($query); 
	$ex->execute($client->CharacterID()); 
	while (@row = $ex->fetchrow_array()) {
		quest::gmsay("[Guild] " . $client->GetCleanName() . " is now online", 15, 1, $uguild_id, 0); 
	}
}

#::: Friend online messages
$query = "
	SELECT
	character_data.name
	FROM
	friends
	INNER JOIN character_data ON friends.charid = character_data.id
	WHERE 
	friends.name = ? 
	and friends.type = 1
	and (character_data.last_login > UNIX_TIMESTAMP() - 600)
";
$ex = plugin::LoadMysql()->prepare($query); 
$ex->execute($client->GetCleanName()); 
while (@row = $ex->fetchrow_array()) { 
	quest::crosszonemessageplayerbyname(15, $row[0], "[Friend] " . $client->GetCleanName() . " is now online");
}
Reply With Quote
Reply

Thread Tools
Display Modes

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:25 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3