[Freeciv-tickets] [freeciv] #44703: Optimize create_city()

Back to archive index
OSDN Ticket System norep****@osdn*****
Sun May 29 09:21:24 JST 2022


#44703: Optimize create_city()

  Open Date: 2022-05-29 00:25
Last Update: 2022-05-29 03:21

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/44703
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44703

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-05-29 03:21 Updated by: cazfi

Comment:

Let's concentrate on master/S3_1 patch first. Whether we want to backport it to release branch remains to be seen.
- You still need to emit proper "city_size_change" and (deprecated) "city_growth" signals to not break scripts that track the size via them
- handle_edit_city_create() is about handling untrusted input from the client - do not assert() input validity, but check it even in release build
- "Set from UINT8 packet field, no need to check the top" sounds a bit like something to make a FC_STATIC_ASSERT() about, if possible
- "Max range is %d" - that's not a "range" but just one end of one - upper limit.
- The unit type "city_size" sanity check cannot go in this form to a d3f branch, as it prohibits zero "city_size" even when it does not break nothing (unit would not be able to build a city anyway). I wouldn't break S3_1 semi-freeze for this, but add the sanity check to master only, with rscompat code that updates value 0 from a 3.1 ruleset to 1.
---
- As for the "city_growth" signal that you need to emit once for each increment step, and that's already been deprecated for some time, I think it's the time to start thinking how to turn deprecated lua constructs to completely unsupported ones -> will open a ticket about that, but that's not going to get resolved for this need (esp. in stable branches)


---------------------------------------------------------------------
Ticket Status:

      Reporter: ihnatus
         Owner: (None)
          Type: Feature Requests
        Status: Open
      Priority: 5 - Medium
     MileStone: 3.0.2
     Component: Server
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Add size parameter to create_city()function. As a side effect, allow creation of cities bigger than maximal size an empty city may grow to (a notice is left). As another related fix, check city_size sanity for all ruleset units.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/44703
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44703



More information about the Freeciv-tickets mailing list
Back to archive index