Exemplo n.º 1
0
        private static bool ClientLoadoutValid(int connectionId)
        {
            var conn = NetworkServer.connections[connectionId];

            if (conn != null)
            {
                var player = NetworkMatch.m_player_loadout_data[conn.connectionId];
                if (player != null)
                {
                    return(MPModifiers.PlayerModifiersValid(player.m_mp_modifier1, player.m_mp_modifier2));
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 public static void UpdateLobbyStatus()
 {
     if (!MPModifiers.PlayerModifiersValid(Player.Mp_modifier1, Player.Mp_modifier2))
     {
         if (Array.IndexOf(MenuManager.m_mp_status_id, 20) == -1)
         {
             MenuManager.AddMpStatus("MODIFIER(S) DISALLOWED, CHECK CUSTOMIZE MENU", 1f, 20);
         }
     }
     else
     {
         var idx = Array.IndexOf(MenuManager.m_mp_status_id, 20);
         if (idx >= 0)
         {
             MenuManager.m_mp_status_details[idx] = String.Empty;
             MenuManager.m_mp_status_flash[idx]   = 0f;
             MenuManager.m_mp_status_id[idx]      = -1;
         }
     }
 }
Exemplo n.º 3
0
            static void Prefix()
            {
                if (!Overload.NetworkManager.IsServer())
                {
                    return;
                }

                bool[] serverFilters = new bool[8];
                RUtility.BitmaskToBoolArray(MPModPrivateData.ModifierFilterMask, ref serverFilters);

                foreach (var player in NetworkMatch.m_player_loadout_data.Where(x => x.Key > 0))
                {
                    if (!MPModifiers.PlayerModifiersValid(player.Value.m_mp_modifier1, player.Value.m_mp_modifier2))
                    {
                        var conn = NetworkServer.connections[player.Key];
                        if (conn != null)
                        {
                            NetworkServer.SendToClient(conn.connectionId, 86, new StringMessage("This match has disabled modifiers: " + GetDisabledModifiers()));
                            NetworkMatch.RemoveConnectionId(conn.connectionId);
                            GameManager.m_gm.StartCoroutine(DisconnectCoroutine(conn.connectionId));
                        }
                    }
                }
            }
Exemplo n.º 4
0
        static bool DrawLast(UIElement uie)
        {
            if (MenuManager.m_menu_micro_state != 0)
            {
                return(MenuManager.m_menu_micro_state == 1 ? DrawLastQuit(uie) : true);
            }
            Vector2 position;

            position.x = 0f;
            position.y = 170f + 62f * 2;
            //uie.DrawMenuSeparator(position - Vector2.up * 40f);
            bool flag = NetworkMatch.m_last_lobby_status != null && NetworkMatch.m_last_lobby_status.m_can_start_now && MPModifiers.PlayerModifiersValid(Player.Mp_modifier1, Player.Mp_modifier2);

            uie.SelectAndDrawCheckboxItem(Loc.LS("START MATCH NOW"), position - Vector2.right * 250f, 0, MenuManager.m_mp_ready_to_start && flag,
                                          !flag || MenuManager.m_mp_ready_vote_timer > 0f, 0.75f, -1);
            //position.y += 62f;
            uie.SelectAndDrawItem(Loc.LS("CUSTOMIZE"), position + Vector2.right * 250f, 1, false, 0.75f, 0.75f);
            position.y += 62f;
            uie.SelectAndDrawItem(Loc.LS("OPTIONS"), position - Vector2.right * 250f, 2, false, 0.75f, 0.75f);
            //position.y += 62f;
            uie.SelectAndDrawItem(Loc.LS("MULTIPLAYER MENU"), position + Vector2.right * 250f, 100, false, 0.75f, 0.75f);
            return(false);
        }