private void userlogin(packet data)
{
//string msg = string.Format("u+ {0},", cmd[1]); //new comer's login msg
string userpass = _client_password[data.Name] as string;
if (_client_password.ContainsKey(data.Name) == false)
{
_client_password.Add(data.Name, data.Msg);
using (StreamWriter sw = File.CreateText(path))
{
foreach (DictionaryEntry de in _client_password)
{
string s = string.Format(de.Key + " " + de.Value);
sw.WriteLine(s);
}
}
}
mutTable.WaitOne();
Console.WriteLine("{0} 已登入,線上人數:{1}\n", data.Name, _client_table.Count);
mutTable.ReleaseMutex();
}