Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed the "GameType" value being set incorrectly (using Strilanc's sp…

…ecification, thanks again!)

you can now specify the map filters that should apply to the games your bot creates
removed map config value map_gametype (its functionality has been replaced by map_options in a previous revision)
added map config value map_filter_maker
added map config value map_filter_type
added map config value map_filter_size
added map config value map_filter_obs

git-svn-id: http://ghostplusplus.googlecode.com/svn/trunk@419 a7494f72-a4b0-11dd-a887-7ffe1a420f8d
  • Loading branch information...
commit 9a58a681ff0366ab5a63f7865c539b7bd5b114d3 1 parent 39f0d77
hogantp authored
View
31 ghost/bnet.cpp
@@ -2321,8 +2321,6 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
if( m_LoggedIn && map )
{
- BYTEARRAY MapGameType;
-
// construct a fixed host counter which will be used to identify players from this realm
// the fixed host counter's 4 most significant bits will contain a 4 bit ID (0-15)
// the rest of the fixed host counter will contain the 28 least significant bits of the actual host counter
@@ -2332,14 +2330,14 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
uint32_t FixedHostCounter = ( hostCounter & 0x0FFFFFFF ) | ( m_HostCounterID << 28 );
- // construct the correct SID_STARTADVEX3 packet
-
if( saveGame )
{
- MapGameType.push_back( 0 );
- MapGameType.push_back( 10 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
+ uint32_t MapGameType = MAPGAMETYPE_SAVEDGAME;
+
+ // the state should always be private when creating a saved game
+
+ if( state == GAME_PRIVATE )
+ MapGameType |= MAPGAMETYPE_PRIVATEGAME;
// use an invalid map width/height to indicate reconnectable games
@@ -2351,16 +2349,17 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
MapHeight.push_back( 7 );
if( m_GHost->m_Reconnect )
- m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, MapGameType, map->GetMapGameFlags( ), MapWidth, MapHeight, gameName, hostName, upTime, "Save\\Multiplayer\\" + saveGame->GetFileNameNoPath( ), saveGame->GetMagicNumber( ), map->GetMapSHA1( ), FixedHostCounter ) );
+ m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, UTIL_CreateByteArray( MapGameType, false ), map->GetMapGameFlags( ), MapWidth, MapHeight, gameName, hostName, upTime, "Save\\Multiplayer\\" + saveGame->GetFileNameNoPath( ), saveGame->GetMagicNumber( ), map->GetMapSHA1( ), FixedHostCounter ) );
else
- m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, MapGameType, map->GetMapGameFlags( ), UTIL_CreateByteArray( (uint16_t)0, false ), UTIL_CreateByteArray( (uint16_t)0, false ), gameName, hostName, upTime, "Save\\Multiplayer\\" + saveGame->GetFileNameNoPath( ), saveGame->GetMagicNumber( ), map->GetMapSHA1( ), FixedHostCounter ) );
+ m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, UTIL_CreateByteArray( MapGameType, false ), map->GetMapGameFlags( ), UTIL_CreateByteArray( (uint16_t)0, false ), UTIL_CreateByteArray( (uint16_t)0, false ), gameName, hostName, upTime, "Save\\Multiplayer\\" + saveGame->GetFileNameNoPath( ), saveGame->GetMagicNumber( ), map->GetMapSHA1( ), FixedHostCounter ) );
}
else
{
- MapGameType.push_back( map->GetMapGameType( ) );
- MapGameType.push_back( 32 );
- MapGameType.push_back( 73 );
- MapGameType.push_back( 0 );
+ uint32_t MapGameType = map->GetMapGameType( );
+ MapGameType |= MAPGAMETYPE_UNKNOWN0;
+
+ if( state == GAME_PRIVATE )
+ MapGameType |= MAPGAMETYPE_PRIVATEGAME;
// use an invalid map width/height to indicate reconnectable games
@@ -2372,9 +2371,9 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
MapHeight.push_back( 7 );
if( m_GHost->m_Reconnect )
- m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, MapGameType, map->GetMapGameFlags( ), MapWidth, MapHeight, gameName, hostName, upTime, map->GetMapPath( ), map->GetMapCRC( ), map->GetMapSHA1( ), FixedHostCounter ) );
+ m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, UTIL_CreateByteArray( MapGameType, false ), map->GetMapGameFlags( ), MapWidth, MapHeight, gameName, hostName, upTime, map->GetMapPath( ), map->GetMapCRC( ), map->GetMapSHA1( ), FixedHostCounter ) );
else
- m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, MapGameType, map->GetMapGameFlags( ), map->GetMapWidth( ), map->GetMapHeight( ), gameName, hostName, upTime, map->GetMapPath( ), map->GetMapCRC( ), map->GetMapSHA1( ), FixedHostCounter ) );
+ m_OutPackets.push( m_Protocol->SEND_SID_STARTADVEX3( state, UTIL_CreateByteArray( MapGameType, false ), map->GetMapGameFlags( ), map->GetMapWidth( ), map->GetMapHeight( ), gameName, hostName, upTime, map->GetMapPath( ), map->GetMapCRC( ), map->GetMapSHA1( ), FixedHostCounter ) );
}
}
}
View
23 ghost/game.cpp
@@ -1434,31 +1434,26 @@ bool CGame :: EventPlayerBotCommand( CGamePlayer *player, string command, string
// so if we try to send accurate numbers it'll always be off by one and results in Warcraft 3 assuming the game is full when it still needs one more player
// the easiest solution is to simply send 12 for both so the game will always show up as (1/12) players
- BYTEARRAY MapGameType;
-
- // construct the correct W3GS_GAMEINFO packet
-
if( m_SaveGame )
{
- MapGameType.push_back( 0 );
- MapGameType.push_back( 2 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
+ // note: the PrivateGame flag is not set when broadcasting to LAN (as you might expect)
+
+ uint32_t MapGameType = MAPGAMETYPE_SAVEDGAME;
BYTEARRAY MapWidth;
MapWidth.push_back( 0 );
MapWidth.push_back( 0 );
BYTEARRAY MapHeight;
MapHeight.push_back( 0 );
MapHeight.push_back( 0 );
- m_GHost->m_UDPSocket->SendTo( IP, Port, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, MapGameType, m_Map->GetMapGameFlags( ), MapWidth, MapHeight, m_GameName, "Varlock", GetTime( ) - m_CreationTime, "Save\\Multiplayer\\" + m_SaveGame->GetFileNameNoPath( ), m_SaveGame->GetMagicNumber( ), 12, 12, m_HostPort, m_HostCounter ) );
+ m_GHost->m_UDPSocket->SendTo( IP, Port, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, UTIL_CreateByteArray( MapGameType, false ), m_Map->GetMapGameFlags( ), MapWidth, MapHeight, m_GameName, "Varlock", GetTime( ) - m_CreationTime, "Save\\Multiplayer\\" + m_SaveGame->GetFileNameNoPath( ), m_SaveGame->GetMagicNumber( ), 12, 12, m_HostPort, m_HostCounter ) );
}
else
{
- MapGameType.push_back( m_Map->GetMapGameType( ) );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- m_GHost->m_UDPSocket->SendTo( IP, Port, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, MapGameType, m_Map->GetMapGameFlags( ), m_Map->GetMapWidth( ), m_Map->GetMapHeight( ), m_GameName, "Varlock", GetTime( ) - m_CreationTime, m_Map->GetMapPath( ), m_Map->GetMapCRC( ), 12, 12, m_HostPort, m_HostCounter ) );
+ // note: the PrivateGame flag is not set when broadcasting to LAN (as you might expect)
+ // note: we do not use m_Map->GetMapGameType because none of the filters are set when broadcasting to LAN (also as you might expect)
+
+ uint32_t MapGameType = MAPGAMETYPE_UNKNOWN0;
+ m_GHost->m_UDPSocket->SendTo( IP, Port, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, UTIL_CreateByteArray( MapGameType, false ), m_Map->GetMapGameFlags( ), m_Map->GetMapWidth( ), m_Map->GetMapHeight( ), m_GameName, "Varlock", GetTime( ) - m_CreationTime, m_Map->GetMapPath( ), m_Map->GetMapCRC( ), 12, 12, m_HostPort, m_HostCounter ) );
}
}
}
View
50 ghost/game_base.cpp
@@ -460,8 +460,6 @@ bool CBaseGame :: Update( void *fd, void *send_fd )
if( !m_CountDownStarted )
{
- BYTEARRAY MapGameType;
-
// construct a fixed host counter which will be used to identify players from this "realm" (i.e. LAN)
// the fixed host counter's 4 most significant bits will contain a 4 bit ID (0-15)
// the rest of the fixed host counter will contain the 28 least significant bits of the actual host counter
@@ -471,29 +469,26 @@ bool CBaseGame :: Update( void *fd, void *send_fd )
uint32_t FixedHostCounter = m_HostCounter & 0x0FFFFFFF;
- // construct the correct W3GS_GAMEINFO packet
-
if( m_SaveGame )
{
- MapGameType.push_back( 0 );
- MapGameType.push_back( 2 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
+ // note: the PrivateGame flag is not set when broadcasting to LAN (as you might expect)
+
+ uint32_t MapGameType = MAPGAMETYPE_SAVEDGAME;
BYTEARRAY MapWidth;
MapWidth.push_back( 0 );
MapWidth.push_back( 0 );
BYTEARRAY MapHeight;
MapHeight.push_back( 0 );
MapHeight.push_back( 0 );
- m_GHost->m_UDPSocket->Broadcast( 6112, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, MapGameType, m_Map->GetMapGameFlags( ), MapWidth, MapHeight, m_GameName, "Varlock", GetTime( ) - m_CreationTime, "Save\\Multiplayer\\" + m_SaveGame->GetFileNameNoPath( ), m_SaveGame->GetMagicNumber( ), 12, 12, m_HostPort, FixedHostCounter ) );
+ m_GHost->m_UDPSocket->Broadcast( 6112, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, UTIL_CreateByteArray( MapGameType, false ), m_Map->GetMapGameFlags( ), MapWidth, MapHeight, m_GameName, "Varlock", GetTime( ) - m_CreationTime, "Save\\Multiplayer\\" + m_SaveGame->GetFileNameNoPath( ), m_SaveGame->GetMagicNumber( ), 12, 12, m_HostPort, FixedHostCounter ) );
}
else
{
- MapGameType.push_back( m_Map->GetMapGameType( ) );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- m_GHost->m_UDPSocket->Broadcast( 6112, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, MapGameType, m_Map->GetMapGameFlags( ), m_Map->GetMapWidth( ), m_Map->GetMapHeight( ), m_GameName, "Varlock", GetTime( ) - m_CreationTime, m_Map->GetMapPath( ), m_Map->GetMapCRC( ), 12, 12, m_HostPort, FixedHostCounter ) );
+ // note: the PrivateGame flag is not set when broadcasting to LAN (as you might expect)
+ // note: we do not use m_Map->GetMapGameType because none of the filters are set when broadcasting to LAN (also as you might expect)
+
+ uint32_t MapGameType = MAPGAMETYPE_UNKNOWN0;
+ m_GHost->m_UDPSocket->Broadcast( 6112, m_Protocol->SEND_W3GS_GAMEINFO( m_GHost->m_TFT, m_GHost->m_LANWar3Version, UTIL_CreateByteArray( MapGameType, false ), m_Map->GetMapGameFlags( ), m_Map->GetMapWidth( ), m_Map->GetMapHeight( ), m_GameName, "Varlock", GetTime( ) - m_CreationTime, m_Map->GetMapPath( ), m_Map->GetMapCRC( ), 12, 12, m_HostPort, FixedHostCounter ) );
}
}
@@ -3300,28 +3295,25 @@ void CBaseGame :: EventGameStarted( )
m_Replay->SetSelectMode( m_Map->GetMapLayoutStyle( ) );
m_Replay->SetStartSpotCount( m_Map->GetMapNumPlayers( ) );
- /*
-
- BYTEARRAY MapGameType;
-
if( m_SaveGame )
{
- MapGameType.push_back( 0 );
- MapGameType.push_back( 2 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
+ uint32_t MapGameType = MAPGAMETYPE_SAVEDGAME;
+
+ if( m_GameState == GAME_PRIVATE )
+ MapGameType |= MAPGAMETYPE_PRIVATEGAME;
+
+ m_Replay->SetMapGameType( MapGameType );
}
else
{
- MapGameType.push_back( m_Map->GetMapGameType( ) );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- MapGameType.push_back( 0 );
- }
+ uint32_t MapGameType = m_Map->GetMapGameType( );
+ MapGameType |= MAPGAMETYPE_UNKNOWN0;
- */
+ if( m_GameState == GAME_PRIVATE )
+ MapGameType |= MAPGAMETYPE_PRIVATEGAME;
- m_Replay->SetMapGameType( m_Map->GetMapGameType( ) );
+ m_Replay->SetMapGameType( MapGameType );
+ }
if( !m_Players.empty( ) )
{
View
92 ghost/map.cpp
@@ -49,7 +49,10 @@ CMap :: CMap( CGHost *nGHost )
m_MapVisibility = MAPVIS_DEFAULT;
m_MapObservers = MAPOBS_NONE;
m_MapFlags = MAPFLAG_TEAMSTOGETHER | MAPFLAG_FIXEDTEAMS;
- m_MapGameType = 9;
+ m_MapFilterMaker = MAPFILTER_MAKER_BLIZZARD;
+ m_MapFilterType = MAPFILTER_TYPE_MELEE;
+ m_MapFilterSize = MAPFILTER_SIZE_LARGE;
+ m_MapFilterObs = MAPFILTER_OBS_NONE;
m_MapOptions = MAPOPT_MELEE;
m_MapWidth = UTIL_ExtractNumbers( "172 0", 2 );
m_MapHeight = UTIL_ExtractNumbers( "172 0", 2 );
@@ -155,6 +158,81 @@ BYTEARRAY CMap :: GetMapGameFlags( )
return UTIL_CreateByteArray( GameFlags, false );
}
+uint32_t CMap :: GetMapGameType( )
+{
+ /* spec stolen from Strilanc as follows:
+
+ Public Enum GameTypes As UInteger
+ None = 0
+ Unknown0 = 1 << 0 '[always seems to be set?]
+
+ '''<summary>Setting this bit causes wc3 to check the map and disc if it is not signed by Blizzard</summary>
+ AuthenticatedMakerBlizzard = 1 << 3
+ OfficialMeleeGame = 1 << 5
+
+ SavedGame = 1 << 9
+ PrivateGame = 1 << 11
+
+ MakerUser = 1 << 13
+ MakerBlizzard = 1 << 14
+ TypeMelee = 1 << 15
+ TypeScenario = 1 << 16
+ SizeSmall = 1 << 17
+ SizeMedium = 1 << 18
+ SizeLarge = 1 << 19
+ ObsFull = 1 << 20
+ ObsOnDeath = 1 << 21
+ ObsNone = 1 << 22
+
+ MaskObs = ObsFull Or ObsOnDeath Or ObsNone
+ MaskMaker = MakerBlizzard Or MakerUser
+ MaskType = TypeMelee Or TypeScenario
+ MaskSize = SizeLarge Or SizeMedium Or SizeSmall
+ MaskFilterable = MaskObs Or MaskMaker Or MaskType Or MaskSize
+ End Enum
+
+ */
+
+ // note: we allow "conflicting" flags to be set at the same time (who knows if this is a good idea)
+ // we also don't set any flags this class is unaware of such as Unknown0, SavedGame, and PrivateGame
+
+ uint32_t GameType = 0;
+
+ // maker
+
+ if( m_MapFilterMaker & MAPFILTER_MAKER_USER )
+ GameType |= MAPGAMETYPE_MAKERUSER;
+ if( m_MapFilterMaker & MAPFILTER_MAKER_BLIZZARD )
+ GameType |= MAPGAMETYPE_MAKERBLIZZARD;
+
+ // type
+
+ if( m_MapFilterType & MAPFILTER_TYPE_MELEE )
+ GameType |= MAPGAMETYPE_TYPEMELEE;
+ if( m_MapFilterType & MAPFILTER_TYPE_SCENARIO )
+ GameType |= MAPGAMETYPE_TYPESCENARIO;
+
+ // size
+
+ if( m_MapFilterSize & MAPFILTER_SIZE_SMALL )
+ GameType |= MAPGAMETYPE_SIZESMALL;
+ if( m_MapFilterSize & MAPFILTER_SIZE_MEDIUM )
+ GameType |= MAPGAMETYPE_SIZEMEDIUM;
+ if( m_MapFilterSize & MAPFILTER_SIZE_LARGE )
+ GameType |= MAPGAMETYPE_SIZELARGE;
+
+ // obs
+
+ if( m_MapFilterObs & MAPFILTER_OBS_FULL )
+ GameType |= MAPGAMETYPE_OBSFULL;
+ if( m_MapFilterObs & MAPFILTER_OBS_ONDEATH )
+ GameType |= MAPGAMETYPE_OBSONDEATH;
+ if( m_MapFilterObs & MAPFILTER_OBS_NONE )
+ GameType |= MAPGAMETYPE_OBSNONE;
+
+ return GameType;
+}
+
unsigned char CMap :: GetMapLayoutStyle( )
{
// 0 = melee
@@ -683,7 +761,10 @@ void CMap :: Load( CConfig *CFG, string nCFGFile )
m_MapVisibility = CFG->GetInt( "map_visibility", MAPVIS_DEFAULT );
m_MapObservers = CFG->GetInt( "map_observers", MAPOBS_NONE );
m_MapFlags = CFG->GetInt( "map_flags", MAPFLAG_TEAMSTOGETHER | MAPFLAG_FIXEDTEAMS );
- m_MapGameType = CFG->GetInt( "map_gametype", 1 );
+ m_MapFilterMaker = CFG->GetInt( "map_filter_maker", MAPFILTER_MAKER_USER );
+ m_MapFilterType = CFG->GetInt( "map_filter_type", 0 );
+ m_MapFilterSize = CFG->GetInt( "map_filter_size", MAPFILTER_SIZE_LARGE );
+ m_MapFilterObs = CFG->GetInt( "map_filter_obs", MAPFILTER_OBS_NONE );
// todotodo: it might be possible for MapOptions to legitimately be zero so this is not a valid way of checking if it wasn't parsed out earlier
@@ -861,12 +942,7 @@ void CMap :: CheckValid( )
}
// todotodo: m_MapFlags
-
- if( m_MapGameType != 1 && m_MapGameType != 2 && m_MapGameType != 9 )
- {
- m_Valid = false;
- CONSOLE_Print( "[MAP] invalid map_gametype detected" );
- }
+ // todotodo: m_MapFilterMaker, m_MapFilterType, m_MapFilterSize, m_MapFilterObs
if( m_MapWidth.size( ) != 2 )
{
View
37 ghost/map.h
@@ -53,6 +53,36 @@
#define MAPOPT_WATERWAVESONCLIFFSHORES 1 << 11
#define MAPOPT_WATERWAVESONSLOPESHORES 1 << 12
+#define MAPFILTER_MAKER_USER 1
+#define MAPFILTER_MAKER_BLIZZARD 2
+
+#define MAPFILTER_TYPE_MELEE 1
+#define MAPFILTER_TYPE_SCENARIO 2
+
+#define MAPFILTER_SIZE_SMALL 1
+#define MAPFILTER_SIZE_MEDIUM 2
+#define MAPFILTER_SIZE_LARGE 4
+
+#define MAPFILTER_OBS_FULL 1
+#define MAPFILTER_OBS_ONDEATH 2
+#define MAPFILTER_OBS_NONE 4
+
+#define MAPGAMETYPE_UNKNOWN0 1 // always set except for saved games?
+// AuthenticatedMakerBlizzard = 1 << 3
+// OfficialMeleeGame = 1 << 5
+#define MAPGAMETYPE_SAVEDGAME 1 << 9
+#define MAPGAMETYPE_PRIVATEGAME 1 << 11
+#define MAPGAMETYPE_MAKERUSER 1 << 13
+#define MAPGAMETYPE_MAKERBLIZZARD 1 << 14
+#define MAPGAMETYPE_TYPEMELEE 1 << 15
+#define MAPGAMETYPE_TYPESCENARIO 1 << 16
+#define MAPGAMETYPE_SIZESMALL 1 << 17
+#define MAPGAMETYPE_SIZEMEDIUM 1 << 18
+#define MAPGAMETYPE_SIZELARGE 1 << 19
+#define MAPGAMETYPE_OBSFULL 1 << 20
+#define MAPGAMETYPE_OBSONDEATH 1 << 21
+#define MAPGAMETYPE_OBSNONE 1 << 22
+
#include "gameslot.h"
//
@@ -76,7 +106,10 @@ class CMap
unsigned char m_MapVisibility;
unsigned char m_MapObservers;
unsigned char m_MapFlags;
- unsigned char m_MapGameType;
+ unsigned char m_MapFilterMaker;
+ unsigned char m_MapFilterType;
+ unsigned char m_MapFilterSize;
+ unsigned char m_MapFilterObs;
uint32_t m_MapOptions;
BYTEARRAY m_MapWidth; // config value: map width (2 bytes)
BYTEARRAY m_MapHeight; // config value: map height (2 bytes)
@@ -109,7 +142,7 @@ class CMap
unsigned char GetMapObservers( ) { return m_MapObservers; }
unsigned char GetMapFlags( ) { return m_MapFlags; }
BYTEARRAY GetMapGameFlags( );
- unsigned char GetMapGameType( ) { return m_MapGameType; }
+ uint32_t GetMapGameType( );
uint32_t GetMapOptions( ) { return m_MapOptions; }
unsigned char GetMapLayoutStyle( );
BYTEARRAY GetMapWidth( ) { return m_MapWidth; }
View
20 ghost/replay.cpp
@@ -32,7 +32,7 @@ CReplay :: CReplay( ) : CPacked( )
{
m_HostPID = 0;
m_PlayerCount = 0;
- m_MapGameType = 1;
+ m_MapGameType = 0;
m_RandomSeed = 0;
m_SelectMode = 0;
m_StartSpotCount = 0;
@@ -162,10 +162,7 @@ void CReplay :: BuildReplay( string gameName, string statString, uint32_t war3Ve
Replay.push_back( 0 ); // Null (4.0)
UTIL_AppendByteArrayFast( Replay, statString ); // StatString (4.3)
UTIL_AppendByteArray( Replay, (uint32_t)m_Slots.size( ), false ); // PlayerCount (4.6)
- Replay.push_back( m_MapGameType ); // GameType (4.7)
- Replay.push_back( 32 ); // GameType (4.7)
- Replay.push_back( 73 ); // GameType (4.7)
- Replay.push_back( 0 ); // GameType (4.7)
+ UTIL_AppendByteArray( Replay, m_MapGameType, false ); // GameType (4.7)
UTIL_AppendByteArray( Replay, LanguageID, false ); // LanguageID (4.8)
// PlayerList (4.9)
@@ -230,7 +227,7 @@ void CReplay :: ParseReplay( bool parseBlocks )
m_GameName.clear( );
m_StatString.clear( );
m_PlayerCount = 0;
- m_MapGameType = 1;
+ m_MapGameType = 0;
m_Players.clear( );
m_Slots.clear( );
m_RandomSeed = 0;
@@ -313,16 +310,7 @@ void CReplay :: ParseReplay( bool parseBlocks )
return;
}
- READB( ISS, &Garbage4, 4 ); // GameType (4.7)
-
- /* if( (Garbage4 & 0xFFFFFF00) != 4792320 )
- {
- CONSOLE_Print( "[REPLAY] invalid replay (4.7 GameType mismatch)" );
- m_Valid = false;
- return;
- } */
-
- m_MapGameType = Garbage4 & 0x000000FF;
+ READB( ISS, &m_MapGameType, 4 ); // GameType (4.7)
READB( ISS, &Garbage4, 4 ); // LanguageID (4.8)
while( 1 )
View
8 ghost/replay.h
@@ -50,11 +50,11 @@ class CReplay : public CPacked
string m_GameName;
string m_StatString;
uint32_t m_PlayerCount;
- unsigned char m_MapGameType;
+ uint32_t m_MapGameType;
vector<PIDPlayer> m_Players;
vector<CGameSlot> m_Slots;
uint32_t m_RandomSeed;
- unsigned char m_SelectMode;
+ unsigned char m_SelectMode; // also known as the "layout style" elsewhere in this project
unsigned char m_StartSpotCount;
queue<BYTEARRAY> m_LoadingBlocks;
queue<BYTEARRAY> m_Blocks;
@@ -70,7 +70,7 @@ class CReplay : public CPacked
string GetGameName( ) { return m_GameName; }
string GetStatString( ) { return m_StatString; }
uint32_t GetPlayerCount( ) { return m_PlayerCount; }
- unsigned char GetMapGameType( ) { return m_MapGameType; }
+ uint32_t GetMapGameType( ) { return m_MapGameType; }
vector<PIDPlayer> GetPlayers( ) { return m_Players; }
vector<CGameSlot> GetSlots( ) { return m_Slots; }
uint32_t GetRandomSeed( ) { return m_RandomSeed; }
@@ -85,7 +85,7 @@ class CReplay : public CPacked
void SetRandomSeed( uint32_t nRandomSeed ) { m_RandomSeed = nRandomSeed; }
void SetSelectMode( unsigned char nSelectMode ) { m_SelectMode = nSelectMode; }
void SetStartSpotCount( unsigned char nStartSpotCount ) { m_StartSpotCount = nStartSpotCount; }
- void SetMapGameType( unsigned char nMapGameType ) { m_MapGameType = nMapGameType; }
+ void SetMapGameType( uint32_t nMapGameType ) { m_MapGameType = nMapGameType; }
void SetHostPID( unsigned char nHostPID ) { m_HostPID = nHostPID; }
void SetHostName( string nHostName ) { m_HostName = nHostName; }
View
36 mapcfgs/wormwar.cfg
@@ -131,12 +131,38 @@ map_observers = 1
map_flags = 3
-# map game type
-# 1 = custom
-# 2 = custom melee
-# 9 = blizzard
+# map filters are only used for filtering maps on battle.net and for specifying some metadata about the map
+# most of these values won't affect anything important and can be changed as you wish
-map_gametype = 9
+# map filter (maker)
+# - you can combine these flags by adding together all the options you want to use (some combinations may not make sense)
+# 1 = map was made by user
+# 2 = map was made by blizzard
+
+map_filter_maker = 1
+
+# map filter (type)
+# - you can combine these flags by adding together all the options you want to use (some combinations may not make sense)
+# 1 = melee map
+# 2 = scenario map
+
+map_filter_type = 0
+
+# map filter (size)
+# - you can combine these flags by adding together all the options you want to use (some combinations may not make sense)
+# 1 = small map
+# 2 = medium map
+# 4 = large map
+
+map_filter_size = 4
+
+# map filter (observers)
+# - you can combine these flags by adding together all the options you want to use (some combinations may not make sense)
+# 1 = full observers
+# 2 = observers on death
+# 4 = no observers
+
+map_filter_obs = 4
#####################################################################################
### Templates by Varlock & Instinct121 ###
Please sign in to comment.
Something went wrong with that request. Please try again.