Modding:Network API: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 29: Line 29:
Next, we'll set up our network channel on the server side, and register a server command to dispatch our message.
Next, we'll set up our network channel on the server side, and register a server command to dispatch our message.


== Server Set up ==
== Server Setup ==


<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
Line 70: Line 70:
The server channel gives us the BroadcastPacket method which we'll use to send out a <code>NetworkApiTestMessage</code> instance to all clients listening to the "networkapitest" channel, in this case we send "Hello World!" as the message.
The server channel gives us the BroadcastPacket method which we'll use to send out a <code>NetworkApiTestMessage</code> instance to all clients listening to the "networkapitest" channel, in this case we send "Hello World!" as the message.


== Client Side ==
== Client Setup ==


<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">