HackerExperience / Helix

GNU Affero General Public License v3.0
53 stars 10 forks source link

Add support for implicit bounce #379

Open renatomassaro opened 6 years ago

renatomassaro commented 6 years ago

Implicit bounce may happen on at least two scenarios:

1) Player connects to other servers gradually, creating a "natural bounce". Example: S connects directly to A. Then, using A as origin, connects to B. Then, using B as origin, connects to C. The resulting connection would be: S -> A -> B -> C, without the player ever explicitly creating a bounce.

2) Player S is connected to bank B1 using bounce B. Connection is: S -> [B] -> B1. Now player will make a transfer (i.e. create a wire_transfer connection) to an account located at bank B2. The transfer connection will be S -> [B] -> B1 -> B2, i.e. origin ATM B1 is added implicitly to the bounce.

Proposed implementation

Have bounces reference themselves (no need for arbitrarily nesting though, one-level is enough). So Bounce.t would have a parent_id that may be nil (explicit bounce) or Bounce.id (implicit bounce).

As long as the Client is properly updated when an implicit bounce is created, everything shall be fine (and we don't need to create a new data structure like e.g. Bounce.Implicit.t)

renatomassaro commented 6 years ago

When implementing, look for references to #379