Fixed Eager Dimension Data Creation #175

Merged
SenseiKiwi merged 1 commits from master into master 2014-07-14 02:50:37 +00:00
SenseiKiwi commented 2014-07-14 00:15:14 +00:00 (Migrated from github.com)
  1. Fixed a design flaw in PocketManager. We originally assumed that all
    requests to PocketManager.getDimensionData() had to be legitimate
    requests for dimensions that existed. That was true in most cases, but
    for things like processing user commands, it was dangerously optimistic.
    It was possible that a flaw in DD's usage of that function could be
    exploited by a player to trick the mod into pre-registering dimension
    data for a non-existent dimension. That would declare the dimension as a
    root. DD would crash later if Forge ever allocated that ID for a pocket
    dimension. The new implementation is almost the same as the old one, but
    allows us to differentiate between cases when we can eagerly create
    dimension data, and cases in which the absence of a dimension should
    cause a crash to alert us of a design flaw.
  2. Remove the pocket regeneration code from PocketBuilder. We simply
    don't support pocket regeneration and it's unlikely it'll ever be
    implemented because it's a difficult issue. Wiping out pockets
    completely is easier. We can always recover the code from this commit if
    it's needed later.
  3. Minor changes: removed some debug prints from PocketManager and
    changed some static accesses in PocketBuilder.
1. Fixed a design flaw in PocketManager. We originally assumed that all requests to PocketManager.getDimensionData() had to be legitimate requests for dimensions that existed. That was true in most cases, but for things like processing user commands, it was dangerously optimistic. It was possible that a flaw in DD's usage of that function could be exploited by a player to trick the mod into pre-registering dimension data for a non-existent dimension. That would declare the dimension as a root. DD would crash later if Forge ever allocated that ID for a pocket dimension. The new implementation is almost the same as the old one, but allows us to differentiate between cases when we can eagerly create dimension data, and cases in which the absence of a dimension should cause a crash to alert us of a design flaw. 2. Remove the pocket regeneration code from PocketBuilder. We simply don't support pocket regeneration and it's unlikely it'll ever be implemented because it's a difficult issue. Wiping out pockets completely is easier. We can always recover the code from this commit if it's needed later. 3. Minor changes: removed some debug prints from PocketManager and changed some static accesses in PocketBuilder.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: apex/DimDoors#175
No description provided.