Comments (4)
The background polling required to detect the member change requires a scheduled task, which would have to be part of the trigger itself.
This means that triggers must provide a hook to let events register scheduled tasks, which in turn means that the event must be able to register a task. This scheduled task would also need an input for the outfit ID to poll, which must be passed as part of the event definition.
All this combined makes me wonder if we should simplify Trigger
s to only handle subscriptions, task loops, and filters, with Event
s being responsible for defining subscriptions or scheduled tasks. This would also tidy up the redundancy of Trigger.conditions
and the characters
/worlds
list in the Trigger initialiser; since the latter would be part of the Event
definition (which is nice, since character IDs being available for FacilityControl
events made no sense to begin with).
I am not sure if we can (or should) combine the Event
s passed to Triggers and the Event
s received by trigger actions into the same object.
from auraxium.
The following is an attempt to stick to a single Event
object.
We cannot use the auraxium.Event
initialiser to pass event-specific data; not without fighting pydantic over the initialiser. An alternative would be to use any variable-length positional arguments as inputs:
@client.trigger(auraxium.OutfitMemberJoin, 1234567890123456)
async def on_member_join(event: auraxium.OutfitMemberJoin) -> None:
print(f'{event.member_name} joined on {event.membed_joined}')
We could even forward any arguments except for conditions=
to the event, that way the current characters
/worlds
syntax would remain available for the built-in PS2 events:
@client.trigger(auraxium.Death, characters=[...], worlds=[...])
async def on_death(...):
...
The biggest difference would happen internally, since Event
s would need to expose a hook to register them, either by subscriptions or via scheduled tasks that can be attached to a given trigger.
from auraxium.
Putting this on hold until #34 is resolved.
from auraxium.
Closing as there is no real benefit to modelling this as a pseudo-event rather than a simple scheduled check.
Users wanting to check for outfit joins are advised to just store the list of members in a local file and run a checker at their desired schedule to scan for new members.
from auraxium.
Related Issues (20)
- Fix unit test workflow for forks HOT 1
- weapon datasheet 'max' and 'min' damage are meaningless due to API quirks HOT 2
- Reconsider object model getter helpers
- Note GainExperience quirks in documentation HOT 1
- Faction image_path missing HOT 1
- outfit.leader() -> Character or OutfitMember HOT 2
- ('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])> HOT 2
- Improve error message when pydantic validation fails
- RTD broken link HOT 1
- Allow unsecured connections for expired API certs HOT 3
- WebSocket version migration HOT 1
- Support third-party fallback endpoints HOT 1
- Uncaught exception on await Character.items(): KeyError HOT 5
- README example is raising RuntimeError HOT 2
- Client.get_by_name not using name.first_lower HOT 3
- Ignoring Unsupported Payload (Continent Lock) HOT 1
- Move payload validation to OpenAPI spec
- ClientResponseError: 400, message='Bad Request' when querying census API HOT 4
- events.ContinentUnlock no longer exists HOT 1
- Unable to add World to Trigger filter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auraxium.