Register for your free account! | Forgot your password?

You last visited: Today at 21:51

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

Advertisement



LoginStatus problem

Discussion on LoginStatus problem within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
Unhappy LoginStatus problem

LoginStatus not Detect! please help how to fix this? thanks
[PH]KEO(DEV) is offline  
Old 03/19/2018, 15:52   #2

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
Hi,
please explain your problem more.

Regards
{Skrillex} is offline  
Old 03/19/2018, 15:58   #3
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
Quote:
Originally Posted by .:Skrillex:. View Post
Hi,
please explain your problem more.

Regards
LoginStatus problem .. (Online Players)
can't detect if the players is online or offline.. my php script is correct .. i think in SQL scripts i need! can you help me?
[PH]KEO(DEV) is offline  
Old 03/19/2018, 16:06   #4

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
Hi,
sure I can.

ADD the query below in
Quote:
PS_GameLog -> Programmability -> Stored Procedures -> usp_Insert_Action_Log_E
Quote:
IF (@ActionType = '107')
BEGIN
DECLARE @CheckCountry int

-- Get country of the player
-- 0: Light 1: Dark
SET @CheckCountry = (SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = @UserUID)

IF (@CheckCountry = '0') -- light
BEGIN
UPDATE PS_GameData.dbo.Chars SET LoginStatus = '1' WHERE CharID = @CharID
END
IF (@CheckCountry = '1') -- dark
BEGIN
UPDATE PS_GameData.dbo.Chars SET LoginStatus = '2' WHERE CharID = @CharID
END

END

IF (@ActionType = '108')
BEGIN
UPDATE PS_GameData.dbo.Chars SET LoginStatus = '0' WHERE CharID = @CharID
END
{Skrillex} is offline  
Old 03/19/2018, 16:23   #5
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
Unhappy

Quote:
Originally Posted by .:Skrillex:. View Post
Hi,
sure I can.

ADD the query below in
still not working this is my

USE [PS_GameLog]
GO
/****** Object: StoredProcedure [dbo].[usp_Insert_Action_Log_E] Script Date: 3/19/2018 4:21:35 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Insert_Action_Log_E Script Date: 2008-6-7 18:32:40 ******/

/****** Object: Stored Procedure dbo.usp_Insert_Action_Log_E Script Date: 2008/3/15 下午 05:16:53 ******/



ALTER Proc [dbo].[usp_Insert_Action_Log_E]


/*

*/

@UserID varchar(18),
@ID int,
@CharID int,
@CharName varchar(50),
@CharLevel tinyint,
@CharExp int,
@MapID smallint,
@PosX real,
@PosY real,
@PosZ real,
@ActionTime datetime,
@ActionType tinyint,
@ bigint = null,
@ int = null,
@3 int = null,
@4 bigint = null,
@5 int = null,
@6 int = null,
@7 int = null,
@8 int = null,
@9 int = null,
@0 int = null,
@Text1 varchar(100) = '',
@Text2 varchar(100) = '',
@Text3 varchar(100) = '',
@Text4 varchar(100) = '',
@Sql nvarchar(4000) = '',
@ varchar(4) = '',
@mm varchar(2) = '',
@dd varchar(2) = '',
@Bucket smallint = -1

AS

SET @ = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)


IF(LEN(@mm) = 1)
BEGIN
SET @mm = '0' + @mm
END

IF(LEN(@dd) = 1)
BEGIN
SET @dd = '0' + @dd
END

