Jump to content

Guild Castles as multi-map server objects?


Gepard

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

While investigating issue http://rathena.org/b...e-data-loading/ I analyzed guild castle code thoroughly, and started to wonder about reasons why every map-server keeps a local copy of all castles. It's counterintuitive, since every castle is tied to a map, and every map is tied to a map-server. So it is not possible to have the same castle on more than one map-server.

Unless I'm wrong there are just two ways of modifying guild castle data:

  • with a script command SetCastleData
  • breaking a guild that owns the castle, which abandons the castle

Guild breaking can happen on another map-server, and this scenario is already covered:

  1. Map-server requests guild break from char-server.
  2. Char-server deletes the guild and notifies all map-servers.
  3. Map-servers performs ::OnGuildBreak NPC events, reset castle owners and request char-server to save castle data.

Manipulating castle data on one map-server with a script that is on another map-server doesn't make sense to me. This could be disallowed without any harm to usability IMO.

The only piece of information about castles on other map-servers that could be used, is number of castles owned by each guild (required in guild info window and guild_max_castles battle conf). This is however guild's attribute and could be stored in guild struct.

So it looks to me that we could safely remove non-local guild castles from map-server.

Another question that arises immediately is: is it char-server or map-server that should declare/define castle maps? Currently char-server knows nothing about castle maps, unless map-server requests data for it (based on db/castle_db.txt and WoE scripts). Char-server does no checks whatsoever, assuming that if castle is not in SQL, but has been requested by map-server, then it must be an empty castle.

It is possible to have 2 castles with same castle ID on different map-servers as long as map names are different as well. It would make more sense if castle was identified by mapindex.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

I completely agree.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...