private void ProcessTranportObject(MyTransportObject obj) { if (obj.Obj is ChatContent) { SendMyObject(obj.Obj as ChatContent); } Logger.Write(obj.Obj.ToString()); }
private bool CheckLogin() { MyTransportObject dataReceive = clientDataTrans.ReceiveData(); UserAccount tempUser = dataReceive.Obj as UserAccount; if (tempUser.CheckExisted()) { this.User = tempUser; SendUser(tempUser); return(true); } SendUser(tempUser); return(false); }
public bool Login() { dataTrans.SendData(new MyTransportObject(this.User)); MyTransportObject receiveData = dataTrans.ReceiveData(); UserAccount receiveUser = receiveData.Obj as UserAccount; if (receiveUser.UserName == "") { return(false); } this.User = receiveUser; threadListen.Start(); return(true); }
private bool CheckLogin() { MyTransportObject dataReceive = clientDataTrans.ReceiveData(); UserAccount tempUser = dataReceive.Obj as UserAccount; if (tempUser.CheckExisted()) { if (!TheServer.Instance.ListClient.IsOnline(tempUser)) { this.User = tempUser; SendUser(tempUser); return(true); } } tempUser.Refresh(); SendUser(tempUser); return(false); }