void UActorComponent::CreatePhysicsState()
{
	check(IsRegistered());
	check(ShouldCreatePhysicsState());
	check(World->GetPhysicsScene());
	check(!bPhysicsStateCreated);
	bPhysicsStateCreated = true;
}
void UActorComponent::MarkRenderTransformDirty()
{
	if (IsRegistered() && bRenderStateCreated)
	{
		bRenderTransformDirty = true;
		MarkForNeededEndOfFrameUpdate();
	}
}
void UActorComponent::RegisterComponentWithWorld(UWorld* InWorld)
{
	checkf(!HasAnyFlags(RF_Unreachable), TEXT("%s"), *GetFullName());

	if(IsPendingKill())
	{
		UE_LOG(LogActorComponent, Log, TEXT("RegisterComponentWithWorld: (%s) Trying to register component with IsPendingKill() == true. Aborting."), *GetPathName());
		return;
	}

	// If the component was already registered, do nothing
	if(IsRegistered())
	{
		UE_LOG(LogActorComponent, Log, TEXT("RegisterComponentWithWorld: (%s) Already registered. Aborting."), *GetPathName());
		return;
	}

	if(InWorld == NULL)
	{
		//UE_LOG(LogActorComponent, Log, TEXT("RegisterComponentWithWorld: (%s) NULL InWorld specified. Aborting."), *GetPathName());
		return;
	}

	// If not registered, should not have a scene
	checkf(World == NULL, TEXT("%s"), *GetFullName());

	// Follow outer chain to see if we can find an Actor
	AActor* Owner = GetOwner();

	ensureMsgf(Owner == NULL || Owner == GetOuter(), TEXT("Component %s is owned by %s by has an Outer of %s."), *GetName(), *Owner->GetName(), *GetOuter()->GetName());

	if ((Owner != NULL) && Owner->GetClass()->HasAnyClassFlags(CLASS_NewerVersionExists))
	{
		UE_LOG(LogActorComponent, Log, TEXT("RegisterComponentWithWorld: Owner belongs to a DEADCLASS"));
		return;
	}

#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
	// Can only register with an Actor if we are created within one
	if(Owner != NULL)
	{
		checkf(!Owner->HasAnyFlags(RF_Unreachable), TEXT("%s"), *GetFullName());
		// can happen with undo because the owner will be restored "next"
		//checkf(!Owner->IsPendingKill(), TEXT("%s"), *GetFullName());

		if(InWorld != GetOwner()->GetWorld())
		{
			// The only time you should specify a scene that is not GetOwner()->GetWorld() is when you don't have an Actor
			UE_LOG(LogActorComponent, Log, TEXT("RegisterComponentWithWorld: (%s) Specifying a world, but an Owner Actor found, and InWorld is not GetOwner()->GetWorld()"), *GetPathName());
		}
	}
#endif // !(UE_BUILD_SHIPPING || UE_BUILD_TEST)

	World = InWorld;

	ExecuteRegisterEvents();
	RegisterAllComponentTickFunctions(true);
}
Example #4
0
/*
** check_registered user cancels message, if 'x' is not
** registered (e.g. we don't know yet whether a server
** or user)
*/
int	check_registered(aClient *sptr)
{
	if (!IsRegistered(sptr))
	    {
		sendto_one(sptr, replies[ERR_NOTREGISTERED], ME, "*");
		return -1;
	    }
	return 0;
}
Example #5
0
/*
 * mr_pong - registration message handler
 *
 * parv[0] = sender prefix
 * parv[1] = pong response echo
 * NOTE: cptr is always unregistered here
 */
int mr_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
  assert(0 != cptr);
  assert(cptr == sptr);
  assert(!IsRegistered(sptr));

  ClearPingSent(cptr);
  return (parc > 1) ? auth_set_pong(cli_auth(sptr), strtoul(parv[parc - 1], NULL, 10)) : 0;
}
Example #6
0
/*
 * * check_registered user cancels message, if 'x' is not * registered
 * (e.g. we don't know yet whether a server * or user)
 */
