Sporny Posted August 19, 2015 Report Share Posted August 19, 2015 I saw this method to refresh the vehicle spawn on epochservers Is this possible for linux servers? and how do i realise this with server-object-cache? Link to comment Share on other sites More sharing options...
Swordsworn Posted August 20, 2015 Report Share Posted August 20, 2015 im quite sure this shouldnt be a big problem to do on linux. instead of a batch you need a bash or shell to execute the refresh. you have to look up how to access the mysql via bash but the syntax should be almost the same. the only thing which im not sure about is how the restartroutine should look like... To cut it short, he explained it quite well what to do, all you have to do is to check how the commands are difrent in linux and to "translate" it. Since I dont know them myself without looking them up I cant give you a finished example, sry ;-) Link to comment Share on other sites More sharing options...
Sporny Posted August 21, 2015 Author Report Share Posted August 21, 2015 Thats no problem and i will try it on my testserver... but: whats about the cache? the objects sould be deleted there too... or not? i dont really understand the cache folder in linux servers. Link to comment Share on other sites More sharing options...
Swordsworn Posted August 29, 2015 Report Share Posted August 29, 2015 If I understood it right the cache does simply "save" the database in an excluded file and syncs it from time to time with the "real" database.Even if this isnt too accurate, I made a lot of changes in the database itself and they all showed up on the server, thats being saied i believe you can ignore the cache files in matter of implementing non locked vehicles. An hole other thing is if it comes down to locked (hive) vehicles, there the cache is indeed important and so far no one figured rly out how to "bypass" it :) Link to comment Share on other sites More sharing options...
Sporny Posted August 31, 2015 Author Report Share Posted August 31, 2015 Okay.... nice.... thanks for this man! I will try it tonight ;) Link to comment Share on other sites More sharing options...
jahangir13 Posted December 10, 2015 Report Share Posted December 10, 2015 The cache should not be a problem. Just do the changes in the db when the server is down in a restart. Thats a part of a script I've used in my server to do cleanup tasks in the db. I guess I've started this from restarter.pl everytime before the server is actually started. #!/usr/bin/perl # use DBI; use warnings; use strict; use constant { INSTANCE => 24, # Chernarus instance DB_NAME => 'epoch', # Set database name DB_LOGIN => 'your_db_user', # Set database login DB_PASSWD => 'your_db_user_pass', # Set database password DB_HOST => 'localhost', # Set database host DB_PORT => 3306, # Set database port (default 3306) }; # connect to the db my $dbh = connect_to_db(); # Here you call your function for cleanup or whatever clean_player_login_data(); # disconnect again $dbh->disconnect; exit; #--------------------------------------------------------------------------- # SQL Query Sub-functions # sub connect_to_db { my $dbh = DBI->connect('dbi:mysql:'.DB_NAME.':'.DB_HOST.':'.DB_PORT, DB_LOGIN, DB_PASSWD, {'PrintError' => 1, 'RaiseError' => 1, 'AutoCommit' => 1}) or die "Can't connect to mysql: $!"; $dbh->{'mysql_auto_reconnect'} = 1; return $dbh; } # Clean player_login data older than 2 days sub clean_player_login_data { my $sql = "DELETE FROM `Player_LOGIN` WHERE `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 2 DAY);"; my $sth = $dbh->prepare ($sql); my $res = $sth->execute (); $sth->finish; return $res; } The perl script connects to the db and executes the function, here clean_player_login_data{}. The function called a few lines above. Of course you can create more functions. The clean_player_login_data function is the example where you need to enter the query you've posted. You could also have a look at a video I made some time ago which contains some useful sql queries: " https://www.youtube.com/watch?v=jLLbjWttBZ4 " Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now