Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 17:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]Get Result from Query

Discussion on [Help]Get Result from Query within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2018
Posts: 34
Received Thanks: 3
Question [Help]Get Result from Query

how do i get result from Stored Procedures

I try to do this
PHP Code:
void CDbManager::LoadMemberGuildOnline(CQuery *qryLPDB_OVERLAPPED_PLUS lpDbOverlappedPlus)
{
    
OutputDebugString("CDbManager::LoadMemberGuildOnline - IN");
    
CAr arRead(lpDbOverlappedPlus->lpBuflpDbOverlappedPlus->uBufSize);
    
char szQuery[QUERY_SIZE] = { 0, };
    
DWORD m_nGuildID;
    
arRead >> m_nGuildID;
    
CMover    mover;

    
sprintf(szQuery"{ call CHARACTER_01_DBF.dbo.GUILD_MEMBER_COUNT('%06d') }"m_nGuildID);
    if (
qry->Exec(szQuery) == FALSE)
    {
        
WriteLog("LoadMemberGuildOnline  %s, %d\t%s"__FILE____LINE__szQuery);
        
FreeRequest(lpDbOverlappedPlus);
        return;
    }
    while (
qry->Fetch())
    {
        
GUILD_MEMBER_COUNT Count;
        
Count.nCount qry->GetInt("fText");
    }

    
CDPTrans::GetInstance()->SendMemberOnline();
    
FreeRequest(lpDbOverlappedPlus);
    
OutputDebugString("CDbManager::LoadMemberGuildOnline - OUT");

But how to return back to world server ?
Thank you.

This is my procedures
Code:
ALTER PROCEDURE [dbo].[GUILD_MEMBER_COUNT]
	-- Add the parameters for the stored procedure here
 [MENTION=2189477]ngu[/MENTION]ildID	char(6)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	DECLARE [MENTION=2204251]nco[/MENTION]unt int

    -- Insert statements for procedure here
	SELECT [MENTION=2204251]nco[/MENTION]unt = COUNT(*) FROM CHARACTER_TBL WHERE serverindex = 01 AND m_idPlayer in (SELECT m_idPlayer FROM GUILD_MEMBER_TBL WHERE m_idGuild = [MENTION=2189477]ngu[/MENTION]ildID) AND MultiServer != 0

	SELECT fText = [MENTION=2204251]nco[/MENTION]unt;
END
Barameu is offline  
Old 04/13/2018, 17:22   #2
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
Code:
void CDbManager::LoadMemberGuildOnline(CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus)
{
    OutputDebugString("CDbManager::LoadMemberGuildOnline - IN");
    CAr arRead(lpDbOverlappedPlus->lpBuf, lpDbOverlappedPlus->uBufSize);
    char szQuery[QUERY_SIZE] = { 0, };
    DWORD m_nGuildID;
    arRead >> m_nGuildID;

    sprintf(szQuery, "GUILD_MEMBER_COUNT '%06d'", m_nGuildID);
    if (qry->Exec(szQuery) == FALSE)
    {
        WriteLog("LoadMemberGuildOnline  %s, %d\t%s", __FILE__, __LINE__, szQuery);
        FreeRequest(lpDbOverlappedPlus);
        return;
    }
    while (qry->Fetch())
    {
        GUILD_MEMBER_COUNT Count;
        Count.nCount = qry->GetInt("fText");
    }

    CDPTrans::GetInstance()->SendMemberOnline();
    FreeRequest(lpDbOverlappedPlus);
    OutputDebugString("CDbManager::LoadMemberGuildOnline - OUT");
}
Did some changes. I don't understand the purpose of GUILD_MEMBER_COUNT structure, you set the value but you don't save anywhere. Now the function CDPTrans::SendMemberOnline() should send the value to worldserver but it won't because is nowhere.
Also the count(*) on stored procedure is really bad.

If you want to know online players from guild you can do it easier.
Code:
CGuild* pGuild = g_pPlayer->GetGuild();
USHORT count = 0;
if(pGuild)
{
	for(auto member : pGuild->m_mapPMember)
	{
		PlayerData* pPlayerData		= CPlayerDataCenter::GetInstance()->GetPlayerData( member.second->m_idPlayer );
		if(pPlayerData->data.uLogin > 0)
			count++;
	}
}
All guild data is available at player client. You can loop the map container and check if player is online or not.
alfredico is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Release][Query] Query _InvCOS Items WITH _Char Connection
12/29/2015 - SRO PServer Guides & Releases - 1 Replies
Ok, so i needed to write this query for a procedure im working on and not many people know how to connect the pet inventory table to the character table.... so this query will explain how its done... im not going to explain every single detail, like how there is no charcos when pet is despawned / dead... but yea you can probably figure that all out from this query... The code... USE SELECT pet_invo. ,pet_invo. PetSlot
Help FLYFF PATCHER FEHLER CODE:12007 RESULT:2
08/28/2010 - Flyff Private Server - 3 Replies
hi entschuldige mich schon mal fals es so einen thead schon gibt den ich habe nichts vernünftiges unter SUFU gefunden, also wenn ich meinen patcher starte kommt Der Servername oder die Serveradresse konnte nicht verarbeitet werden CODE:12007 RESULT:2 helft mir pls hab schon ausprobiert als admin auszufüren aber kan das häcken nicht machen XD
[Suche]Query für "Alteklinge, Reichsklinge" &' Stichdolche NUR QUERY!
08/18/2010 - Metin2 Private Server - 1 Replies
Ich weiß ich werd nervig aber ich suche die Query's für Alteklinge, Reichsklinge &' Strichdolche Why? Naya, weil ich in der DB i-wie nur Drachenmaulglocke hab ... not more -.- Auf jeden Fall Icon's etc. etc. etc. hab ich ich brauche nur die Query's



All times are GMT +1. The time now is 17:06.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.