int
check_registered(aClient *sptr)
{
   if (!IsRegistered(sptr)) {
      sendto_one(sptr, err_str(ERR_NOTREGISTERED), me.name, "*");
      return -1;
   }
   return 0;
}
int     m_notice(struct Client *cptr,
                 struct Client *sptr,
                 int parc,
                 char *parv[])
{
  if (!IsRegistered(cptr))
    return 0;
  return m_message(cptr, sptr, parc, parv, 1);
}
Example #8
0
FormatPtr FormatManager::operator()(FormatPtr format)
{
    if (!format || IsRegistered(format))
    {
        return format;
    }

    return RegisterFormat(format->type, format->bps, format->sample, format->subsample_w, format->subsample_h);
}
BOOL CParticleGroupManager::Register(CParticleGroup *prototype)
{
	if(prototype == NULL) return FALSE;
	if( prototype->GetName() == "" || IsRegistered(prototype->GetName()) ) return FALSE;

	my_map::value_type registerTri( prototype->GetName(), prototype );
	//등록 성공 or 실패 정보를 리턴
	return m_mapRegistered.insert( registerTri ).second;
}
Example #10
0
File: m_cap.c Project: Macs/NeoIRCd
static void
cap_ls(struct Client *source_p, const char *arg)
{
	if(!IsRegistered(source_p))
		source_p->flags |= FLAGS_CLICAP;

	/* list of what we support */
	clicap_generate(source_p, "LS", 0, 0);
}
void UChildActorComponent::SetChildActorClass(TSubclassOf<AActor> Class)
{
	ChildActorClass = Class;
	if (IsRegistered())
	{
		DestroyChildActor();
		CreateChildActor();
	}
}
Example #12
0
/*
** m_pong
**      parv[0] = sender prefix
**      parv[1] = origin
**      parv[2] = destination
*/
int     m_pong(struct Client *cptr,
               struct Client *sptr,
               int parc,
               char *parv[])
{
  struct Client *acptr = NULL;
  char  *origin, *destination;

  if (parc < 2 || *parv[1] == '\0')
    {
      sendto_one(sptr, form_str(ERR_NOORIGIN), me.name, parv[0]);
      return 0;
    }

  origin = parv[1];
  destination = parv[2];

  /* Now attempt to route the PONG, comstud pointed out routable PING
   * is used for SPING.  routable PING should also probably be left in
   *        -Dianora
   * That being the case, we will route, but only for registered clients (a
   * case can be made to allow them only from servers). -Shadowfax
   */
  if (!EmptyString(destination) && irccmp(destination, me.name) != 0
                && IsRegistered(sptr))
    {
      if ((acptr = find_client(destination, NULL)) ||
          (acptr = find_server(destination)))
        sendto_one(acptr,":%s PONG %s %s",
                   parv[0], origin, destination);
      else
        {
          sendto_one(sptr, form_str(ERR_NOSUCHSERVER),
                     me.name, parv[0], destination);
          return 0;
        }
    }
  else
    {
      if (MyConnect(sptr))
      {
        sptr->flags &= ~FLAGS_PINGSENT;
#ifdef NEED_SPLITCODE
#ifdef SPLIT_PONG
        if (IsServer(sptr))
          got_server_pong = 1;
#endif
#endif
      }
#ifdef  DEBUGMODE
      Debug((DEBUG_NOTICE, "PONG: %s %s", origin,
           destination ? destination : "*"));
#endif
    }
  return 0;
}
void UActorComponent::MarkRenderStateDirty()
{
	// If registered and has a render state to make as dirty
	if((!bRenderStateDirty || !GetWorld()) && IsRegistered() && bRenderStateCreated)
	{
		// Flag as dirty
		bRenderStateDirty = true;
		MarkForNeededEndOfFrameRecreate();
	}
}
void UActorComponent::ReregisterComponent()
{
	if(!IsRegistered())
	{
		UE_LOG(LogActorComponent, Log, TEXT("ReregisterComponent: (%s) Not currently registered. Aborting."), *GetPathName());
		return;
	}

	FComponentReregisterContext(this);
}
void UActorComponent::MarkRenderDynamicDataDirty()
{
	// If registered and has a render state to make as dirty
	if(IsRegistered() && bRenderStateCreated)
	{
		// Flag as dirty
		bRenderDynamicDataDirty = true;
		MarkForNeededEndOfFrameUpdate();
	}
}
Example #16
0
/*
 * handle_command
 *
 * inputs	- pointer to message block
 *		- pointer to client
 *		- pointer to client message is from
 *		- count of number of args
 *		- pointer to argv[] array
 * output	- -1 if error from server
 * side effects	-
 */
static int
handle_command(struct Message *mptr, struct Client *client_p,
	       struct Client *from, int i, char *hpara[MAXPARA])
{
	MessageHandler handler = 0;

	if(IsServer(client_p))
		mptr->rcount++;

	mptr->count++;

	/* New patch to avoid server flooding from unregistered connects
	   - Pie-Man 07/27/2000 */

