View Single Post
  #4  
Old 06-04-2004, 04:13 AM
matt8891 matt8891 is offline
Registered User
matt8891's Avatar
Join Date: Jul 2003
Location: New York
Posts: 0
matt8891 is on a distinguished road
Send a message via AIM to matt8891 Send a message via Yahoo to matt8891
Quote:
Originally Posted by Stefan
Tomorrow all servers will be restarted. It will fix some bugs and improve the speed of gmaps.

Bug fixes:
- adding server flags by script works again (before it was blocked after some hours of uptime)
- the script command setplayerprop and setcharprop can only set valid color values (max 19), it was possible before to set more colors but that could possibly crash the client
- getnearestplayers(searchx,searchy,searchcondition) is sorting the player indices correctly (it's returning an array of player indices, starting with the closest player)
- a memory leak in the npcserver has been removed

Gmap optimizations:
To speed up the loading of gmaps, the parts of the gmaps are not loaded at startup anymore. They are only loaded when a player enters it or an npc accesses things on the map part. After a few minutes when all player left the map part and npcs don't do timeouts anymore, the map part will be removed from memory again. So the server can load gmaps faster and takes less memory, also you have less npcs on the gmap which should make some npc scripts faster.
The drawback is that npcs of those map parts (local npcs saved in the .nw file) are not loaded at startup, so when they do important things then there would be problems. To avoid that there are two new options for the gmap, which you need to specify in the .gmap file:

LOADFULLMAP
is loading all map parts at startup and is not removing them from memory, this would be the old behaviour

LOADATSTART
levelname, levelname, ...
levelname, levelname, ...
LOADATSTARTEND
is loading the specified levels at startup and is not removing them from memory, this way you can enforce the loading of important map parts without losing the advantages of the optimizations.

Normally you don't need to use the LOADFULLMAP flag, things should work quite smoothly without it since the map parts are loaded into memory as needed. Following npc functions/variables are enforcing the loading of map parts: onwall,onwall2,getareanpcs,testnpcs,putnpc2,npcsco unt,tiles[]
Nice work stefan
Reply With Quote