How store the ip of the players in sql 2005 ?

Results 1 to 8 of 8
  1. #1
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    How store the ip of the players in sql 2005 ?

    Hello

    How store the ip of the players in sql 2005 ?


  2. #2
    Sorcerer Supreme LogiN is offline
    Member +Rank
    Mar 2012 Join Date
    SROTEAMLocation
    283Posts

    Re: How store the ip of the players in sql 2005 ?

    Quote Originally Posted by modog1545 View Post
    Hello

    How store the ip of the players in sql 2005 ?
    Here:
    PHP Code:
    USE SRO_VT_SHARD
    DECLARE @charname VARCHAR(16),@JID INT
    SET 
    @charname 'CHAR'
    SET @JID = (SELECT userJID FROM _User WHERE CharID=(SELECT CharID FROM _Char WHERE CharName16 = @charname))
    USE 
    SRO_VT_ACCOUNT SELECT reg_ip FROM TB_User WHERE JID =@JID 
    Luck!

  3. #3
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    Re: How store the ip of the players in sql 2005 ?

    thx man but not this what i want
    i want store the ip of the all players like this http://forum.ragezone.com/f722/chara...ban-ip-889849/
    but in sql 2005

  4. #4
    Sorcerer Supreme LogiN is offline
    Member +Rank
    Mar 2012 Join Date
    SROTEAMLocation
    283Posts

    Re: How store the ip of the players in sql 2005 ?

    I then used the thread.

  5. #5
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    Re: How store the ip of the players in sql 2005 ?

    this thread for sql 2008 i want for sql 2005 :(

  6. #6
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    Re: How store the ip of the players in sql 2005 ?

    up up

  7. #7
    Grand Master lemoniscool is offline
    Grand MasterRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    Re: How store the ip of the players in sql 2005 ?

    you can easily use the sql statements from the thread you linked .. all you have to do is put variable initialization to a new line and use 1 line for every variable declaration .. for example:

    this:
    PHP Code:
    DECLARE 
            @
    ID VARCHAR(64) = (Select STRuserID FROM TB_User Where JID = @AccJID),
            @
    Begin DATETIME GETDATE()-1,
            @
    End DATETIME GETDATE()+3650 
    you would need to change to:
    PHP Code:
    DECLARE @ID VARCHAR(64)
    SET @ID = (Select STRuserID FROM TB_User Where JID = @AccJID)
    DECLARE @
    Begin DATETIME
    SET 
    @Begin GETDATE()-1
    DECLARE @End DATETIME
    SET 
    @End GETDATE()+3650 
    do this with all variable declarations/initializations and the queries will work in 2005 too

  8. #8
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    Re: How store the ip of the players in sql 2005 ?

    thx lemoniscool
    can you please make example for this :

    PHP Code:
    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 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 and @len_desc 0
        
    begin     
            insert _LogEventChar values
    (@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)     
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2EventPosvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2strDescvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @Desc
        
    end 
        
    else 
        
    begin 
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2values(@CharIDGetDate(), @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.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE()) 
        -- 
    END 

        END 



Advertisement