Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@goodgamestudios/cxf-events
Advanced tools
Readme
💬 Unified events for CXF extensions
Games exchange messages in different formats and with different IDs. For example, a login command looks different on BigFarm and Empire. cxf-events
normalizes & standardizes basic events in a game-agnostic way. Your CXF extension can subscribe to cxf.*
events and work in almost all games.
+------------------+
| |
| LOGIN_BASIC_DATA |--->------+
| | becomes
+------------------+ ↓
+---------------+
| |
| cxf.login |---→ your CXF Extension
| |
+---------------+
+------------------+ ↑
| | becomes
| gbd |--->------+
| |
+------------------+
@goodgamestudios/cxf-events
in @goodgamestudios/cxf-plugins
// Wait for cxf to be ready
require('@goodgamestudios/cxf-ready').then(cxf => {
// Subscribe to relevant events
cxf.on(CxfEvents.Login, loginData => {
// do something on login
})
})
cxf.login
Emitted after a successful player login.
In addition to sending the login arguments with the event, cxf.login
also stores them in cxf.playerId
, cxf.instanceId
, cxf.networkId
, cxf.gameId
and cxf.language
.
cxf.login
{ playerId, instanceId, networkId, gameId, language }
require('@goodgamestudios/cxf-ready').then(cxf => {
cxf.on(CxfEvents.Login, loginData => {
// do something on login
})
})
To be able to listen for a new event from bigfarm, you will need to either listen to its descriptive event or its ID event. For instance: If you want to listen for the SUBSCRIPTION_INFO event (ID 460) you will need to:
To be able to listen for a new event from bigfarm, you will need to either listen to its descriptive event and also its ID event. For instance, if you want to listen for the SUBSCRIPTION_INFO event (ID 460) you will need to:
// Just listening for this event is not enough
cxf.once('SUBSCRIPTION_INFO', (e: BigfarmEvent<BigfarmSubscriptionEvent>) => {
// Your code here
});
// Subscribing to event id, so the first event will be fowarded to CXF
cxf.on('460', () => {});
FAQs
Unified events for BigFarm, Empire and others
The npm package @goodgamestudios/cxf-events receives a total of 237 weekly downloads. As such, @goodgamestudios/cxf-events popularity was classified as not popular.
We found that @goodgamestudios/cxf-events demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.