public void LogIn(string username) { accountData = Global.data.GetAccount(username); nickname = accountData.Nickname; playerState = NetPlayerState.InMainLobby; clientState = ClientTCPState.MainLobby; foreach (string guideKey in accountData.Friends.ToArray()) { foreach (ClientTCP friend in Global.clientList) { if (friend.accountData.GuideKey.Equals(guideKey)) { friends.Add(friend); friend.friends.Add(this); SendDataTCP.SendFriendInfo(friend, this); break; } } } SendDataTCP.SendLoginOk(nickname, this); }