~ubuntu-branches/ubuntu/lucid/mumble/lucid-security

« back to all changes in this revision

Viewing changes to plugins/dys/dys.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thorvald Natvig, Patrick Matthäi, Thorvald Natvig
  • Date: 2009-11-11 23:33:38 UTC
  • mfrom: (9.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091111233338-yrojdl25rlm0f2zy
Tags: 1.2.0~beta1-1
[ Patrick Matthäi ]
* Do not build with missing libcap2-dev on kfreebsd-*.
* Merge 1.1.8-3 and 1.1.8-4 changelog.
* Merge remaining changes from the 1.1.8 branch.
* Also install the menu icon for the mumble-11x package.
* Extend the long description of the mumble-11x package. Thanks lintian.

[ Thorvald Natvig ]
* New upstream beta release.
* Update get-orig-source.
* Update dependencies.
* Let the qmake script find the celt/speex libraries on its own.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
}
63
63
 
64
64
static void about(HWND h) {
65
 
        ::MessageBox(h, L"Reads audio position information from Dystopia (Build 3698)", L"Mumble Dystopia Plugin", MB_OK);
 
65
        ::MessageBox(h, L"Reads audio position information from Dystopia (Build 3945)", L"Mumble Dystopia Plugin", MB_OK);
66
66
}
67
67
 
68
68
static bool calcout(float *pos, float *rot, float *opos, float *front, float *top) {
110
110
 
111
111
        // Check if we really have Dystopia running
112
112
        /*
113
 
                position tuple:         client.dll+0x4238a0  (x,y,z, float)
114
 
                orientation tuple:      client.dll+0x423930  (v,h float)
115
 
                ID string:                      client.dll+0x3c947e = "DysObjective@@" (14 characters, text)
116
 
            spawn state:        client.dll+0x3c6260  (0 when at main menu, 2 when not spawned, 6 when spawned, byte)
 
113
                position tuple:         client.dll+0x423990  (x,y,z, float)
 
114
                orientation tuple:      client.dll+0x423924  (v,h float)
 
115
                ID string:                      client.dll+0x3c948e = "DysObjective@@" (14 characters, text)
 
116
            spawn state:        client.dll+0x3c6270  (0 when at main menu, 2 when not spawned, 6 when spawned, byte)
117
117
        */
118
118
        char sMagic[14];
119
 
        if (!peekProc(mod + 0x3c947e, sMagic, 14) || strncmp("DysObjective@@", sMagic, 14)!=0)
 
119
        if (!peekProc(mod + 0x3c948e, sMagic, 14) || strncmp("DysObjective@@", sMagic, 14)!=0)
120
120
                return false;
121
121
 
122
122
        // Remember addresses for later
123
 
        posptr = mod + 0x4238a0;
124
 
        rotptr = mod + 0x423930;
125
 
        stateptr = mod + 0x3c6260;
 
123
        posptr = mod + 0x423990;
 
124
        rotptr = mod + 0x423924;
 
125
        stateptr = mod + 0x3c6270;
126
126
 
127
127
        float pos[3];
128
128
        float rot[3];
147
147
        return;
148
148
}
149
149
 
150
 
static int fetch(float *pos, float *front, float *top) {
 
150
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) {
151
151
        for (int i=0;i<3;i++)
152
 
                pos[i] = front[i] = top[i] = 0;
 
152
                avatar_pos[i] = avatar_front[i] = avatar_top[i] = 0;
153
153
 
154
154
        float ipos[3], rot[3];
155
155
        bool ok;
165
165
        if (state == 0 || state == 2)
166
166
                return true; // Deactivate plugin
167
167
 
168
 
        return calcout(ipos, rot, pos, front, top);
169
 
}
 
168
        if (ok) {
 
169
                int res = calcout(ipos, rot, avatar_pos, avatar_front, avatar_top);
 
170
                if (res) {
 
171
                        for (int i=0;i<3;++i) {
 
172
                                camera_pos[i] = avatar_pos[i];
 
173
                                camera_front[i] = avatar_front[i];
 
174
                                camera_top[i] = avatar_top[i];
 
175
                        }
 
176
                        return res;
 
177
                }
 
178
        }
 
179
 
 
180
        return false;
 
181
}
 
182
 
 
183
static const std::wstring longdesc() {
 
184
        return std::wstring(L"Supports Dystopia build 3945. No identity or context support yet.");
 
185
}
 
186
 
 
187
static std::wstring description(L"Dystopia (Build 3945)");
 
188
static std::wstring shortname(L"Dystopia");
170
189
 
171
190
static MumblePlugin dysplug = {
172
191
        MUMBLE_PLUGIN_MAGIC,
173
 
        L"Dystopia (Build 3698)",
174
 
        L"Dystopia",
 
192
        description,
 
193
        shortname,
175
194
        about,
176
195
        NULL,
177
196
        trylock,
178
197
        unlock,
 
198
        longdesc,
179
199
        fetch
180
200
};
181
201