diff options
author | Tuck Therebelos <snares@users.sourceforge.net> | 2009-12-08 19:00:48 +0300 |
---|---|---|
committer | Tuck Therebelos <snares@users.sourceforge.net> | 2009-12-08 19:01:14 +0300 |
commit | eb9ab115b20260522ec5bf4d087242ec45997a19 (patch) | |
tree | bba8a84b6d42ca3471fb836d2f14a377ed33f39f /plugins/codmw2 | |
parent | 58f972620f29ed15106edd36f750fd7fe7ade913 (diff) |
Various Source plugin updates, fixes; CoD4, MW2 context fixes
Diffstat (limited to 'plugins/codmw2')
-rw-r--r-- | plugins/codmw2/codmw2.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/plugins/codmw2/codmw2.cpp b/plugins/codmw2/codmw2.cpp index 664ff48d4..272a1b8e9 100644 --- a/plugins/codmw2/codmw2.cpp +++ b/plugins/codmw2/codmw2.cpp @@ -38,13 +38,14 @@ static bool peekProc(VOID *base, VOID *dest, SIZE_T len) { } static void about(HWND h) { - ::MessageBox(h, L"Reads audio position information from Call of Duty: Modern Warfare 2 Multiplayer(v1.0.168)", L"Mumble CoDMW2 MP Plugin", MB_OK); + ::MessageBox(h, L"Reads audio position information from Call of Duty: Modern Warfare 2 Multiplayer v1.0.172). IP:Port context without team discriminator.", L"Mumble CoDMW2 MP Plugin", MB_OK); } static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &identity) { float viewHor, viewVer; char state; + char ccontext[128]; for (int i=0;i<3;i++) avatar_pos[i]=avatar_front[i]=avatar_top[i]=0.0f; @@ -83,11 +84,20 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa peekProc((BYTE *) 0x008EA52C, avatar_pos, 4) && //X peekProc((BYTE *) 0x008EA530, avatar_pos+1, 4) && //Y peekProc((BYTE *) 0x008EA538, &viewHor, 4) && //Hor - peekProc((BYTE *) 0x008EA534, &viewVer, 4); //Ver - + peekProc((BYTE *) 0x008EA534, &viewVer, 4) && //Ver + peekProc((BYTE *) 0x00A7C950, ccontext, 128); + if (! ok) return false; + /* + Get context string; in this plugin this will be an + ip:port (char 256 bytes) string. + If you start your own server, the string for this address will be "localhost". + */ + ccontext[127] = 0; + context = std::string(ccontext); + // Scale Coordinates /* Z-Value is increasing when heading north @@ -163,10 +173,10 @@ static void unlock() { } static const std::wstring longdesc() { - return std::wstring(L"Supports Call of Duty: Modern Warfare 2 MP v1.0.169 only. No context or identity support yet."); + return std::wstring(L"Supports Call of Duty: Modern Warfare 2 MP v1.0.172 only. No identity support yet."); } -static std::wstring description(L"Call of Duty: Modern Warfare 2 MP v1.0.169"); +static std::wstring description(L"Call of Duty: Modern Warfare 2 MP v1.0.172"); static std::wstring shortname(L"Call of Duty: Modern Warfare 2 MP"); static MumblePlugin codmw2plug = { |