	if(!IsRegistered(client_p))
	{
		/* if its from a possible server connection
		 * ignore it.. more than likely its a header thats sneaked through
		 */

		if(IsAnyServer(client_p) && !(mptr->flags & MFLG_UNREG))
			return (1);
	}

	handler = mptr->handlers[client_p->handler];

	/* check right amount of params is passed... --is */
	if(i < (int)mptr->parameters)
	{
		if(!IsServer(client_p))
		{
			sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
				   me.name, BadPtr(hpara[0]) ? "*" : hpara[0], mptr->cmd);
			if(MyClient(client_p))
				return (1);
			else
				return (-1);
		}

		sendto_realops_flags(UMODE_ALL, L_ALL,
				     "Dropping server %s due to (invalid) command '%s'"
				     "with only %d arguments (expecting %d).",
				     client_p->name, mptr->cmd, i, mptr->parameters);
		ilog(L_CRIT, "Insufficient parameters (%d) for command '%s' from %s.",
		     i, mptr->cmd, client_p->name);

		exit_client(client_p, client_p, client_p,
			    "Not enough arguments to server command.");
		return (-1);
	}

	(*handler) (client_p, from, i, hpara);
	return (1);
}
Example #17
0
static void
cap_end(struct Client *source_p, const char *arg)
{
	if(IsRegistered(source_p))
		return;

	source_p->flags &= ~FLAGS_CLICAP;

	if(source_p->name[0] && source_p->flags & FLAGS_SENTUSER)
	{
		register_local_user(source_p, source_p);
	}
}
Example #18
0
void UActorComponent::DestroyComponent(bool bPromoteChildren/*= false*/)
{
	// Avoid re-entrancy
	if (bIsBeingDestroyed)
	{
		return;
	}

	bIsBeingDestroyed = true;

	if (bHasBegunPlay)
	{
		EndPlay(EEndPlayReason::Destroyed);
	}

	// Ensure that we call UninitializeComponent before we destroy this component
	if (bHasBeenInitialized)
	{
		UninitializeComponent();
	}

	// Unregister if registered
	if(IsRegistered())
	{
		UnregisterComponent();
	}

	// Then remove from Components array, if we have an Actor
	if(AActor* MyOwner = GetOwner())
	{
		if (IsCreatedByConstructionScript())
		{
			MyOwner->BlueprintCreatedComponents.Remove(this);
		}
		else
		{
			MyOwner->RemoveInstanceComponent(this);
		}
		MyOwner->RemoveOwnedComponent(this);
		if (MyOwner->GetRootComponent() == this)
		{
			MyOwner->SetRootComponent(NULL);
		}
	}

	// Tell the component it is being destroyed
	OnComponentDestroyed();

	// Finally mark pending kill, to NULL out any other refs
	MarkPendingKill();
}
void UDestructibleComponent::PostPhysicsTick( FPrimitiveComponentPostPhysicsTickFunction &ThisTickFunction )
{
	Super::PostPhysicsTick(ThisTickFunction);

	if (IsRegistered())
	{
		if (BodyInstance.bSimulatePhysics)
		{
			SyncComponentToRBPhysics();
		}

		RefreshBoneTransforms();
	}
}
//-----------------------------------------------------------------------------
// Adds a callable to the end of the CListenerManager vector.
//-----------------------------------------------------------------------------
void CListenerManager::RegisterListener(PyObject* pCallable)
{
	// Get the object instance of the callable
	object oCallable = object(handle<>(borrowed(pCallable)));

	// Is the callable already in the vector?
	if( !IsRegistered(oCallable) )
	{
		m_vecCallables.AddToTail(oCallable);
	}
	else {
		BOOST_RAISE_EXCEPTION(PyExc_ValueError, "Callback already registered.")
	}
}
Example #21
0
static void
cap_end(struct Client *source_p, const char *arg)
{
    if(IsRegistered(source_p))
        return;

    source_p->flags &= ~FLAGS_CLICAP;

    if(source_p->name[0] && source_p->flags & FLAGS_SENTUSER) {
        char buf[USERLEN+1];
        rb_strlcpy(buf, source_p->username, sizeof(buf));
        register_local_user(source_p, source_p, buf);
    }
}
// -----------------------------------------------------------------------------
// CCoverageMonitor::RunL
// -----------------------------------------------------------------------------
//
void CRegistrationMonitor::RunL()
	{
	TBool isRegistered = IsRegistered();	
	TInt errorCode = iStatus.Int();
	
	MonitorStatus();

	// Notify observers about state changes and errors
	if( ( isRegistered != iIsRegistered ) || ( errorCode != KErrNone ) )
		{
		iIsRegistered = isRegistered;
		iObserver.MonitorStateChanged( errorCode );
		}	
	}
