Author Topic: Disable login while saving server data  (Read 1121 times)

Legacy_Black One

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Disable login while saving server data
« on: July 01, 2014, 10:03:23 am »


               

I am using a custom cache method like APS, setting all persistant data on local vars, and dump them only before server shutting down to minimize database queries. (A protective function will be activated when server was not shutting down correctly last time to make data dump more frequently. So don't worry about that one-time per reset data saving.)


But when dumping data, I need an empty server, so I do this by kicking all players and setting a server password via scripting, I know there was a nwnx2 plugin, like Server Administration Tool, but since nwvault gone, I can no more find it. So does anyone know an alternative method to achieve this goal? Not by kicking players during whole data dumping...


 


Thx



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Disable login while saving server data
« Reply #1 on: July 01, 2014, 03:31:06 pm »


               

No idea what plugin you need, but here's a link to the NWNX2 Forums : http://www.nwnx.org/phpBB2/



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Disable login while saving server data
« Reply #2 on: July 01, 2014, 03:38:26 pm »


               

This can be done via firewall, however I dont know how to sync it with NWN but I can ask a friend who is using this method to prevent early logins.

He uses linux so might not be useable for you though.



               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Disable login while saving server data
« Reply #3 on: July 01, 2014, 05:29:27 pm »


               

Are you sure there's no way to optimize it?


I have a system that goes through *every* object in the module and synchronizes them with the database. It takes about 25 seconds on first boot (with empty database) and 3-5 seconds on every boot afterwards. I don't even need to restrict logins.


Other than optimizing, you can set TMI limit to a very high value and process everything synchronously in one script, effectively hanging the nwserver process so it won't be responding to requests.



               
               

               
            

Legacy_Black One

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Disable login while saving server data
« Reply #4 on: July 02, 2014, 06:08:19 pm »


               


Are you sure there's no way to optimize it?


I have a system that goes through *every* object in the module and synchronizes them with the database. It takes about 25 seconds on first boot (with empty database) and 3-5 seconds on every boot afterwards. I don't even need to restrict logins.


Other than optimizing, you can set TMI limit to a very high value and process everything synchronously in one script, effectively hanging the nwserver process so it won't be responding to requests.




Wow! That's GREAT!


Might I ask you which plug-in and database system do you use?


I wish I could do the same >_<


               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Disable login while saving server data
« Reply #5 on: July 02, 2014, 08:54:02 pm »


               

I'm using MySQL on Linux with the latest version of nwnx_odbc for Linux. 


General suggestions if you're storing a lot of data:


- use MySQL or PostgreSQL


- create custom tables with the structure you need and use custom queries to manipulate only the data you need


- create indexes on fields you use for selection


- check for nested loops with queries (those can usually be optimized by using joins for SELECT queries or batching for updates/deletes).

- batch inserts/replaces when you insert more than 100 rows