[RELEASE FIX] Players Online - Logout not detected or not displayed properly

06/25/2015 20:42 BodySalvage#1
For those of you using the original release of the players online script that are having trouble with accurate logout detection would benefit from this mini fix. The reason the error occurs is because the script is tagging the wrong stored procedure for logout. This SP is not fired when the server doesn't detect a proper logout so disconnections will error the script results. I have been asked repeatedly for this fix after I released my players online php/css adaptation and wish to release the fix to assist others unable to figure out the error.

Instructions

Place the code below in your PS_GameLog.dbo.usp_Insert_Action_Log_E

( PS_GameLog > Programmability > Stored Procedures > usp_Insert_Action_Log_E )

You should place this near the bottom to insure it will take effect properly if your unsure where to add new script to the procedure.

Code:
/* Login - Logout replacement for players online */
IF @ActionType = '108'
	BEGIN
        UPDATE PS_GameData.dbo.Chars SET [LoginStatus]=0 WHERE PS_GameData.dbo.Chars.CharID=@CharID 	
	END
IF @ActionType = '107'
	BEGIN
        UPDATE PS_GameData.dbo.Chars SET [LoginStatus]=1 WHERE PS_GameData.dbo.Chars.CharID=@CharID		
    END
Explanation

This script is designed to read login / logout of any character the server detects as offline. This means even DC's will register as the server logs the logout when it detects the online person as not being present any longer.

**Related Material
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]