Changeset 842
- Timestamp:
- 11/27/08 17:05:05 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/Client.cs
r795 r842 28 28 namespace HeuristicLab.Hive.Contracts.BusinessObjects { 29 29 30 public enum State { idle, calculating };30 public enum State { idle, calculating, offline }; 31 31 32 32 [DataContract] -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs
r796 r842 15 15 List<User> GetAllUsers(); 16 16 [OperationContract] 17 void AddNewUser(User user); 18 [OperationContract] 17 19 List<UserGroup> GetAllUserGroups(); 18 20 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r838 r842 7 7 using HeuristicLab.Hive.Contracts; 8 8 using HeuristicLab.Core; 9 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess; 10 using System.Resources; 11 using System.Reflection; 9 12 10 13 namespace HeuristicLab.Hive.Server.Core { … … 17 20 int nrOfJobs = 1; 18 21 22 IClientAdapter clientAdapter; 23 ResourceManager rm; 24 19 25 public ClientCommunicator() { 26 clientAdapter = ServiceLocator.GetClientAdapter(); 27 rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly()); 28 20 29 jobs = new LinkedList<long>(); 21 30 for (long i = 0; i < nrOfJobs; i++) { … … 27 36 28 37 public Response Login(ClientInfo clientInfo) { 29 if (clients == null)30 clients = new List<ClientInfo>();31 32 clients.Add(clientInfo);33 34 38 Response response = new Response(); 35 39 response.Success = true; 36 response.StatusMessage = "Client with GUID " + clientInfo.ClientId + " successuflly logged in"; 40 41 ICollection<ClientInfo> allClients = clientAdapter.GetAllClients(); 42 foreach (ClientInfo client in allClients) { 43 if (client.ClientId.Equals(clientInfo.ClientId)) { 44 if (client.State != State.offline) { 45 response.Success = false; 46 response.StatusMessage = rm.GetString("UserAllreadyOnline"); 47 break; 48 } else 49 break; // searching for clients can be stopped, because it was found and it's state is offline 50 } 51 } 52 53 if (response.Success) { 54 clientAdapter.UpdateClient(clientInfo); 55 response.Success = true; 56 response.StatusMessage = rm.GetString("LoginSuccess"); 57 } 37 58 38 59 return response; -
trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
r837 r842 54 54 <Compile Include="DbTestApp.cs" /> 55 55 <Compile Include="HiveServerCorePlugin.cs" /> 56 <Compile Include="HiveServerMessages.Designer.cs"> 57 <AutoGen>True</AutoGen> 58 <DesignTime>True</DesignTime> 59 <DependentUpon>HiveServerMessages.resx</DependentUpon> 60 </Compile> 56 61 <Compile Include="InternalInterfaces\DataAccess\IClientAdapter.cs" /> 57 62 <Compile Include="InternalInterfaces\DataAccess\IResourceAdapter.cs" /> … … 60 65 <Compile Include="ServerConsoleFacade.cs" /> 61 66 <Compile Include="ServiceLocator.cs" /> 67 <Compile Include="Settings.cs" /> 62 68 <Compile Include="UserRoleManager.cs" /> 63 69 </ItemGroup> 64 70 <ItemGroup> 71 <None Include="app.config" /> 65 72 <None Include="HeuristicLab.snk" /> 66 73 <None Include="Properties\AssemblyInfo.frame" /> … … 80 87 </ProjectReference> 81 88 </ItemGroup> 89 <ItemGroup> 90 <EmbeddedResource Include="HiveServerMessages.resx"> 91 <Generator>ResXFileCodeGenerator</Generator> 92 <LastGenOutput>HiveServerMessages.Designer.cs</LastGenOutput> 93 </EmbeddedResource> 94 </ItemGroup> 82 95 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 83 96 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r821 r842 42 42 } 43 43 44 public void AddNewUser(User user) { 45 userRoleManager.AddNewUser(user); 46 } 47 44 48 public List<HeuristicLab.Hive.Contracts.BusinessObjects.UserGroup> GetAllUserGroups() { 45 49 return userRoleManager.GetAllUserGroups(); -
trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
r820 r842 30 30 } 31 31 32 public void AddNewUser(User user) { 33 34 } 35 32 36 public List<UserGroup> GetAllUserGroups() { 33 37 return userGroups;
Note: See TracChangeset
for help on using the changeset viewer.