Torque3D Documentation / _generateds / SimpleMessageEvent

SimpleMessageEvent

consoledoc.h

A very simple example of a network event.

More...

Public Static Functions

void
msg(NetConnection con, string message)

Send a SimpleMessageEvent message to the specified connection.

Detailed Description

A very simple example of a network event.

This object exists purely for instructional purposes. It is primarily geared toward developers that wish to understand the inner-working of Torque 3D's networking system. This is not intended for actual game development.

see:

NetEvent for the inner workings of network events

Public Static Functions

msg(NetConnection con, string message)

Send a SimpleMessageEvent message to the specified connection.

The far end that receives the message will print the message out to the console. Parameters:

con

The unique ID of the connection to transmit to

message

The string containing the message to transmit

// Send a message to the other end of the given NetConnection
SimpleMessageEvent::msg( %conn, "A message from me!");

// The far end will see the following in the console
// (Note: The number may be something other than 1796 as it is the SimObjectID
// of the received event)
// 
// RMSG 1796  A message from me!