What is IPC?
IPC (Inter-Plugin Communication) provides two main capabilities:- CallGate System: Remote procedure calls (RPC) between plugins
- Data Sharing: Efficient sharing of reference-type data without serialization overhead
CallGate System
The CallGate system uses a publisher-subscriber pattern where:- Providers (publishers) expose functions and send notifications
- Subscribers (consumers) call those functions and receive notifications
Key Features
- Type-safe communication with generic type parameters
- Supports up to 8 parameters plus a return type
- Automatic serialization for complex types via JSON
- Same-thread execution for predictable behavior
- Context information about the calling plugin
Communication Patterns
Remote Procedure Calls (RPC)- Subscribers invoke functions registered by providers
- Supports both actions (no return value) and functions (with return value)
- Providers broadcast messages to all subscribers
- Multiple subscribers can listen to the same channel
- Executed sequentially in registration order
Data Sharing
The DataShare system provides reference-counted sharing of data between plugins:- Share instances of reference types without copying
- Automatic lifecycle management with reference counting
- Only works with types from Dalamud or shared assemblies
- Automatic disposal when all consumers release the data
Data sharing is more efficient than CallGate for large, read-only data structures since it avoids serialization overhead.
Getting Started
Access IPC functionality throughIDalamudPluginInterface:
Provider Pattern
Create a provider to expose functionality:Subscriber Pattern
Create a subscriber to consume functionality:Best Practices
Naming Conventions
Use a consistent naming scheme for your IPC gates:"Glamourer.GetCurrentGlamour"
Versioning
For breaking changes, include version numbers:"MyPlugin.GetData.v2"
Error Handling
Availability Checking
Check if a provider is ready before calling:Cleanup
Always unregister providers when your plugin unloads:Type Compatibility
Supported Types
- Primitive types (int, string, bool, etc.)
- Enums
- Classes and structs (serialized via JSON)
- Dalamud types (ICharacter, IGameObject, etc.)
- Arrays and collections
Type Conversion
When types don’t match exactly, Dalamud attempts automatic conversion:- Check inheritance hierarchy
- JSON serialization/deserialization
- Compatible type matching (field/property names)
For best performance, use exact type matches between provider and subscriber.
Thread Safety
- Providers execute on the subscriber’s thread
- Notifications execute sequentially on the provider’s thread
- No automatic thread synchronization is provided
Next Steps
CallGate Provider
Learn how to expose functionality to other plugins
CallGate Subscriber
Learn how to consume functionality from other plugins
Data Sharing
Learn how to efficiently share data between plugins