示例#1
0
        private void ProcessCharacterPositionEvent(bEvents.DynelPositionEventArgs e)
        {
            if (this.curCharacterPos != null)
            {
                if (this.curCharacterPos.Equals(e)
                    && this.lastCharPos!=null
                    && this.lastCharPos.ElapsedMilliseconds < 250)
                {
                    return;
                }
            }

            if (this.lastCharPos == null) { this.lastCharPos = new Stopwatch(); }
            this.lastCharPos.Restart();

            //Debug.WriteLine("N3: X: {0} Y: {1} Z: {2}", e.X, e.Y, e.Z);
            this.curCharacterPos = e;
            this.outgoingEvents.Enqueue(new hEvents.CharacterPositionEventArgs(
                e.ProcessId,
                e.ServerID,
                e.DynelType,
                e.DynelID,
                e.ZoneID,
                e.ZoneName,
                e.InShadowlands,
                e.X,
                e.Y,
                e.Z,
                e.Time));
        }
示例#2
0
        private void ProcessBridgeEvents(bEvents.BridgeEventArgs e)
        {
            Debug.WriteLine("Type: {0}", e.EventType);

            switch (e.EventType)
            {
                case BridgeEventType.CharacterPosition:
                    this.ProcessCharacterPositionEvent(e as bEvents.DynelPositionEventArgs);
                    break;
                case BridgeEventType.DynelName:
                    this.outgoingEvents.Enqueue(new hEvents.DynelNameEventArgs(e as bEvents.DynelNameEventArgs));
                    break;
                case BridgeEventType.Debug:
                    this.outgoingEvents.Enqueue(new hEvents.DebugEventArgs(e as bEvents.DebugEventArgs));
                    break;
                case BridgeEventType.HookStateChange:
                    this.outgoingEvents.Enqueue(new hEvents.HookStateChangeEventArgs(e as bEvents.HookStateChangeEventArgs));
                    break;
                case BridgeEventType.QuestLocation:
                    this.outgoingEvents.Enqueue(new hEvents.QuestLocationEventArgs(e as bEvents.QuestLocationEventArgs));
                    break;
                case BridgeEventType.ServerID:
                    this.outgoingEvents.Enqueue(new hEvents.ServerIdEventArgs(e as bEvents.ServerIdEventArgs));
                    break;
                case BridgeEventType.CharacterLogin:
                    this.outgoingEvents.Enqueue(new hEvents.CharacterLoginEventArgs(e as bEvents.CharacterLoginEventArgs));
                    break;
                case BridgeEventType.CharacterLogout:
                    this.outgoingEvents.Enqueue(new hEvents.CharacterLogoutEventArgs(e as bEvents.CharacterLogoutEventArgs));
                    break;
            }
        }