Exemple #1
0
		public void SetUser(User _user){
			this.Name=_user.Name;
			this.Password=_user.Password;
			this.GameArgs=_user.GameArgs;
			this.GamePath=_user.GamePath;
			this.RePassword=_user.RePassword;
		}
Exemple #2
0
		public static void Start(Server server,User user,string room){
			if(server==null||user==null){
				return;
			}
			if(room==null){
				room="";
			}
			if(server.NeedAuth){
				Start(server.IP, ""+server.Port, user.Name+"$"+user.getPassword(),room, user.GameArgs, user.GamePath);
			}else{
				Start(server.IP, ""+server.Port, user.Name, room, user.GameArgs, user.GamePath);
			}
			
		}
Exemple #3
0
		public void ChangedUser(){
			if(m_user==null){
				return;
			}
			using(UserForm form=new UserForm(false, ShortPasswrod)){
				if(form.ShowDialog() == DialogResult.OK){
					User user = form.GetUser();
					if(m_notifyIcon!=null && user!=null){
						m_user=user;
						m_notifyIcon.Text="用户:"+m_user.Name;
						m_user.Save();
					}
				}
			}
			Show();
		}
		public CreateRoomForm(Server server,User user)
		{
			InitializeComponent();
			this.m_user=user;
			this.m_server=server;
			cb_banlist.SelectedIndex=0;
			cb_draw.SelectedIndex=0;
			cb_hand.SelectedIndex=4;
			cb_lp.SelectedIndex=1;
			cb_mode.SelectedIndex=0;
			cb_rule.SelectedIndex=2;
			cb_timeout.SelectedIndex=2;
			chk_sp1.Checked=false;
			chk_sp2.Checked=false;
			chk_sp3.Checked=false;
			tb_name.Text="";
			tb_password.Text="";
		}
Exemple #5
0
		public void Show(){
			if(m_user==null){
				//需要登录
				using(UserForm form=new UserForm(true,ShortPasswrod)){
					if(form.ShowDialog() == DialogResult.OK){
						m_user = form.GetUser();
						if(m_user!=null && m_notifyIcon!=null){
							m_notifyIcon.Text="用户:"+m_user.Name;
							m_user.Save();
						}
					}
				}
			}
			if(m_user==null){
				return;
			}
			if(m_room==null || m_room.IsDisposed){
				m_room=new RoomForm(this);
			}
			m_room.Text = ""+m_user.Name;
			m_room.Show();
			m_room.Activate();
		}
Exemple #6
0
		public User(User _user){
			SetUser(_user);
			ShortPwd = false;
		}
Exemple #7
0
		public Client(NotifyIcon notifyIcon)
		{
			m_user=null;
			m_notifyIcon=notifyIcon;
			ShortPasswrod = ConfigManager.readBoolean("shortpwd");
		}
Exemple #8
0
		public void Connect(ServerInfo info, User user){
			if(client!=null){
				client.Close();
			}
			client = new AsyncClient();
			try{
				client.Connect(info.Host, info.Port);
				using(GameServerPacket login = new GameServerPacket()){
					login.WriteUnicode(user.Name, 20);
					login.WriteUnicode(user.Password, 32);
					login.Use();
					client.BeginSend(login.Content);
				}
			}catch(Exception){
				
			}
		}
Exemple #9
0
		public User GetUser(){
			if(string.IsNullOrEmpty(cb_username.Text)){
				return null;
			}
			m_User=new User(cb_username.Text, tb_password.Text);
			m_User.setGamePath(tb_gamepath.Text);
			m_User.setGameArgs(tb_args.Text);
			m_User.setRecord(chkb_record.Checked);
			return m_User;
		}
Exemple #10
0
		public void SetInfo(Server server, User user){
			this.m_user=user;
			this.m_server=server;
		}