Eh, this is (probably) why server browser map search doesn't work...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • [SAJ]Sentinel

    #1

    Eh, this is (probably) why server browser map search doesn't work...

    So, when we make a search, BF2 connects to certain server/port combination, and sends certain packets.

    Inside, there is a part of SQL command (which probably gets integrated with the rest of hardcoded SQL statement).

    SQL query looks like (I have "unwrapped it, for easier reading):

    Code:
    bf2_ranked = 1
    and bf2_anticheat = 1
    and (bf2_mapsize = 16 or bf2_mapsize = 32 or bf2_mapsize = 64)
    and gamever = '1.1.2696-528.0'
    and  
    and mapname like '%strike%'
    Empty "and " statement (2nd row from the bottom), most likely, generate SQL error on their side, so we get no results back. I am not sure what SQL server they use, and I can't be bothered to try the "and and" on MySQL right now, but I think SQL spec won't allow 2 consecutive AND statements, and will fail.

    DICE, please hire someone who knows what he/she is doing. Pretty please? :)

    (if someone has access to M$ SQL, which is what I think BF2 db uses, try some dummy statement with 2 ANDs one after another, and see if it bombs).
  • R0man

    #2
    Re: Eh, this is (probably) why server browser map search doesn't work...

    Intersting, I wonder if it could really be that simple.

    Nice find btw.

    Comment

    • vbl

      #3
      Re: Eh, this is (probably) why server browser map search doesn't work...

      Actually, the map filter works fine as long as you only enter 1-3 letters.

      Comment

      • RagingPigeons

        #4
        Re: Eh, this is (probably) why server browser map search doesn't work...

        Excellent detective work Sentinel.

        Comment

        • [SAJ]Sentinel

          #5
          Re: Eh, this is (probably) why server browser map search doesn't work...

          Originally posted by ||bfa||variable
          Actually, the map filter works fine as long as you only enter 1-3 letters.
          Wish it would be true.

          Tried just about any combination of things (including trying to 'recraft' SQL query), as well as 1-3 letter thingie, but I never get anything back no matter what I enter into "map name" field.

          Does it REALLY work for you, search on map name?

          Comment

          • vbl

            #6
            Re: Eh, this is (probably) why server browser map search doesn't work...

            Originally posted by [SAJ]Sentinel
            Wish it would be true.

            Tried just about any combination of things (including trying to 'recraft' SQL query), as well as 1-3 letter thingie, but I never get anything back no matter what I enter into "map name" field.

            Does it REALLY work for you, search on map name?
            It did in 1.12 - I'll have to test in 1.2.

            I used to enter "Str" for Strike at Karkand and got results. If I entered more, less, or even "Kar" it never worked.

            Comment

            • [SAJ]Sentinel

              #7
              Re: Eh, this is (probably) why server browser map search doesn't work...

              Originally posted by ||bfa||variable
              It did in 1.12 - I'll have to test in 1.2.

              I used to enter "Str" for Strike at Karkand and got results. If I entered more, less, or even "Kar" it never worked.
              Ah, I see :)

              You don't need to test it, just trust all the others who tested it already and found out it's screwed with 1.2 patch

              It seems as if one of their "improvements" in 1.2 browser was ability to search on a string by adding % (SQL wildcards) around the string, so "kar" would return karkand maps as well. Before you always had to search on beggining of the map name (Dal, Stri, Daqin, etc).

              I actually posted this topic in hope that maybe some DICE employees read this forum, so they'd say "Look, even they found out how stupid the bug is - let's make a hotfix and not embarass ourselves more than needed".

              Wishful thinking

              Comment

              • troybob
                Member
                • Sep 2007
                • 2823

                #8
                Re: Eh, this is (probably) why server browser map search doesn't work...

                try unchecking all your map size filters

                no map can be 16 and 32 and 64 all at the same time =)

                Comment

                • [SAJ]Sentinel

                  #9
                  Re: Eh, this is (probably) why server browser map search doesn't work...

                  Originally posted by troybob
                  try unchecking all your map size filters

                  no map can be 16 and 32 and 64 all at the same time =)
                  Naaaah! It remained there because I was desparate and tried various combinations of checkboxes. Won't matter, since they're OR-ing it, so it would return everything anyway. Doesn't work with "default" settings either (all map sizes unchecked).

                  Now that I think of it, EA/GAMESPY/DICE/WHOEVER could fix this on server side, without a patch.

                  They'd just need to add some sanity checking in the program that receives the query, and discard stupid parts of the statement coming in (substitute "and<2 spaces>and" with "and") and execute SQL query.

                  EA/GAMESPY/WHOEVER - pretty please? :cry:

                  Damn, I really miss search by map name feature...

                  EDIT: Anyway, point made, won't spam this w/ my replies anymore. Sorry guys.

                  Comment

                  • troybob
                    Member
                    • Sep 2007
                    • 2823

                    #10
                    Re: Eh, this is (probably) why server browser map search doesn't work...

                    i think your allowed to spam your own thread

                    didn't see those or's (i read too fast sometimes)

                    but i still have more success when i uncheck them all.

                    Comment

                    • The Soup Nazi

                      #11
                      Re: Eh, this is (probably) why server browser map search doesn't work...

                      Just ran a similar query against a MySQL database using the two "AND" syntax. This is what was returned:

                      SELECT *
                      FROM `someTable`
                      WHERE user_login LIKE '%blah%'
                      AND user_url LIKE '%blah%'
                      AND
                      AND display_name LIKE '%someUsername%'

                      MySQL said: Documentation
                      #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND display_name LIKE '%someUsername%'

                      Comment

                      Working...