de.yourecom.bgs
-
Marcel Beckers -
YoureCom/de.yourecom.bgs -
Privat -
26. Januar 2025 um 10:02
-
Standard: Kommentare bereinigt (314 Methodenkommentare ergänzt, lange Kommentare auf einen Satz, Inline- und lose Kommentare entfernt, @inheritDoc), commentsKnown leer, Kommentar-Prüfung aktualisiert Entfernte Kommentare (Wozu, zum Nachlesen): - eventListener.xml: UserAction UserAction UserExportGdprAction - files/acp/global.php: define paths; include config; @noinspection PhpIncludeInspection include WCF; @noinspection PhpIncludeInspection - files/acp/install_de.yourecom.bgs.php: Make important thinks for the installation; `getColumns()` builds `SHOW COLUMNS FROM \`{$tableName}\`` and lets Database::prepare() rewrite the; `app1_` table prefix to the real installation number. A bound `?` parameter on an information_schema; query would bypass that rewrite and always miss on installations with WCF_N != 1.; `getIndexInformation()` builds `SHOW INDEX FROM \`{$tableName}\`` and lets Database::prepare() rewrite; the `app1_` table prefix to the real installation number, unlike a bound `?` parameter on an; information_schema query (see `ensureDatabaseColumn()` above for the full explanation).; `Database::prepare()` rewrites the `app1_` table prefix to the real installation number only in the literal SQL text, never in a bound parameter value. `getTableNames()` runs `SHOW TABLES`, which already returns the real, rewritten names, so the name being checked for is rewritten the same way before the comparison instead of being bound to an information_schema query. - files/global.php: include config; @noinspection PhpIncludeInspection include wcf - files/lib/action/CityAction.class.php: Returns all buildings and active constructions including the standard API response payload. - files/lib/data/building/type/AbstractBuildingType.class.php: Constructor that stores dynamic building data. Magic getter for dynamic access to data array keys as properties.; The server is the source of truth for unlocks. The client may use the resulting building list for display, but manipulated requests still end up here. Always include money with scaling factor; Add wood starting from level 5; Returns all produced resource types. Buildings with a single output can keep overriding getProducedResourceType() only. - files/lib/data/building/type/Sawmill.class.php: Bretter sind wertvoller, deshalb langsamer als Holz; etwas flacher skalierend - files/lib/data/city/City.class.php: update population; Sync A: makes cityID and all other columns available via $this->; (magic getter reads $this->data) before any of the methods below; are called - they run before parent::handleData($data) at the; bottom, which is otherwise the only place $this->data gets set.; Sync B: simulate() just changed populationDetails/unemployed/etc.; The production service below reads those via $this->, so it must; see the post-simulation values, not the Sync A snapshot.; Sync C: covers the (currently unlikely) case that; getGridSizeBySurveyLevel() below ends up depending on anything set; in this method - cheap insurance, no behavioural downside.; Beispielwert; 15% Kinder und Jugendliche; 55% Erwerbsfähige; 20% Ältere; 10% Senioren; Berechne die Anzahl der Menschen pro Altersgruppe; Verteilung der Bevölkerung pro Altersgruppe; Verteile jeweils eine Person; Verteile jeweils eine Person; Survey offices remain the authority for expansion, but callers should prefer these semantic bounds over legacy row/column-only grid size. - files/lib/data/community/CommunityAction.class.php: Delete removed images.; Store uploaded image. - files/lib/data/player/PlayerAction.class.php: create town hall; create house; create lumberjack hut with initial workers so the first city; immediately has an understandable production loop. - files/lib/data/resource/PlayerResourceService.class.php: Initializes and loads the player's resource data from the database.; buildingID:int, resourceType:string, amount:float }>; Update Cache; Merke geänderte Werte für späteres SQL - files/lib/data/resource/ResourceStockAction.class.php: Used during initial city setup. cityID:int, buildingID:int, resourceType:string, amount:int|float }> $rows string|int, string|int|float|array{raw:string} > $updateFields - files/lib/data/resource/ResourceType.class.php: Extend this class as new resource types are introduced. - files/lib/system/ServerAPI.class.php: reload player data is needed, because of creating city etc.; Finde den Typ basierend auf dem Suffix des Klassennamens; choose folder; Check if file exists - files/lib/system/exception/BgsApiException.class.php: IMPORTANT: - scalar properties only - no previous exception - safe for JSON serialization - files/lib/system/exception/BgsErrorType.class.php: IMPORTANT: - Do not invent new error types ad-hoc. - Extend this registry first. Generic; Auth / Security; Ownership / Access; City / State; Buildings; Grid / Placement; Workers; Actions; static only - files/lib/system/game/BuildingMechanicsService.class.php: Client code may display these rules, but only this service is trusted for unlocks, queue capacity, costs and construction timing. - files/lib/system/game/CityGuidanceService.class.php: The service returns stable identifiers and phrase keys instead of localized text. This keeps the game rules on the server while letting each client localize presentation. - files/lib/system/game/CityRandomEventService.class.php: Events are deterministic per time slot and exposed through one generic snapshot shape, so later event types can be added as definitions. - files/lib/system/game/CitySnapshotService.class.php: Lightweight metadata snapshot for actions that already return their changed building/road explicitly. Lightweight snapshot for road mutations. Roads affect event chances, city profile and district activation, so these status objects must refresh immediately after build/upgrade/remove without returning a full city payload. Public city visits need the same visible blocker state as the owner map, but must never receive stocks, rates, costs or other economy details. - files/lib/system/game/CommunityVisitService.class.php: The API request already owns the sender player transaction lock. Consume first;; the outer request transaction rolls both sides back if the credit fails.; This keeps participation requirements stable while making role choice tangible. Otherwise the strongest currently visible city feature decides. Seventy percent participation keeps larger communities collaborative without; requiring every member, while a two-city community still needs both players. - files/lib/system/game/PlayerEntitlementService.class.php: The shop integration should grant time-limited entitlements on the player. Game rules must read them through this service instead of trusting client flags or request parameters. - files/lib/system/game/QuestDefinitionService.class.php: Dynamic daily/weekly IDs are still created in QuestRewardService because they depend on the current date. Ordered one-time quests live here so reward, guidance and tests cannot drift apart silently. - files/lib/system/game/ShopEntitlementService.class.php: This is intentionally signature-free: it must only be called from trusted PHP code in the same WSC installation. Public HTTP callbacks must use grantFromShopPayload(). - files/lib/system/game/WorldBoundsService.class.php: Survey offices remain the progression gate. The returned structure is wider than the legacy rows/cols grid size so the client and server can move toward chunked or direction-based expansion without changing every caller at once. Current design: odd survey levels expand downward, even levels expand right.; Keeping this here makes later expansion shapes a local rules change. - files/lib/system/simulation/CitySimulationService.class.php: The City object performs the actual catch-up simulation in handleData(). This service guarantees that only one request can simulate a city at once. - files/lib/system/simulation/SimulationContext.class.php: Prevents architectural bypass of the simulation gate. - files/lib/system/simulation/SimulationLogger.class.php: Can be enabled/disabled via constant. 6.2
Marcel Beckers23. Oktober 2026 um 08:33 -298 Löschungen +446 Hinzufügungen 744 Gesamt 71 Dateien -
Standard: Regeln für SQL und Kommentare übernommen (mit xml-comment), bekannte Lücken eingetragen Verwaltete Dateien aus _dev/standard (apply.php). Einträge in tests/lint/config.php sind Funde der neuen Regeln im bestehenden Code (comments-known.php, architecture-known.php); sie werden abgebaut, nicht ergänzt. Ein Minus heißt: Der Fund gilt nicht mehr (Regel geändert oder Datei bereinigt). Netto je Regel (Dateien): - commentsKnown: comment-annotation-gap +3, comment-too-long +20, function-needs-comment-or-override +50, magic-method-inheritdoc +25, stray-comment +16, xml-comment +4 - architectureKnown: sql-concat +6, sql-variable +14 6.2
Marcel Beckers22. Oktober 2026 um 17:40 -21 Löschungen +352 Hinzufügungen 373 Gesamt 7 Dateien -
Playwright: baseURL auf die bgs-Anwendung statt auf die WCF-Wurzel 6.2
Marcel Beckers22. Oktober 2026 um 08:21 -1 Löschungen +4 Hinzufügungen 5 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers21. Oktober 2026 um 22:12 +237 Hinzufügungen 237 Gesamt 3 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers21. Oktober 2026 um 22:01 +3 Hinzufügungen 3 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers21. Oktober 2026 um 09:18 -2 Löschungen +4 Hinzufügungen 6 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers21. Oktober 2026 um 01:07 +60 Hinzufügungen 60 Gesamt 2 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers20. Oktober 2026 um 17:42 -1 Löschungen +44 Hinzufügungen 45 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers20. Oktober 2026 um 14:12 -6 Löschungen +27 Hinzufügungen 33 Gesamt 2 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers20. Oktober 2026 um 14:06 -7 Löschungen +357 Hinzufügungen 364 Gesamt 4 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers20. Oktober 2026 um 13:58 -3 Löschungen +14 Hinzufügungen 17 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers20. Oktober 2026 um 12:15 -2 Löschungen +7 Hinzufügungen 9 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers19. Oktober 2026 um 09:05 -1 Löschungen +51 Hinzufügungen 52 Gesamt 2 Dateien -
YoureCom Standard: PHPStan clean, Unit- und E2E-Tests, Version 6.2.0 Alpha 13 Vervollständigt die Umstellung auf den YoureCom Standard (wsc6.2/CLAUDE.md, _dev/standard/README.md). check.sh (voller Lauf, ohne --fast) endet jetzt mit "All checks passed.". PHPStan: alle 204 ursprünglichen Fehler behoben (die letzten 2 waren der in einem separaten Commit gefixte Community-Erstellungs-Bug), überwiegend durch: - fehlende Array-Shape-Typen ergänzt (@param/@return/@var) - redundante is_array()/is_string()/is_scalar()-Prüfungen und tote Zweige entfernt - veraltete @return-Docblocks korrigiert, die nicht zur tatsächlichen Rückgabe passten (u. a. CityRoadService::getNetworkStats(), CitySnapshotService:: createStatusSnapshot()/createMutationObjects()) – reine Dokumentationsfehler, kein Verhalten geändert - FrontierEventService: Array-Key-Typ von string auf int korrigiert (PHP normalisiert numerische String-Keys ohnehin zu int, Laufzeitverhalten unverändert) - fehlende Options-Konstanten (BGS_SHOP_*) zu dynamicConstantNames ergänzt, da sie zur Laufzeit über ACP-Optionen gesetzt werden, nicht über constants.php (nur für IDE-Autocompletion, siehe Dateikopf) - nicht mehr benötigte ignoreErrors-Einträge entfernt (reportUnmatchedIgnoredErrors) - Lint:architecture: ungenutzte AJAX-Methode ResourceStockAction:: validateBulkCreate() entfernt (nie aufgerufen); eventListener.xml-Listener bleiben mit Begründung in architectureKnown, da WSC 6.2 für UserAction::rename und UserExportGdprAction::export keine PSR-14-Events anbietet Unit-Tests: tests/Unit/CommunityEndorsementCalculatorTest.php (11 Tests) E2E-Tests: Playwright + axe für Gast- und Benutzer-Sicht der Startseite (tests/e2e/guest.spec.ts, user.spec.ts), 0 Accessibility-Verstöße. Die Seite "Community pflegen" ist bewusst ausgeklammert, bis der separate Community- Erstellungs-Bugfix sich stabilisiert hat. 6.2
Marcel Beckers18. Oktober 2026 um 14:31 -174 Löschungen +446 Hinzufügungen 620 Gesamt 39 Dateien -
Fix: Community-Erstellung crasht für Spieler ohne Community CommunityAction::create() überschrieb die Signatur von AbstractDatabaseObjectAction:: create() mit void und verwarf damit den Rückgabewert (die neu angelegte Community). executeAction() setzt $this->returnValues auf diesen Rückgabewert; bei void war das null, und der anschließende foreach ($this->returnValues as $community) in create() selbst crashte mit "foreach() argument must be of type array|object, null given" – reproduzierbar für jeden Spieler ohne Community (nicht nur Gäste), im Dev-System sowohl als Gast als auch mit dem Testaccount Sheldon. create() gibt jetzt wie die Basisklasse die neu angelegte Community zurück und generiert die Authentifizierungsdaten über einen CommunityEditor-Wrapper (gleiches Muster wie update()). CommunityEditForm.class.php:80 las zusätzlich $action->getReturnValues()[0] – die Methode liefert aber kein 0-indiziertes Array, sondern ['actionName', 'objectIDs', 'returnValues']. Dadurch wäre $community selbst nach dem ersten Fix immer null geblieben. Liest jetzt ['returnValues']. Verifiziert im Dev-System: Sheldons Test-Community gelöscht und den Erstanmelde- Flow frisch durchgeklickt – Community wird angelegt, Private Key wird angezeigt, kein Fatal Error mehr. 6.2
Marcel Beckers18. Oktober 2026 um 14:17 -8 Löschungen +7 Hinzufügungen 15 Gesamt 3 Dateien -
YoureCom Standard: Code Style, Lint xsd/deletes/templates/php behoben, Version 6.2.0 Alpha 11 Teilumstellung auf den YoureCom Standard (wsc6.2/CLAUDE.md, _dev/standard/README.md): - _dev/standard/apply.php aktualisiert verwaltete Dateien (Lint-Skripte, build-package.sh) - php-cs-fixer autofix für Code Style (87 Dateien) - Lint: xsd - ungueltige niceValue/showOrder-Elemente aus eventListener.xml/option.xml entfernt - Lint: deletes - fehlende fileDelete.xml-Eintraege per check-deletes.php --fix ergaenzt - Lint: templates - aria-label fuer zwei Textareas in communityEdit.tpl - Lint: php - Docblocks (description, @author, @license) fuer ~60 Klassen ergaenzt, native trim() durch StringUtil::trim() ersetzt - Lint: architecture - listener-instanceof-Check in BGSUserExportListener ergaenzt Offen (zu gross/riskant fuer diese Sitzung, siehe Bericht): Unit-Tests, E2E-Tests (Playwright), PHPStan (204 Fehler), restliche Lint:architecture-Punkte (AJAX->RPC- Migration, Event-Listener->PSR-14 Migration). 6.2
Marcel Beckers18. Oktober 2026 um 11:57 -377 Löschungen +1.581 Hinzufügungen 1.958 Gesamt 102 Dateien -
Fix: Installer erkennt Spalten/Indizes/Tabellen auf Mehrfach-Installationen nicht mehr falsch Die Existenzprüfungen in install_de.yourecom.bgs.php banden den Tabellennamen als gebundenen Parameter an information_schema-Abfragen. Database::prepare() schreibt app1_ -> appN_ aber nur im SQL-Text um, nie in gebundenen Werten, daher schlugen alle Prüfungen auf Installationen mit WCF_N != 1 immer fehl und Spalten/Indizes/Tabellen wurden stillschweigend nie angelegt. Ersetzt durch getEditor()->getColumns()/getIndexInformation()/getTableNames(), die den Tabellennamen in den SQL-Text setzen und damit korrekt umgeschrieben werden. 6.2.0 Alpha 10 (noch unveröffentlicht). 6.2
Marcel Beckers17. Oktober 2026 um 20:56 -83 Löschungen +110 Hinzufügungen 193 Gesamt 3 Dateien -
47 Dateien geändert: tests (21), (Hauptordner) (19), .github (5), language (2) 6.2
Marcel Beckers17. Oktober 2026 um 09:11 -67 Löschungen +3.299 Hinzufügungen 3.366 Gesamt 47 Dateien -
PHPStan: .vscode optional ausschließen (Agent-Worktrees haben keinen) 6.2
Marcel Beckers16. Oktober 2026 um 07:33 -1 Löschungen +1 Hinzufügungen 2 Gesamt 1 Dateien -
YoureCom Standard automatisch aktualisiert (verwaltete Dateien aus _dev/standard) 6.2
Marcel Beckers13. Oktober 2026 um 12:39 +2 Hinzufügungen 2 Gesamt 1 Dateien
Bereit, deine Community smarter zu machen?
Ob fertiges Produkt oder individuelle Softwarelösung – überzeuge dich selbst.