You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.7 KiB
62 lines
1.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SogClient
|
|
{
|
|
public class Program
|
|
{
|
|
public static DateTime m_dateTime1970_utc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
public static DateTime m_dateTime1970 = m_dateTime1970_utc.ToLocalTime();
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
string path = "ClientTest.json";
|
|
if (args.Length == 1)
|
|
{
|
|
path = args[0];
|
|
}
|
|
|
|
//Console.WriteLine("config json file path:{0}", path);
|
|
|
|
if (!File.Exists(path))
|
|
{
|
|
Console.WriteLine("please input json config file,like ClientTest test.json");
|
|
return;
|
|
}
|
|
|
|
Config.ClientTestConfig = JsonConfig.parseFile<ClientTestConfig>(path);
|
|
|
|
TimeUtils.GetTime();
|
|
TimeUtils.GetTimeSecond();
|
|
|
|
//注册协议处理
|
|
ProtoRegister.Instance.RegisterAllPacket();
|
|
|
|
ClientSession.m_rsaCrypto = new object();
|
|
|
|
RSABigIntegerUtils.GenRSAKey();
|
|
|
|
Console.WriteLine("机器人测试开始");
|
|
|
|
//开启工作线程
|
|
TestWorkThread[] threads = new TestWorkThread[Config.ClientTestConfig.threadCount];
|
|
|
|
for (int i = 0; i < threads.Length; i++)
|
|
{
|
|
threads[i] = new TestWorkThread();
|
|
|
|
threads[i].Init(i, Config.ClientTestConfig.playerCountPerThread);
|
|
|
|
if (i > 0)
|
|
{
|
|
threads[i].StartThread(true);
|
|
}
|
|
}
|
|
|
|
threads[0].StartThread(false);
|
|
}
|
|
}
|
|
}
|
|
|