示例#1
0
        public static void HandleLoadPcap(Session session, params string[] parameters)
        {
            // pcap-load "D:\Asheron's Call\Log Files\PCAP Part 1\AC1Live-The-Ripley-Collection-part01\AC1Live-The-Ripley-Collection\aclog pcaps\pkt_2017-1-9_1484023507_log.pcap"
            // pcap-load "D:\ACE\Logs\PCAP Part 1\AC1Live-The-Ripley-Collection-part01\AC1Live-The-Ripley-Collection\aclog pcaps\pkt_2017-1-9_1484023507_log.pcap"

            string pcapFileName;

            if (parameters?.Length != 1)
            {
                Console.WriteLine("pcap-load <full-path-to-pcap-file>");
                return;
            }

            pcapFileName = parameters[0];

            // Check if file exists!
            if (!System.IO.File.Exists(pcapFileName))
            {
                Console.WriteLine($"Could not find pcap file to load: {pcapFileName}");
                return;
            }

            bool abort = false;

            Console.WriteLine($"Loading pcap...");

            //List<PacketRecord> records = PCapReader.LoadPcap(pcapFileName, true, ref abort);
            PCapReader.LoadPcap(pcapFileName, true, ref abort);

            Console.WriteLine($"Pcap Loaded with {PCapReader.Records.Count} records.");

            if (PCapReader.LoginInstances > 0)
            {
                Console.WriteLine($"\n{PCapReader.LoginInstances} unique login events detected.");
                if (PCapReader.LoginInstances > 1)
                {
                    Console.WriteLine(
                        $"Please specify a login to use using the command 'pcap-login <login-#>', where <login-#> is 1 to {PCapReader.LoginInstances}\n");
                }
                Console.WriteLine("Login set to first instance.");
                Console.WriteLine(
                    $"Instance has {PCapReader.TeleportIndexes[1].Count} teleports. Use @teleport in-game to advance to next, or @teleport <index> to select a specific one.");

                Console.WriteLine($"StartRecordIndex: {PCapReader.StartRecordIndex}");
                Console.WriteLine($"EndRecordIndex: {(PCapReader.EndRecordIndex - 1)}");
            }
            else
            {
                Console.WriteLine(
                    "\nNo login events detected. We will attempt to join this pcap already in progress.\n");
                Console.WriteLine(
                    $"Instance has {PCapReader.TeleportIndexes[0].Count} teleports. Use @teleport in-game to advance to next, or @teleport <index> to select a specific one.");
            }

            Console.WriteLine("");
        }
示例#2
0
        public static void HandleLoadPcap(Session session, params string[] parameters)
        {
            // pcap-load "D:\Asheron's Call\Log Files\PCAP Part 1\AC1Live-The-Ripley-Collection-part01\AC1Live-The-Ripley-Collection\aclog pcaps\pkt_2017-1-9_1484023507_log.pcap"
            // pcap-load "D:\ACE\Logs\PCAP Part 1\AC1Live-The-Ripley-Collection-part01\AC1Live-The-Ripley-Collection\aclog pcaps\pkt_2017-1-9_1484023507_log.pcap"

            string pcapFileName;

            if (parameters?.Length != 1)
            {
                Console.WriteLine("pcap-load <full-path-to-pcap-file>");
                return;
            }

            pcapFileName = parameters[0];

            // Check if file exists!
            if (!System.IO.File.Exists(pcapFileName))
            {
                Console.WriteLine($"Could not find pcap file to load: {pcapFileName}");
                return;
            }

            bool abort = false;

            Console.WriteLine($"Loading pcap...");

            //List<PacketRecord> records = PCapReader.LoadPcap(pcapFileName, true, ref abort);
            PCapReader.LoadPcap(pcapFileName, true, ref abort);

            Console.WriteLine($"Pcap Loaded with {PCapReader.Records.Count} records.");

            if (PCapReader.LoginInstances > 0)
            {
                Console.WriteLine($"\n{PCapReader.LoginInstances} unique login events detected.");
                if (PCapReader.LoginInstances > 1)
                {
                    Console.WriteLine($"Please specify a login to use using the command 'pcap-login <login-#>', where <login-#> is 1 to {PCapReader.LoginInstances}\n");
                }
                Console.WriteLine("Login set to first instance.");

                if (PCapReader.TeleportIndexes.ContainsKey(1))
                {
                    Console.WriteLine($"Instance has {PCapReader.TeleportIndexes[1].Count} teleports. Use @teleport in-game to advance to next, or @teleport <index> to select a specific one.");
                    Console.WriteLine($"\nUse `list` to display a detailed breackdown of all login instances and teleports.\n");
                }
                else
                {
                    Console.WriteLine($"Instance has no teleports.");
                }

                Console.WriteLine($"StartRecordIndex: {PCapReader.StartRecordIndex}");
                Console.WriteLine($"EndRecordIndex: {(PCapReader.EndRecordIndex - 1)}");
            }
            else
            {
                Console.WriteLine("\nNo login events detected. We will attempt to join this pcap already in progress.\n");
                if (PCapReader.TeleportIndexes.ContainsKey(0))
                {
                    Console.WriteLine($"Instance has {PCapReader.TeleportIndexes[0].Count} teleports. Use @teleport in-game to advance to next, or @teleport <index> to select a specific one.");
                    Console.WriteLine($"\nUse `list` to display a detailed breackdown of teleports.\n");
                }
                else
                {
                    Console.WriteLine($"Instance has no teleports.");
                }
            }

            var port = Common.ConfigManager.Config.Server.Network.Port;

            Console.WriteLine($"\nTo connect, enter the following command at the Command Prompt in your Asheron's Call folder, or use a launcher to connect using any username and password combination.\n\n    acclient.exe -h 127.0.0.1:{port} -a USER -v PASS\n");
        }