Results 1 to 8 of 8

Thread: Server lag [LIBCOD]

  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts

    Server lag [LIBCOD]

    I use a script to save the statistics in the database (mysql):
    PHP Code:
    Endmap()
    {
    players getentarray("player""classname");
    for(
    0players.sizei++)
    {
    players[idatabase_save();
    wait 0.25//without, lags so much that the card does not end
    }
    }
    database_save()
    {
    sql_zapros="UPDATE `base_rank_players` SET `rank`='"+self.data["rank"]+"', `kills`='"+self.data["kills"]+"' WHERE `login_player`='"+self.accdata["login"]+"'";
    mysql_query(level.db["mysql"], sql_zapros);

    The data is saved, but if the number of players is greater than 5 server lag.
    Characteristics my VDS:
    RAM: 1024 (Indications at 10 players and change maps: 204/1024)
    Proccesor Core's: 2 (2.8 + 2.8 Mhz); Ubuntu-14.04-x86_64-minimal
    //////
    Could it be due to libcod?????

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    You mean to keep everything in one common request ??

  4. #4
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Code:
    mysql_async_create_query
    mysql_async_create_query_nosave
    mysql_async_getdone_list
    mysql_async_getresult_and_free
    mysql_async_initializer
    Whether it is possible to carry out not using:http://killtube.org/showthread.php?1...-mysql-queries and using these features!
    I am a bit do not understand (Write an example using my code) I will be very, very, very etc. Grateful to
    Last edited by maxdamage99; 16th October 2015 at 13:53.

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    There IS an example function in that thread. If you dont understand that, you shouldnt be trying to program asynchronously.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    I need to create a connection?
    PHP Code:
    mysql_async_initializer(hostuserpassdbport4); //??? 

  7. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Have you even read the code?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #8
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Izno, look.
    PHP Code:
    Endmap()
    {
    players getentarray("player""classname");
    for(
    0players.sizei++)
    {
    players[idatabase_save();
    }
    }
    database_save()
    {
    sql_zapros="UPDATE `base_rank_players` SET `rank`='"+self.data["rank"]+"', `kills`='"+self.data["kills"]+"' WHERE `login_player`='"+self.accdata["login"]+"'";
    mysql_async_create_query(sql_zapros);

    so necessary?

Posting Permissions

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