Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 4Story
You last visited: Today at 22:20

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

Advertisement



[Fix] TLogout Function

Discussion on [Fix] TLogout Function within the 4Story forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 214
Received Thanks: 171
[Fix] TLogout Function

I corrected this script and added the missing variables.
TGLOBAL_GSP -> Functions -> TLogout.


PHP Code:
/* LOGOUT PROCESS

========================================================
PARAMETER
========================================================
@dwUserID        INT

========================================================
RETURN VALUE
========================================================
0    : SUCCESS
1    : NO USER

========================================================
PROCESS
========================================================
1. Check TCURRENTUSER table
2. Delete user from TCURRENTUSER
3. Update log data

*/

ALTER PROCEDURE [dbo].[TLogout]
    @
dwUserID    INT,
    @
dwCharID    INT,
    @
bLevel    TINYINT,
    @
dwExp    INT,
    @
bSlot TINYINT,
    @
szNAME VARCHAR,
    @
bClass TINYINT,
    @
bRace TINYINT,
    @
bCountry TINYINT,
    @
bSex TINYINT,
    @
bHair TINYINT,
    @
bFace TINYINT
AS
    DECLARE @
dwCurCharID    INT
    
DECLARE @dwKEY        INT

    
DECLARE @bGroupID        TINYINT
    
DECLARE @bChannel        TINYINT

    
DECLARE @dLoginDate        SMALLDATETIME

    BEGIN TRAN LOGOUT
    SELECT TOP 1 
@dwKEY dwKEY, @dwCurCharID dwCharID, @bGroupID bGroupID, @bChannel bChannel, @dLoginDate dLoginDate FROM TCURRENTUSER WHERE dwUserID = @dwUserID
    
IF (@@ROWCOUNT 0)
    
BEGIN
        
/* Not found connected user */
        
COMMIT TRAN LOGOUT
        
RETURN 1
    END
    
ELSE
    
BEGIN
    UPDATE TLOG SET
        dwCharID 
= @dwCurCharID,
        
bGroupID = @bGroupID,
        
bChannel = @bChannel,
        
timeLOGOUT GETDATE()
    
WHERE dwKEY = @dwKEY
    END

      
/*  @dwCurCharID e il dwCharID   */
    
SELECT FROM TALLCHARTABLE  WHERE dwCharID = @dwCurCharID
    
    
IF(@@ROWCOUNT 1)
    
BEGIN
        UPDATE TALLCHARTABLE
            SET     bLevel         
=     @bLevel,
             
dwExp        =    @dwExp,
             
dLoginDate    =    @dLoginDate,
             
dLogoutDate    =    GETDATE(),
             
bSlot  =    @bSlot,
             
szNAME =    @szNAME,
             
bClass  =    @bClass,
             
bRace    =    @bRace,
             
bCountry =    @bCountry,
             
bSex =        @bSex,
             
bHair =    @bHair,
             
bFace =    @bFace,                                       
              
dwPlayTime    =    dwPlayTime DATEDIFF(second, @dLoginDategetdate()) 
        
WHERE dwCharID    =    @dwCharID
        
AND     bWorldID    =    @bGroupID

        
        DELETE FROM TCURRENTUSER WHERE dwUserID 
= @dwUserID
    END

    
    COMMIT TRAN LOGOUT

    
RETURN 
Sicarium is offline  
Thanks
6 Users
Old 06/14/2013, 08:05   #2
 
elite*gold: 0
Join Date: Nov 2011
Posts: 391
Received Thanks: 471
Quote:
Originally Posted by Sicarium View Post
I corrected this script and added the missing variables.
TGLOBAL_GSP -> Functions -> TLogout.


PHP Code:
/* LOGOUT PROCESS

========================================================
PARAMETER
========================================================
@dwUserIDINT

========================================================
RETURN VALUE
========================================================
0: SUCCESS
1: NO USER

========================================================
PROCESS
========================================================
1. Check TCURRENTUSER table
2. Delete user from TCURRENTUSER
3. Update log data

*/

ALTER PROCEDURE [dbo].[TLogout]
@
dwUserIDINT,
@
dwCharIDINT,
@
bLevelTINYINT,
@
dwExpINT,
@
bSlot TINYINT,
@
szNAME VARCHAR,
@
bClass TINYINT,
@
bRace TINYINT,
@
bCountry TINYINT,
@
bSex TINYINT,
@
bHair TINYINT,
@
bFace TINYINT
AS
DECLARE @
dwCurCharIDINT
DECLARE @dwKEYINT

DECLARE @bGroupIDTINYINT
DECLARE @bChannelTINYINT

DECLARE @dLoginDateSMALLDATETIME

BEGIN TRAN LOGOUT
SELECT TOP 1 
@dwKEY dwKEY, @dwCurCharID dwCharID, @bGroupID bGroupID, @bChannel bChannel, @dLoginDate dLoginDate FROM TCURRENTUSER WHERE dwUserID = @dwUserID
IF (@@ROWCOUNT 0)
BEGIN
/* Not found connected user */
COMMIT TRAN LOGOUT
RETURN 1
END
ELSE
BEGIN
UPDATE TLOG SET
dwCharID 
= @dwCurCharID,
bGroupID = @bGroupID,
bChannel = @bChannel,
timeLOGOUT GETDATE()
WHERE dwKEY = @dwKEY
END

  
/*  @dwCurCharID e il dwCharID   */
SELECT FROM TALLCHARTABLE  WHERE dwCharID = @dwCurCharID

IF(@@ROWCOUNT 1)
BEGIN
UPDATE TALLCHARTABLE
    SET bLevel 
= @bLevel,
 
dwExp=@dwExp,
 
dLoginDate=@dLoginDate,
 
dLogoutDate=GETDATE(),
 
bSlot  =@bSlot,
 
szNAME =@szNAME,
 
bClass  =@bClass,
 
bRace=@bRace,
 
bCountry =@bCountry,
 
bSex =@bSex,
 
bHair =@bHair,
 
bFace =@bFace,   
  
dwPlayTime=dwPlayTime DATEDIFF(second, @dLoginDategetdate()) 
WHERE dwCharID=@dwCharID
AND bWorldID=@bGroupID


DELETE FROM TCURRENTUSER WHERE dwUserID 
= @dwUserID
END


COMMIT TRAN LOGOUT

RETURN 
Good joob ^^ :thumbup:
EliteTuerie is offline  
Thanks
1 User
Old 06/14/2013, 13:15   #3
 
elite*gold: 0
Join Date: Apr 2013
Posts: 317
Received Thanks: 223
For what is that fix? Is dont know a bug in TLogout
Konst™ is offline  
Old 06/14/2013, 16:34   #4
 
elite*gold: 0
Join Date: Nov 2010
Posts: 214
Received Thanks: 171
the tallchartable dont save all variables and the script is not all correct .
Sicarium is offline  
Thanks
1 User
Old 06/14/2013, 16:46   #5
 
elite*gold: 0
Join Date: Apr 2013
Posts: 317
Received Thanks: 223
But which bug it fix? I dont got bugs in tallchartable. You dont really all variables there. Its a edited function not a fix
Konst™ is offline  
Old 06/14/2013, 17:00   #6
 
elite*gold: 0
Join Date: Nov 2010
Posts: 214
Received Thanks: 171
Make a character, enter in game and change name or change color hair, ok now do logout, next.. see the tallchartable and tchartable, you will see that tallchartable not refresh all information becouse dont save all thinks of the tchartable and that can make some problems.

The structure of the this script is wrong.
Sicarium is offline  
Thanks
1 User
Old 06/14/2013, 17:02   #7
 
elite*gold: 0
Join Date: Apr 2013
Posts: 317
Received Thanks: 223
Ah ok. Nice
Konst™ is offline  
Reply


Similar Threads Similar Threads
vb.net sql Function
01/26/2013 - .NET Languages - 2 Replies
hallo ich würde gerne mit vb.net auf eine sql function zugreifen auf tables is ja ned schwer aber wie mach ich das mit functions mfg
Help with function
01/22/2013 - Metin2 Private Server - 1 Replies
What function i can use to teleport a members of a party? I need to teleport the party members to the dragon room: Coords. Index - X - Y 73 1774 12204 Thanks ;)
function
07/23/2012 - Rappelz Private Server - 4 Replies
Hi pepole Trying to make Lua Code But i cant find The Function to Open Store :D anyone can help l
Function Box
09/27/2011 - Combat Arms - 5 Replies
Hey undzwar hab ich eine frage von den DailyJob kriegt man ja auch eine Function box und wollte fragen ob man da nur wsachen für 1 day oder mehrere tage bekommen kann bedanke mcih schonmal für eure antworten :)
[VIP-function] ToxicSYS [VIP-function]
08/14/2010 - WarRock Hacks, Bots, Cheats & Exploits - 1 Replies
heeeey E-pvpers :pimp: this is a new hack by TSYS Status : UNDETECTED Functions (VIDEO) : YouTube - WarRock - Bikini event VIP hack



All times are GMT +1. The time now is 22:20.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.