bool USkeletalMeshComponent::ShouldTickPose() const
{
	// Characters playing Root Motion will tick pose themselves before physics.
	ACharacter * CharacterOwner = Cast<ACharacter>(GetOwner());
	const bool bSkipBecauseOfRootMotion = CharacterOwner && CharacterOwner->IsPlayingRootMotion();

	// When we stop root motion we go back to ticking after CharacterMovement. Unfortunately that means that we could tick twice that frame.
	// So only enforce a single tick per frame.
	const bool bAlreadyTickedThisFrame = (LastTickTime == GetWorld()->TimeSeconds);

	// Remote Clients on the Server will always tick animations as updates from the client comes in. To use Client's delta time.
	const bool bRemoteClientOnServer = CharacterOwner && (CharacterOwner->Role == ROLE_Authority) && CharacterOwner->Controller && !CharacterOwner->Controller->IsLocalController();

	return (Super::ShouldTickPose() && IsRegistered() && AnimScriptInstance && !bPauseAnims && GetWorld()->HasBegunPlay() && !bNoSkeletonUpdate && !bSkipBecauseOfRootMotion && !bRemoteClientOnServer && !bAlreadyTickedThisFrame);
}
Example #24
0
static void
cap_end(struct Client *source_p, const char *arg)
{
	if(IsRegistered(source_p))
		return;

	source_p->flags2 &= ~FLAGS2_CLICAP;

	if(!EmptyString(source_p->name) && HasSentUser(source_p))
	{
		char buf[USERLEN+1];
		strlcpy(buf, source_p->username, sizeof(buf));
		register_local_user(source_p, source_p, buf);
	}
}
Example #25
0
	bool SocketPollerImpl::RegisterSocket(SocketHandle socket)
	{
		NazaraAssert(!IsRegistered(socket), "Socket is already registered");

		PollSocket entry = {
			socket,
			POLLRDNORM,
			0
		};

		m_allSockets[socket] = m_sockets.size();
		m_sockets.emplace_back(entry);

		return true;
	}
Example #26
0
File: send.c Project: ahf/irc
/*
** flush_fdary
**      Used to empty all output buffers for connections in fdary.
*/
void    flush_fdary(FdAry *fdp)
{
        int     i;
        aClient *cptr;

        for (i = 0; i <= fdp->highest; i++)
            {
                if (!(cptr = local[fdp->fd[i]]))
                        continue;
                if (!IsRegistered(cptr)) /* is this needed?? -kalt */
                        continue;
                if (DBufLength(&cptr->sendQ) > 0)
                        (void)send_queued(cptr);
            }
}
/*************************************
 * EventActiveInQueue
 *************************************/
SHVBool SHVModuleListImpl::EventActiveInQueue()
{
SHVBool retVal(true);

	Lock.Lock();

	if (IsRegistered() || (State > StateInitialized && State < StateUnregistering && SHVThreadBase::GetCurrentThreadID() == DefaultEventQueue.GetThreadID()))
		EventsActive++;
	else
		retVal = false;

	Lock.Unlock();
	
	return retVal;
}
void UActorComponent::CreateRenderState_Concurrent()
{
	check(IsRegistered());
	check(World->Scene);
	check(!bRenderStateCreated);
	bRenderStateCreated = true;

	bRenderStateDirty = false;
	bRenderTransformDirty = false;
	bRenderDynamicDataDirty = false;

#if LOG_RENDER_STATE
	UE_LOG(LogActorComponent, Log, TEXT("CreateRenderState_Concurrent: %s"), *GetPathName());
#endif
}
Example #29
0
void PluginManager::RegisterPlugin(const wxString & type, const wxString & path)
{
   if (IsRegistered(type, path)) {
      return;
   }

   mConfig->SetPath(wxString::Format(wxT("/%s/%d"), type.c_str(), GetPluginCount(type)));

   mConfig->Write(wxT("PluginPath"), path);
   SetDirty();

   mConfig->SetPath(wxT("private"));

   return;
}
void UPrimitiveComponent::OnComponentCollisionSettingsChanged()
{
	if (!IsTemplate() && IsRegistered())			// not for CDOs
	{
		// changing collision settings could affect touching status, need to update
		UpdateOverlaps();

		// update navigation data if needed
		const bool bNewNavRelevant = IsNavigationRelevant();
		if (bNavigationRelevant != bNewNavRelevant)
		{
			bNavigationRelevant = bNewNavRelevant;
			UNavigationSystem::UpdateNavOctree(this);
		}
	}
}