/* 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

/* 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
UPDATE PS_GameData.dbo.Chars
SET LoginStatus = 0
Where CharID = @CharID

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType,
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @ID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType,
@, @, @3, @4, @5, @6, @7, @8, @9, @0, @Text1, @Text2, @Text3, @Text4)'

EXEC sp_executesql @Sql,
N'@UserID varchar(18), @ID int, @CharID int, @CharName varchar(50),
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint,
@ bigint, @ int, @3 int, @4 bigint, @5 int, @6 int, @7 int, @8 int,
@9 int, @0 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)',
@UserID, @ID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType,
@, @, @3, @4, @5, @6, @7, @8, @9, @0, @Text1, @Text2, @Text3, @Text4
[PH]KEO(DEV) is offline  
Old 03/19/2018, 16:28   #6

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
Do you have the Column Loginstatus in your Chars Table?

Check it with this query:
Quote:
SELECT *FROM [PS_GameData].[dbo].[Chars] where LoginStatus = 0
When It results your Characters then is everything ok there. When You have an error there you need to Add the LognStatus Column

Cheers
{Skrillex} is offline  
Old 03/19/2018, 16:32   #7
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
Quote:
Originally Posted by .:Skrillex:. View Post
Do you have the Column Loginstatus in your Chars Table?

Check it with this query:


When It results your Characters then is everything ok there. When You have an error there you need to Add the LognStatus Column

Cheers
yes i have but still not working
[PH]KEO(DEV) is offline  
Old 03/19/2018, 16:44   #8

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
Okay. When you execute the query with =1 at the end does it show your online charakter? When yes something is wrong with your PHP-file.

Regards
{Skrillex} is offline  
Old 03/19/2018, 16:59   #9
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
when i query = 1 does not show online player but im online now and my players!

my php file is correct because i try this to other db and its working but when i connect to db its not working..
[PH]KEO(DEV) is offline  
Old 03/19/2018, 17:06   #10

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
hm ok..

then try this scripts:

Quote:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Read_Chars_Detail2_R]

@CharID int

AS

SET NOCOUNT ON

DECLARE @UserUID int
DECLARE @Money bigint
DECLARE @GuildID int
DECLARE @GuildLevel tinyint
DECLARE @UID varchar (18)

-- 2005-12-30 스탯,스킬 이벤트관련...
DECLARE @Event1 tinyint
DECLARE @Event2 tinyint
--

SET @Money = 0
SET @UserUID = (SELECT UserUID FROM Chars WHERE CharID = @CharID)
SET @GuildID = (SELECT GuildID FROM GuildChars WHERE CharID = @CharID AND Del = 0)

IF(@UserUID IS NOT NULL)
BEGIN
SET @Money = (SELECT ISNULL([Money], 0) FROM UserStoredMoney WHERE UserUID = @UserUID)
END
ELSE
BEGIN
SET @Money = 0
END

IF(@GuildID IS NOT NULL)
BEGIN
SET @GuildLevel = (SELECT GuildLevel FROM GuildChars WHERE CharID = @CharID AND Del = 0)
END
ELSE
BEGIN
SET @GuildID = 0
SET @GuildLevel = 0
END

-- 2005-12-30 스탯,스킬 이벤트관련...
SELECT @Event1=Event1, @Event2=Event2 FROM CharEvents WHERE CharID=@CharID
--

SELECT UserUID, CharID, CharName, Slot, Family, Grow, Hair, Face, [Size], Job, Sex, [Level],
StatPoint AS DistPoint, SkillPoint, [Str], Dex, Rec, [Int], Luc, Wis, HP, MP, SP, Map, Dir, [Exp], [Money],
PosX, PosY, PosZ, Hg, Vg, Cg, Og, Ig, Del, K1, K2, K3, K4, @Money AS StoredMoney, @GuildID AS GuildID, @GuildLevel AS GuildLevel,

-- 전투공로관 보상레벨
KillLevel, DeadLevel,
--

-- 스탯,스킬 이벤트관련...
@Event1, @Event2,
--

DATEPART(yyyy, LeaveDate) AS LeaveDate_YYYY,
DATEPART(mm, LeaveDate) AS LeaveDate_MM,
DATEPART(dd, LeaveDate) AS LeaveDate_DD,
DATEPART(hh, LeaveDate) AS LeaveDate_HH,
DATEPART(mi, LeaveDate) AS LeaveDate_MI,
DATEPART(ss, LeaveDate) AS LeaveDate_SS

--

FROM Chars WHERE CharID = @CharID

-- 접속시간 기록
UPDATE Chars SET JoinDate=GETDATE(), LoginStatus = 1 WHERE CharID=@CharID
SELECT @UID=UserID FROM CHARS WHERE CharID=@CharID
UPDATE Chars SET LoginStatus = 0 WHERE (CharID<>@CharID) AND (UserID=@UID)
--

SET NOCOUNT OFF
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS OFF
Quote:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO


ALTER Proc [dbo].[usp_Save_Char_LeaveDate_R]

@CharID int

AS

SET NOCOUNT ON

-- 종료시간 기록
UPDATE Chars SET LeaveDate=GETDATE(), LoginStatus=0 WHERE CharID=@CharID

SET NOCOUNT OFF

SET QUOTED_IDENTIFIER OFF

SET ANSI_NULLS OFF
Now it should work!
{Skrillex} is offline  
Old 03/19/2018, 17:19   #11
 
[PH]KEO(DEV)'s Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 84
Received Thanks: 15
Quote:
Originally Posted by .:Skrillex:. View Post
hm ok..

then try this scripts:





Now it should work!
result

Msg 208, Level 16, State 6, Procedure usp_Read_Chars_Detail2_R, Line 3
Invalid object name 'dbo.usp_Read_Chars_Detail2_R'.
Msg 208, Level 16, State 6, Procedure usp_Save_Char_LeaveDate_R, Line 3
Invalid object name 'dbo.usp_Save_Char_LeaveDate_R'.
[PH]KEO(DEV) is offline  
Old 03/19/2018, 17:30   #12

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
you have to choose the database in the top mate...

Please learn sql basics...
{Skrillex} is offline  
Reply

Tags
shaiya


Similar Threads Similar Threads
[PROBLEM]HATCHERY PROBLEM[PROBLEM]
07/27/2013 - Facebook - 8 Replies
GUYS I HAVE 3 HATCHERY IN MY ISLAND I WANT TO DELETE THE 2 I CLICK THE REMOVE TOOL THEN CLICK ON THE HATCHERY THEN NOTHING HAPPENS HELP?? THANKS =)
[problem] IB problem
05/11/2008 - Flyff - 2 Replies
Hi , i have problem with IB when i click on this its load the game guard and then Disappear , someone know what the problem? its in the flyff folder i just dont know what the problem whay its disappear , Thnx.
[Problem] Server Inspection Problem
05/01/2008 - Silkroad Online - 1 Replies
Hi, By the update of 1.145 I get the error "The servers is undergoing inspection or updates. Connect to htpp://www.silkroadonline.net for more information." I reinstall the game but I get the same error. And the servers are open! Who can help me. Thank You
Problem with Infinty/ Problem mit Infinity
04/14/2008 - Dekaron - 1 Replies
Hey guys, i donwloadet Infinity from this site http://www.gametribe.com/. K i installed this game and now if i try to start is i get an error message: The game security module update has failed How i can fix this problem, i wont to play it. Ps. I postet it here becoz its the same producer like Dekaronīs Hi Leute, ich hab mir Infinty gedownloadet von http://www.gametribe.com/ und hab es auch installiert, doch jedes mal wenn ich das spiel starten will bekomm ich diesen Fehler: The...



All times are GMT +1. The time now is 21:51.


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.