Jump to content

Basic MaNGOS Understanding questions


Guest trhyne

Recommended Posts

I'd like to become a code contributor, have synced the tree and begun the process of figuring out wth is going on with it. I've got a few questions regarding my understanding. I'll probably answer some of these myself over time, but any answers will ramp up my understanding faster!

Are messages sent immediately or queued at all?

If Queued, where's the basic server loop/thread that reads from sockets and signals them to send queued messages?

Is Nagling (TCP_NODELAY off) generally turned on or off on public servers? If on, what drives the "lag conditions" to begin the process of aggregating packets?

Is there a cutoff for "relevance" regarding information on NPCs and other PCs involving distance, or are you updated with movement/position on all entities in the current zone?

Which events are generated for NPC positions -- Is it movement start/stop/turn/etc like PCs, or is there a more basic, less verbose set?

Link to comment
Share on other sites

Are messages sent immediately or queued at all?

If Queued, where's the basic server loop/thread that reads from sockets and signals them to send queued messages?

Is there a cutoff for "relevance" regarding information on NPCs and other PCs involving distance, or are you updated with movement/position on all entities in the current zone?

Which events are generated for NPC positions -- Is it movement start/stop/turn/etc like PCs, or is there a more basic, less verbose set?

The low level socket stuff is managed by the ACE library in its own way on separate threads but on the higher level the incoming messages (WorldPackets) are queued and processed on world update, outgoing ones are not.

The world is split into many "grids" and each grid into cells. Only the cells near the player are checked for creature visibility. When something moves, everything in range (visibility distance) gets notified. Only the grids near any active objects (players + some special creatures) are updated. If grid unloading is enabled or at the beginning, only those are loaded too (with terrain info + creature spawns).

Creature position can be given by its current position and/or its destination(s). When a creature is moving you just send a destination, set its speed and the client interpolates the rest.

Link to comment
Share on other sites

The low level socket stuff is managed by the ACE library in its own way on separate threads but on the higher level the incoming messages (WorldPackets) are queued and processed on world update, outgoing ones are not.

The world is split into many "grids" and each grid into cells. Only the cells near the player are checked for creature visibility. When something moves, everything in range (visibility distance) gets notified. Only the grids near any active objects (players + some special creatures) are updated. If grid unloading is enabled or at the beginning, only those are loaded too (with terrain info + creature spawns).

Creature position can be given by its current position and/or its destination(s). When a creature is moving you just send a destination, set its speed and the client interpolates the rest.

Many thanks, I'm getting the hang of it now.

So outgoing messages are just shot downstream as they are broadcast? Packet traces I originally looked at seemed to indicate fairly consistent packets, so I figured there must be an outgoing queue I missed somewhere. Any idea if the official servers do it this way, too? Just curious...

I'll look into Grids and cells. Much appreciate you pointing me at these.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use