public void AddFile(Connection connection, byte exchangeType, byte[] hash, byte[] data)
            {
                string path       = FileDataExchangeUtils.CacheFile(ref exchangeType, ref hash, ref data);
                string hashString = hash.GetHexaString();

                Console.WriteLine("> AddFile: {0} ({1})", exchangeType, hashString);
            }
Exemplo n.º 2
0
        public void AddFile(Connection connection, byte exchangeType, byte[] hash, byte[] data)
        {
            string hashString = hash.GetHexaString();

            Console.WriteLine("> AddFile: {0} ({1})", exchangeType, hashString);

            FileDataExchangeUtils.CacheFile(ref exchangeType, ref hash, ref data);

            // distribute to connected clients
            foreach (Connection other in ServerManager.Instance.GetAuthenticatedPlayers())
            {
                ServerManager.Instance.ServerToClientProvider.CheckFileExistRequest(other, exchangeType, hash);
            }
        }