Hello guys. Need some help out here!

Results 1 to 9 of 9
  1. #1
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,431Posts

    Hello guys. Need some help out here!

    I was trying to do a something new (at least for me). Anyway, It is an Alchemy (Success, Fail) logs.

    This is my lines in _AddLogItem:
    Code:
    DECLARE @CharacterName varchar(64)
    IF (@Operation = 90)
    BEGIN
    IF NOT EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    SET @CharacterName = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID)
    INSERT INTO AlchemyLogs (CharID, CharacterName, AlchemySuccess, AlchemyFail)
    VALUES  @CharID, @CharacterName, 0, 0)
    END
    IF EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    UPDATE AlchemyLogs SET AlchemySuccess = AlchemySuccess + 1 WHERE CharID = @CharID
    END
    END
    IF (@Operation = 91)
    BEGIN
    IF NOT EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    SET @CharacterName = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID)
    INSERT INTO AlchemyLogs (CharID, CharacterName, AlchemySuccess, AlchemyFail)
    VALUES  @CharID, @CharacterName, 0, 0)
    END
    IF EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    UPDATE AlchemyLogs SET AlchemyFail = AlchemyFail + 1 WHERE CharID = @CharID
    END
    END
    And AlchemyLogs table:
    Code:
    USE [SRO_VT_LOG]
    GO
    
    
    /****** Object:  Table [dbo].[AlchemyLogs]    Script Date: 10/14/2015 3:57:20 PM ******/
    SET ANSI_NULLS ON
    GO
    
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    SET ANSI_PADDING ON
    GO
    
    
    CREATE TABLE [dbo].[AlchemyLogs](
        [CharID] [int] NOT NULL,
        [CharacterName] [varchar](64) NOT NULL,
        [AlchemySuccess] [bigint] NOT NULL,
        [AlchemyFail] [bigint] NOT NULL
    ) ON [PRIMARY]
    
    
    GO
    
    
    SET ANSI_PADDING OFF
    GO
    No logs was sent to AlchemyLogs table
    Any idea?


  2. #2
    Member mtnman33 is offline
    MemberRank
    Jun 2012 Join Date
    80Posts

    Re: Hello guys. Need some help out here!

    are you trying to setup a log to see if everyone succeeds or fails just plusing up items ? or are you trying to see everything such as the plus , the blues the whites and so on ? if so i can help you there mine also shows if a GM made an item(s) for anyone , who picked them up and what they done with it...hehe if this is more what your looking for let me know and i will post it for you

  3. #3
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,431Posts

    Re: Hello guys. Need some help out here!

    Quote Originally Posted by mtnman33 View Post
    are you trying to setup a log to see if everyone succeeds or fails just plusing up items ?
    This exactly what i want.

  4. #4
    Member mtnman33 is offline
    MemberRank
    Jun 2012 Join Date
    80Posts

    Re: Hello guys. Need some help out here!

    #1 i always recommend to everyone to ALWAYS do a full database backup before running any script
    in case the script changes anything or adds anything or do not get the desired results you can always go right back to the way it was before .

    ok first part create the table
    USE [SRO_VT_LOG]
    GO

    /****** Object: Table [dbo].[_LogEventItem] Script Date: 10/14/2015 11:30:58 AM ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    SET ANSI_PADDING ON
    GO

    CREATE TABLE [dbo].[_LogEventItem](
    [EventTime] [datetime] NOT NULL,
    [CharID] [int] NOT NULL,
    [ItemRefID] [int] NOT NULL,
    [dwData] [int] NOT NULL,
    [TargetStorage] [tinyint] NOT NULL,
    [Operation] [tinyint] NOT NULL,
    [Slot_From] [tinyint] NOT NULL,
    [Slot_To] [tinyint] NOT NULL,
    [EventPos] [varchar](64) NULL,
    [strDesc] [varchar](128) NULL,
    [Serial64] [bigint] NOT NULL,
    [Gold] [bigint] NULL
    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF
    GO

    ALTER TABLE [dbo].[_LogEventItem] ADD CONSTRAINT [DF___LogEvent__Seria__440B1D61] DEFAULT (0) FOR [Serial64]
    GO

    ALTER TABLE [dbo].[_LogEventItem] ADD DEFAULT (0) FOR [Gold]
    GO

    second part add the stored procedure

    USE [SRO_VT_LOG]
    GO
    /****** Object: StoredProcedure [dbo].[_AddLogItem_edit] Script Date: 10/14/2015 11:29:58 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO


    -------------------------------------------------------------------------------------------------------------------
    -- Step 2
    -- ±âÁ¸ ¾ÆÀÌÅÛ ·Î±× ÀÔ·Â Stored procedure ¼öÁ¤
    -- DataBase : Shard Log
    ALTER procedure [dbo].[_AddLogItem_edit]
    @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
    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
    then restart SQL and it will be ready to use , then go in game and plus something up and you can see how it works, hope this helps :)

    - - - Updated - - -

    did that do what you wanted it to do RenePunik ?
    Last edited by mtnman33; 14-10-15 at 05:42 PM.

  5. #5
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,431Posts

    Re: Hello guys. Need some help out here!

    Quote Originally Posted by mtnman33 View Post
    #1 i always recommend to everyone to ALWAYS do a full database backup before running any script
    in case the script changes anything or adds anything or do not get the desired results you can always go right back to the way it was before .

    ok first part create the table


    second part add the stored procedure


    then restart SQL and it will be ready to use , then go in game and plus something up and you can see how it works, hope this helps :)

    - - - Updated - - -

    did that do what you wanted it to do RenePunik ?
    Unfortunately, I wanted to find out what's wrong with my lines. because when i trying to plus items no logs was sent to AlchemyLogs table.

  6. #6
    Member mtnman33 is offline
    MemberRank
    Jun 2012 Join Date
    80Posts

    Re: Hello guys. Need some help out here!

    well if its not sending then its in the stored procedures for that table , if you used the one i posted it should work without any problems and i have not had any trouble with it yet and works perfectly , if you really want to use the one you posted i will try it on my database and see what i can do with it to get it working .
    here is what i found wring with your lines so far , the main reason info wont send is because the top post of yours is a stored procedure without any controls so here is what i got so far

    USE [SRO_VT_LOG]
    GO
    /****** Object: StoredProcedure [dbo].[_AlchemyLogs] Script Date: 10/14/2015 8:57:51 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    CREATE PROCEDURE [dbo].[_AddAlchemyLogs]
    @CharacterName varchar(64),
    @CharID int,
    @AlchemySuccess bigint,
    @AlchemyFail bigint,
    @Operation tinyint
    as

    IF (@Operation = 90)
    BEGIN
    IF NOT EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    SET @CharacterName = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID)
    INSERT INTO AlchemyLogs (CharID, CharacterName, AlchemySuccess, AlchemyFail)
    VALUES (@CharID, @CharacterName, 0, 0)
    END
    IF EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    UPDATE AlchemyLogs SET AlchemySuccess = AlchemySuccess + 1 WHERE CharID = @CharID
    END
    END
    IF (@Operation = 91)
    BEGIN
    IF NOT EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    SET @CharacterName = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID)
    INSERT INTO AlchemyLogs (CharID, CharacterName, AlchemySuccess, AlchemyFail)
    VALUES (@CharID, @CharacterName, 0, 0)
    END
    IF EXISTS (SELECT CharID FROM AlchemyLogs WHERE CharID = @CharID)
    BEGIN
    UPDATE AlchemyLogs SET AlchemyFail = AlchemyFail + 1 WHERE CharID = @CharID
    END
    END
    Last edited by mtnman33; 15-10-15 at 07:41 AM.

  7. #7
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,431Posts

    Re: Hello guys. Need some help out here!

    Quote Originally Posted by mtnman33 View Post
    well if its not sending then its in the stored procedures for that table , if you used the one i posted it should work without any problems and i have not had any trouble with it yet and works perfectly , if you really want to use the one you posted i will try it on my database and see what i can do with it to get it working .
    here is what i found wring with your lines so far , the main reason info wont send is because the top post of yours is a stored procedure without any controls so here is what i got so far
    Doesn't works, recording the alchemy success and fail wasn't recorded and it wasn't sent to AlchemyLogs table

  8. #8
    Member mtnman33 is offline
    MemberRank
    Jun 2012 Join Date
    80Posts

    Re: Hello guys. Need some help out here!

    well im still working on it cause it could be a use full table indeed . i will keep you updated

  9. #9
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,431Posts

    Re: Hello guys. Need some help out here!

    Quote Originally Posted by mtnman33 View Post
    well im still working on it cause it could be a use full table indeed . i will keep you updated
    Thanks, I'm also working on fixing recording the logs.



Advertisement