Fixes for several pinfo formats...

This commit is contained in:
Chocochaos
2014-07-02 21:53:51 +02:00
parent 300d1dc739
commit 02c06a7115
2 changed files with 79 additions and 24 deletions

View File

@@ -171,15 +171,21 @@ function ChatFrame_MessageEventHandler(self, event, ...)
local phase = string.match(arg1, "Phase: (.*)");
local account, accountId, gmLevel = string.match(arg1, "Account: (.*) %(ID: (.*)%), GMLevel: (.*)");
local login, failedLogins = string.match(arg1, "Last Login: (.*) %(Failed Logins: (.*)%)");
local os, latency, email = string.match(arg1, "OS: (.*) %- Latency: (.*) ms %- Mail: (.*)");
local os, latency = string.match(arg1, "OS: (.*) %- Latency: (.*) ms");
local email = string.match(arg1, "Mail: (.*)");
if not email then
local email = string.match(arg1, "Email: (.*)");
end
local ip, locked = string.match(arg1, "Last IP: (.*) %(Locked: (.*)%)");
local level, xpCurrent, xpMax = string.match(arg1, "Level: (.*) %((.*)/(.*) XP");
local level = string.match(arg1, "Level: ([0-9]+)");
local race, class = string.match(arg1, "Race: (.*), (.*)");
local alive = string.match(arg1, "Alive %?: (.*)");
local money = string.match(arg1, "Money: (.*)");
local map, area, zone = string.match(arg1, "Map: (.*), Area: (.*), Zone: (.*)");
local guild, guildId = string.match(arg1, "Guild: (.*) %(ID: (.*)%)");
local guildRank = string.match(arg1, "Rank: (.*)");
local note = string.match(arg1, "Note: (.*)");
local officerNote = string.match(arg1, "O. Note: (.*)");
local playedTime = string.match(arg1, "Played time: (.*)");
@@ -200,43 +206,55 @@ function ChatFrame_MessageEventHandler(self, event, ...)
ActionTaken = true;
end
if os then
GMGenie.Spy.processPin05(os, latency, email, arg1);
GMGenie.Spy.processPin05(os, latency, arg1);
ActionTaken = true;
end
if email then
GMGenie.Spy.processPin06(email, arg1);
ActionTaken = true;
end
if ip then
GMGenie.Spy.processPin06(ip, locked, arg1);
GMGenie.Spy.processPin07(ip, locked, arg1);
ActionTaken = true;
end
if level then
GMGenie.Spy.processPin07(level, xpCurrent, xpMax, arg1);
GMGenie.Spy.processPin08(level, arg1);
ActionTaken = true;
end
if race then
GMGenie.Spy.processPin08(race, class, arg1);
GMGenie.Spy.processPin09(race, class, arg1);
ActionTaken = true;
end
if alive then
GMGenie.Spy.processPin09(alive, arg1);
GMGenie.Spy.processPin10(alive, arg1);
ActionTaken = true;
end
if money then
GMGenie.Spy.processPin10(money, arg1);
GMGenie.Spy.processPin11(money, arg1);
ActionTaken = true;
end
if map then
GMGenie.Spy.processPin11(map, area, zone, arg1);
GMGenie.Spy.processPin12(map, area, zone, arg1);
ActionTaken = true;
end
if guild then
GMGenie.Spy.processPin12(guild, guildId, arg1);
GMGenie.Spy.processPin13(guild, guildId, arg1);
ActionTaken = true;
end
if guildRank then
GMGenie.Spy.processPin13(guildRank, arg1);
GMGenie.Spy.processPin14(guildRank, arg1);
ActionTaken = true;
end
if note then
GMGenie.Spy.processPin15(note, arg1);
ActionTaken = true;
end
if officerNote then
GMGenie.Spy.processPin16(officerNote, arg1);
ActionTaken = true;
end
if playedTime then
GMGenie.Spy.processPin14(playedTime, arg1);
GMGenie.Spy.processPin17(playedTime, arg1);
ActionTaken = true;
end
else
@@ -250,6 +268,14 @@ function ChatFrame_MessageEventHandler(self, event, ...)
end
end
if GMGenie.Spy.waitingForMail then
local read, total = string.match(arg1, "Mails: (.*) Read/(.*) Total");
if read then
GMGenie.Spy.processPin18(read, total, arg1);
ActionTaken = true;
end
end
if GMGenie.Spawns.waitingForObject then
local name, guid, id = string.match(arg1, "%|cffffffff%|Hgameobject:.*%|h%[(.*)%]%|h%|r%sGUID:%s(.*)%sID:%s(.*)");
if name and guid and id then

