發表文章

目前顯示的是 1月, 2025的文章

Census Plus Community 8.0.7a is released

圖片
CensusPlus Community 8.0.7a  has been released. There are still lots of broken functions, but yes, it's working now. I'll start working on the new races and classes lacked there, perhaps the locale issues as well since due to the nature of SendWho API - it's actually accepts locale aware strings - it would be difficult to work on it among different clients. I don't know, I guess, maybe I should start from WhoLib to resolve this for the people.

Strange behaviors

I feel sometimes there are strange behaviors in WOW addon codes. For example, the timing of UnregisterAllEvents() is a little bit strange. When UnregisterAllEvents() is invoked, it will take effect in the next update (i.e., if you perform operations that fires the event in the same function, your handler will still get it). However, this is randomly happening. For example, with the following code: local frame = CreateFrame('Frame') frame:RegisterEvent('CHAT_MSG_SYSTEM') frame:SetScript('OnEvent', function() print('got event') end) C_Timer.After(1, function()   frame:UnregisterAllEvents()   SendChatMessage('test', 'DND') end) Occasionally, it shows "got event". Furthermore, recently, I had seen "You are now Busy: DND" when I invoked SendChatMessage('', 'DND') which is expected to show "You are no longer marked Busy."

The best system event to fire arbitrarily from an addon

If you want to fire an system event that you can listen by Frame:RegisterEvent() , consider  SendChatMessage([SOME MESSAGE], 'DND') . It is not hardware event protected, which can be freely invoked several times in an addon. In fact, it's not useful for a regular addon, but I guess it would be good for some testing purposes.

Try and error

I'm not sure how the other Addon Writer has been doing. I'm basically now examining the WOW frames by probing them one by one (thanks to the WowLua addon). You just keep invoking GetChildren() and GetDebugName() to understand the whole structure of a frame - again and again. I don't know, I guess it's quite useful and you know you are making progress. Slow but fine I guess.

Focusing

After several attempts, I decided to fully repair WhoLib first. Some of people has been trying to continue Sylvanaar's work by forking his projects under the organization of Legacy of Sylvanaar. I will make a version of WhoLib first and continue to fix CensusPlus later. Hope that I can do it quick.

A needle in a haystack

The CensusPlus UI showed nothing at the beginning. I thought it's because that I haven't run a scan - and the database was not saved properly. I'm wrong. After checking the debug information, I realized that the data was there. It's just not shown. Now the problem becomes to display the data at the beginning. It's actually a little bit difficult since the realm list the UI accesses is truly empty at the begging and I need to find a way to fill them - and to keep the data sane under the consistent logic of it! There are over 7000 lines and 59 occurrences of the realm table. God bless. 

Hello World!

圖片
Finally! There are still much work to do, but at least we have a good start. I will focus on make it scan completely, since it lacks the new stuffs from 9.0 ~ 11.0. Lots of gaps to catch up!

Mourning

RealPazza has been updating the package. However, he is not the owner. The repository owner, sylvanaar, Jon S Akhtar, has passed away long time ago. I guess it's why these projects were stopped updating. It's the first time that I feel so connected to someone through the code, just because that it's the only way to know him after several years later. Thank you Jon, may you rest in peace and be happy ever after in the Heaven.

Branching

It looks like I need to branch WhoLib as well. Because if I was developing something that requires querying who, I would like to use a library, too. It also provides more control to the developers when using the same library - if we want to do so, we should have it released publicly as well. An exciting fact is, I just noticed that the lib owner RealPazza is still maintaining something else in 2025, which I think I should be able to contact him now. Let's try to make some changes in the mainline!

Make it move (continued)!

 Most functions are analyzed. I'm trying to figure out what's the next steps. 1. Sounds like that Blizzard forbids the SendWho function to get invoked without user triggered event. This should be the first thing to clarify. 1.a. Invoke SendWho after the Frame update event get done. Let's create a function that handles this: show the frame, and ask the frame to invoke SendWho . Result: Failed as expected. Now we are going to test which event can trigger it. 1.b. Try the idea that CensusPlus had been done: Obstacle Frame. We can use an obstacle frame that a player will tends to frequently clicked unintentionally. 2. After this, I can start to consider how to make it move!

Make it move!

The architecture of WhoLib was much more clear now. It basically puts the lib invocation to a queue and pops the query out in somewhere ... somewhere I haven't dug out yet lol. I will start trying to enable this process. I have confirmed the intention of the "frame" variable of this lib, which is used to count down the timer. The hooks and the overrides are also clarified and I guess I will want to skip them for now. I can almost confirm that this lib is still under development, all these logics all support for the coroutine requests for SendWho .

Maintaining codes without structured information

As a reader, I guess I can understand why some of the logic are flawed. I really want to express the appreciation to Lua Language Server . It brings the possibility to document and track a table object so that after a while of passing it around, I can still know what the current variable is (there are  TABLES  everywhere!) I would say that the annotation is the shinning light tower, as the Beledar, in this dark, endless pit. Without our Beledar to keep track the information of my code, I could definitely make similar, maybe more errors.

Strategy

After failing to make WhoLib functioning, I decided to write comments for it. Also format it first to make it easier to read. Hope this strategy helps me to understand the underlying logic of it. Also settled down the intellisense which can offer good assistance. I'm not sure if there is anyone who encountered the similar problem with me: when using LibStub to load libraries, the vscode plugin Lua Language Server won't recognize the loaded lib. I made a trick for this, by introducing a library which sets a global variable with the value always being  false . We can use it to link the relationship between libraries. For example: -- LibGlobalTrick.lua ExposeGlobal = false -- Lib_A.lua local lib = LibStub:NewLibrary("Lib_A", 1) if  ExposeGlobal  then   Lib_A = lib end -- Lib_B.lua local lib_a if  ExposeGlobal  then   lib_a = Lib_A else   lib_a = LibStub:GetLibrary("Lib_A") end After this linking, Lua Language Server is able to recognize lib_a in Li...

WhoLib is also Broken!?

I can't believe it. WhoLib 2.0.179 was also broken? By exploring the code finding out why it does not work, I just realized that WhoLib replaced C_FriendList.SendWho with its own definition, and - dropped the original one? It looks like the author was trying to upgrade the library and somehow ended up uploading a semi finished version. I'm wondering if it is the reason that CensusPlus Classic and CensusPlus WotLK both abandoned it. Well, in what degree I can trust this library ...

Development Diary

Since CensusPlus has not been updated for a long time. I decided to try to work on it and bring it back. I have heard that Blizzard has ruined all the functions that it relies on, so I don't know if it's possible for me to fix it or not. I have never learned Lua, it's also a challenge that I can start to try it. Well, I have never written anything like development diaries, and want to try it. I guess it's a good chance to do so. There might be something worth to write down. Now, it has been settled up as a base version, you might check it here  if you were interested. Surprisingly, the version I can get from CurseForge (8.0.5) is actually malfunctioned - not because of the outdated API, but due to the incomplete state of itself. The code logic is broken and I got to "guess" how it intended to do ... I guess there will be a tough way to go.