Esempio n. 1
0
 internal void Handle(SitesUpdateRequest request) {
    var resp = new SitesUpdateResponse();
    if (MockupHelpers.IsActivated(request.DriverId)) {
       if (request.OldVersion != CurrentSitesVersion) {
          //var m = CCHelpers.GetTmpSites();
          resp.NewVersion = CurrentSitesVersion;
          IEnumerable<Site> old = null;
          try {
             old = GetMockupSites("sites_{0}-{1}.txt".Substitute(request.OldVersion.Major, request.OldVersion.Minor));
          } catch { }
          if (old != null) {
             // resp.RemovedSites = new BplArray<BplIdentity>(m.Item2;);
             resp.RemovedSites = new BplArray<BplIdentity>(old.Select(s => s.Id));
          }
          // resp.AddedSites.AddRange(m.Item1);                              
          resp.AddedSites.AddRange(SitesCache);
       }
    } else {
       resp.NewVersion = request.OldVersion;
    }
    resp.OldVersion = request.OldVersion;
    Reply(resp);
 }
Esempio n. 2
0
 internal void Handle(SitesUpdateRequest request) {
    _handle(request);
 }