summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/IMultiplayerEvents.cs
blob: c50eaf049fd49e3d31f76ea1157ba99c12f4505f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#nullable disable

using System;

namespace StardewModdingAPI.Events
{
    /// <summary>Events raised for multiplayer messages and connections.</summary>
    public interface IMultiplayerEvents
    {
        /// <summary>Raised after the mod context for a peer is received. This happens before the game approves the connection (<see cref="PeerConnected"/>), so the player doesn't yet exist in the game. This is the earliest point where messages can be sent to the peer via SMAPI.</summary>
        event EventHandler<PeerContextReceivedEventArgs> PeerContextReceived;

        /// <summary>Raised after a peer connection is approved by the game.</summary>
        event EventHandler<PeerConnectedEventArgs> PeerConnected;

        /// <summary>Raised after a mod message is received over the network.</summary>
        event EventHandler<ModMessageReceivedEventArgs> ModMessageReceived;

        /// <summary>Raised after the connection with a peer is severed.</summary>
        event EventHandler<PeerDisconnectedEventArgs> PeerDisconnected;
    }
}