Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

custom map airport free for all en team deatmatch

Featured Replies

Опубликовано:
  • Автор

change file foor source

PatchMW2SPMaps.cpp

// ==========================================================
// IW4M project
// 
// Component: clientdll
// Sub-component: steam_api
// Purpose: singleplayer level loading code (reallocation, 
//          address changes, other patches, ...)
//
// Initial author: NTAuthority
// Started: 2011-05-25
// ==========================================================

#include "StdInc.h"
#include "Hooking.h"

// entity dumping, needs to be split?
struct MapEnts
{
const char* name;
const char* entitystring;
};

void DumpMapEntities(MapEnts* entities)
{
char filename[255];

CreateDirectoryA("raw/maps", NULL);
CreateDirectoryA("raw/maps/mp", NULL);

_snprintf(filename, sizeof(filename), "raw/%s.ents", entities->name);

FILE* file = fopen(filename, "w");
if (file)
{
	fwrite(entities->entitystring, 1, strlen(entities->entitystring), file);
	fclose(file);
}
}

static char mapEntities[1024 * 1024];

void LoadMapEntities(MapEnts* entry)
{
char* buffer;
char filename[255];
_snprintf(filename, sizeof(filename), "%s.ents", entry->name);

// why the weird casts?
if (FS_ReadFile((const char*)(&filename), (void**)&buffer) >= 0)
{
	strcpy(mapEntities, buffer);
	entry->entitystring = mapEntities;

	FS_FreeFile(buffer);
}
}

// more code
static DWORD gameWorldSP;
static DWORD gameWorldMP;

// defined in Load.cpp
void* ReallocateAssetPool(assetType_t type, unsigned int newSize);

// TODO: load these dynamically
struct LevelDependency
{
const char* level;
const char* dependency;
};

LevelDependency _dependencies[] = 
{
{ "oilrig", "mp_subbase" },//actually mp_subbase is spetsnax vs seals
{ "invasion", "mp_invasion" },//opfor vs rangers
{ "gulag", "mp_subbase" },// spetsnaz vs seals
{ "contingency", "mp_subbase" }, //spetsnaz vs seals
{ "so_ghillies", "mp_brecourt" },//actually mp_brecourt is spetsnax vs tf141
{ "roadkill", "mp_rust" }, ////orginal actually Rust is vs. TF 141 and not vs. Army Rangers, but meh.
{ "favela", "mp_favela" }, ////orginal originally said 'takedown', don't know who the fsck came up with this
{ "iw4_credits", "mp_rust" },//actually mp_rust is opfor vs TF 141
{ "trainer", "mp_rust" },//actually mp_rust is opfor vs TF 141
{ "dc_whitehouse", "mp_rust" },//actually mp_rust is opfor vs TF 141
//new code
{ "so_bridge", "mp_checkpoint" }, // not rust/terminal	??? vs rangers no fix
{ "roadkill", "mp_subbase" },// not rust/checkpoint		opfor vs ??? (rangers)
{ "estate", "mp_rust" },// not rust/chekcpoint/afghan	opfor vs ???
{ "airport", "mp_invasion" },// not rust/chekcpoint/afghan	???? vs ranger
//
{ "mp_rust", 0 },
{ 0, 0 }
};



// called during Com_LoadLevelZone, replaces the DB_LoadXAssets call
CallHook mapZoneLoadHook;
DWORD mapZoneLoadHookLoc = 0x42C2AF;

// Com_Sprintf call in Com_GetBspFilename
CallHook getBSPNameHook;
DWORD getBSPNameHookLoc = 0x4C5979;

static char levelDependencyName[64];
static char levelAssetName[64];

bool AssetRestrict_RestrictFromMaps(assetType_t type, const char* name, const char* zone)
{
if (!stricmp(zone, levelDependencyName))
{
	// don't load other maps
	if (type == ASSET_TYPE_GAME_MAP_MP || type == ASSET_TYPE_COL_MAP_MP || type == ASSET_TYPE_GFX_MAP || type == ASSET_TYPE_MAP_ENTS || type == ASSET_TYPE_COM_MAP || type == ASSET_TYPE_FX_MAP)
	{
		return true;
	}

	// also don't load localize/fx
	if (type == ASSET_TYPE_LOCALIZE/* || type == ASSET_TYPE_FX*/) // we need to link 'fx' assets as otherwise we
															      // crash at Mark_FxEffectDefAsset...
																  // guess rule #1 needs to be expanded:
																  // so rule #2 becomes 'don't touch fastfiles through code
																  // if you do not understand the code'.
																  // rule #1 still stands: 'don't touch fastfiles'
	{
		return true;
	}
}

if (type == ASSET_TYPE_WEAPON)
{
	//if (!stricmp(zone, levelAssetName))
	//{
		//OutputDebugString(name);
		//OutputDebugString("\n");

		if (strstr(name, "_mp") == 0 && strstr(name, "m40a3") == 0 && strstr(name, "winchester1200") == 0)
		{
			return true;
		}
	//}
}

return false;
}

