Exemple #1
0
        private static void Postfix()
        {
            if (!GameplayManager.IsDedicatedServer())
            {
                return;
            }
            Debug.Log("MPTweaksLoadScene");
            RobotManager.ReadMultiplayerModeFile();
            Debug.Log("MPTweaks loaded mode file");
            var tweaks = new Dictionary <string, string>()
            {
            };

            if (NetworkMatch.GetMode() == CTF.MatchModeCTF)
            {
                tweaks.Add("ctf.returntimer", CTF.ReturnTimeAmountDefault.ToStringInvariantCulture());
            }
            if (!MPCustomModeFile.PickupCheck)
            {
                tweaks.Add("item.pickupcheck", Boolean.FalseString);
            }
            tweaks.Add("nocompress.reliable_timestamps", Boolean.TrueString);
            if (tweaks.Any())
            {
                Debug.LogFormat("MPTweaks: sending tweaks {0}", tweaks.Join());
                MPTweaks.Set(tweaks);
                MPTweaks.Send();
            }
        }
Exemple #2
0
        private static void Postfix()
        {
            if (!GameplayManager.IsDedicatedServer())
            {
                return;
            }
            Debug.Log("MPTweaksLoadScene");
            RobotManager.ReadMultiplayerModeFile();
            Debug.Log("MPTweaks loaded mode file");
            bool nobodySupportsProj = !NetworkMatch.m_players.Keys.Any(connId =>
                                                                       MPTweaks.ClientInfos.TryGetValue(connId, out var clientInfo) &&
                                                                       clientInfo.SupportsTweaks.Contains("proj"));
            var tweaks = new Dictionary <string, string>()
            {
            };

            if (nobodySupportsProj) // use stock hunters for all stock client match
            {
                Debug.LogFormat("MPTweaks: not tweaking hunter: unsupported by all clients");
            }
            else
            {
                tweaks.Add("proj.missile_hunter.m_init_speed_min", "17.5");
            }
            if (NetworkMatch.GetMode() == CTF.MatchModeCTF)
            {
                tweaks.Add("ctf.returntimer", CTF.ReturnTimeAmountDefault.ToStringInvariantCulture());
            }
            if (!MPCustomModeFile.PickupCheck)
            {
                tweaks.Add("item.pickupcheck", Boolean.FalseString);
            }
            if (tweaks.Any())
            {
                Debug.LogFormat("MPTweaks: sending tweaks {0}", tweaks.Join());
                MPTweaks.Set(tweaks);
                MPTweaks.Send();
            }
        }