Exemple #1
0
 public void TransmitEvent(EventsEnum newEvent, uint data)
 {
     if (!Connected)
     {
         return;
     }
     simClient.TransmitClientEvent(0U, newEvent, data, NotificationGroupsEnum.Group0, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
 }
Exemple #2
0
    public void ReplaceEventTrigger(EventsEnum newEvt, int newIndex)
    {
        var index     = GameComponentsLookup.EventTrigger;
        var component = CreateComponent <EventTriggerComponent>(index);

        component.Evt   = newEvt;
        component.Index = newIndex;
        ReplaceComponent(index, component);
    }
        public void Handle(EventsEnum message)
        {
            switch (message)
            {
            case EventsEnum.LogOn:
                ActivateItem(serversViewModel);
                break;

            case EventsEnum.LogOut:
                ActivateItem(this.container.GetInstance <LoginViewModel>());
                break;
            }
        }
Exemple #4
0
        public void RecordEventsStats(EventsEnum data, long count)
        {
            try
            {
                if (count <= 0)
                {
                    return;
                }

                _eventsDataRecords.AddOrUpdate(data, count, (key, value) => value + count);
            }
            catch (Exception ex)
            {
                _log.Warn("Exception caught executing RecordEventsStats", ex);
            }
        }
    private void ProcessEvent(EventsEnum evt, int index)
    {
        //Debug.Log(evt.ToString());

        if (_missions.ContainsKey(evt))
        {
            MissionsDB.Mission mission = _missions[evt];

            if (mission.IsObjective)
            {
                mission.Index += index;
                mission.Index  = Mathf.Clamp(mission.Index, 0, int.MaxValue);

                GameEntity alert = _gameContext.CreateEntity();
                alert.AddNotebookAlert(true);

                _missions[evt] = mission;
            }
        }

        UpdateObjectives();
        CheckEndMission();
    }
        /// <summary>
        /// Converts a EventsEnum value to a corresponding string value
        /// </summary>
        /// <param name="enumValue">The EventsEnum value to convert</param>
        /// <returns>The representative string value</returns>
        public static string ToValue(EventsEnum enumValue)
        {
            switch (enumValue)
            {
            //only valid enum elements can be used
            //this is necessary to avoid errors
            case EventsEnum.PROCESSED:
            case EventsEnum.SENT:
            case EventsEnum.OPEN:
            case EventsEnum.CLICK:
            case EventsEnum.UNSUBSCRIBE:
            case EventsEnum.BOUNCE:
            case EventsEnum.SOFTBOUNCE:
            case EventsEnum.SPAM:
            case EventsEnum.INVALID:
            case EventsEnum.DROPPED:
            case EventsEnum.HARDBOUNCE:
                return(stringValues[(int)enumValue]);

            //an invalid enum value was requested
            default:
                return(null);
            }
        }
Exemple #7
0
 public EventMessage(EventsEnum EventObject, string userId)
 {
     Event  = EventObject;
     UserId = userId;
 }
Exemple #8
0
        public static byte[] GetCode4SyncData(List <ObjectHitInfo> objects)
        {
            try
            {
                using (BattlePacketWriter send = new BattlePacketWriter())
                {
                    for (int i = 0; i < objects.Count; i++)
                    {
                        ObjectHitInfo HitInfo = objects[i];
                        if (HitInfo.SyncType == 1)
                        {
                            if (HitInfo.ObjSyncId == 0)
                            {
                                send.WriteC((byte)P2PSubHeadEnum.OBJECT_STATIC); //Action Type
                                send.WriteH((ushort)HitInfo.ObjId);              //Action Slot
                                send.WriteH(8);                                  //Action Length

                                send.WriteH((ushort)HitInfo.ObjectLife);         //ObjectLife
                                send.WriteC((byte)HitInfo.killerId);             //DestroyedBySlot (Slot de quem destruiu o objeto).
                            }
                            else
                            {
                                send.WriteC((byte)P2PSubHeadEnum.OBJECT_ANIM); //Action Type
                                send.WriteH((ushort)HitInfo.ObjId);            //Action Slot
                                send.WriteH(13);                               //Action Length

                                send.WriteH((ushort)HitInfo.ObjectLife);
                                send.WriteC((byte)HitInfo.AnimationId1);
                                send.WriteC((byte)HitInfo.AnimationId2);
                                send.WriteT(HitInfo.SpecialUse);
                            }
                        }
                        else if (HitInfo.SyncType == 2)
                        {
                            EventsEnum events = EventsEnum.LifeSync;
                            ushort     length = 11;
                            if (HitInfo.ObjectLife == 0)
                            {
                                events |= EventsEnum.Death;
                                length += 12;
                            }
                            send.WriteC((byte)P2PSubHeadEnum.USER); //Action Type
                            send.WriteH((ushort)HitInfo.ObjId);     //Action Slot
                            send.WriteH(length);                    //Action Length

                            send.WriteD((uint)events);              //Action Events Flags
                            send.WriteH((ushort)HitInfo.ObjectLife);

                            if (events.HasFlag(EventsEnum.Death))
                            {
                                send.WriteC((byte)(HitInfo.DeathType + (HitInfo.ObjId * 16)));
                                send.WriteC((byte)HitInfo.HitPart);
                                send.WriteH(HitInfo.Position.X.RawValue);
                                send.WriteH(HitInfo.Position.Y.RawValue);
                                send.WriteH(HitInfo.Position.Z.RawValue);
                                send.WriteD(HitInfo.WeaponId);
                            }
                        }
                        else if (HitInfo.SyncType == 3)
                        {
                            if (HitInfo.ObjSyncId == 0)
                            {
                                send.WriteC((byte)P2PSubHeadEnum.STAGEINFO_OBJ_STATIC); //Action Type
                                send.WriteH((ushort)HitInfo.ObjId);                     //Action Slot
                                send.WriteH(6);                                         //Action Length

                                send.WriteC(HitInfo.ObjectLife == 0);                   //isDestroyed
                            }
                            else
                            {
                                send.WriteC((byte)P2PSubHeadEnum.STAGEINFO_OBJ_ANIM); //Action Type
                                send.WriteH((ushort)HitInfo.ObjId);                   //Action Slot
                                send.WriteH(14);                                      //Action Length

                                send.WriteC((byte)HitInfo.DestroyState);
                                send.WriteH((ushort)HitInfo.ObjectLife);
                                send.WriteT(HitInfo.SpecialUse);
                                send.WriteC((byte)HitInfo.AnimationId1);
                                send.WriteC((byte)HitInfo.AnimationId2);
                            }
                        }
                        else if (HitInfo.SyncType == 4)
                        {
                            send.WriteC((byte)P2PSubHeadEnum.STAGEINFO_CHARA); //Action Type
                            send.WriteH((ushort)HitInfo.ObjId);                //Action Slot
                            send.WriteH(11);                                   //Action Length

                            send.WriteD((uint)EventsEnum.LifeSync);
                            send.WriteH((ushort)HitInfo.ObjectLife);
                        }
                        else if (HitInfo.SyncType == 5)
                        {
                            send.WriteC((byte)P2PSubHeadEnum.USER);        //Action Type
                            send.WriteH((short)HitInfo.ObjId);             //Action Slot
                            send.WriteH(11);                               //Action Length

                            send.WriteD((uint)EventsEnum.SufferingDamage); //Dano Sofrido
                            send.WriteC((byte)(HitInfo.killerId + ((byte)HitInfo.DeathType * 16)));
                            send.WriteC((byte)HitInfo.ObjectLife);
                        }
                    }
                    return(send.memory.ToArray());
                }
            }
            catch (Exception ex)
            {
                Logger.Exception(ex);
            }
            return(new byte[0]);
        }
    private void TriggerEvent(EventsEnum evt, int index)
    {
        GameEntity entity = _gameContext.CreateEntity();

        entity.AddEventTrigger(evt, index);
    }