Ejemplo n.º 1
0
        public Main()
        {
            ConsoleManager.Show();
            _instance = this;
            Console.WriteLine("##Starting Server##");
            Console.WriteLine("APPLICATION_DATA_ROOT_DIR" + Constants.APPLICATION_DATA_ROOT_DIR);
            Console.WriteLine("Current Version: " + Version.currentVersion + "\nLatest Version: " + Version.latestVersion + "\nUp to Date: " + Version.isUpToDate + "\n");

            IDCodes.fill();
            serverName = Environment.MachineName;
            info       = new VolumeServer()
            {
                name = serverName, hasPassword = AuthentificationManager.Instance.usesPassword, id = VCCryptography.getPublicKey()
            };
            audioManager = new AudioManager();
            ListenerFactory.listener.startListening();

            if (!BroadcastReceiver.running)
            {
                broadcastThread = new Thread(new ThreadStart(BroadcastReceiver.findClients));
                broadcastThread.Start();
            }
            else
            {
                BroadcastReceiver.respondToNdRequests = true;
            }
            BroadcastSender.sendServerStartedBroadcast();
        }
Ejemplo n.º 2
0
        public static bool removeSessionID(string id)
        {
            bool hasRemoved = false;

            if (sessionIDCodes.ContainsKey(id))
            {
                string IDCode = sessionIDCodes[id];
                sessionIDCodes.Remove(id);
                IDCodes.free(byte.Parse(IDCode));
                hasRemoved = true;
            }

            return(hasRemoved);
        }
Ejemplo n.º 3
0
        public static bool registerSessionID(string id)
        {
            bool isSet = false;

            if (getCode(id) == "-1")
            {
                byte?idCode = IDCodes.claim();
                if (idCode != null)
                {
                    sessionIDCodes.Add(id, idCode.ToString());
                    isSet = true;
                }
            }
            else
            {
                isSet = true;
            }

            return(isSet);
        }