Publishing v0.8.4.0
authorStephaneLenclud
Mon, 25 Jan 2016 21:26:30 +0100
changeset 185729e91c7d5b2
parent 184 7b6aa551eb6c
child 186 e10744f29ef3
Publishing v0.8.4.0
Now taking priority into account before switching client.
Server/MainForm.cs
Server/SharpDisplayManager.csproj
     1.1 --- a/Server/MainForm.cs	Sun Jan 24 19:25:51 2016 +0100
     1.2 +++ b/Server/MainForm.cs	Mon Jan 25 21:26:30 2016 +0100
     1.3 @@ -637,16 +637,26 @@
     1.4                  return;
     1.5              }
     1.6  
     1.7 +            ClientData requestedClientData = iClients[aSessionId];
     1.8  
     1.9              //Check when was the last time we switched to that client
    1.10              if (iCurrentClientData != null)
    1.11              {
    1.12 +                //Do not switch client if priority of current client is higher 
    1.13 +                if (!aForce && requestedClientData.Priority < iCurrentClientData.Priority)
    1.14 +                {
    1.15 +                    return;
    1.16 +                }
    1.17 +
    1.18 +
    1.19                  double lastSwitchToClientSecondsAgo = (DateTime.Now - iCurrentClientData.LastSwitchTime).TotalSeconds;
    1.20                  //TODO: put that hard coded value as a client property
    1.21                  //Clients should be able to define how often they can be interrupted
    1.22                  //Thus a background client can set this to zero allowing any other client to interrupt at any time
    1.23                  //We could also compute this delay by looking at the requests frequencies?
    1.24 -                if (!aForce && (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds
    1.25 +                if (!aForce &&
    1.26 +                    requestedClientData.Priority == iCurrentClientData.Priority && //Time sharing is only if clients have the same priority
    1.27 +                    (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds
    1.28                  {
    1.29                      //Don't switch clients too often
    1.30                      return;
    1.31 @@ -658,7 +668,7 @@
    1.32              //Set the time we last switched to that client
    1.33              iClients[aSessionId].LastSwitchTime = DateTime.Now;
    1.34              //Fetch and set current client data.
    1.35 -            iCurrentClientData = iClients[aSessionId];
    1.36 +            iCurrentClientData = requestedClientData;
    1.37              //Apply layout and set data fields.
    1.38              UpdateTableLayoutPanel(iCurrentClientData);
    1.39          }
     2.1 --- a/Server/SharpDisplayManager.csproj	Sun Jan 24 19:25:51 2016 +0100
     2.2 +++ b/Server/SharpDisplayManager.csproj	Mon Jan 25 21:26:30 2016 +0100
     2.3 @@ -34,7 +34,7 @@
     2.4      <WebPage>index.htm</WebPage>
     2.5      <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
     2.6      <ApplicationRevision>0</ApplicationRevision>
     2.7 -    <ApplicationVersion>0.8.1.0</ApplicationVersion>
     2.8 +    <ApplicationVersion>0.8.4.0</ApplicationVersion>
     2.9      <UseApplicationTrust>false</UseApplicationTrust>
    2.10      <CreateDesktopShortcut>true</CreateDesktopShortcut>
    2.11      <PublishWizardCompleted>true</PublishWizardCompleted>