Removed
Printable View
Removed
Nice release thank you :).
Good job, but I don't support it that much I would prefer peoples take the hard way, better for educational purposes
they can improve their knowledge.
So we can just drag and drop map files into the map folder?! Chu' iz awsum!!!! =w=!
Heh surprised no one did this yet. I did it for DarkGunz not too long ago.
Still have to fix mine to allow items spawns to appear properly in maps, and to allow for exp gains past the first kill.
Also, make sure you adjust the spawns to spawn you after death if you plan on using this.
Fuck yea, no need to do all that shit in XML :)
Good guy blade, releasing usefull stuff on rz. Ty man
"Warning: This will remove relaymap!" read the warning before you replacing it in the source.
Anyway GJ.
Because I did shit back when it was cool (this is '07 MatchServer, should work on 1.5 with small modifications).
PHP Code:void GoatServer::loadMaps() {
int nMaps = 0;
WIN32_FIND_DATAA pFindFileData;
HANDLE hFindHandle = FindFirstFileA("Maps/*.*", &pFindFileData);
if (hFindHandle == INVALID_HANDLE_VALUE) {
Logging::getInstance()->writeLog("Failed to load maps!");
return;
}
do {
if (!strstr(pFindFileData.cFileName, ".")) {
nMaps++;
}
}
while (FindNextFileA(hFindHandle, &pFindFileData));
FindClose(hFindHandle);
m_pMapDesc = new MMatchMapDesc[nMaps];
m_pMMatchMapsWorldItemSpawnInfo = malloc(4 + (5608 * nMaps));
hFindHandle = FindFirstFileA("Maps/*.*", &pFindFileData);
if (hFindHandle == INVALID_HANDLE_VALUE) {
Logging::getInstance()->writeLog("Failed to load maps!");
return;
}
int nDummy = 0;
int nMansion = 0;
do {
if (!strstr(pFindFileData.cFileName, ".")) {
if (nDummy >= nMaps) {
break;
}
if (strcmp(pFindFileData.cFileName, "Mansion") == 0) {
nMansion = nDummy;
}
memset(&m_pMapDesc[nDummy], 0, sizeof(MMatchMapDesc));
m_pMapDesc[nDummy].m_nMapID = nDummy;
strcpy_s(m_pMapDesc[nDummy].m_szMapname, sizeof(m_pMapDesc[nDummy].m_szMapname), pFindFileData.cFileName);
m_pMapDesc[nDummy].m_fpExpRatio = 1;
m_pMapDesc[nDummy++].m_nMaxPlayers = 24;
}
}
while (FindNextFileA(hFindHandle, &pFindFileData));
DWORD dwOffset = PtrToUlong(&m_pMapDesc[0]);
FindClose(hFindHandle);
Logging::getInstance()->writeLog("Maps loaded at memory offset: %X, mansion is at index %i. Amount: %i.", dwOffset, nMansion, nMaps);
DWORD dwDummy;
dwOffset += 4;
/* Patch MMatchStageSetting::MMatchStageSetting */
VirtualProtect((void *)0x00504998, 1, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x00504998, &nMansion, 1);
VirtualProtect((void *)0x00504998, 1, dwDummy, &dwDummy);
/* Patch MMatchMapsWorldItemSpawnInfo::GetInstance */
unsigned char uchBuffer[6];
uchBuffer[0] = 0xB8; //MOV EAX
DWORD dwInstanceAddr = PtrToUlong(m_pMMatchMapsWorldItemSpawnInfo);
memcpy((uchBuffer + 1), &dwInstanceAddr, sizeof(DWORD));
uchBuffer[5] = 0xC3; //RETN
VirtualProtect((void *)0x0043D9C0, sizeof(uchBuffer), PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x0043D9C0, &uchBuffer, sizeof(uchBuffer));
VirtualProtect((void *)0x0043D9C0, sizeof(uchBuffer), dwDummy, &dwDummy);
/* Patch MMatchMapsWorldItemSpawnInfo::Read */
VirtualProtect((void *)0x0043EA1A, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x0043EA1A, &dwOffset, 4);
VirtualProtect((void *)0x0043EA1A, 4, dwDummy, &dwDummy);
VirtualProtect((void *)0x0043EA5D, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x0043EA5D, &nMaps, 4);
VirtualProtect((void *)0x0043EA5D, 4, dwDummy, &dwDummy);
/* Patch MMatchServer::OnStageSetting */
VirtualProtect((void *)0x0045C143, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x0045C143, &dwOffset, 4);
VirtualProtect((void *)0x0045C143, 4, dwDummy, &dwDummy);
/* Patch MMatchStageSetting::SetMapName */
VirtualProtect((void *)0x00466492, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x00466492, &dwOffset, 4);
VirtualProtect((void *)0x00466492, 4, dwDummy, &dwDummy);
VirtualProtect((void *)0x004664AA, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x004664AA, &nMaps, 4);
VirtualProtect((void *)0x004664AA, 4, dwDummy, &dwDummy);
/* Patch MMatchStageSetting::SetMapIndex */
VirtualProtect((void *)0x004664FD, 1, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x004664FD, &nMaps, 1);
VirtualProtect((void *)0x004664FD, 1, dwDummy, &dwDummy);
VirtualProtect((void *)0x00466505, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x00466505, &dwOffset, 4);
VirtualProtect((void *)0x00466505, 4, dwDummy, &dwDummy);
/* Patch MMatchServer::CalcExpOnGameKill */
VirtualProtect((void *)0x0045922C, 1, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x0045922C, &nMaps, 1);
VirtualProtect((void *)0x0045922C, 1, dwDummy, &dwDummy);
DWORD dwTemp = (dwOffset + 96);
VirtualProtect((void *)0x00459238, 4, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x00459238, &dwTemp, 4);
VirtualProtect((void *)0x00459238, 4, dwDummy, &dwDummy);
/* Patch MMatchWorldItemManager::OnStageBegin */
VirtualProtect((void *)0x00480A40, 1, PAGE_EXECUTE_READWRITE, &dwDummy);
memcpy((void *)0x00480A40, &nMaps, 1);
VirtualProtect((void *)0x00480A40, 1, dwDummy, &dwDummy);
}
Heeeeeeey.... speak for yourself x'D I for one LOVE to improve my GunZ development knowledge ^^ you know its funny. When I first began to start learning to develop for GunZ I actually thought you could just drag and drop maps, items and weapons into their folders and they would appear in game x3 so I went on a downloading spree and downloaded as much maps and weapons as I could from as many sources as possible (over 150+ MAPS) and gave it to the owner of this server I was developing for to put it in game X'D although he was as clueless as me so he didn't mind.
Awesome release.:laugh::laugh::laugh::laugh:
after this build only gunz?or gunz and matchserver?