Merge lp:~widelands-dev/widelands/bug-1800337-unlocalize-log into lp:widelands
- bug-1800337-unlocalize-log
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 8916 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-1800337-unlocalize-log | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
236 lines (+25/-25) 9 files modified
src/logic/map_objects/tribes/militarysite.cc (+1/-1) src/logic/map_objects/tribes/production_program.cc (+6/-6) src/logic/map_objects/tribes/productionsite.cc (+2/-2) src/logic/map_objects/tribes/tribe_descr.cc (+3/-3) src/logic/map_objects/tribes/warehouse.cc (+2/-2) src/logic/map_objects/tribes/worker.cc (+1/-1) src/map_io/map_buildingdata_packet.cc (+7/-7) src/map_io/map_object_packet.cc (+1/-1) src/map_io/map_players_view_packet.cc (+2/-2) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1800337-unlocalize-log | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Toni Förster | Approve | ||
Review via email: mp+358424@code.launchpad.net |
Commit message
Use internal names rather than descnames for log messages and workarea IDs.
Description of the change
To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Revision history for this message
Toni Förster (stonerl) wrote : | # |
Looks good to me. Also playtested it.
review:
Approve
Revision history for this message
GunChleoc (gunchleoc) wrote : | # |
Thanks for the review! :)
@bunnybot merge
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/logic/map_objects/tribes/militarysite.cc' | |||
2 | --- src/logic/map_objects/tribes/militarysite.cc 2018-04-07 16:59:00 +0000 | |||
3 | +++ src/logic/map_objects/tribes/militarysite.cc 2018-11-07 10:28:51 +0000 | |||
4 | @@ -307,7 +307,7 @@ | |||
5 | 307 | heal_per_second_ = table.get_int("heal_per_second"); | 307 | heal_per_second_ = table.get_int("heal_per_second"); |
6 | 308 | 308 | ||
7 | 309 | if (conquer_radius_ > 0) | 309 | if (conquer_radius_ > 0) |
9 | 310 | workarea_info_[conquer_radius_].insert(descname() + " conquer"); | 310 | workarea_info_[conquer_radius_].insert(name() + " conquer"); |
10 | 311 | prefers_heroes_at_start_ = table.get_bool("prefer_heroes"); | 311 | prefers_heroes_at_start_ = table.get_bool("prefer_heroes"); |
11 | 312 | 312 | ||
12 | 313 | std::unique_ptr<LuaTable> items_table = table.get_table("messages"); | 313 | std::unique_ptr<LuaTable> items_table = table.get_table("messages"); |
13 | 314 | 314 | ||
14 | === modified file 'src/logic/map_objects/tribes/production_program.cc' | |||
15 | --- src/logic/map_objects/tribes/production_program.cc 2018-10-12 10:29:33 +0000 | |||
16 | +++ src/logic/map_objects/tribes/production_program.cc 2018-11-07 10:28:51 +0000 | |||
17 | @@ -575,7 +575,7 @@ | |||
18 | 575 | if (it == programs.end()) | 575 | if (it == programs.end()) |
19 | 576 | throw GameDataError("the program \"%s\" has not (yet) been declared in %s " | 576 | throw GameDataError("the program \"%s\" has not (yet) been declared in %s " |
20 | 577 | "(wrong declaration order?)", | 577 | "(wrong declaration order?)", |
22 | 578 | program_name, descr.descname().c_str()); | 578 | program_name, descr.name().c_str()); |
23 | 579 | program_ = it->second.get(); | 579 | program_ = it->second.get(); |
24 | 580 | } | 580 | } |
25 | 581 | 581 | ||
26 | @@ -663,13 +663,13 @@ | |||
27 | 663 | for (const auto& area_info : worker_workarea_info) { | 663 | for (const auto& area_info : worker_workarea_info) { |
28 | 664 | std::set<std::string>& building_radius_infos = descr->workarea_info_[area_info.first]; | 664 | std::set<std::string>& building_radius_infos = descr->workarea_info_[area_info.first]; |
29 | 665 | 665 | ||
32 | 666 | for (const std::string& worker_descname : area_info.second) { | 666 | for (const std::string& worker_name : area_info.second) { |
33 | 667 | std::string description = descr->descname(); | 667 | std::string description = descr->name(); |
34 | 668 | description += ' '; | 668 | description += ' '; |
35 | 669 | description += production_program_name; | 669 | description += production_program_name; |
36 | 670 | description += " worker "; | 670 | description += " worker "; |
37 | 671 | description += main_worker_descr.name(); | 671 | description += main_worker_descr.name(); |
39 | 672 | description += worker_descname; | 672 | description += worker_name; |
40 | 673 | building_radius_infos.insert(description); | 673 | building_radius_infos.insert(description); |
41 | 674 | } | 674 | } |
42 | 675 | } | 675 | } |
43 | @@ -1124,8 +1124,8 @@ | |||
44 | 1124 | throw GameDataError("expected %s but found \"%s\"", "percentage", parameters); | 1124 | throw GameDataError("expected %s but found \"%s\"", "percentage", parameters); |
45 | 1125 | } | 1125 | } |
46 | 1126 | std::string description = | 1126 | std::string description = |
49 | 1127 | (boost::format("%1$s %2$s mine %3$s") % descr->descname() % production_program_name % | 1127 | (boost::format("%1$s %2$s mine %3$s") % descr->name() % production_program_name % |
50 | 1128 | world.get_resource(resource_)->descname()) | 1128 | world.get_resource(resource_)->name()) |
51 | 1129 | .str(); | 1129 | .str(); |
52 | 1130 | 1130 | ||
53 | 1131 | descr->workarea_info_[distance_].insert(description); | 1131 | descr->workarea_info_[distance_].insert(description); |
54 | 1132 | 1132 | ||
55 | === modified file 'src/logic/map_objects/tribes/productionsite.cc' | |||
56 | --- src/logic/map_objects/tribes/productionsite.cc 2018-09-10 05:59:47 +0000 | |||
57 | +++ src/logic/map_objects/tribes/productionsite.cc 2018-11-07 10:28:51 +0000 | |||
58 | @@ -559,7 +559,7 @@ | |||
59 | 559 | * Intercept remove_worker() calls to unassign our worker, if necessary. | 559 | * Intercept remove_worker() calls to unassign our worker, if necessary. |
60 | 560 | */ | 560 | */ |
61 | 561 | void ProductionSite::remove_worker(Worker& w) { | 561 | void ProductionSite::remove_worker(Worker& w) { |
63 | 562 | molog("%s leaving\n", w.descr().descname().c_str()); | 562 | molog("%s leaving\n", w.descr().name().c_str()); |
64 | 563 | WorkingPosition* wp = working_positions_; | 563 | WorkingPosition* wp = working_positions_; |
65 | 564 | 564 | ||
66 | 565 | for (const auto& temp_wp : descr().working_positions()) { | 565 | for (const auto& temp_wp : descr().working_positions()) { |
67 | @@ -657,7 +657,7 @@ | |||
68 | 657 | if (current == nuwo) | 657 | if (current == nuwo) |
69 | 658 | throw wexception( | 658 | throw wexception( |
70 | 659 | "Something went wrong! No fitting place for worker %s in %s at (%u, %u) found!", | 659 | "Something went wrong! No fitting place for worker %s in %s at (%u, %u) found!", |
72 | 660 | w->descr().descname().c_str(), psite.descr().descname().c_str(), | 660 | w->descr().name().c_str(), psite.descr().name().c_str(), |
73 | 661 | psite.get_position().x, psite.get_position().y); | 661 | psite.get_position().x, psite.get_position().y); |
74 | 662 | } | 662 | } |
75 | 663 | } | 663 | } |
76 | 664 | 664 | ||
77 | === modified file 'src/logic/map_objects/tribes/tribe_descr.cc' | |||
78 | --- src/logic/map_objects/tribes/tribe_descr.cc 2018-09-15 07:47:59 +0000 | |||
79 | +++ src/logic/map_objects/tribes/tribe_descr.cc 2018-11-07 10:28:51 +0000 | |||
80 | @@ -393,7 +393,7 @@ | |||
81 | 393 | if (!res || !amount) { | 393 | if (!res || !amount) { |
82 | 394 | auto list = resource_indicators_.find(""); | 394 | auto list = resource_indicators_.find(""); |
83 | 395 | if (list == resource_indicators_.end() || list->second.empty()) { | 395 | if (list == resource_indicators_.end() || list->second.empty()) { |
85 | 396 | throw GameDataError("Tribe '%s' has no indicator for no resources!", descname_.c_str()); | 396 | throw GameDataError("Tribe '%s' has no indicator for no resources!", name_.c_str()); |
86 | 397 | } | 397 | } |
87 | 398 | return list->second.begin()->second; | 398 | return list->second.begin()->second; |
88 | 399 | } | 399 | } |
89 | @@ -401,7 +401,7 @@ | |||
90 | 401 | auto list = resource_indicators_.find(res->name()); | 401 | auto list = resource_indicators_.find(res->name()); |
91 | 402 | if (list == resource_indicators_.end() || list->second.empty()) { | 402 | if (list == resource_indicators_.end() || list->second.empty()) { |
92 | 403 | throw GameDataError( | 403 | throw GameDataError( |
94 | 404 | "Tribe '%s' has no indicators for resource '%s'!", descname_.c_str(), res->name().c_str()); | 404 | "Tribe '%s' has no indicators for resource '%s'!", name_.c_str(), res->name().c_str()); |
95 | 405 | } | 405 | } |
96 | 406 | 406 | ||
97 | 407 | uint32_t lowest = 0; | 407 | uint32_t lowest = 0; |
98 | @@ -416,7 +416,7 @@ | |||
99 | 416 | if (lowest < amount) { | 416 | if (lowest < amount) { |
100 | 417 | throw GameDataError("Tribe '%s' has no indicators for amount %i of resource '%s' (highest " | 417 | throw GameDataError("Tribe '%s' has no indicators for amount %i of resource '%s' (highest " |
101 | 418 | "possible amount is %i)!", | 418 | "possible amount is %i)!", |
103 | 419 | descname_.c_str(), amount, res->name().c_str(), lowest); | 419 | name_.c_str(), amount, res->name().c_str(), lowest); |
104 | 420 | } | 420 | } |
105 | 421 | 421 | ||
106 | 422 | return list->second.find(lowest)->second; | 422 | return list->second.find(lowest)->second; |
107 | 423 | 423 | ||
108 | === modified file 'src/logic/map_objects/tribes/warehouse.cc' | |||
109 | --- src/logic/map_objects/tribes/warehouse.cc 2018-09-04 15:48:47 +0000 | |||
110 | +++ src/logic/map_objects/tribes/warehouse.cc 2018-11-07 10:28:51 +0000 | |||
111 | @@ -299,7 +299,7 @@ | |||
112 | 299 | heal_per_second_ = table.get_int("heal_per_second"); | 299 | heal_per_second_ = table.get_int("heal_per_second"); |
113 | 300 | if (table.has_key("conquers")) { | 300 | if (table.has_key("conquers")) { |
114 | 301 | conquers_ = table.get_int("conquers"); | 301 | conquers_ = table.get_int("conquers"); |
116 | 302 | workarea_info_[conquers_].insert(descname() + " conquer"); | 302 | workarea_info_[conquers_].insert(name() + " conquer"); |
117 | 303 | } | 303 | } |
118 | 304 | } | 304 | } |
119 | 305 | 305 | ||
120 | @@ -1072,7 +1072,7 @@ | |||
121 | 1072 | } else | 1072 | } else |
122 | 1073 | throw wexception("worker type %s needs \"%s\" to be built but that is neither " | 1073 | throw wexception("worker type %s needs \"%s\" to be built but that is neither " |
123 | 1074 | "a ware type nor a worker type defined in the tribe %s", | 1074 | "a ware type nor a worker type defined in the tribe %s", |
125 | 1075 | w_desc.descname().c_str(), input_name.c_str(), | 1075 | w_desc.name().c_str(), input_name.c_str(), |
126 | 1076 | owner().tribe().name().c_str()); | 1076 | owner().tribe().name().c_str()); |
127 | 1077 | } | 1077 | } |
128 | 1078 | } | 1078 | } |
129 | 1079 | 1079 | ||
130 | === modified file 'src/logic/map_objects/tribes/worker.cc' | |||
131 | --- src/logic/map_objects/tribes/worker.cc 2018-09-25 06:32:35 +0000 | |||
132 | +++ src/logic/map_objects/tribes/worker.cc 2018-11-07 10:28:51 +0000 | |||
133 | @@ -2101,7 +2101,7 @@ | |||
134 | 2101 | /// Give the recruit his diploma and say farwell to him. | 2101 | /// Give the recruit his diploma and say farwell to him. |
135 | 2102 | void Worker::start_task_releaserecruit(Game& game, Worker& recruit) { | 2102 | void Worker::start_task_releaserecruit(Game& game, Worker& recruit) { |
136 | 2103 | push_task(game, taskReleaserecruit); | 2103 | push_task(game, taskReleaserecruit); |
138 | 2104 | molog("Starting to release %s %u...\n", recruit.descr().descname().c_str(), recruit.serial()); | 2104 | molog("Starting to release %s %u...\n", recruit.descr().name().c_str(), recruit.serial()); |
139 | 2105 | return schedule_act(game, 5000); | 2105 | return schedule_act(game, 5000); |
140 | 2106 | } | 2106 | } |
141 | 2107 | 2107 | ||
142 | 2108 | 2108 | ||
143 | === modified file 'src/map_io/map_buildingdata_packet.cc' | |||
144 | --- src/map_io/map_buildingdata_packet.cc 2018-07-08 15:16:16 +0000 | |||
145 | +++ src/map_io/map_buildingdata_packet.cc 2018-11-07 10:28:51 +0000 | |||
146 | @@ -152,7 +152,7 @@ | |||
147 | 152 | if (building.old_buildings_.empty() && !is_a(ConstructionSite, &building)) { | 152 | if (building.old_buildings_.empty() && !is_a(ConstructionSite, &building)) { |
148 | 153 | throw GameDataError("Failed to read %s %u: No former buildings information.\n" | 153 | throw GameDataError("Failed to read %s %u: No former buildings information.\n" |
149 | 154 | "Your savegame is corrupted", | 154 | "Your savegame is corrupted", |
151 | 155 | building.descr().descname().c_str(), building.serial()); | 155 | building.descr().name().c_str(), building.serial()); |
152 | 156 | } | 156 | } |
153 | 157 | 157 | ||
154 | 158 | if (fr.unsigned_8()) { | 158 | if (fr.unsigned_8()) { |
155 | @@ -161,7 +161,7 @@ | |||
156 | 161 | log("WARNING: Found a stopped %s at (%i, %i) in the " | 161 | log("WARNING: Found a stopped %s at (%i, %i) in the " |
157 | 162 | "savegame. Militarysites are not stoppable. " | 162 | "savegame. Militarysites are not stoppable. " |
158 | 163 | "Ignoring.", | 163 | "Ignoring.", |
160 | 164 | building.descr().descname().c_str(), building.get_position().x, | 164 | building.descr().name().c_str(), building.get_position().x, |
161 | 165 | building.get_position().y); | 165 | building.get_position().y); |
162 | 166 | } else { | 166 | } else { |
163 | 167 | productionsite->set_stopped(true); | 167 | productionsite->set_stopped(true); |
164 | @@ -170,7 +170,7 @@ | |||
165 | 170 | log("WARNING: Found a stopped %s at (%i, %i) in the " | 170 | log("WARNING: Found a stopped %s at (%i, %i) in the " |
166 | 171 | "savegame. Only productionsites are stoppable. " | 171 | "savegame. Only productionsites are stoppable. " |
167 | 172 | "Ignoring.", | 172 | "Ignoring.", |
169 | 173 | building.descr().descname().c_str(), building.get_position().x, | 173 | building.descr().name().c_str(), building.get_position().x, |
170 | 174 | building.get_position().y); | 174 | building.get_position().y); |
171 | 175 | } | 175 | } |
172 | 176 | 176 | ||
173 | @@ -372,7 +372,7 @@ | |||
174 | 372 | if (!game.tribes().worker_exists(worker_index)) { | 372 | if (!game.tribes().worker_exists(worker_index)) { |
175 | 373 | log("WARNING: %s %u has a next_spawn time for nonexistent " | 373 | log("WARNING: %s %u has a next_spawn time for nonexistent " |
176 | 374 | "worker type \"%s\" set to %u, ignoring\n", | 374 | "worker type \"%s\" set to %u, ignoring\n", |
178 | 375 | warehouse.descr().descname().c_str(), warehouse.serial(), worker_typename, | 375 | warehouse.descr().name().c_str(), warehouse.serial(), worker_typename, |
179 | 376 | next_spawn); | 376 | next_spawn); |
180 | 377 | continue; | 377 | continue; |
181 | 378 | } | 378 | } |
182 | @@ -380,7 +380,7 @@ | |||
183 | 380 | log("WARNING: %s %u has a next_spawn time for worker type " | 380 | log("WARNING: %s %u has a next_spawn time for worker type " |
184 | 381 | "\"%s\", that costs something to build, set to %u, " | 381 | "\"%s\", that costs something to build, set to %u, " |
185 | 382 | "ignoring\n", | 382 | "ignoring\n", |
187 | 383 | warehouse.descr().descname().c_str(), warehouse.serial(), worker_typename, | 383 | warehouse.descr().name().c_str(), warehouse.serial(), worker_typename, |
188 | 384 | next_spawn); | 384 | next_spawn); |
189 | 385 | continue; | 385 | continue; |
190 | 386 | } | 386 | } |
191 | @@ -391,7 +391,7 @@ | |||
192 | 391 | throw GameDataError("%s %u has a next_spawn time for worker type " | 391 | throw GameDataError("%s %u has a next_spawn time for worker type " |
193 | 392 | "\"%s\" set to %u, but it was previously set " | 392 | "\"%s\" set to %u, but it was previously set " |
194 | 393 | "to %u\n", | 393 | "to %u\n", |
196 | 394 | warehouse.descr().descname().c_str(), warehouse.serial(), | 394 | warehouse.descr().name().c_str(), warehouse.serial(), |
197 | 395 | worker_typename, next_spawn, | 395 | worker_typename, next_spawn, |
198 | 396 | warehouse.next_worker_without_cost_spawn_[i]); | 396 | warehouse.next_worker_without_cost_spawn_[i]); |
199 | 397 | warehouse.next_worker_without_cost_spawn_[i] = next_spawn; | 397 | warehouse.next_worker_without_cost_spawn_[i] = next_spawn; |
200 | @@ -717,7 +717,7 @@ | |||
201 | 717 | 717 | ||
202 | 718 | } catch (const WException& e) { | 718 | } catch (const WException& e) { |
203 | 719 | throw GameDataError( | 719 | throw GameDataError( |
205 | 720 | "productionsite (%s): %s", productionsite.descr().descname().c_str(), e.what()); | 720 | "productionsite (%s): %s", productionsite.descr().name().c_str(), e.what()); |
206 | 721 | } | 721 | } |
207 | 722 | } | 722 | } |
208 | 723 | 723 | ||
209 | 724 | 724 | ||
210 | === modified file 'src/map_io/map_object_packet.cc' | |||
211 | --- src/map_io/map_object_packet.cc 2018-04-07 16:59:00 +0000 | |||
212 | +++ src/map_io/map_object_packet.cc 2018-11-07 10:28:51 +0000 | |||
213 | @@ -153,7 +153,7 @@ | |||
214 | 153 | if (!obj.has_new_save_support()) | 153 | if (!obj.has_new_save_support()) |
215 | 154 | throw GameDataError("MO(%u of type %s) without new style save support not saved " | 154 | throw GameDataError("MO(%u of type %s) without new style save support not saved " |
216 | 155 | "explicitly", | 155 | "explicitly", |
218 | 156 | obj.serial(), obj.descr().descname().c_str()); | 156 | obj.serial(), obj.descr().name().c_str()); |
219 | 157 | 157 | ||
220 | 158 | mos.register_object(obj); | 158 | mos.register_object(obj); |
221 | 159 | obj.save(egbase, mos, fw); | 159 | obj.save(egbase, mos, fw); |
222 | 160 | 160 | ||
223 | === modified file 'src/map_io/map_players_view_packet.cc' | |||
224 | --- src/map_io/map_players_view_packet.cc 2018-07-12 08:08:47 +0000 | |||
225 | +++ src/map_io/map_players_view_packet.cc 2018-11-07 10:28:51 +0000 | |||
226 | @@ -856,8 +856,8 @@ | |||
227 | 856 | else { | 856 | else { |
228 | 857 | // We should never get here.. output some information about the situation. | 857 | // We should never get here.. output some information about the situation. |
229 | 858 | log("\nwidelands_map_players_view_data_packet.cc::write_unseen_immovable(): "); | 858 | log("\nwidelands_map_players_view_data_packet.cc::write_unseen_immovable(): "); |
232 | 859 | log("%s %s (%s) was not expected.\n", typeid(*map_object_descr).name(), | 859 | log("%s %s was not expected.\n", typeid(*map_object_descr).name(), |
233 | 860 | map_object_descr->name().c_str(), map_object_descr->descname().c_str()); | 860 | map_object_descr->name().c_str()); |
234 | 861 | NEVER_HERE(); | 861 | NEVER_HERE(); |
235 | 862 | } | 862 | } |
236 | 863 | immovable_kinds_file.unsigned_8(immovable_kind); | 863 | immovable_kinds_file.unsigned_8(immovable_kind); |
Continuous integration builds have changed state:
Travis build 4192. State: passed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 452673599. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ bug_1800337_ unlocalize_ log-3988.
Appveyor build 3988. State: success. Details: https:/