mhh, weird, ofc problem looks is like at proc (if using writetextfile directly works)
mhh, weird, ofc problem looks is like at proc (if using writetextfile directly works)
I dont know why it dont insert anything in the tables...
try this:
replace everything under if (@Operation = 90 OR @Operation = 160)
for this
is not going to write anything in tables, but must show a msg when you plusCode:if(@Operation = 90) begin declare @iname varchar(129) declare @iid int declare @nombre varchar(200) declare @plus varchar(5) declare @cname varchar(64) select @iid = RefItemID from SRO_VT_SHARD.dbo._Items where Serial64 = @ItemSerial select @iname = NameStrID128 from SRO_VT_SHARD.dbo._RefObjCommon where id = @iid select @cname = CharName16 from SRO_VT_SHARD.dbo._Char where CharID = @CharID select @nombre = itemname from SRO_VT_SHARD.dbo.nombredeitems where itemcode = @iname select @plus = SUBSTRING(@strDesc, CHARINDEX('+',@strDesc,0) + 1, LEN(@strDesc)) insert PlusNotice(Sent, Message, Date)values(0,'[' + @cname +']'+ ' has increased '+'[' + @nombre + ']'+' to lvl [' + @plus ,GETDATE()) declare @veremos varchar(200) select @veremos = '[' + @cname +']'+ ' has increased '+'[' + @nombre + ']'+' to level [' + @plus declare @azar INT declare @randomfile varchar(50) SELECT top 1 @azar = (ABS(CHECKSUM(NEWID())) % 10000) FROM Master.dbo.Syscolumns select @randomfile = 'C:\MSSQLTips\' + convert(varchar, @azar) + '.txt' SELECT dbo.WriteTextFile(@veremos, @randomfile, 0) end
Hmm its correct like that because its still not work (made a bow +9 etc.)
USE [u28gzUEanKJYL2aH9BRJap3Tx]
GO
/****** Object: StoredProcedure [dbo].[_AddLogItem] Script Date: 08/08/2013 22:51:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_AddLogItem]
@CharID int,
@ItemRefID int,
@ItemSerial bigint,
@dwData int,
@TargetStorage tinyint,
@Operation tinyint,
@Slot_From tinyint,
@Slot_To tinyint,
@EventPos varchar(64),
@strDesc varchar(128),
@Gold bigint -- #ifdef EXTEND_GOLD_TYPE »ðÀÔ
as
declare @len_pos int
declare @len_desc int
declare @strDesc_separado varchar(128)
declare @len_desc1 int
set @len_pos = len(@EventPos)
set @len_desc = len(@strDesc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventItem (EventTime, CharID, ItemRefID, dwData, TargetStorage, Operation, Slot_From, Slot_To, EventPos, strDesc, Serial64, Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
values(GetDate(), @CharID, @ItemRefID, @dwData, @TargetStorage, @Operation, @Slot_From, @Slot_To, @EventPos, @strDesc, @ItemSerial, @Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventItem (EventTime, CharID, ItemRefID, dwData, TargetStorage, Operation, Slot_From, Slot_To, EventPos, Serial64, Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
values(GetDate(), @CharID, @ItemRefID, @dwData, @TargetStorage, @Operation, @Slot_From, @Slot_To, @EventPos, @ItemSerial, @Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventItem (EventTime, CharID, ItemRefID, dwData, TargetStorage, Operation, Slot_From, Slot_To, strDesc, Serial64, Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
values(GetDate(), @CharID, @ItemRefID, @dwData, @TargetStorage, @Operation, @Slot_From, @Slot_To, @strDesc, @ItemSerial, @Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
end
else if (@len_pos = 0 and @len_desc = 0)
begin
insert _LogEventItem (EventTime, CharID, ItemRefID, dwData, TargetStorage, Operation, Slot_From, Slot_To, Serial64, Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
values(GetDate(), @CharID, @ItemRefID, @dwData, @TargetStorage, @Operation, @Slot_From, @Slot_To, @ItemSerial, @Gold) -- #ifdef EXTEND_GOLD_TYPE ±³Ã¼
end
-- À¯·á ¾ÆÀÌÅÛ ±¸ÀÔÀ̸é!
-- #define LOG_ITEMEVENT_BUY_CASHITEM (BYTE)35
if (@Operation = 35)
begin
insert _LogCashItem (RefItemID, CharID, Cnt, EventTime, Serial64)
values(@ItemRefID, @CharID, @dwData, GetDate(), @ItemSerial)
end
if(@Operation = 90)
begin
declare @iname varchar(129)
declare @iid int
declare @nombre varchar(200)
declare @plus varchar(5)
declare @cname varchar(64)
select @iid = RefItemID from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Items where Serial64 = @ItemSerial
select @iname = Name from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._ItemName where CodeName128 in(select CodeName128 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._RefObjCommon where id = @iid)
select @cname = CharName16 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Char where CharID = @CharID
--select @nombre = itemname from cKPekjnu5NKqdPbDh4CnVy9gS.dbo.nombredeitems where itemcode = @iname
select @plus = SUBSTRING(@strDesc, CHARINDEX('+',@strDesc,0) + 1, LEN(@strDesc))
insert PlusNotice(Sent, Message, Date)values(0,'[' + @cname +']'+ ' has increased '+'[' + @iname + ']'+' to lvl [' + @plus ,GETDATE())
declare @veremos varchar(200)
select @veremos = '[' + @cname +']'+ ' has increased '+'[' + @iname + ']'+' to level [' + @plus
declare @azar INT
declare @randomfile varchar(50)
SELECT top 1 @azar = (ABS(CHECKSUM(NEWID())) % 10000) FROM Master.dbo.Syscolumns
select @randomfile = 'C:\MSSQLTips\' + convert(varchar, @azar) + '.txt'
SELECT dbo.WriteTextFile(@veremos, @randomfile, 0)
end
PlusNotice , my table is named PlusNotice, not _PlusNotice. edit it to your db and check if save any data
Hmm? Where you see _PlusNotice? My Table is also named PlusNotice not _PlusNotice ^^
Ok i found there musst be something wrong with the
Because if i run the query it dont give out any file, but if i set @veremos to any text it gives me the file correct!Code:SELECT @veremos = '[' + @cname +']'+' has Succeeded in Plusing '+'[' + @iname + ']'+' to Plus [' + @plus + ']'
Ok, i fixed now the Login and Logout notice of GM's and i still work on the alchemy notice...
The main problem is, the procedure ignores the insert statments! I tested If (@Operation = 90) [91 and also != 90) it dont insert anythink in the PlusNotice table....
I tested it with this codes:
Code:if(@Operation = 90) begin declare @azar INT declare @randomfile varchar(50) declare @veremos as varchar(max) declare @iname varchar(200) declare @iid int declare @plus varchar(200) declare @cname varchar(64) set @iid = (SELECT RefItemID from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Items where Serial64 = @ItemSerial) set @iname = (SELECT Name from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._ItemName where CodeName128 in(select CodeName128 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._RefObjCommon where id = @iid)) set @cname = (SELECT CharName16 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Char where CharID = @CharID) set @plus = SUBSTRING(@strDesc, CHARINDEX('+',@strDesc,0) + 1, LEN(0)) set @veremos = '['+ @cname +']'+' has successfully fused '+'['+ @iname +']'+' to plus ['+ @plus +']' SELECT top 1 @azar = (ABS(CHECKSUM(NEWID())) % 10000) FROM Master.dbo.Syscolumns set @randomfile = 'C:\MSSQLTips\' + convert(varchar, @azar) + '.txt' SELECT dbo.WriteTextFile(@veremos, @randomfile, 0) Insert into PlusNotice (Sent, Message) values ('0',@veremos) Insert into PlusNotice (Sent, Result) values ('0', 'Success') end if(@Operation = 91) begin declare @plus2 int set @iid = (SELECT RefItemID from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Items where Serial64 = @ItemSerial) set @iname = (SELECT Name from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._ItemName where CodeName128 in(select CodeName128 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._RefObjCommon where id = @iid)) set @cname = (SELECT CharName16 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Char where CharID = @CharID) set @plus = SUBSTRING(@strDesc, CHARINDEX('+',@strDesc,0) + 1, LEN(0)) set @plus2 = @plus + 1 set @veremos = '['+ @cname +']'+' has failed at fusing '+'['+ @iname +']'+' to plus ['+ @plus2 +']' SELECT top 1 @azar = (ABS(CHECKSUM(NEWID())) % 10000) FROM Master.dbo.Syscolumns set @randomfile = 'C:\MSSQLTips\' + convert(varchar, @azar) + '.txt' SELECT dbo.WriteTextFile(@veremos, @randomfile, 0) Insert into PlusNotice (Sent, Message) values ('0',@veremos) Insert into PlusNotice (Sent, Result) values ('0','Failed') end If (@Operation != 90) begin set @iid = (SELECT RefItemID from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Items where Serial64 = @ItemSerial) set @iname = (SELECT Name from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._ItemName where CodeName128 in(select CodeName128 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._RefObjCommon where id = @iid)) set @cname = (SELECT CharName16 from cKPekjnu5NKqdPbDh4CnVy9gS.dbo._Char where CharID = @CharID) set @plus = SUBSTRING(@strDesc, CHARINDEX('+',@strDesc,0) + 1, LEN(0)) set @veremos = '['+ @cname +']'+' has successfully fused '+'['+ @iname +']'+' to plus ['+ @plus +']' SELECT top 1 @azar = (ABS(CHECKSUM(NEWID())) % 10000) FROM Master.dbo.Syscolumns set @randomfile = 'C:\MSSQLTips\' + convert(varchar, @azar) + '.txt' SELECT dbo.WriteTextFile(@veremos, @randomfile, 0) Insert into PlusNotice (Sent, Message) values ('0',@veremos) Insert into PlusNotice (Sent, Result) values ('0', 'Success') end
Last edited by trytokillme; 09-08-13 at 03:07 PM.
not even insert to db?, try to run this simply query
Insert into PlusNotice (Sent, Result) values ('0', 'Success')
and check if inster that line on the db
Yup it inserts successfully. I guess there is a problem with the whole procedure....I made also now a working Academy Notice system (everything works fine). just this stupid alchemy notice dont work
mhhh, try this
replace
if(@Operation = 90)
for
if (@Operation = '90')
Still doesnt work xD
stupid procedure...
Could you post your complete procedure?
enjoy
proc.rar
Caosfox Can you come T.V and help me in this shit Auto plus notice
i can later, when im home