Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: Files for extended Server + Random-Scripts like sliding mapvote on Deathrun

  1. #21
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by kung foo man View Post
    MySQL does that for you

    PHP Code:
    SELECT md5('test'
    Thanks. I have been looking into mysql's security functions. It is safer to use SHA2.

    PHP Code:
    DELIMITER $$

    DROP FUNCTION IF EXISTS generateSalt$$

    CREATE FUNCTION generateSalt()
    RETURNS VARCHAR(255)
    DETERMINISTIC
    BEGIN
        
    DECLARE x INT;
        DECLARE 
    s VARCHAR(255);
        
    SET s '';
        
    SET x 0;

        WHILE 
    x  10 DO
            
    SET s CONCAT(s,CHAR(FLOOR(34+(RAND()*93))));
            
    SET x 1
        
    END WHILE;

        RETURN 
    s;
    END$$

    DELIMITER 
    PHP Code:
    SET s generateSalt();
    SET pass SHA2(CONCAT(spass), 256); 
    Last edited by Mitch; 20th May 2013 at 13:09.

  2. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (20th May 2013)

  3. #22
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    If you have got an account system and you often search your user on their username. Then it would be better to make this an index. This will increase performance 10 times.

    PHP Code:
        CREATE INDEX players_user ON players(user); 
    If you want to see or drop your one of your indexes
    PHP Code:
        SHOW INDEX FROM players;
        
    DROP INDEX players_user ON players

  4. #23
    Banned
    Join Date
    Jul 2019
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post
    Decent, need to accomplish something like this with mine.

  5. The Following User Says Thank You to ARTOTTO For This Useful Post:

    kubislav23 (1st August 2019)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •