public ServerRingInfo(Ring __ring, ClientManager __ringClientManager, 
     AccountsManager __ringAccountsManager, PeerManager __ringPeerManager,
     ServerPolicyManager __serverPolicyManager)
 {
     ring = __ring;
     ringClientManager = __ringClientManager;
     ringAccountsManager = __ringAccountsManager;
     ringPeerManager = __ringPeerManager;
     serverPolicyManager = __serverPolicyManager;
     nextSessionID = 1;
 }
Ejemplo n.º 2
0
        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;
        }