Esempio n. 1
0
        // 실제 데이터 처리 하는 곳
        private void PacketWorker_OnEventReceived(string pid, GameEvents gameevent, int[] args)
        {
            var text = pid + "|" + gameevent + "|";
            var pos  = 0;

            var isfate = false;

            switch (gameevent)
            {
            case GameEvents.InstanceEnter:                          // [0] = instance code
            case GameEvents.InstanceLeave:
            {
                if (args.Length > 0)
                {
                    text += GameData.GetInstanceName(args[0]) + "|";
                    pos++;
                }

                _frmOverlay.EventNone();
            }
            break;

            case GameEvents.FateOccur:                              // [0] = fate code
            {
                var fate = GameData.GetFate(args[0]);
                text += fate.Name + "|" + fate.Area.Name + "|";
                pos++;

                // 모든 페이트를 골라도 목록에 있는것만 알려줌
                if (Settings.SelectedFates.Contains(args[0].ToString()))
                {
                    _frmOverlay.EventFate(fate);
                    if (_use_notify)
                    {
                        NotifyFate(fate);
                    }
                    PlayEffectSound();
                }

                isfate = true;
            }
            break;

            case GameEvents.MatchQueue:                             // [0] = MatchType, [1] = code, [...] = instances
            {
                var type = (MatchType)args[0];

                text += type + "|";
                pos++;

                switch (type)
                {
                case MatchType.Roulette:
                    var roulette = GameData.GetRoulette(args[1]);

                    text += roulette.Name + "|";
                    pos++;

                    _frmOverlay.EventRoulette(roulette);

                    break;

                case MatchType.Assignment:
                    text += args[1] + "|";
                    pos++;

                    var p = pos;
                    for (var i = p; i < args.Length; i++)
                    {
                        text += GameData.GetInstanceName(args[i]) + "|";
                        pos++;
                    }

                    _frmOverlay.EventStatus(args[1]);

                    break;
                }
            }
            break;

            case GameEvents.MatchDone:                              // [0] = roulette code, [1] = instance code
            {
                var roulette = GameData.GetRoulette(args[0]);
                var instance = GameData.GetInstance(args[1]);

                text += roulette.Name + "|";
                pos++;
                text += instance.Name + "|";
                pos++;

                _frmOverlay.EventMatch(instance);
                if (_use_notify)
                {
                    NotifyDuty(instance);
                }
                PlayEffectSound();
            }
            break;

            case GameEvents.MatchCancel:
                _frmOverlay.StopBlink();
                break;
            }

            for (var i = pos; i < args.Length; i++)
            {
                text += args[i] + "|";
            }

            if (isfate)
            {
                text += args[0] + "|";
            }

            ActGlobals.oFormActMain.ParseRawLogLine(false, DateTime.Now, "00|" + DateTime.Now.ToString("O") + "|0048|F|" + text);
        }
Esempio n. 2
0
        // 실제 데이터 처리 하는 곳
        private void PacketFFXIV_OnEventReceived(int pid, GameEvents gameevent, int[] args)
        {
            var clienttype = _pronets[pid].ClientType;
            var text       = pid + "|" + clienttype + "|" + gameevent + "|";
            var pos        = 0;
            var isFate     = false;

            switch (gameevent)
            {
            case GameEvents.InstanceEnter:          // [0] = instance code
            case GameEvents.InstanceLeave:
            {
                if (args.Length > 0)
                {
                    text += GameData.GetInstanceName(args[0]) + "|";
                    pos++;
                }

                _frmOverlay.EventNone();
            }
            break;

            case GameEvents.FateBegin:              // [0] = fate code
            {
                var fate = GameData.GetFate(args[0]);

                isFate = true;
                text  += fate.Name + "|" + fate.Area.Name + "|";
                pos++;

                if (Settings.SelectedFates.Contains(args[0].ToString()))            // 모든 페이트를 골라도 목록에 있는것만 알려줌
                {
                    _frmOverlay.EventFate(GameData.GetFate(args[0]));
                    PlayEffectSound();
                }
            }
            break;

            case GameEvents.FateProgress:           // [0] = fate code, [1] = progress
            case GameEvents.FateEnd:                // [0] = fate code, [1] = status(?)
            {
                var fate = GameData.GetFate(args[0]);

                isFate = true;
                text  += fate.Name + "|" + fate.Area.Name + "|";
                pos++;
            }
            break;

            case GameEvents.MatchBegin:             // [0] = match type(0,1), [1] = roulette code or instance count, [...] = instance
            {
                text += (MatchType)args[0] + "|";
                pos++;

                switch ((MatchType)args[0])
                {
                case MatchType.Roulette:
                    var roulette = GameData.GetRoulette(args[1]);

                    text += roulette.Name + "|";
                    pos++;

                    _frmOverlay.EventRoulette(roulette);

                    break;

                case MatchType.Assignment:
                    text += args[1] + "|";
                    pos++;

                    var p = pos;
                    for (var i = p; i < args.Length; i++)
                    {
                        text += GameData.GetInstanceName(args[i]) + "|";
                        pos++;
                    }

                    _frmOverlay.EventStatus(args[1]);

                    break;
                }
            }
            break;

            case GameEvents.MatchEnd:               // [0] = end reason <MatchEndType>
            {
                text += (MatchResult)args[0] + "|";
                pos++;

#if false
                if (Settings.UseOverlay)
                {
                    var mres = (MatchResult)args[0];
                    if (mres == MatchResult.Enter)
                    {
                        _frmOverlay.Hide();
                    }
                    else
                    {
                        _frmOverlay.Show();
                    }
                }
#endif

                _frmOverlay.EventNone();
            }
            break;

            case GameEvents.MatchOrder:             // [0] = order
                _frmOverlay.EventStatus(args[0]);
                break;

            case GameEvents.MatchStatus:            // [0] = match type(2,3), [1] = instance code, [2] = status
                                                    // [3] = tank, [4] = healer, [5] = dps
            {
                if ((MatchType)args[0] == MatchType.ShortStatus)
                {
                    // 5.1 이전
                    var instance = GameData.GetInstance(args[1]);

                    text += instance.Name + "|";
                    pos++;

                    _frmOverlay.EventStatus(instance, args[3], args[4], args[5]);
                }
                else
                {
                    // 5.1 부터   [6] = maxtank, [7] = maxhealer, [8] = maxdps
                    _frmOverlay.EventStatus(args[3], args[4], args[5], args[6], args[7], args[8]);
                }
            }
            break;

            case GameEvents.MatchDone:              // [0] = roulette code, [1] = instance code
            {
                var roulette = GameData.GetRoulette(args[0]);
                var instance = GameData.GetInstance(args[1]);

                text += roulette.Name + "|";
                pos++;
                text += instance.Name + "|";
                pos++;

                _frmOverlay.EventMatch(instance);
                PlayEffectSound();
            }
            break;

            case GameEvents.MatchCancel:
                _frmOverlay.StopBlink();
                break;
            }

            for (var i = pos; i < args.Length; i++)
            {
                text += args[i] + "|";
            }

            if (isFate)
            {
                text += args[0] + "|";
            }

            ActGlobals.oFormActMain.ParseRawLogLine(false, DateTime.Now, "00|" + DateTime.Now.ToString("O") + "|0048|F|" + text);
        }