arul wrote:Here's a (short) list of things I've been missing in the UOAI so far:
- More event-ish approach in some places (like Targetting - when there's a target available, it would be nice if some callback method would be executed).
- Expose pack handling functions - I mean something like OnPacketSend(PBYTE pBuf, int len) / OnPacketReceive(PBYTE pBuf, int len).
Both are already on my todo list, actually.
The most important part needed to implement such events is already present in the current version, it is simply not used yet. A dll injected into each client, already hooks the packetsend and receive functions (at a point where the packets are not encrypted yet or already decrypted) and passes that info to UOAI (IPC is through windows messages).
So I can easily add a onPacketSend and OnPacketReceive event to the UOClient object, but I'm not sure if thats the right way to go.
My first thought was to interpret the packets and sent specific events, such as UOItem_onItemUpdate, UOItem_onDelete, ..., but then again a simple onPacketRcv and onPacketSend event is implemented much faster.
One question remains: should I allow users of my library to modify packets while they before they are sent to the server or client? That would be extremely powerfull, but then again easily abused. Also it would mean the events have to be synchronized with the clients receiving and sending, so if your app hangs in the onReceive or onSend event the whole UO Client will hang too... so whats your opinion on that?
ps. IPC messages are also sent whenever a UOClient's window receives a WM_KEYDOWN or WM_KEYUP, so hotkey handling will be done in a similar by triggering a onHotkey event.
Greetz,
Artaxerxes