المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : طلب فى Procuder


Jaffa
21-02-2015, 12:46 PM
عاوز حد يدمجلى ده
USE SRO_VT_SHARDLOG
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as

IF(@EventID = 4 OR @EventID = 6)
BEGIN

declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventChar values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, EventPos) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos)
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, strDesc) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @Desc)
end
else
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2) values(@CharID, GetDate(), @EventID, @Data1, @Data2)
end

--For the new IPLog table
Declare @DynIP varchar(max);
exec @DynIP = SRO_VT_ACCOUNT.dbo.split_ip @Data2
INSERT INTO _IPLogs (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE())
-- END

END


مع ده
USE [Log_DB]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as

IF(@EventID = 4 OR @EventID = 6)
BEGIN

declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventChar values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, EventPos) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos)
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, strDesc) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @Desc)
end
else
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2) values(@CharID, GetDate(), @EventID, @Data1, @Data2)
end

--For the new IPLog table
Declare @DynIP varchar(max);
exec @DynIP = SRO_VT_ACCOUNT.dbo.split_ip @Data2
INSERT INTO _IPLogs (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE())
-- END
-- Banned IP stuff
IF exists (SELECT IP FROM _BannedIPs WHERE IP like @DynIP)
BEGIN
Declare @Charname varchar(max) = (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID)

exec SRO_VT_ACCOUNT.dbo._BannPlayerSP @Charname,'usage of a banned IP'
-- END banned IP stuff
END

END



و يكون مجربه ونبى

Hamza FiGo
21-02-2015, 03:01 PM
تمت الموافقة

اتفضل

USE [SRO_VT_SHARDLOG]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as

IF(@EventID = 4 OR @EventID = 6)
BEGIN

declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventChar values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, EventPos) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos)
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, strDesc) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @Desc)
end
else
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2) values(@CharID, GetDate(), @EventID, @Data1, @Data2)
end

--For the new IPLog table
Declare @DynIP varchar(max);
exec @DynIP = SRO_VT_ACCOUNT.dbo.split_ip @Data2
INSERT INTO _IPLogs (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE())
-- END
-- Banned IP stuff
IF exists (SELECT IP FROM _BannedIPs WHERE IP like @DynIP)
BEGIN
Declare @Charname varchar(max) = (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID)

exec SRO_VT_ACCOUNT.dbo._BannPlayerSP @Charname,'usage of a banned IP'
-- END banned IP stuff
END

END

Jaffa
21-02-2015, 06:45 PM
لا خلاص تم الحل بنفسى شكرا

Hamza FiGo
21-02-2015, 07:17 PM
طيب تمام . بس ممنوع تعمل اجابة بالكلام زي كدة. يا اما تقول انت عملت اية ودة تعملة مجاب

ياما الموضوع تقفل من غير اي اجابة

دي تعليمات المدير العام

##