Exemplo n.º 1
0
Robot::Robot(int initialLives, GC::Rectangle& _platform)
	: rd(1, 0.2, 0.4),
	  pos(), initialPos(),
	  base(rd),
	  armBase(rd),
	  arm(rd),
      clawBase(rd),
      claw(rd),
	  flyingArea(rd)
{
    lives = initialLives;
    step = DEFAULT_STEP;
	baseX = _platform.getWidth();
	baseY = _platform.getHeight();
	baseZ = _platform.getDeep();
	maxX = maxY = maxZ = 100;
	minX = minY = minZ = -100;
    minBaseX = rd.baseWidth / 2;
    minBaseZ = rd.baseDeep / 2;
    maxBaseX = baseX - minBaseX;
    maxBaseZ = baseZ - minBaseZ;
    revive();
    initialPos = pos;
    landingSafePosition = false;

    detectedColision = false;
}
Exemplo n.º 2
0
TrackPointer GlobalTrackCache::lookupByRef(
        const TrackRef& trackRef) {
    if (trackRef.hasId()) {
        return lookupById(trackRef.getId());
    } else {
        const auto canonicalLocation = trackRef.getCanonicalLocation();
        const auto trackByCanonicalLocation(
                m_tracksByCanonicalLocation.find(canonicalLocation));
        if (m_tracksByCanonicalLocation.end() != trackByCanonicalLocation) {
            // Cache hit
            if (traceLogEnabled()) {
                kLogger.trace()
                        << "Cache hit for"
                        << canonicalLocation
                        << trackByCanonicalLocation->second->getPlainPtr();
            }
            return revive(trackByCanonicalLocation->second);
        } else {
            // Cache miss
            if (traceLogEnabled()) {
                kLogger.trace()
                        << "Cache miss for"
                        << canonicalLocation;
            }
            return TrackPointer();
        }
    }
}
Exemplo n.º 3
0
void WebPageProxy::loadURL(const String& url)
{
    if (!isValid()) {
        puts("loadURL called with a dead WebProcess");
        revive();
    }
    process()->connection()->send(WebPageMessage::LoadURL, m_pageID, CoreIPC::In(url));
}
Exemplo n.º 4
0
void WebPageProxy::initializeWebPage(const IntSize& size, PassOwnPtr<DrawingAreaProxy> drawingArea)
{
    if (!isValid()) {
        puts("initializeWebPage called with a dead WebProcess");
        revive();
        return;
    }

    m_drawingArea = drawingArea;
    process()->connection()->send(WebProcessMessage::Create, m_pageID, CoreIPC::In(size, pageNamespace()->context()->preferences()->store(), *(m_drawingArea.get())));
}
Exemplo n.º 5
0
bool CObjectBase::init(CCDictionary* pObjectDict)
{
//    CCAssert(NULL != pObjectDict, "pObjectDict can't be NULL");
    clearAll();
    revive();
    
    setObjectDictionary(pObjectDict);

    turnOnCollision();
    return true;
}
Exemplo n.º 6
0
void Spaceship::handleInput(unsigned char key)
{
	switch(key)
	{
	case 'w': m_currentSpeed++;              break;
	case 's': m_currentSpeed--;              break;
	case 'a': m_Angle -= ANGLE_OF_ROTATION;  break;
	case 'd': m_Angle += ANGLE_OF_ROTATION;  break;
	case ' ': fireBullet();                  break;
    case 'r': if(!m_isAlive){ revive(); }    break;
	}
}
Exemplo n.º 7
0
bool OSExecutorModule::signal_event( BObjectImp* imp )
{
    INC_PROFILEVAR(events);

    if (blocked_ && (wait_type == WAIT_EVENT)) // already being waited for
    {
        /* Now, the tricky part.  The value to return on an error or
		   completion condition has already been pushed onto the value
		   stack - so, we need to replace it with the real result.
        */
        exec.ValueStack.top().set( new BObject( imp ) );
        /* This executor will get moved to the run queue at the
           next step_scripts(), where blocked is checked looking
           for timed out or completed operations. */

        revive();
    }
    else        // not being waited for, so queue for later.
    {
        if (events_.size() < max_eventqueue_size)
        {
            events_.push( imp );
        }
        else
        {
			if (config.discard_old_events)
			{
				BObject ob( events_.front() );
				events_.pop();
				events_.push( imp );
			}
			else
			{
				if (config.loglevel >= 11)
				{
					cout << "Event queue for " << exec.scriptname() << " is full, discarding event." << endl;
					ExecutorModule* em = exec.findModule( "npc" );
					if (em)
					{
						NPCExecutorModule* npcemod = static_cast<NPCExecutorModule*>(em);
						cout << "NPC Serial: " << hexint( npcemod->npc.serial ) <<
							" (" << npcemod->npc.x << " " << npcemod->npc.y << " " << (int) npcemod->npc.z << ")" << endl;
					}
					BObject ob( imp );
					cout << "Event: " << ob->getStringRep() << endl;
				}
				return false;
			}
        }
    }

	return true;
}
Exemplo n.º 8
0
void Ripple::reset(int p)
{
	revive();

	x = (p % Level::WIDTH) * DungeonTilemap::SIZE;
	y = (p / Level::WIDTH) * DungeonTilemap::SIZE;

	GameMath::PointFSet(&origin, width / 2, height / 2);
	//origin.set(width / 2, height / 2);
	GameMath::PointFSet(&scale, 0);
	//scale.set(0);

	time = TIME_TO_FADE;
}
Exemplo n.º 9
0
static bool
bhito(struct obj *obj, struct obj *otmp)
	/* object obj was hit by the effect of wand otmp */
	/* returns TRUE if sth was done */
{
	int res = TRUE;

	if(obj == uball || obj == uchain)
		res = FALSE;
	else
	switch(otmp->otyp) {
	case WAN_POLYMORPH:
		/* preserve symbol and quantity, but turn rocks into gems */
		mkobj_at((obj->otyp == ROCK || obj->otyp == ENORMOUS_ROCK)
			? GEM_SYM : obj->olet,
			obj->ox, obj->oy) -> quan = obj->quan;
		delobj(obj);
		break;
	case WAN_STRIKING:
		if(obj->otyp == ENORMOUS_ROCK)
			fracture_rock(obj);
		else
			res = FALSE;
		break;
	case WAN_CANCELLATION:
		if(obj->spe && obj->olet != AMULET_SYM) {
			obj->spe = 0;
		}
		break;
	case WAN_TELEPORTATION:
		rloco(obj);
		break;
	case WAN_MAKE_INVISIBLE:
		obj->oinvis = 1;
		break;
	case WAN_UNDEAD_TURNING:
		res = revive(obj);
		break;
	case WAN_SLOW_MONSTER:		/* no effect on objects */
	case WAN_SPEED_MONSTER:
#ifdef WAN_PROBING
	case WAN_PROBING:
#endif /* WAN_PROBING */
		res = FALSE;
		break;
	default:
		impossible("What an interesting wand (%u)", otmp->otyp);
	}
	return(res);
}
Exemplo n.º 10
0
void die()
{
	object ob, me;
	me = this_object();

	if( !living(this_object()) ) revive(1);
	command("chat* disapp");
	if( objectp(ob = me->query_temp("last_damage_from")) )
	{
		command("chat " + ob->name() + "德配天地,威震寰宇,古今无比。");
		command("chat* admire2 yang guo");
	}
	::die();
}
Exemplo n.º 11
0
Arquivo: main.c Projeto: Sciumo/minix
/*===========================================================================*
 *			       do_async_dev_result			     *
 *===========================================================================*/
