|
You last visited: Today at 05:21
Advertisement
Query check user or char online
Discussion on Query check user or char online within the SRO PServer Questions & Answers forum part of the SRO Private Server category.
05/09/2018, 10:02
|
#1
|
elite*gold: 0
Join Date: Mar 2018
Posts: 18
Received Thanks: 0
|
Query check user or char online
Hello all,
I want to check online or offline by user or char!
Help me! Query. Sr i 'm not good english
|
|
|
05/09/2018, 10:16
|
#2
|
elite*gold: 350
Join Date: Aug 2015
Posts: 1,999
Received Thanks: 1,188
|
event id 4 Login and 6 Logout in _LogCharEvent (idk the name but it's in the Log database)
also, wrong section. ask here
|
|
|
05/10/2018, 00:25
|
#3
|
elite*gold: 6
Join Date: Nov 2013
Posts: 279
Received Thanks: 223
|
U Can Use Guard To Save Characters Log in Table , Or U Can Add This Function To _AddLogChar
At Frist Make This Table
Code:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_IPLogs] Script Date: 5/10/2018 12:21:28 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_IPLogs](
[CharID] [int] NOT NULL,
[Charname] [varchar](64) NOT NULL,
[IP] [varchar](20) NOT NULL,
[DATE] [datetime] NOT NULL,
CONSTRAINT [PK__IPLogs] PRIMARY KEY CLUSTERED
(
[CharID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
Then Add This Function in _addLogChar
Code:
if (@EventID=4)
begin
declare [MENTION=1414528]Dyn[/MENTION]IP varchar(20)
declare [MENTION=300634]peto[/MENTION]ption tinyint
exec [MENTION=1414528]Dyn[/MENTION]IP = SRO_VT_ACCOUNT.dbo.split_ip [MENTION=336745]DaTa[/MENTION]2
if (exists(SELECT * From _IPLogs where CharID [MENTION=395373]Chari[/MENTION]D))
begin
UPDATE _IPLogs SET IP [MENTION=1414528]Dyn[/MENTION]IP where CharID [MENTION=395373]Chari[/MENTION]D
end
if(not exists(SELECT * FROM _IPLogs where CharID [MENTION=395373]Chari[/MENTION]D))
begin
Insert into _IPLogs (CharID,Charname,IP,DATE) Values [MENTION=395373]Chari[/MENTION]D [MENTION=3898309]charname[/MENTION] [MENTION=1414528]Dyn[/MENTION]IP,Getdate())
END
END
IF (@EventID=6)
begin
Delete From _IPLogs Where CharID = [MENTION=395373]Chari[/MENTION]D
END
If U Want To Search For Online Player use That Query
Code:
USE SRO_VT_SHARDLOG
Go
Select * From _IPLogs Where Charname = 'CharName'
|
|
|
10/24/2020, 08:10
|
#4
|
elite*gold: 0
Join Date: Oct 2020
Posts: 24
Received Thanks: 0
|
Quote:
|
exec @DynIP = SRO_VT_ACCOUNT.dbo.split_ip @Data2
|
this code only return ip of server, no foreign ip of users. can you help me ?
|
|
|
10/24/2020, 12:56
|
#5
|
elite*gold: 64
Join Date: Nov 2007
Posts: 1,179
Received Thanks: 1,025
|
Quote:
Originally Posted by hunter2051
this code only return ip of server, no foreign ip of users. can you help me ?
|
because you are using a filter, it's catching FILTER's IP^^
|
|
|
10/25/2020, 13:15
|
#6
|
elite*gold: 0
Join Date: Apr 2020
Posts: 79
Received Thanks: 42
|
a simple addon like this maybe will help you !
_AddLogChar
declare @  varchar(max) set @  = (select charname16 from SRO_VT_SHARD.dbo._char where charID @  ID) if @  d = 4 and not exists (Select charname16 from _onlineplayers where charid @  id)
begin
insert into _onlineplayers (charid,charname16,isonline) values @  id @  ,1)
end
if eventid = 6
begin
delete from _onlineplayers where charid @  id
end
Create table
USE [LOG_ARTEMIS]
GO
/****** Object: Table [dbo].[_Trivia_Losers] Script Date: 10/25/2020 1:12:52 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[_OnlinePlayers](
[CharID] [int] NULL,
[Charname16] [varchar](max) NULL,
[isonline] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
this will record everysingle online player and will be deleted once they exit the game.
|
|
|
 |
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
|
[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
|
[Help] Can some check this query and let me no what i did wrong
08/04/2010 - EO PServer Hosting - 3 Replies
This is a query i maid for a new pet and i am trying to figure if I did it right can someone experience in this area let me no if it is right please.
delete from cq_action where id >= 20000500 and id <= 20000505;
INSERT INTO `cq_action` VALUES (20000500, 20000501, 20000504, 0508, 0, '1 0 52');
INSERT INTO `cq_action` VALUES (20000501, 20000502, 0000, 0502, 729443, '');
INSERT INTO `cq_action` VALUES (20000502, 20000503, 0000, 0501, 1081120, '');
INSERT INTO `cq_action` VALUES...
|
All times are GMT +1. The time now is 05:21.
|
|