53
Spy.lua
View File

@@ -71,48 +71,52 @@ function GMGenie.Spy.processPin04(login, failedLogins, pin)
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin05(os, latency, email, pin)
function GMGenie.Spy.processPin05(os, latency, pin)
-- todo os
GMGenie.Spy.currentRequest["email"] = email;
GMGenie.Spy.currentRequest["latency"] = latency;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin06(ip, locked, pin)
function GMGenie.Spy.processPin06(email, pin)
GMGenie.Spy.currentRequest["email"] = email;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin07(ip, locked, pin)
GMGenie.Spy.currentRequest["ip"] = ip;
-- todo locked
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin07(level, xpCurrent, xpMax, pin)
function GMGenie.Spy.processPin08(level, pin)
GMGenie.Spy.currentRequest["level"] = level;
-- todo xp
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin08(race, class, pin)
function GMGenie.Spy.processPin09(race, class, pin)
GMGenie.Spy.currentRequest["race"] = race;
GMGenie.Spy.currentRequest["class"] = class;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin09(alive, pin)
function GMGenie.Spy.processPin10(alive, pin)
-- todo alive
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin10(money, pin)
function GMGenie.Spy.processPin11(money, pin)
GMGenie.Spy.currentRequest["money"] = money;
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin11(map, area, zone, pin)
function GMGenie.Spy.processPin12(map, area, zone, pin)
GMGenie.Spy.currentRequest["location"] = map;
if map ~= area then
GMGenie.Spy.currentRequest["location"] = area .. ', ' .. GMGenie.Spy.currentRequest["location"];
@@ -124,28 +128,53 @@ function GMGenie.Spy.processPin11(map, area, zone, pin)
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin12(guild, guildId, pin)
function GMGenie.Spy.processPin13(guild, guildId, pin)
GMGenie.Spy.currentRequest["guild"] = '<' .. guild .. '> (' .. guildId .. ')';
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin13(guildRank, pin)
function GMGenie.Spy.processPin14(guildRank, pin)
GMGenie.Spy.currentRequest["guild"] = '"' .. guildRank .. '" of ' .. GMGenie.Spy.currentRequest["guild"];
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin14(playedTime, pin)
function GMGenie.Spy.processPin15(note, pin)
-- todo note
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin16(officerNote, pin)
-- todo officerNote
GMGenie.Spy.addToCache(pin);
end
function GMGenie.Spy.processPin17(playedTime, pin)
GMGenie.Spy.currentRequest["playedTime"] = playedTime;
GMGenie.Spy.addToCache(pin);
GMGenie.Spy.waitingForPin = false;
GMGenie.Spy.waitingForMail = true;
Chronos.scheduleByName('mailinpinprotection', 2, GMGenie.Spy.abortWaitingForMail);
GMGenie.Spy.resetBoxes();
GMGenie_Spy_InfoWindow:Show();
end
function GMGenie.Spy.processPin18(read, total, pin)
GMGenie.Spy.addToCache(pin);
GMGenie.Spy.waitingForMail = false;
Chronos.unscheduleByName('mailinpinprotection');
GMGenie.Spy.resetBoxes();
GMGenie_Spy_InfoWindow:Show();
end
function GMGenie.Spy.abortWaitingForMail()
GMGenie.Spy.waitingForMail = false;
end
function GMGenie.Spy.resetBoxes()
GMGenie_Spy_InfoWindow_Info_CharInfo:SetText("Level " .. GMGenie.Spy.currentRequest["level"] .. " " .. GMGenie.Spy.currentRequest["race"] .. " " .. GMGenie.Spy.currentRequest["class"]);
GMGenie_Spy_InfoWindow_Info_Guild:SetText(GMGenie.Spy.currentRequest["guild"]);