static void *do_async_dev_result(void *arg)
{
  endpoint_t endpt;
  struct job my_job;

  my_job = *((struct job *) arg);
  fp = my_job.j_fp;

  /* An asynchronous character driver has results for us */
  if (job_call_nr == DEV_REVIVE) {
	endpt = job_m_in.REP_ENDPT;
	if (endpt == VFS_PROC_NR)
		endpt = find_suspended_ep(job_m_in.m_source,
					  job_m_in.REP_IO_GRANT);

	if (endpt == NONE) {
		printf("VFS: proc with grant %d from %d not found\n",
			job_m_in.REP_IO_GRANT, job_m_in.m_source);
	} else if (job_m_in.REP_STATUS == SUSPEND) {
		printf("VFS: got SUSPEND on DEV_REVIVE: not reviving proc\n");
	} else
		revive(endpt, job_m_in.REP_STATUS);
  }
  else if (job_call_nr == DEV_OPEN_REPL) open_reply();
  else if (job_call_nr == DEV_REOPEN_REPL) reopen_reply();
  else if (job_call_nr == DEV_CLOSE_REPL) close_reply();
  else if (job_call_nr == DEV_SEL_REPL1)
	select_reply1(job_m_in.m_source, job_m_in.DEV_MINOR,
		      job_m_in.DEV_SEL_OPS);
  else if (job_call_nr == DEV_SEL_REPL2)
	select_reply2(job_m_in.m_source, job_m_in.DEV_MINOR,
		      job_m_in.DEV_SEL_OPS);

  if (deadlock_resolving) {
	if (fp != NULL && fp->fp_wtid == dl_worker.w_tid)
		deadlock_resolving = 0;
  }

  if (fp != NULL && (fp->fp_flags & FP_SYS_PROC)) {
	struct vmnt *vmp;

	if ((vmp = find_vmnt(fp->fp_endpoint)) != NULL)
		vmp->m_flags &= ~VMNT_CALLBACK;
  }

  thread_cleanup(NULL);
  return(NULL);
}
Exemplo n.º 12
0
    JNIEXPORT void JNICALL
    Java_org_cocos2dx_cpp_AppActivity_VungleAndroidCallbackWillCloseAd
    (JNIEnv * env, jobject obj)
    {
        //Log.e("MANYOU==", "Java_org_cocos2dx_cpp_AppActivity_VungleAndroidCallback_willCloseAd");

    	ResourceManager::getInstance()->addBigSource();

        Director::getInstance()->resume();
        AudioHelp::resumeAllEft();
        AudioHelp::resumeBgA();
        auto menu = ThirdPartyManager::getInstance()->getReviveMenu();
        if (menu)
        {
            menu->revive();
        }
    };
