Research Article

Virtual Net: A Decentralized Architecture for Interaction in Mobile Virtual Worlds

Algorithm 8

Group reconfiguration.
1. On any replica:
2. Upon RG ≠ ∅  ∧ RGT  ∧ LE = false
3.  GT R
4.  GR← true
5.  If rL = self, then
6.   cid cid + 1
7.   GR_QUERY (epoch, cid)
8.   Reliably broadcast GR_QUERY to GT  ∩R
9.
10.
11. Upon GR_QUERY(epoch’, cid’) from rL  ∧ epoch’ ≥          // Use cid to discard messages from a
   epochcid’ > cidLE = false                 previous unfinished GR;
12.  GR true                        // epoch’epoch: for new members
13.  cid cid’                       // cid’ > cid: because the new cid has not
14.  If epoch = 0, then                     been received
15.   epoch epoch’
16.  GE_STATE (Qd, E, cid, epoch)
17.  Reliably send GE _STATE to rL
18.
19. Upon LOAD_CONFIG(Qd’, E’, epoch’, cid’, GT, Init)
   from rL  ∧ epoch’ = epochcid’ = cidLE = false
20.  (Qd, E) (Qd’, E’)
21.  G GT
22.  LE false
23.  If newReplica = true, then
24.   Initialize(Init)
25.   newReplica←false
26.  For each r∈G∩R,
27.   r.age r.age + 1
28.
29.
30. Upon GE _STATE(Qd,i, Ei, cidi, epochi) from ri  ∧ epochi
   = epochcidi = cidLE = false
31.  Events←Events∪  
32.  Decisions←Decision∪  
33.  Senders←Senders∪  
34.
35. Upon GT  ∩R⊆Senders
36.  Qd Longest(Events)
37.  E Merge(Decisions)
38.  Init (t0,  , (λc, state),      // state: current application state
   ,S)
39.  LOAD_ CONFIG (Qd, E, epoch, cid, GT, Init)
40.  Reliably broadcast LOAD_ CONFIG to GT  ∩R
41.  Broadcast GT to S
42.  GT