View Single Post
  #4 (permalink)  
Old 06-22-2007, 12:47 PM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,635
Last Blog:
CherryPy(thon)
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

If you want the old IDs to be used again, by other monsters/players, then you can implement some kind of structure to hold the already used IDs in the monster/player-class. In the CWorldServer-class you have to have an identical structure to hold the IDs there's currently used.

* Player have an ID (1001)
* Monster have an ID (1002)
** CWorldServer now knows the IDs there are used (1001, 1002)
* Monster kills Player, and the used Player ID is saved in the Player-class
** The Player ID is now deleted in CWorldServers currently used IDs (1002)
** CWorldServer gives Player a new ID, but first it checks that it isn't in the Players used-IDs (1001), so CWorldServer gives it a new ID (1003)
* Now Player have a new

Think about that one "star" (*) is something there's going on in the monster/player class and two "stars" (**) is something there's going on in the CWorldServer class. I hope you get the idea of it.

It's pretty hard, as you see, to help you exactly. Can you maybe come with an more detailed/complex example of what you're trying to do?
__________________
05-03-2007 - 11-13-2008
Reply With Quote