Changes

Jump to navigation Jump to search
update for SMAPI 2.8 release
Line 22: Line 22:     
===Get connected player info===
 
===Get connected player info===
{{SMAPI upcoming|2.8}}
  −
   
You can see basic info about other players connected to the same server using the <tt>GetConnectedPlayer(playerID)</tt> and <tt>GetConnectedPlayers()</tt> methods. This is available immediately when the player connects (before the game even approves the connection). Most of the information is only available for players who are running SMAPI too. You can access these fields for each player:
 
You can see basic info about other players connected to the same server using the <tt>GetConnectedPlayer(playerID)</tt> and <tt>GetConnectedPlayers()</tt> methods. This is available immediately when the player connects (before the game even approves the connection). Most of the information is only available for players who are running SMAPI too. You can access these fields for each player:
 
{| class="wikitable"
 
{| class="wikitable"
Line 90: Line 88:     
===Send messages===
 
===Send messages===
{{SMAPI upcoming|2.8}}
  −
   
You can send a message to mods on other players' computers using the <tt>SendMessage</tt> method. The destination can range from very narrow (e.g. one mod on one connected computer) to very broad (all mods on all computers).
 
You can send a message to mods on other players' computers using the <tt>SendMessage</tt> method. The destination can range from very narrow (e.g. one mod on one connected computer) to very broad (all mods on all computers).
   Line 112: Line 108:     
===Receive messages===
 
===Receive messages===
{{SMAPI upcoming|2.8}}
  −
   
You can receive messages by listening to the <tt>helper.Multiplayer.ModMessageReceived</tt> [[Modding:Modder Guide/APIs/Events|event]]. Within your event handler, the event arguments specify who sent the message and let you read the message into a matching data model:
 
You can receive messages by listening to the <tt>helper.Multiplayer.ModMessageReceived</tt> [[Modding:Modder Guide/APIs/Events|event]]. Within your event handler, the event arguments specify who sent the message and let you read the message into a matching data model:
 
<source lang="C#">
 
<source lang="C#">
translators
8,403

edits

Navigation menu