void MapZoneLoadHookFunc(XZoneInfo* data, int count, int unknown)
{
XZoneInfo newData[3];

// flag us as loading level assets so we don't load weapons
strcpy(levelAssetName, data[0].name);
levelDependencyName[0] = '\0';

// load the base XAsset
DB_LoadXAssets(data, count, unknown);

// add level dependencies
count = 0;

for (LevelDependency* dependency = _dependencies; dependency->level; dependency++)
{
	if (!_stricmp(dependency->level, data[0].name))
	{
		newData[count].name = dependency->dependency;
		newData[count].type1 = data[0].type1;
		newData[count].type2 = data[0].type2;

		count++;
		break;
	}
}

// load level dependencies
if (count > 0)
{
	if (newData[0].name)
	{
		strcpy(levelDependencyName, newData[0].name);
		DB_LoadXAssets(newData, count, unknown);
	}
}
#if PRE_RELEASE_DEMO
/*else
{
	Com_Error(2, "Unsupported level: %s", data[0].name);
}*/
#endif

// check for being MP/SP, and change data accordingly
if (_strnicmp("mp_", data[0].name, 3))
{
	// SP
	*(DWORD*)0x4D90B7 = gameWorldSP + 52;		// some game data structure
}
else
{
	// MP
	*(DWORD*)0x4D90B7 = gameWorldMP + 4;		// some game data structure
}
}

void GetBSPNameHookFunc(char* buffer, size_t size, const char* format, const char* mapname)
{
if (_strnicmp("mp_", mapname, 3))
{
	format = "maps/%s.d3dbsp";
}

_snprintf(buffer, size, format, mapname);
}

void AssetRestrict_PreLoadFromMaps(assetType_t type, void* entry, const char* zone)
{
if (type == ASSET_TYPE_MAP_ENTS)
{
	//if (GAME_FLAG(GAME_FLAG_DUMPDATA))
	//{
		DumpMapEntities((MapEnts*)entry);
	//}

	LoadMapEntities((MapEnts*)entry);
}
}

CallHook ignoreEntityHook;
DWORD ignoreEntityHookLoc = 0x5FBD6E;

bool IgnoreEntityHookFunc(const char* entity); // TODO: move here from Load
void ReallocXAssetEntries();
void PatchMW2_Uncoupling();

void PatchMW2_SPMaps()
{
// reallocate asset pools
ReallocateAssetPool(ASSET_TYPE_IMAGE, 7168);
ReallocateAssetPool(ASSET_TYPE_LOADED_SOUND, 2700);
ReallocateAssetPool(ASSET_TYPE_FX, 1200);
ReallocateAssetPool(ASSET_TYPE_LOCALIZE, 14000);
ReallocateAssetPool(ASSET_TYPE_XANIM, 8192);
ReallocateAssetPool(ASSET_TYPE_XMODEL, 3072);
ReallocateAssetPool(ASSET_TYPE_PHYSPRESET, 128);

// get and store GameWorld*p data
gameWorldSP = (DWORD)ReallocateAssetPool(ASSET_TYPE_GAME_MAP_SP, 1);
gameWorldMP = (*(DWORD*)0x4D90B7) - 4;

// allow loading of IWffu (unsigned) files
*(BYTE*)0x4158D9 = 0xEB; // main function
*(WORD*)0x4A1D97 = 0x9090; // DB_AuthLoad_InflateInit

// ignore 'node_' entities
//ignoreEntityHook.initialize((PBYTE)ignoreEntityHookLoc);
//ignoreEntityHook.installHook((void(*)())IgnoreEntityHookFunc, false);

// asset zone loading
mapZoneLoadHook.initialize((PBYTE)mapZoneLoadHookLoc);
mapZoneLoadHook.installHook((void(*)())MapZoneLoadHookFunc, false);

// BSP name
getBSPNameHook.initialize((PBYTE)getBSPNameHookLoc);
getBSPNameHook.installHook((void(*)())GetBSPNameHookFunc, false);

// hunk size (was 300 MiB)
*(DWORD*)0x64A029 = 0x1C200000; // 450 MiB
*(DWORD*)0x64A057 = 0x1C200000;

// XAsset entries
ReallocXAssetEntries();

// uncouple
PatchMW2_Uncoupling();
}

typedef struct  
{
char unknown[16];
} xAssetEntry_t;

static xAssetEntry_t xEntries[789312];

void ReallocXAssetEntries()
{
int newsize = 516 * 2048;
//newEnts = malloc(newsize);

// get (obfuscated) memory locations
unsigned int origMin = 0x134CAD8;
unsigned int origMax = 0x134CAE8;

unsigned int difference = (unsigned int)xEntries - origMin;

// scan the .text memory
char* scanMin = (char*)0x401000;
char* scanMax = (char*)0x6D7000;
char* current = scanMin;

for (; current < scanMax; current += 1) {
	unsigned int* intCur = (unsigned int*)current;

	// if the address points to something within our range of interest
	if (*intCur == origMin || *intCur == origMax) {
		// patch it
		*intCur += difference;
	}
}

*(DWORD*)0x5BAEB0 = 789312;
}

Опубликовано:
  • Автор

it takes like for ever 2 release the maps. alteriw like 1year and no release. i got it in 60min dm an tdm not blok al areas but you can play it.

 

btw lots of sp maps work

contingency

gulag

invasion

iw4_credits

oilrig

 

dm/tdm

so_ghillies

airport

 

ff

so_bridge

roadkill

estate

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.