Code Monkey home page Code Monkey logo

Comments (4)

uakfdotb avatar uakfdotb commented on August 9, 2024

Overridden map game type -- are you setting bot_mapgametype in ghost.cfg? It shouldn't be overridden, the code looks like this (bnet.cpp):

uint32_t MapGameType = map->GetMapGameType( );
MapGameType |= MAPGAMETYPE_UNKNOWN0;
//Apply overwrite if not equal to 0
MapGameType = ( m_GHost->m_MapGameType != 0 ) ? MapGameType : m_GHost->m_MapGameType;

if( state == GAME_PRIVATE )
	MapGameType |= MAPGAMETYPE_PRIVATEGAME;

So initially MapGameType is set based on the map, but if m_GHost->m_MapGameType is nonzero, then m_GHost->m_MapGameType is used.

It might be useful to debug a bit what caused the overriding problem since that may be related to the second issue. You could add a CONSOLE_Print statement after the code above to print MapGameType, m_GHost->m_MapGameType, and map->GetMapGameType( ).

Note: you may want to convert the number to binary so you can see exactly what flags are getting set. You can just google "XYZ in binary".

For map authorized error, one way to debug it would be to see what the map game type reported by actual WC3 client is. So you run Wireshark, host the map in WC3 client, and then look for the SID_STARTADVEX3 TCP packets, which should start with 0xFF (header constant) and then 0x1C (SID_STARTADVEX3).

Another thing to check is map_path should be something like Maps(2)BootyBay.w3m; it should not be in Maps\Download, and should use backslashes.

Also, do you get "failed to authorize the map" if you use a map configuration file like this, without overriding the map game type?

map_path = Maps\(2)BootyBay.w3m
map_localpath = (2)BootyBay.w3m
map_options = 4

# blizzard maker
map_filter_maker = 2

# melee map
map_filter_type = 1

Note that the map_filter_maker option makes GHost++ automatically compute a map game type that includes the (1 << 14) MAPGAMETYPE_MAKERBLIZZARD flag, which is probably the flag in the map game type that makes it show up more often (perhaps gets put in a different bucket of games, and shows up just because so few games with Blizzard maps are being hosted).

from ghostpp.

marciii avatar marciii commented on August 9, 2024

Hi,

first of all: thanks for your great work!
I'm a little bit busy at the moment, but i try to answer as fast as possible.

I think I found the bug which causes the overwriting of the mapgametype:

MapGameType = ( m_GHost->m_MapGameType != 0 ) ? MapGameType : m_GHost->m_MapGameType;

This line checks if m_GHost->m_MapGameType is NOT zero. And if thats true (so if it doesnt equal zero) it will be overwritten by the MapGameType (which is the return value from the GetMapGameType Function). However if it's zero, it will remain zero - which doesn't make sense, does it? I think it should be the other way around, like this:
MapGameType = ( m_GHost->m_MapGameType != 0 ) ? m_GHost->m_MapGameType : MapGameType;
Thats probably the reason the bot doesn't apply the mapgametype from the config file.

Also I tried the mapconfig details you provided: One can join the games, so there's no issue. But it's not really visible then.

I also tried sniffing out the packet, but I don't really know how to read it out properly. Should be this one:
https://pastebin.com/1jUzM1XP
"test1212" is the gamename. But where can I readout the mapgametype?

Again: Thank you!

from ghostpp.

marciii avatar marciii commented on August 9, 2024

Okay it is solved now. My issue was the structure of the maps directory. Apparently it has to be the exact same as it is in the wc3 installation directory. Then the players are able to join and stay - the "failed to authorize the map" error doesn't appear anymore.
But it's probably still useful to swap the parameters in line 2281, then the bot applies what is written in the ghost.cfg.

from ghostpp.

uakfdotb avatar uakfdotb commented on August 9, 2024

Ah oops... thanks for the fix (I committed it)!

from ghostpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.