public static void StartNewClient(string name, int session) { if (IsSessionRunning(session)) { return; } //Start new client ClientThread cl = new ClientThread(name, session, false); clients.Add(cl); //Run client on new thread Thread thread = new Thread(new ThreadStart(cl.run)); thread.IsBackground = true; thread.Start(); Thread.Sleep(5); List <NetCommand> sessionbacklog = GetBacklogForSession(session); for (int i = sessionbacklog.Count - 1; i >= 0; i--) { cl.HandleCommand(sessionbacklog[i]); } Thread.Sleep(5); SendNetCommand(new NetCommand(NetCommand.RequestType.PERSONALDATA, session)); }
public static void StartNewClient(string name, int session) { if (IsSessionRunning(session)) return; //Start new client ClientThread cl = new ClientThread(name, session, false); clients.Add(cl); //Run client on new thread Thread thread = new Thread(new ThreadStart(cl.run)); thread.IsBackground = true; thread.Start(); Thread.Sleep(5); List<NetCommand> sessionbacklog = GetBacklogForSession(session); for (int i = sessionbacklog.Count - 1; i >= 0; i--) { cl.HandleCommand(sessionbacklog[i]); } Thread.Sleep(5); SendNetCommand(new NetCommand(NetCommand.RequestType.PERSONALDATA, session)); }