comparison AskMrRobot-Serializer/AskMrRobot-Serializer.lua @ 93:177391341e26

added back in automatic combat logging feature, useful for upload to any log site
author yellowfive
date Wed, 21 Sep 2016 11:25:11 -0700
parents b8e9664d3229
children e0ddd02d6555
comparison
equal deleted inserted replaced
92:18327cfec09f 93:177391341e26
1 -- AskMrRobot-Serializer will serialize and communicate character data between users. 1 -- AskMrRobot-Serializer will serialize and communicate character data between users.
2 -- This is used primarily to associate character information to logs uploaded to askmrrobot.com. 2 -- This is used primarily to associate character information to logs uploaded to askmrrobot.com.
3 3
4 local MAJOR, MINOR = "AskMrRobot-Serializer", 43 4 local MAJOR, MINOR = "AskMrRobot-Serializer", 44
5 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR) 5 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
6 6
7 if not Amr then return end -- already loaded by something else 7 if not Amr then return end -- already loaded by something else
8 8
9 -- event and comm used for player snapshotting on entering combat 9 -- event and comm used for player snapshotting on entering combat
145 ["Alliance"] = 1, 145 ["Alliance"] = 1,
146 ["Horde"] = 2 146 ["Horde"] = 2
147 } 147 }
148 148
149 Amr.InstanceIds = { 149 Amr.InstanceIds = {
150 EmeraldNightmare = 1094, 150 EmeraldNightmare = 1520,
151 Nighthold = 1530 151 Nighthold = 1530
152 } 152 }
153 153
154 -- instances that AskMrRobot currently supports logging for 154 -- instances that AskMrRobot currently supports logging for
155 Amr.SupportedInstanceIds = { 155 Amr.SupportedInstanceIds = {
156 [1094] = true, 156 [1520] = true,
157 [1088] = true 157 [1530] = true
158 } 158 }
159 159
160 -- just to make life easier, maps ID of each artifact weapon to the spec number (1-4) 160 -- just to make life easier, maps ID of each artifact weapon to the spec number (1-4)
161 Amr.ArtifactIdToSpecNumber = { 161 Amr.ArtifactIdToSpecNumber = {
162 [128402] = 1, -- DK 162 [128402] = 1, -- DK
727 return ret 727 return ret
728 end 728 end
729 729
730 -- returns true if this is an instance that AskMrRobot supports for logging 730 -- returns true if this is an instance that AskMrRobot supports for logging
731 function Amr.IsSupportedInstanceId(instanceMapID) 731 function Amr.IsSupportedInstanceId(instanceMapID)
732 for k,v in pairs(Amr.SupportedInstanceIds) do
733 local instanceId = GetAreaMapInfo(k)
734 if instanceId == tonumber(instanceMapID) then
735 return true
736 end
737 end
738 return false
739 --[[
740 if Amr.SupportedInstanceIds[tonumber(instanceMapID)] then 732 if Amr.SupportedInstanceIds[tonumber(instanceMapID)] then
741 return true 733 return true
742 else 734 else
743 return false 735 return false
744 end 736 end
745 ]]
746 end 737 end
747 738
748 -- returns true if currently in a supported instance for logging 739 -- returns true if currently in a supported instance for logging
749 function Amr.IsSupportedInstance() 740 function Amr.IsSupportedInstance()
750 local zone, _, difficultyIndex, _, _, _, _, instanceMapID = GetInstanceInfo() 741 local zone, _, difficultyIndex, _, _, _, _, instanceMapID = GetInstanceInfo()