Показать сообщение отдельно
Старый 25.08.2007, 13:47   #15
jimon
 
Сообщений: n/a
Re: Проблема аццкого мегапроЭкта ...

Jet

SendNetMsg type,data$,from,to,reliable
Parameters
type = value 1-99
data$ = string containing message to send
from = player ID of the sender
to = player ID of the recipient (0=broadcast)
reliable = flag for sending message reliably

Description
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).

This is probably the most complicated of the networking commands. This what you use to actually send a message to one or all of the players on the network game. The other players will use RecvNetMsg() to intercept your message.
The TYPE parameter is a number from 1 to 99. These values are denoted as 'user messages'.

The Data$ parameter is the actual string that contains the message you want to send. Helpful to know that in order to keep traffic low, you will want to combine details of a message into a single message instead of sending multiple messages with a single element. For example, you might want to send X, Y, and FRAME in a single string like "200,100,4" and parse it out at the recipient's end.

FROM is the player's ID that is sending the message. This is the value returned from the CreateNetPlayer() command.

TO is the player's ID you wish to send the message to. A default value of 0 will broadcast to ALL players.

The RELIABLE flag will put a priority on the message and it will ensure there is no packet loss in the delivery. However, it is at least 3 times slower than a regular non-reliable message.

The example requires that you run it on the local machine while the remote computer runs the example in the RecvNetMsg() command.
 
Ответить с цитированием