Merge lp:~widelands-dev/widelands/bug-1800337-unlocalize-log into lp:widelands

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
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.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4192. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/452673599.
Appveyor build 3988. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1800337_unlocalize_log-3988.

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
=== modified file 'src/logic/map_objects/tribes/militarysite.cc'
--- src/logic/map_objects/tribes/militarysite.cc 2018-04-07 16:59:00 +0000
+++ src/logic/map_objects/tribes/militarysite.cc 2018-11-07 10:28:51 +0000
@@ -307,7 +307,7 @@
307 heal_per_second_ = table.get_int("heal_per_second");307 heal_per_second_ = table.get_int("heal_per_second");
308308
309 if (conquer_radius_ > 0)309 if (conquer_radius_ > 0)
310 workarea_info_[conquer_radius_].insert(descname() + " conquer");310 workarea_info_[conquer_radius_].insert(name() + " conquer");
311 prefers_heroes_at_start_ = table.get_bool("prefer_heroes");311 prefers_heroes_at_start_ = table.get_bool("prefer_heroes");
312312
313 std::unique_ptr<LuaTable> items_table = table.get_table("messages");313 std::unique_ptr<LuaTable> items_table = table.get_table("messages");
314314
=== modified file 'src/logic/map_objects/tribes/production_program.cc'
--- src/logic/map_objects/tribes/production_program.cc 2018-10-12 10:29:33 +0000
+++ src/logic/map_objects/tribes/production_program.cc 2018-11-07 10:28:51 +0000
@@ -575,7 +575,7 @@
575 if (it == programs.end())575 if (it == programs.end())
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 "
577 "(wrong declaration order?)",577 "(wrong declaration order?)",
578 program_name, descr.descname().c_str());578 program_name, descr.name().c_str());
579 program_ = it->second.get();579 program_ = it->second.get();
580 }580 }
581581
@@ -663,13 +663,13 @@
663 for (const auto& area_info : worker_workarea_info) {663 for (const auto& area_info : worker_workarea_info) {
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];
665665
666 for (const std::string& worker_descname : area_info.second) {666 for (const std::string& worker_name : area_info.second) {
667 std::string description = descr->descname();667 std::string description = descr->name();
668 description += ' ';668 description += ' ';
669 description += production_program_name;669 description += production_program_name;
670 description += " worker ";670 description += " worker ";
671 description += main_worker_descr.name();671 description += main_worker_descr.name();
672 description += worker_descname;672 description += worker_name;
673 building_radius_infos.insert(description);673 building_radius_infos.insert(description);
674 }674 }
675 }675 }
@@ -1124,8 +1124,8 @@
1124 throw GameDataError("expected %s but found \"%s\"", "percentage", parameters);1124 throw GameDataError("expected %s but found \"%s\"", "percentage", parameters);
1125 }1125 }
1126 std::string description =1126 std::string description =
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 %
1128 world.get_resource(resource_)->descname())1128 world.get_resource(resource_)->name())
1129 .str();1129 .str();
11301130
1131 descr->workarea_info_[distance_].insert(description);1131 descr->workarea_info_[distance_].insert(description);
11321132
=== modified file 'src/logic/map_objects/tribes/productionsite.cc'
--- src/logic/map_objects/tribes/productionsite.cc 2018-09-10 05:59:47 +0000
+++ src/logic/map_objects/tribes/productionsite.cc 2018-11-07 10:28:51 +0000
@@ -559,7 +559,7 @@
559 * Intercept remove_worker() calls to unassign our worker, if necessary.559 * Intercept remove_worker() calls to unassign our worker, if necessary.
560 */560 */
561void ProductionSite::remove_worker(Worker& w) {561void ProductionSite::remove_worker(Worker& w) {
562 molog("%s leaving\n", w.descr().descname().c_str());562 molog("%s leaving\n", w.descr().name().c_str());
563 WorkingPosition* wp = working_positions_;563 WorkingPosition* wp = working_positions_;
564564
565 for (const auto& temp_wp : descr().working_positions()) {565 for (const auto& temp_wp : descr().working_positions()) {
@@ -657,7 +657,7 @@
657 if (current == nuwo)657 if (current == nuwo)
658 throw wexception(658 throw wexception(
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!",
660 w->descr().descname().c_str(), psite.descr().descname().c_str(),660 w->descr().name().c_str(), psite.descr().name().c_str(),
661 psite.get_position().x, psite.get_position().y);661 psite.get_position().x, psite.get_position().y);
662 }662 }
663 }663 }
664664
=== modified file 'src/logic/map_objects/tribes/tribe_descr.cc'
--- src/logic/map_objects/tribes/tribe_descr.cc 2018-09-15 07:47:59 +0000
+++ src/logic/map_objects/tribes/tribe_descr.cc 2018-11-07 10:28:51 +0000
@@ -393,7 +393,7 @@
393 if (!res || !amount) {393 if (!res || !amount) {
394 auto list = resource_indicators_.find("");394 auto list = resource_indicators_.find("");
395 if (list == resource_indicators_.end() || list->second.empty()) {395 if (list == resource_indicators_.end() || list->second.empty()) {
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());
397 }397 }
398 return list->second.begin()->second;398 return list->second.begin()->second;
399 }399 }
@@ -401,7 +401,7 @@
401 auto list = resource_indicators_.find(res->name());401 auto list = resource_indicators_.find(res->name());
402 if (list == resource_indicators_.end() || list->second.empty()) {402 if (list == resource_indicators_.end() || list->second.empty()) {
403 throw GameDataError(403 throw GameDataError(
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());
405 }405 }
406406
407 uint32_t lowest = 0;407 uint32_t lowest = 0;
@@ -416,7 +416,7 @@
416 if (lowest < amount) {416 if (lowest < amount) {
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 "
418 "possible amount is %i)!",418 "possible amount is %i)!",
419 descname_.c_str(), amount, res->name().c_str(), lowest);419 name_.c_str(), amount, res->name().c_str(), lowest);
420 }420 }
421421
422 return list->second.find(lowest)->second;422 return list->second.find(lowest)->second;
423423
=== modified file 'src/logic/map_objects/tribes/warehouse.cc'
--- src/logic/map_objects/tribes/warehouse.cc 2018-09-04 15:48:47 +0000
+++ src/logic/map_objects/tribes/warehouse.cc 2018-11-07 10:28:51 +0000
@@ -299,7 +299,7 @@
299 heal_per_second_ = table.get_int("heal_per_second");299 heal_per_second_ = table.get_int("heal_per_second");
300 if (table.has_key("conquers")) {300 if (table.has_key("conquers")) {
301 conquers_ = table.get_int("conquers");301 conquers_ = table.get_int("conquers");
302 workarea_info_[conquers_].insert(descname() + " conquer");302 workarea_info_[conquers_].insert(name() + " conquer");
303 }303 }
304}304}
305305
@@ -1072,7 +1072,7 @@
1072 } else1072 } else
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 "
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",
1075 w_desc.descname().c_str(), input_name.c_str(),1075 w_desc.name().c_str(), input_name.c_str(),
1076 owner().tribe().name().c_str());1076 owner().tribe().name().c_str());
1077 }1077 }
1078 }1078 }
10791079
=== modified file 'src/logic/map_objects/tribes/worker.cc'
--- src/logic/map_objects/tribes/worker.cc 2018-09-25 06:32:35 +0000
+++ src/logic/map_objects/tribes/worker.cc 2018-11-07 10:28:51 +0000
@@ -2101,7 +2101,7 @@
2101/// Give the recruit his diploma and say farwell to him.2101/// Give the recruit his diploma and say farwell to him.
2102void Worker::start_task_releaserecruit(Game& game, Worker& recruit) {2102void Worker::start_task_releaserecruit(Game& game, Worker& recruit) {
2103 push_task(game, taskReleaserecruit);2103 push_task(game, taskReleaserecruit);
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());
2105 return schedule_act(game, 5000);2105 return schedule_act(game, 5000);
2106}2106}
21072107
21082108
=== modified file 'src/map_io/map_buildingdata_packet.cc'
--- src/map_io/map_buildingdata_packet.cc 2018-07-08 15:16:16 +0000
+++ src/map_io/map_buildingdata_packet.cc 2018-11-07 10:28:51 +0000
@@ -152,7 +152,7 @@
152 if (building.old_buildings_.empty() && !is_a(ConstructionSite, &building)) {152 if (building.old_buildings_.empty() && !is_a(ConstructionSite, &building)) {
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"
154 "Your savegame is corrupted",154 "Your savegame is corrupted",
155 building.descr().descname().c_str(), building.serial());155 building.descr().name().c_str(), building.serial());
156 }156 }
157157
158 if (fr.unsigned_8()) {158 if (fr.unsigned_8()) {
@@ -161,7 +161,7 @@
161 log("WARNING: Found a stopped %s at (%i, %i) in the "161 log("WARNING: Found a stopped %s at (%i, %i) in the "
162 "savegame. Militarysites are not stoppable. "162 "savegame. Militarysites are not stoppable. "
163 "Ignoring.",163 "Ignoring.",
164 building.descr().descname().c_str(), building.get_position().x,164 building.descr().name().c_str(), building.get_position().x,
165 building.get_position().y);165 building.get_position().y);
166 } else {166 } else {
167 productionsite->set_stopped(true);167 productionsite->set_stopped(true);
@@ -170,7 +170,7 @@
170 log("WARNING: Found a stopped %s at (%i, %i) in the "170 log("WARNING: Found a stopped %s at (%i, %i) in the "
171 "savegame. Only productionsites are stoppable. "171 "savegame. Only productionsites are stoppable. "
172 "Ignoring.",172 "Ignoring.",
173 building.descr().descname().c_str(), building.get_position().x,173 building.descr().name().c_str(), building.get_position().x,
174 building.get_position().y);174 building.get_position().y);
175 }175 }
176176
@@ -372,7 +372,7 @@
372 if (!game.tribes().worker_exists(worker_index)) {372 if (!game.tribes().worker_exists(worker_index)) {
373 log("WARNING: %s %u has a next_spawn time for nonexistent "373 log("WARNING: %s %u has a next_spawn time for nonexistent "
374 "worker type \"%s\" set to %u, ignoring\n",374 "worker type \"%s\" set to %u, ignoring\n",
375 warehouse.descr().descname().c_str(), warehouse.serial(), worker_typename,375 warehouse.descr().name().c_str(), warehouse.serial(), worker_typename,
376 next_spawn);376 next_spawn);
377 continue;377 continue;
378 }378 }
@@ -380,7 +380,7 @@
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 "
381 "\"%s\", that costs something to build, set to %u, "381 "\"%s\", that costs something to build, set to %u, "
382 "ignoring\n",382 "ignoring\n",
383 warehouse.descr().descname().c_str(), warehouse.serial(), worker_typename,383 warehouse.descr().name().c_str(), warehouse.serial(), worker_typename,
384 next_spawn);384 next_spawn);
385 continue;385 continue;
386 }386 }
@@ -391,7 +391,7 @@
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 "
392 "\"%s\" set to %u, but it was previously set "392 "\"%s\" set to %u, but it was previously set "
393 "to %u\n",393 "to %u\n",
394 warehouse.descr().descname().c_str(), warehouse.serial(),394 warehouse.descr().name().c_str(), warehouse.serial(),
395 worker_typename, next_spawn,395 worker_typename, next_spawn,
396 warehouse.next_worker_without_cost_spawn_[i]);396 warehouse.next_worker_without_cost_spawn_[i]);
397 warehouse.next_worker_without_cost_spawn_[i] = next_spawn;397 warehouse.next_worker_without_cost_spawn_[i] = next_spawn;
@@ -717,7 +717,7 @@
717717
718 } catch (const WException& e) {718 } catch (const WException& e) {
719 throw GameDataError(719 throw GameDataError(
720 "productionsite (%s): %s", productionsite.descr().descname().c_str(), e.what());720 "productionsite (%s): %s", productionsite.descr().name().c_str(), e.what());
721 }721 }
722}722}
723723
724724
=== modified file 'src/map_io/map_object_packet.cc'
--- src/map_io/map_object_packet.cc 2018-04-07 16:59:00 +0000
+++ src/map_io/map_object_packet.cc 2018-11-07 10:28:51 +0000
@@ -153,7 +153,7 @@
153 if (!obj.has_new_save_support())153 if (!obj.has_new_save_support())
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 "
155 "explicitly",155 "explicitly",
156 obj.serial(), obj.descr().descname().c_str());156 obj.serial(), obj.descr().name().c_str());
157157
158 mos.register_object(obj);158 mos.register_object(obj);
159 obj.save(egbase, mos, fw);159 obj.save(egbase, mos, fw);
160160
=== modified file 'src/map_io/map_players_view_packet.cc'
--- src/map_io/map_players_view_packet.cc 2018-07-12 08:08:47 +0000
+++ src/map_io/map_players_view_packet.cc 2018-11-07 10:28:51 +0000
@@ -856,8 +856,8 @@
856 else {856 else {
857 // We should never get here.. output some information about the situation.857 // We should never get here.. output some information about the situation.
858 log("\nwidelands_map_players_view_data_packet.cc::write_unseen_immovable(): ");858 log("\nwidelands_map_players_view_data_packet.cc::write_unseen_immovable(): ");
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(),
860 map_object_descr->name().c_str(), map_object_descr->descname().c_str());860 map_object_descr->name().c_str());
861 NEVER_HERE();861 NEVER_HERE();
862 }862 }
863 immovable_kinds_file.unsigned_8(immovable_kind);863 immovable_kinds_file.unsigned_8(immovable_kind);

Subscribers

People subscribed via source and target branches

to status/vote changes: