private void onPlayerTagAdded(long sessionId)
 {
     if (dataEntityCollection.TryFindEntity <SessionIdData, long>(sessionId, out var dataEntityHandle) && dataEntityCollection.TryGetComponent <PlayerStatusData>(dataEntityHandle, out var component))
     {
         onStatusChanged(component, component.QuestMascotName);
     }
 }
        private string getPlayerName(long sessionId)
        {
            string result = "";

            if (dataEntityCollection.TryFindEntity <SessionIdData, long>(sessionId, out var dataEntityHandle) && dataEntityCollection.TryGetComponent <DisplayNameData>(dataEntityHandle, out var component))
            {
                result = component.DisplayName;
            }
            return(result);
        }
 private void setupNetworkServiceListeners()
 {
     cpMMOItemId = new CPMMOItemId(long.Parse(partyBlasterId), CPMMOItemId.CPMMOItemParent.WORLD);
     if (dataEntityCollection.TryFindEntity <ServerObjectItemData, CPMMOItemId>(cpMMOItemId, out serverObjectHandle) && dataEntityCollection.TryGetComponent <ServerObjectPositionData>(serverObjectHandle, out serverObjectPositionData))
     {
         serverObjectPositionData.PositionChanged += onItemMoved;
         dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.EntityRemovedEvent>(onItemRemoved);
     }
     Service.Get <EventDispatcher>().AddListener <RewardServiceEvents.RewardsEarned>(onRewardsReceived);
 }
Exemple #4
0
    private void setupNetworkServiceListeners(long id)
    {
        CPMMOItemId cPMMOItemId = new CPMMOItemId(id, CPMMOItemId.CPMMOItemParent.WORLD);

        if (dataEntityCollection.TryFindEntity <ServerObjectItemData, CPMMOItemId>(cPMMOItemId, out serverObjectHandle))
        {
            serverObjectItemData = dataEntityCollection.GetComponent <ServerObjectItemData>(serverObjectHandle);
            GetComponent <NetworkObjectController>().ItemId = cPMMOItemId;
            serverObjectItemData.ItemChanged += onItemChanged;
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.EntityRemovedEvent>(onItemRemoved);
            parseCPMMOItem(serverObjectItemData.Item);
        }
        Service.Get <EventDispatcher>().AddListener <RewardServiceEvents.RewardsEarned>(onRewardsReceived);
    }