Esempio n. 1
0
        private static long PingServer(string host, ushort port)
        {
            var watch  = Stopwatch.StartNew();
            var client = TCPClientWrapper.Create();

            client.Connect(host, port);
            client.Disconnect();
            watch.Stop();

            return(watch.ElapsedMilliseconds);
        }
Esempio n. 2
0
        public Protocol(MineLibClient client, ProtocolPurpose purpose) : base(client, purpose)
        {
            Stream = new ProtobufStream(TCPClientWrapper.Create());

            RegisterSupportedSendings();



            //ModAPIs
            var modules = AssemblyParser.GetAssemblyInfos("Forge*.dll");

            if (modules.Any())
            {
                foreach (var module in modules)
                {
                    LoadForgeModAPI(module);
                }
            }
            else
            {
                LoadForgeModAPI(new AssemblyInfo("NONE"));
            }
        }