Ejemplo n.º 1
0
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep * orep) : 
  wb_status(sts), m_orep(orep), m_adrep(0), m_size(0), m_offset(0), m_idx(0), m_tid(0),
  m_elements(1), m_is_elem(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__), m_body(0), 
  m_shadowed(false)
{
  if ( orep == 0)
    m_sts = LDH__NOSUCHATTR;
  else {
    m_orep->ref();

    wb_cdef cdef(*orep);
    if (EVEN(cdef.sts())) {
      m_sts = cdef.sts();
      return;
    }
    wb_bdef bdef(((wb_cdrep *)cdef)->bdrep(&m_sts, pwr_eBix_rt));
    if (EVEN(bdef.sts())) {
      wb_bdef bdefdev(((wb_cdrep *)cdef)->bdrep(&m_sts, pwr_eBix_dev));
      if (EVEN(bdefdev.sts())) {
	m_sts = bdefdev.sts();
	return;
      }
      bdef = bdefdev;
    }

    m_size = bdef.size();
    m_bix = bdef.bix();
    m_tid = m_original_tid = orep->cid();
  }
}
Ejemplo n.º 2
0
bool wb_session::validateDestination(wb_destination d, pwr_tCid cid)
{
  wb_object parent;
  wb_object o = object(d.oid());

  // Get parent
  if (o) {
    switch (d.code()) {
    case ldh_eDest_After:
    case ldh_eDest_Before:
      parent = o.parent();
      break;
    default:
      parent = o;
    }
  }
  if (!parent) {
    // No parent, check if valid top object (for vrepmem all objects are valid
    // topobjects)
    wb_cdef c = cdef(cid);
    if (!c.flags().b.TopObject && type() != ldh_eVolRep_Mem) {
      m_sts = LDH__NOTOP;
      return false;
    }
  } else {
    // Check if adoption is legal
    if (parent.flags().b.NoAdopt) {
      m_sts = LDH__NOADOPT;
      return false;
    }
  }
  m_sts = LDH__SUCCESS;
  return true;
}
Ejemplo n.º 3
0
pwr_tStatus wb_volume::triggPostCreate(wb_object& o)
{
  pwr_tStatus sts;
  char *methodName;
  wb_tMethod method;
  
  // Call object method, or inherited method
  for ( wb_cdef cd = cdef(o.cid()); cd; cd = cd.super()) {
    wb_cdrep *cdrep = cd;
    
    cdrep->dbCallBack(&sts, ldh_eDbCallBack_PostCreate, &methodName, 0);

    if (ODD(sts)) {
      m_vrep->erep()->method(&sts, methodName, &method);
      if (EVEN(sts)) return LDH__SUCCESS;

      wb_object father = o.parent();
      if (father) {
	sts = ((wb_tMethodPostCreate) (method))((ldh_tSesContext)this, o.oid(), father.oid(),
						father.cid());
      }
      else
	sts = ((wb_tMethodPostCreate) (method))((ldh_tSesContext)this, o.oid(), pwr_cNObjid,
						pwr_cNClassId);
      return sts;
    }
  }

  return LDH__SUCCESS;
}
Ejemplo n.º 4
0
wb_bdef wb_object::bdef(pwr_eBix bix)
{
  check();

  wb_cdef cdef(*m_orep);
  return cdef.bdef(bix);
}
Ejemplo n.º 5
0
wb_bdef wb_object::bdef(const char* bname)
{
  check();

  wb_cdef cdef(*m_orep);
  return cdef.bdef(bname);
}
Ejemplo n.º 6
0
wb_attribute wb_volume::attribute(wb_name aname)
{
  pwr_tStatus sts;

  if (!aname)
    return wb_attribute();

  wb_object o = object(aname.name());
  if (!o)
    return wb_attribute();

  if (!aname.hasAttribute())
    return wb_attribute(LDH__SUCCESS, (wb_orep *)o);

  wb_cdef cd = cdef(o);
  if (!cd)
    return wb_attribute();

  wb_adrep *adrep = ((wb_cdrep *)cd)->adrep(&sts, aname.attributesAllTrue());

  if (ODD(sts)) {
    bool shadowed = false;
    if (aname.hasSuper()) {
      // Check if shadowed
      wb_attrname an(aname.attributesAllTrue());
      wb_adrep *ad = ((wb_cdrep *)cd)->adrep(&sts, an.name(cdh_mName_attribute));
      if (ODD(sts) && ad->offset() != adrep->offset()) {
        shadowed = true;
        delete ad;
      }
    }

    wb_attribute a;
    if (aname.hasAttrIndex(aname.attributes() - 1))
      a = wb_attribute(sts, (wb_orep *)o, adrep, aname.attrIndex(aname.attributes() - 1));
    else
      a = wb_attribute(sts, (wb_orep *)o, adrep);
    a.setShadowed(shadowed);
    return a;
  }
#if 0
  // This only work on one level attributes... TODO
  wb_adrep *adrep = ((wb_cdrep *)cd)->adrep(&sts, aname.attributesAllTrue());
  if (ODD(sts)) {
    if (aname.hasAttrIndex())
      return wb_attribute(sts, (wb_orep *)o, adrep, aname.attrIndex());
    else
      return wb_attribute(sts, (wb_orep *)o, adrep);
  }
#endif
  return wb_attribute();
}
Ejemplo n.º 7
0
pwr_tStatus wb_volume::syntaxCheckObject(wb_object& o, int *errorcount, int *warningcount)
{
  pwr_tStatus sts, csts;
  wb_object first, after;
  wb_attribute a(o.sts(), o);
  
  sts = triggSyntaxCheck(a, errorcount, warningcount);
  if (EVEN(sts)) return sts;

  // Get any attribute objects
  wb_cdef cd = cdef(o);
  if ( !cd) return cd.sts();

  wb_bdef bdef = cd.bdef(pwr_eBix_rt);
  wb_adef adef;
  if ( bdef) {
    for (adef = bdef.adef(); adef; adef = adef.next()) {
      if ( !(adef.flags() & PWR_MASK_CLASS))
	continue;

      if ( adef.flags() & PWR_MASK_ARRAY) {
	for ( int i = 0; i < adef.nElement(); i++) {
	  wb_attribute a( adef.sts(), o, adef, i);
	  
	  csts = syntaxCheckAttr( a, errorcount, warningcount);
	  if ( EVEN(csts)) sts = csts;
	}
      }
      else {
	wb_attribute a( adef.sts(), o, adef);
	
	if ( adef.flags() & PWR_MASK_DISABLEATTR && a.disabled())
	  continue;

	csts = syntaxCheckAttr( a, errorcount, warningcount);
	if ( EVEN(csts)) sts = csts;
      }
    }
  }


  for ( wb_object c = o.first(); c; c = c.after()) {
    if ( c.cid() == pwr_eClass_LibHier)
      continue;
    csts = syntaxCheckObject(c, errorcount, warningcount);
    if ( EVEN(csts))
      sts = csts;
  }

  return sts;
}
Ejemplo n.º 8
0
bool wb_session::castAttribute(pwr_sAttrRef* arp, pwr_tCid cid)
{
  wb_attribute a = attribute(arp);
  if (!a)
    return a.sts();

  if (!(a.flags() & PWR_MASK_CASTATTR)) {
    m_sts = 0;
    return false;
  }

  wb_cdef c = cdef(cid);
  // if ( c.size( pwr_eBix_rt) != a.size()) {
  //  m_sts = 0;
  //  return false;
  //}

  // pwr_tTid tid = a.tid();

  pwr_tCastId castid;
  if (cid == a.originalTid())
    castid = pwr_cNClassId;
  else
    castid = cid;

  pwr_sAttrRef cast_aref = cdh_ArefToCastAref(arp);
  wb_attribute cast_a = attribute(&cast_aref);
  if (!cast_a)
    return cast_a.sts();

  try {
    writeAttribute(cast_a, &castid);
  } catch (wb_error& e) {
    m_sts = e.sts();
    return false;
  }

  void* body = calloc(1, c.size(pwr_eBix_rt));
  c.attrTemplateBody(&m_sts, pwr_eBix_rt, body, a);

  try {
    writeAttribute(a, body);
  } catch (wb_error& e) {
    m_sts = e.sts();
    return false;
  }

  return true;
}
Ejemplo n.º 9
0
wb_attribute wb_volume::attribute(wb_object o, wb_attrname aname)
{
  pwr_tStatus sts;

  if (!o)
    return wb_attribute();

  wb_cdef cd = cdef(o);
  if (!cd)
    return wb_attribute();

  wb_adrep *adrep = ((wb_cdrep *)cd)->adrep(&sts, aname.attributesAllTrue());
  if (ODD(sts))
    return wb_attribute(sts, (wb_orep *)o, adrep);
  return wb_attribute();
}
Ejemplo n.º 10
0
pwr_tStatus wb_volume::syntaxCheckAttr(wb_attribute& a, int *errorcount, int *warningcount)
{
  pwr_tStatus sts = LDH__SUCCESS;
  pwr_tStatus asts;


  if ( !a.isSuperClass())
    sts = triggSyntaxCheck(a, errorcount, warningcount);

  // Get any attribute objects
  wb_cdef cd = cdef(a.tid());
  if ( !cd) return cd.sts();

  wb_bdef bdef = cd.bdef(pwr_eBix_rt);
  wb_adef adef;
  if ( bdef) {
    for (adef = bdef.adef(); adef; adef = adef.next()) {
      if ( adef.flags() & PWR_MASK_SUPERCLASS)
	continue;
      if ( !(adef.flags() & PWR_MASK_CLASS))
	continue;

      if ( adef.flags() & PWR_MASK_ARRAY) {
	for ( int i = 0; i < adef.nElement(); i++) {
	  wb_attribute attr( a, -1, adef.name(), i);
	  
	  asts = syntaxCheckAttr( attr, errorcount, warningcount);
	  if ( EVEN(asts)) sts = asts;
	}
      }
      else {
	wb_attribute attr( a, 0, adef.name());
	
	if ( adef.flags() & PWR_MASK_DISABLEATTR && attr.disabled())
	  continue;

	asts = syntaxCheckAttr( attr, errorcount, warningcount);
	if ( EVEN(asts)) sts = asts;
      }
    }
  }

  return sts;
}
Ejemplo n.º 11
0
pwr_tStatus wb_volume::triggSyntaxCheck(wb_attribute& a, int *errorcount, int *warningcount)
{
  pwr_tStatus sts;
  char methodName[80];
  wb_tMethod method;
  
  if ( !cdh_tidIsCid( a.tid()))
    return 0;

  // Call object method, or inherited method
  for ( wb_cdef cd = cdef( a.tid()); cd; cd = cd.super()) {
    sprintf( methodName, "%s-SyntaxCheck", cd.name());

    m_vrep->erep()->method(&sts, methodName, &method);
    if ( ODD(sts)) {
      sts = ((wb_tMethodSyntaxCheck) (method))((ldh_tSesContext)this, a.aref(), 
					       errorcount, warningcount);
      if ( EVEN(sts)) return sts;
      break;
    }
  }
  return LDH__SUCCESS;
}
Ejemplo n.º 12
0
void OTerminal::handleInput(OString input) {
	OTerminalArg arg;
	arg.str = input;
	arg.split = input.split(d);
	
	if(input.size() >= 1) {
		for(unsigned i=0; i<fmap.size(); i++) {
			//if we found the command-function map
			//prepare the string and call the function
			if(input.startsWith(fmap[i].first)) {
				int cmdlen = fmap[i].first.length();
				OString a = input.substring(cmdlen);
				
				//if there is a delimiter at the beginning of
				//the input string trim it until there are none left
				for(unsigned j=0; j<a.length(); j++) {
					if(a.startsWith(d)) {
						a = a.substring(d.length());
					} else
						break;
				}
				
				arg.str = a;
				arg.split = a.split(d);
				
				//call the function
				fmap[i].second(arg);
				
				//we are done here
				return;
			}
		}
		
		//fallthrough, call the default function
		if(cdef) cdef(arg);
	}
}
Ejemplo n.º 13
0
ldh_sRefInfo *wb_volume::refinfo(wb_object o, ldh_sRefInfo *rp)
{
  int rows;
  memset(rp, 0, sizeof(*rp));

  wb_cdef c = cdef(o);
  wb_bdef b = c.bdef(pwr_eBix_rt);
  if (!b) return rp;
  
  wb_attribute body = wb_attribute(b.sts(), (wb_orep *)o, b.name());
  char *bp = (char *)body.value(0);
  pwr_tOid oid;
  pwr_sAttrRef attrref;

  wb_adef asuper[20];
  int scnt = 0;
  asuper[scnt++] = b.adef();
  if (asuper[scnt-1] && asuper[scnt-1].isSuperClass()) {
    // Count rows
    rows = 0;
    while (asuper[scnt-1] && asuper[scnt-1].isSuperClass()) {
      wb_cdef subc = cdef(asuper[scnt-1].subClass());
      wb_bdef subb = subc.bdef(pwr_eBix_rt);
      rows += subb.nAttribute() - 1;
      asuper[scnt++] = subb.adef();
    }
    rows += b.nAttribute();

    int j = 0;
    for (int i = scnt - 1; i >= 0; i--) {
      for (wb_adef a = asuper[i]; a; a = a.next()) {
	if (a && a.isSuperClass())
	  continue;

	switch (a.cid()) {
	case pwr_eClass_Input:
	case pwr_eClass_Output:
	case pwr_eClass_Intern:
	case pwr_eClass_Param:
	  switch (a.type()) {
	  case pwr_eType_Objid:
	    for (int i = 0; i < a.nElement(); i++) {
	      rp->ObjRef.Total++;
	      oid = *(pwr_tOid *)(bp + a.offset() + i * a.size() / a.nElement());
	      if (cdh_ObjidIsNotNull(oid)) {
		rp->ObjRef.Used++;
		wb_object otst = object(oid);
		if (!otst)
		  rp->ObjRef.Errors++;
	      }
	    }
	    break;
	  case pwr_eType_AttrRef:
	    for (int i = 0; i < a.nElement(); i++) {
	      rp->ObjRef.Total++;
	      attrref = *(pwr_sAttrRef *)(bp + a.offset() + i * a.size() / a.nElement());
	      if (cdh_ObjidIsNotNull(attrref.Objid)) {
		rp->ObjRef.Used++;
		wb_object otst = object(attrref.Objid);
		if (!otst)
		  rp->ObjRef.Errors++;
	      }
	    }
	    break;
	  default: ;
	  }
	  break;
	case pwr_eClass_AttrXRef:
	  // TODO
	  break;
	case pwr_eClass_ObjXRef:
	  // TODO
	  break;
	default: ;
	}
      }
      if (j > rows)
	// Something is wrong
	break;
    }
  }
  else {  
    rows = b.nAttribute();

    for (wb_adef a = b.adef(); a; a = a.next()) {
      switch (a.cid()) {
      case pwr_eClass_Input:
      case pwr_eClass_Output:
      case pwr_eClass_Intern:
      case pwr_eClass_Param:
	switch (a.type()) {
	case pwr_eType_Objid:
	  for (int i = 0; i < a.nElement(); i++) {
	    rp->ObjRef.Total++;
	    oid = *(pwr_tOid *)(bp + a.offset() + i * a.size() / a.nElement());
	    if (cdh_ObjidIsNotNull(oid)) {
	      rp->ObjRef.Used++;
	      wb_object otst = object(oid);
	      if (!otst)
		rp->ObjRef.Errors++;
	    }
	  }
	  break;
	case pwr_eType_AttrRef:
	  for (int i = 0; i < a.nElement(); i++) {
	    rp->ObjRef.Total++;
	    attrref = *(pwr_sAttrRef *)(bp + a.offset() + i * a.size() / a.nElement());
	    if (cdh_ObjidIsNotNull(attrref.Objid)) {
	      rp->ObjRef.Used++;
	      wb_object otst = object(attrref.Objid);
	      if (!otst)
		rp->ObjRef.Errors++;
	    }
	  }
	  break;
	default: ;
	}
	break;
      case pwr_eClass_AttrXRef:
	// TODO
	break;
      case pwr_eClass_ObjXRef:
	// TODO
	break;
      default: ;
      }
    }
  }    

#if 0
  wb_cdef cd = cdef(o);
  wb_bdef bd = cd.bdef(pwr_eBix_rt);
  if (!bd) return rp;

  wb_attribute body = wb_attribute(bd.sts(), (wb_orep *)o, bd.name());
  char *bp = (char *)body.value(0);
  pwr_tOid oid;
  pwr_sAttrRef attrref;

  wb_adef ad = bd.adef();
  while (ad) {
    switch (ad.cid()) {
    case pwr_eClass_Input:
    case pwr_eClass_Output:
    case pwr_eClass_Intern:
    case pwr_eClass_Param:
      switch (ad.type()) {
      case pwr_eType_Objid:
	for (int i = 0; i < ad.nElement(); i++) {
	  rp->ObjRef.Total++;
	  oid = *(pwr_tOid *)(bp + ad.offset() + i * ad.size() / ad.nElement());
	  if (cdh_ObjidIsNotNull(oid)) {
	    rp->ObjRef.Used++;
	    wb_object otst = object(oid);
	    if (!otst)
	      rp->ObjRef.Errors++;
	  }
	}
	break;
      case pwr_eType_AttrRef:
	for (int i = 0; i < ad.nElement(); i++) {
	  rp->ObjRef.Total++;
	  attrref = *(pwr_sAttrRef *)(bp + ad.offset() + i * ad.size() / ad.nElement());
	  if (cdh_ObjidIsNotNull(attrref.Objid)) {
	    rp->ObjRef.Used++;
	    wb_object otst = object(attrref.Objid);
	    if (!otst)
	      rp->ObjRef.Errors++;
	  }
	}
	break;
      default: ;
      }
      break;
    case pwr_eClass_AttrXRef:
      // TODO
      break;
    case pwr_eClass_ObjXRef:
      // TODO
      break;
    default: ;
    }
    ad = ad.next();
  }
#endif
  return rp;
}
Ejemplo n.º 14
0
wb_cdef wb_volume::cdef(pwr_tOid coid)
{
  return cdef(cdh_ClassObjidToId(coid));
}
Ejemplo n.º 15
0
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, wb_adrep* adrep, int idx) : 
  wb_status(sts), m_orep(orep), m_adrep(adrep), m_size(0), m_offset(0), m_idx(0), m_tid(0),
  m_elements(1), m_is_elem(0), m_type(pwr_eType_), m_flags(0), m_bix(pwr_eBix__), m_body(0), 
  m_shadowed(false)
{
  if ( orep == 0)
    m_sts = LDH__NOSUCHATTR;
  else {
    m_orep->ref();

    if ( m_adrep) {
      m_adrep->ref();
      m_size = m_adrep->size();
      m_offset = m_adrep->offset();
      m_tid = m_original_tid = m_adrep->tid();
      m_elements = m_adrep->nElement();
      m_type = m_adrep->type();
      m_flags = m_adrep->flags();
      m_bix = m_adrep->bix();

      if (m_flags & PWR_MASK_ARRAY) {
        if (idx >= m_elements)
          throw wb_error_str("wb_attribute() subscript out of range");
        m_idx = idx;
        if (idx != -1) { // element
          m_size = m_adrep->size() / m_adrep->nElement();
	  if ( m_flags & PWR_MASK_POINTER)
	    m_offset = m_adrep->offset() + m_idx * sizeof(pwr_tUInt64);
	  else
	    m_offset = m_adrep->offset() + m_idx * m_size;
          m_elements = 1;
	  m_is_elem = 1;
        }
      } else
        m_idx = 0;

      if ( m_flags & PWR_MASK_CASTATTR) {
	pwr_tCastId castid;

	castId( &castid);
	if ( castid != pwr_cNCastId)
	  m_tid = castid;
      }
    }
    else {
      // m_size == get rtbody size... Fix
      wb_cdef cdef(*orep);
      if (EVEN(cdef.sts())) {
        char msg[256];
        m_sts = cdef.sts();
        sprintf(msg, "Can't get cdef for orep: %s", orep->name());  
        throw wb_error_str(m_sts, msg);
      }
      wb_bdef bdef(((wb_cdrep *)cdef)->bdrep(&m_sts, pwr_eBix_rt));
      if (EVEN(bdef.sts())) {
        char msg[256];
        m_sts = bdef.sts();
        sprintf(msg, "Can't get bdef for orep: %s", orep->name());  
        throw wb_error_str(m_sts, msg);
      }

      m_size = bdef.size();
      m_bix = bdef.bix();
    }
  }
}
Ejemplo n.º 16
0
wb_object wb_session::copyObject(wb_object o, wb_destination d, wb_name name)
{
  wb_orep* orep = 0;

  if (isReadonly())
    throw wb_error_str("ReadOnlySession");

  validateDestination(d, o.cid());
  if (evenSts())
    throw wb_error(sts());

  wb_object parent;
  switch (d.code()) {
  case ldh_eDest_IntoFirst:
  case ldh_eDest_IntoLast:
    parent = object(d.oid());
    break;
  case ldh_eDest_After:
  case ldh_eDest_Before:
    parent = object(d.oid()).parent();
    break;
  default:
    throw wb_error(LDH__NODEST);
  }

  m_sts = triggAnteCreate(parent, o.cid());
  if (evenSts())
    throw wb_error(sts());
  m_sts = triggAnteAdopt(parent, o.cid());
  if (evenSts())
    throw wb_error(sts());

  if (m_vrep->vid() == o.vid()) {
    orep = m_vrep->copyObject(&m_sts, (wb_orep*)o, d, name);
    if (evenSts())
      throw wb_error(sts());

    orep->ref();
  } else {
    wb_cdef c = cdef(o.cid());

    orep = m_vrep->createObject(&m_sts, c, d, name);
    orep->ref();
    wb_attribute rba(o.sts(), (wb_orep*)o, "RtBody");
    if (rba) {
      void* p = rba.value();
      wb_attribute rban(m_sts, orep, "RtBody");
      writeAttribute(rban, p);
    }
    wb_attribute dba(o.sts(), (wb_orep*)o, "DevBody");
    if (dba) {
      void* p = dba.value();
      wb_attribute dban(m_sts, orep, "DevBody");
      writeAttribute(dban, p);
    }
    wb_attribute sba(o.sts(), (wb_orep*)o, "SysBody");
    if (sba) {
      void* p = sba.value();
      wb_attribute sban(m_sts, orep, "SysBody");
      writeAttribute(sban, p);
    }
  }
  m_srep->update();

  wb_object onew = wb_object(m_sts, orep);
  orep->unref();
  ldh_sEvent* ep = m_srep->eventStart(onew.oid(), ldh_eEvent_ObjectCreated);
  m_srep->eventNewFamily(ep, onew);
  triggPostCreate(onew);
  triggPostAdopt(parent, onew);
  m_srep->eventSend(ep);

  return onew;
}
Ejemplo n.º 17
0
Configuration::Configuration(const std::string& directory,
    const std::string& filename) throw (ConfigurationException)
{
    if (!filename.length()) {
        throw ConfigurationException("No valid configuration filename.");
    }

    std::string base_dir = get_home_directory();
    create_directory(directory, base_dir);
    this->filename = base_dir + "/" + directory + "/" + filename;

    /* load file */
    if (file_exists(this->filename)) {
        settings.read(this->filename);
    }

    /* load defaults */
    cdef("player_name", generate_name());
    cdef("show_player_name", "1");
    cdef("player_skin", "goat");
    cdef("fullscreen", "0");
    cdef("show_scanlines", "1");
    cdef("scanlines_intensity", "50");
    cdef("music_volume", "128");
    cdef("sfx_volume", "128");
    cdef("master_server", "master.goatattack.net");
    cdef("master_port", "25113");

    cdef("server_name", "frederic's temple");
    cdef("server_port", "25111");
    cdef("game_mode", "0");
    cdef("max_players", "12");
    cdef("duration", "20");
    cdef("warmup", "0");

    cdef("bind_escape_device", "0");
    cdef("bind_escape_param", "27");
    cdef("bind_chat_device", "0");
    cdef("bind_chat_param", "116");
    cdef("bind_down_device", "0");
    cdef("bind_down_param", "1073741905");
    cdef("bind_drop1_device", "0");
    cdef("bind_drop1_param", "115");
    cdef("bind_drop2_device", "0");
    cdef("bind_drop2_param", "100");
    cdef("bind_drop3_device", "0");
    cdef("bind_drop3_param", "102");
    cdef("bind_fire_device", "0");
    cdef("bind_fire_param", "97");
    cdef("bind_jump_device", "0");
    cdef("bind_jump_param", "32");
    cdef("bind_left_device", "0");
    cdef("bind_left_param", "1073741904");
    cdef("bind_right_device", "0");
    cdef("bind_right_param", "1073741903");
    cdef("bind_stats_device", "0");
    cdef("bind_stats_param", "9");
    cdef("bind_up_device", "0");
    cdef("bind_up_param", "1073741906");

    cdef("deadzone_horizontal", "3200");
    cdef("deadzone_vertical", "3200");

    /* extract -> ready for quick access */
    extract();
}