public static ServerRingInfo findServerRingInfoByID(ServerRingInfo[] serverRingsInfo, uint ringID) { for(uint serverRingInfo = 0; serverRingInfo < serverRingsInfo.Length; serverRingInfo++) { if(serverRingsInfo[serverRingInfo].ring.ringID == ringID) return serverRingsInfo[serverRingInfo]; } return null; }
public Server(ServerUserInterface.callbackTable_ _serverUserInterfaceCallbackTable) { serverUserInterfaceCallbackTable = _serverUserInterfaceCallbackTable; clientManager = new ClientManager(); accountsManager = new AccountsManager(@"accounts.xml"); accountsManager.loadAccounts(); //REVISIT: some hard-coded stuff here needs cleanup when file operations are in place serverRingsInfo = new ServerRingInfo[Constants.NUM_RINGS]; AccountsManager ringAccountsManager; for(int index = 0; index < serverRingsInfo.Length; index ++) { ringAccountsManager = new AccountsManager(@"accounts.xml"); ringAccountsManager.loadAccounts(); serverRingsInfo[index] = new ServerRingInfo(Constants.DEFAULT_RINGS[index], new ClientManager(), ringAccountsManager, new PeerManager(), new ServerPolicyManager()); } nextTokenID = 1; }