@Override
	public void received (Connection c, Object object) {
		if (object instanceof Login) {
			try {
				Login login = (Login)object;
				LoginInfoField lif;
					lif = (LoginInfoField)db.getField(DBTable.loginTable, 
							   new DBValue[]{ new DBValue(DBString, "username") }, 
							   new Object[]{ login.username });
				if (lif != null) {
					if (lif.passwordHash == login.passwordHash) {
						LoginGranted lg = new LoginGranted();
						lg.gsi = gsi;
						c.sendTCP(lg);
						return;
					}
				}
				c.sendTCP(new LoginRefused());
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}