Exemple #1
0
        static void Postfix(ref IReadOnlyList <IConnectedPlayer> __result)
        {
            StackTrace stackTrace = new StackTrace();
            string     methodName = stackTrace.GetFrame(2).GetMethod().Name;

            if (methodName == "BindTimeline")
            {
                if (__result.Any(player => player.isMe))
                {
                    List <IConnectedPlayer> nonLocalPlayers = __result.Where(player => !player.isMe).ToList();
                    IConnectedPlayer        localPlayer     = __result.First(player => player.isMe);
                    __result = nonLocalPlayers.Skip((IntroAnimationPatch.targetIterations - 1) * 4).Take(4).ToList();
                    if (IntroAnimationPatch.targetIterations == 1)
                    {
                        __result = __result.AddItem(localPlayer).ToList();
                    }
                }
                else
                {
                    __result = __result.Skip((IntroAnimationPatch.targetIterations - 1) * 4).Take(4).ToList();
                }
            }
            else if (methodName == "BindOutroTimeline")
            {
                __result = __result.Take(4).ToList();
            }
        }