diff options
Diffstat (limited to 'src/SMAPI/Events')
-rw-r--r-- | src/SMAPI/Events/ContextReceivedEventArgs.cs | 25 | ||||
-rw-r--r-- | src/SMAPI/Events/IMultiplayerEvents.cs | 3 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/SMAPI/Events/ContextReceivedEventArgs.cs b/src/SMAPI/Events/ContextReceivedEventArgs.cs new file mode 100644 index 00000000..c715cf1c --- /dev/null +++ b/src/SMAPI/Events/ContextReceivedEventArgs.cs @@ -0,0 +1,25 @@ +using System; + +namespace StardewModdingAPI.Events +{ + /// <summary>Event arguments for an <see cref="IMultiplayerEvents.ContextReceived"/> event.</summary> + public class ContextReceivedEventArgs : EventArgs + { + /********* + ** Accessors + *********/ + /// <summary>The player whose metadata was received.</summary> + public IMultiplayerPeer Peer { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="peer">The player to whom a connection is being established.</param> + internal ContextReceivedEventArgs(IMultiplayerPeer peer) + { + this.Peer = peer; + } + } +} diff --git a/src/SMAPI/Events/IMultiplayerEvents.cs b/src/SMAPI/Events/IMultiplayerEvents.cs index a6ac6fd3..91e0789c 100644 --- a/src/SMAPI/Events/IMultiplayerEvents.cs +++ b/src/SMAPI/Events/IMultiplayerEvents.cs @@ -5,6 +5,9 @@ namespace StardewModdingAPI.Events /// <summary>Events raised for multiplayer messages and connections.</summary> public interface IMultiplayerEvents { + /// <summary>Raised after the mod context for a player is received. This happens before the game approves the connection, so the player does not yet exist in the game. This is the earliest point where messages can be sent to the player via SMAPI.</summary> + event EventHandler<ContextReceivedEventArgs> ContextReceived; + /// <summary>Raised after a mod message is received over the network.</summary> event EventHandler<ModMessageReceivedEventArgs> ModMessageReceived; } |