Exemplo n.º 13
0
/* make a swarm of undead around mm; uses the main RNG */
void
mkundead(struct level *lev, coord *mm, boolean revive_corpses, int mm_flags)
{
    int cnt = (level_difficulty(&lev->z) + 1) / 10 + rnd(5);
    const struct permonst *mdat;
    struct obj *otmp;
    coord cc;

    while (cnt--) {
        mdat = morguemon(&lev->z, rng_main);
        if (enexto(&cc, lev, mm->x, mm->y, mdat) &&
            (!revive_corpses || !(otmp = sobj_at(CORPSE, lev, cc.x, cc.y)) ||
             !revive(otmp)))
            makemon(mdat, lev, cc.x, cc.y, mm_flags);
    }
    lev->flags.graveyard = TRUE;        /* reduced chance for undead corpse */
}
Exemplo n.º 14
0
/*===========================================================================*
 *				select_return				     *
 *===========================================================================*/
static void select_return(struct selectentry *se)
{
  int r, r1;

  assert(!is_deferred(se));	/* Not done yet, first wait for async reply */

  select_cancel_all(se);

  r1 = copy_fdsets(se, se->nfds, TO_PROC);
  if (r1 != OK)
	r = r1;
  else if (se->error != OK)
	r = se->error;
  else
	r = se->nreadyfds;

  revive(se->req_endpt, r);
}
Exemplo n.º 15
0
/* make a swarm of undead around mm */
void 
mkundead (coord *mm, bool revive_corpses, int mm_flags)
{
        int cnt = (level_difficulty() + 1)/10 + rnd(5);
        struct permonst *mdat;
        struct obj *otmp;
        coord cc;

        while (cnt--) {
            mdat = morguemon();
            if (enexto(&cc, mm->x, mm->y, mdat) &&
                    (!revive_corpses ||
                     !(otmp = sobj_at(CORPSE, cc.x, cc.y)) ||
                     !revive(otmp)))
                (void) makemon(mdat, cc.x, cc.y, mm_flags);
        }
        level.flags.graveyard = true;   /* reduced chance for undead corpse */
}
Exemplo n.º 16
0
void die()
{
        object  *living_here, ob, officer, corpse, killer, me=this_object(), where;
        mapping my;
        string  *killer_name, *my_key,clan_d,clan_k,death_str, money,go_room,id,fil;

    if(!me) return ;
	if( !living(me) ) revive(1);
	if( environment()->query("undead") ) return;
	if( wizardp(me) && query("env/immortal") ) return;

	where = environment();
	if( where->query("no_die_room") ) {
		if(userp(me) && !me->query("ckill")) {
            me->remove_all_killer();
            all_inventory(where)->remove_killer(me);
            me->dismiss_team();
            me->set("eff_gin",me->query("max_gin"));
            me->set("eff_kee",me->query("max_kee"));
            me->set("eff_sen",me->query("max_sen"));
            me->set("gin",me->query("max_gin"));
            me->set("kee",me->query("max_kee"));
            me->set("sen",me->query("max_sen"));
            if(me->query_temp("unconcious"))
              me->revive();
            go_room=where->query("die_room");
            if(!go_room){
              me->move("/open/common/room/inn");
              return;
            }
            if(go_room[sizeof(go_room)-2..sizeof(go_room)-1]!=".c")
              go_room+=".c";
            if(file_size(go_room) < 0){
              me->move("/open/common/room/inn");
              return ;
            }
            me->move(go_room);
            return ;
          }
        }
Exemplo n.º 17
0
void // virtual
KClassicGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
{
	pExp = exp;
	if (echo)
		exp = 0;
	else if (!authTok)
		exp = 1;
	else {
		QString pr( prompt );
		if (pr.find( QRegExp( "\\bpassword\\b", false ) ) >= 0) {
			if (pr.find( QRegExp( "\\b(re-?(enter|type)|again|confirm|repeat)\\b",
			                      false ) ) >= 0)
				exp = 3;
			else if (pr.find( QRegExp( "\\bnew\\b", false ) ) >= 0)
				exp = 2;
			else { // QRegExp( "\\b(old|current)\\b", false ) is too strict
				handler->gplugReturnText( "",
				                          KGreeterPluginHandler::IsOldPassword |
				                          KGreeterPluginHandler::IsSecret );
				return;
			}
		} else {
			handler->gplugMsgBox( QMessageBox::Critical,
			                      i18n("Unrecognized prompt \"%1\"")
			                      .arg( prompt ) );
			handler->gplugReturnText( 0, 0 );
			exp = -1;
			return;
		}
	}

	if (pExp >= 0 && pExp >= exp) {
		revive();
		has = -1;
	}

	if (has >= exp || nonBlocking)
		returnData();
}
Exemplo n.º 18
0
TrackPointer GlobalTrackCache::lookupById(
        const TrackId& trackId) {
    const auto trackById(m_tracksById.find(trackId));
    if (m_tracksById.end() != trackById) {
        // Cache hit
        if (traceLogEnabled()) {
            kLogger.trace()
                    << "Cache hit for"
                    << trackId
                    << trackById->second->getPlainPtr();
        }
        return revive(trackById->second);
    } else {
        // Cache miss
        if (traceLogEnabled()) {
            kLogger.trace()
                    << "Cache miss for"
                    << trackId;
        }
        return TrackPointer();
    }
}
Exemplo n.º 19
0
void FloatingText::reset(float x, float y, const std::string& text, int color)
{
	revive();

	if (cameraZoom != Camera::mainCamera->zoomf) 
	{
		cameraZoom = Camera::mainCamera->zoomf;
		PixelScene::chooseFont(9, cameraZoom);
		//font = PixelScene.font;

		GameMath::PointFSet(&scale, PixelScene::scale);
		//scale.set(PixelScene.scale);
	}

	this->text(text);
	hardlight(color);

	measure();
	this->x = PixelScene::align(x - Width() / 2);
	this->y = y - Height();

	timeLeft = LIFESPAN;
}
Exemplo n.º 20
0
/*===========================================================================*
 *			       do_async_dev_result			     *
 *===========================================================================*/
static void *do_async_dev_result(void *arg)
{
  endpoint_t endpt;
  struct job my_job;

  my_job = *((struct job *) arg);
  fp = my_job.j_fp;

  /* An asynchronous character driver has results for us */
  if (job_call_nr == DEV_REVIVE) {
	endpt = job_m_in.REP_ENDPT;
	if (endpt == VFS_PROC_NR)
		endpt = find_suspended_ep(job_m_in.m_source,
					  job_m_in.REP_IO_GRANT);

	if (endpt == NONE) {
		printf("VFS: proc with grant %d from %d not found\n",
			job_m_in.REP_IO_GRANT, job_m_in.m_source);
	} else if (job_m_in.REP_STATUS == SUSPEND) {
		printf("VFS: got SUSPEND on DEV_REVIVE: not reviving proc\n");
	} else
		revive(endpt, job_m_in.REP_STATUS);
  }
  else if (job_call_nr == DEV_OPEN_REPL) open_reply();
  else if (job_call_nr == DEV_REOPEN_REPL) reopen_reply();
  else if (job_call_nr == DEV_CLOSE_REPL) close_reply();
  else if (job_call_nr == DEV_SEL_REPL1)
	select_reply1(job_m_in.m_source, job_m_in.DEV_MINOR,
		      job_m_in.DEV_SEL_OPS);
  else if (job_call_nr == DEV_SEL_REPL2)
	select_reply2(job_m_in.m_source, job_m_in.DEV_MINOR,
		      job_m_in.DEV_SEL_OPS);

  thread_cleanup(fp);
  return(NULL);
}
Exemplo n.º 21
0
void SchoolFish::onEnterState(int action)
{
	Entity::onEnterState(action);
	if (action == STATE_DEAD)
	{
		//rotation.interpolateTo(Vector(0,0,180), 2);
		vel.setLength2D(vel.getLength2D()*-1);

		oldFlockID = flockID;
		flockID = -1;

		doDeathEffects(0,0,0);

		/*
		alpha = 0;
		alphaMod = 0;
		*/
		respawnTimer = 20 + rand()%20;
		alphaMod = 0;
		/*
		this->setLife(2);
		this->setDecayRate(1);
		this->fadeAlphaWithLife = true;
		*/

		/*
		dsq->game->spawnIngredient("FishOil", position, 10);
		dsq->game->spawnIngredient("FishMeat", position, 10);
		dsq->game->spawnIngredient("SmallEgg", position, 10);
		dsq->game->spawnIngredient("PlantLeaf", position, 60);
		*/

		if (!isGoingToBeEaten())
		{
			if (dsq->game->firstSchoolFish)
			{
				if (chance(50))
					dsq->game->spawnIngredient("FishOil", position, 1);
				else
					dsq->game->spawnIngredient("FishMeat", position, 1);

				dsq->game->firstSchoolFish = false;
			}
			else
			{
				if (chance(8))
					dsq->game->spawnIngredient("FishOil", position, 1);
				if (chance(5))
					dsq->game->spawnIngredient("FishMeat", position, 1);
			}
		}
	}
	else if (action == STATE_IDLE)
	{
		revive(3000);
		alpha.interpolateTo(1, 1);
		alphaMod = 1;
		if (oldFlockID != -1)
			flockID = oldFlockID;
	}
}
Exemplo n.º 22
0
/*===========================================================================*
 *				dev_status				     *
 *===========================================================================*/
void dev_status(endpoint_t drv_e)
{
/* A device sent us a notification it has something for us. Retrieve it. */

  message st;
  int major, get_more = 1;
  endpoint_t endpt;

  for (major = 0; major < NR_DEVICES; major++)
	if (dmap_driver_match(drv_e, major))
		break; /* 'major' is the device that sent the message */

  if (major >= NR_DEVICES)	/* Device endpoint not found; nothing to do */
	return;

  if (dev_style_asyn(dmap[major].dmap_style)) {
	printf("VFS: not doing dev_status for async driver %d\n", drv_e);
	return;
  }

  /* Continuously send DEV_STATUS messages until the device has nothing to
   * say to us anymore. */
  do {
	int r;
	st.m_type = DEV_STATUS;
	r = drv_sendrec(drv_e, &st);
	if (r == OK && st.REP_STATUS == ERESTART) r = EDEADEPT;
	if (r != OK) {
		printf("VFS: DEV_STATUS failed to %d: %d\n", drv_e, r);
		if (r == EDEADSRCDST || r == EDEADEPT) return;
		panic("VFS: couldn't sendrec for DEV_STATUS: %d", r);
	}

	switch(st.m_type) {
	  case DEV_REVIVE:
		/* We've got results for a read/write/ioctl call to a
		 * synchronous character driver */
		endpt = st.REP_ENDPT;
		if (endpt == VFS_PROC_NR) {
			endpt = find_suspended_ep(drv_e, st.REP_IO_GRANT);
			if (endpt == NONE) {
			  printf("VFS: proc with grant %d from %d not found\n",
				 st.REP_IO_GRANT, st.m_source);
			  continue;
			}
		}
		revive(endpt, st.REP_STATUS);
		break;
	  case DEV_IO_READY:
		/* Reply to a select request: driver is ready for I/O */
		select_reply2(st.m_source, st.DEV_MINOR, st.DEV_SEL_OPS);
		break;
	  default:
		printf("VFS: unrecognized reply %d to DEV_STATUS\n",st.m_type);
		/* Fall through. */
	  case DEV_NO_STATUS:
		get_more = 0;
		break;
	}
  } while(get_more);
}
Exemplo n.º 23
0
void die()
{
	object corpse, rum_ob;
	mixed killer;
	int i;

	if( environment()->query("no_death") && userp(this_object()) )
		{

//			if ( !objectp(rum_ob = find_object("/d/huashan/npc/referee")) )
//				rum_ob = load_object("/d/huashan/npc/referee");

//			killer = query_temp("last_damage_from");

//			if ( stringp(killer) )
//				CHANNEL_D->do_channel(rum_ob, "chat",
//					sprintf("%s被" + killer + "干掉了。", this_object()->name(1)));
//			else
//				CHANNEL_D->do_channel(rum_ob, "rumor",
//					sprintf("%s被干掉了。", this_object()->name(1)));
			unconcious();
			remove_call_out("revive");

			return;
		}

	if( !living(this_object()) ) revive(1);
	if( wizardp(this_object()) && query("env/immortal") ) return;


	// Clear all the conditions by death.
	this_object()->clear_condition();
	this_object()->delete("poisoner");

	COMBAT_D->announce(this_object(), "dead");

	if ( userp(this_object()) && !environment(this_object())->query("no_death"))
		COMBAT_D->death_penalty(this_object());

	if( objectp(killer = query_temp("last_damage_from"))){
		set_temp("my_killer", killer->query("id"));
		COMBAT_D->killer_reward(killer, this_object());
	} else  if (userp(this_object()))
	{
	if ( !objectp(rum_ob = find_object("/d/city/npc/aqingsao")) )
		rum_ob = load_object("/d/city/npc/aqingsao");

	if ( stringp(killer) )
		CHANNEL_D->do_channel(rum_ob, "rumor",
			sprintf("%s" + killer + "。", this_object()->name(1)));
	else
		CHANNEL_D->do_channel(rum_ob, "rumor",
			sprintf("%s莫名其妙地死了。", this_object()->name(1)));
	}

	if( ( !environment()->query("no_death") || !userp(this_object()) ) 
	 && objectp(corpse = CHAR_D->make_corpse(this_object(), killer)) )
		corpse->move(environment());

	this_object()->remove_all_killer();
	all_inventory(environment())->remove_killer(this_object());

	if( userp(this_object()) ) {
		if (this_object()->is_busy())
			this_object()->interrupt_me();
		set("jing", 1);	set("eff_jing", 1);
		set("qi", 1);	set("eff_qi", 1);
		set("jingli", 1);
		if (environment(this_object())->query("no_death")) {
			set("eff_jing", query("max_jing"));
			set("eff_qi", query("max_qi"));
			return;
		}
		this_object()->dismiss_team();
		this_object()->save();
		ghost = 1;
		this_object()->move(DEATH_ROOM);
		DEATH_ROOM->start_death(this_object());
		MARRY_D->break_marriage(this_object()); // added by Zhuang@XKX
		if( this_object()->query("family/master_id")=="feng qingyang" ) 							CHAR_D->break_relation(this_object()); //added by Qfy
	} else
		destruct(this_object());
}
Exemplo n.º 24
0
Arquivo: main.c Projeto: bend/Minix-RC
/*===========================================================================*
 *				main					     *
 *===========================================================================*/
PUBLIC int main(void)
{
/* This is the main program of the file system.  The main loop consists of
 * three major activities: getting new work, processing the work, and sending
 * the reply.  This loop never terminates as long as the file system runs.
 */
  int error;

  /* SEF local startup. */
  sef_local_startup();

  /* This is the main loop that gets work, processes it, and sends replies. */
  while (TRUE) {
	SANITYCHECK;
	get_work();		/* sets who and call_nr */

	if (call_nr == DEV_REVIVE)
	{
		endpoint_t endpt;

		endpt = m_in.REP_ENDPT;
		if(endpt == VFS_PROC_NR) {
			endpt = suspended_ep(m_in.m_source, m_in.REP_IO_GRANT);
			if(endpt == NONE) {
				printf("FS: proc with "
			"grant %d from %d not found (revive)\n",
					m_in.REP_IO_GRANT, m_in.m_source);
				continue;
			}
		}
		revive(endpt, m_in.REP_STATUS);
		continue;
	}
	if (call_nr == DEV_REOPEN_REPL)
	{
		reopen_reply();
		continue;
	}
	if (call_nr == DEV_CLOSE_REPL)
	{
		close_reply();
		continue;
	}
	if (call_nr == DEV_SEL_REPL1)
	{
		select_reply1();
		continue;
	}
	if (call_nr == DEV_SEL_REPL2)
	{
		select_reply2();
		continue;
	}

 	/* Check for special control messages first. */
        if (is_notify(call_nr)) {
		if (who_e == CLOCK)
		{
			/* Alarm timer expired. Used only for select().
			 * Check it.
			 */
			expire_timers(m_in.NOTIFY_TIMESTAMP);
		}
		else if(who_e == DS_PROC_NR)
		{
			/* DS notifies us of an event. */
			ds_event();
		}
		else
		{
			/* Device notifies us of an event. */
			dev_status(&m_in);
		}
		SANITYCHECK;
		continue;
	}

	/* We only expect notify()s from tasks. */
	if(who_p < 0) {
    		printf("FS: ignoring message from %d (%d)\n",
			who_e, m_in.m_type);
		continue;
	}

	/* Now it's safe to set and check fp. */
	fp = &fproc[who_p];	/* pointer to proc table struct */
	super_user = (fp->fp_effuid == SU_UID ? TRUE : FALSE);   /* su? */

#if DO_SANITYCHECKS
	if(fp_is_blocked(fp)) {
		printf("VFS: requester %d call %d: suspended\n",
			who_e, call_nr);
		panic("requester suspended");
	}
#endif

	/* Calls from PM. */
	if (who_e == PM_PROC_NR) {
		service_pm();

		continue;
	}

		SANITYCHECK;

	  /* Other calls. */
	  switch(call_nr)
	  {
	      case MAPDRIVER:
		error= do_mapdriver();
		if (error != SUSPEND) reply(who_e, error);
		break;

	      default:
		/* Call the internal function that does the work. */
		if (call_nr < 0 || call_nr >= NCALLS) { 
			error = SUSPEND;
			/* Not supposed to happen. */
			printf("VFS: illegal %d system call by %d\n",
				call_nr, who_e);
		} else if (fp->fp_pid == PID_FREE) {
			error = ENOSYS;
			printf(
		"FS, bad process, who = %d, call_nr = %d, endpt1 = %d\n",
				 who_e, call_nr, m_in.endpt1);
		} else {
#if ENABLE_SYSCALL_STATS
			calls_stats[call_nr]++;
#endif
			SANITYCHECK;
			error = (*call_vec[call_nr])();
			SANITYCHECK;
		}

		/* Copy the results back to the user and send reply. */
		if (error != SUSPEND) { reply(who_e, error); }
	}
	SANITYCHECK;
  }
  return(OK);				/* shouldn't come here */
}
Exemplo n.º 25
0
void GolPattern::revive( const int x, const int y )
{
    revive( Vecteur2i( x, y ) );
}