Files
BlitzNext/_release/help/commands/2d_commands/NetMsgData.htm
T

84 lines
2.5 KiB
HTML
Raw Normal View History

2014-12-08 12:43:20 +13:00
<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>NetMsgData$()</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
None.
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
First off, this ONLY works when you have joined a network game via StartNetGame or JoinNetGame and you have created a player via CreateNetPlayer (you must create a player, even if it is just to lurk). You must've received the message already, determined by the RecvNetMsg() command - and probably determined the type of message with (NetMsgType().
<br />
<br />
The string value returned from this command is the actual message text that was sent.
<br />
<br />
You will use NetMsgType(), NetMsgFrom(), and NetMsgTo() to get other important information from the message and act on it.
<br />
<br />
The example requires that you run it on a remote machine while the local computer runs the example in the SendNetMsg command.
</td>
</tr>
</table>
<h1><a href=../2d_examples/NetMsgData.bb>Example</a></h1>
<table>
<tr>
<td>
; NetMsgData$() example
<br />
; --------------------
<br />
; Run this program on the REMOTE computer to 'watch'
<br />
; the activity of the SendNetMsg example. Run that
<br />
; example on local machine.
<br />
;
<br />
; This program will tell you when a player involved in
<br />
; the game hits a wall ...
<br />
<br />
; We'll use this instead of JoinHostGame - make it easier
<br />
StartNetGame()
<br />
<br />
; Create a player - a player must be created to
<br />
; receive mesages!
<br />
playerID=CreateNetPlayer("Shane")
<br />
<br />
; Loop and get status
<br />
While Not KeyHit(1)
<br />
2014-02-26 16:08:39 +13:00
2014-12-08 12:43:20 +13:00
<br />
2014-02-26 16:08:39 +13:00
; Check to see if we've received a message
2014-12-08 12:43:20 +13:00
<br />
2014-02-26 16:08:39 +13:00
If RecvNetMsg() Then