Functions for passing messages and constructing URL objects.

Static methods

staticpost<T>(receiver:Null<HashOrStringOrUrl>, message_id:Message<T>, message:T):Void

staticpost(receiver:Null<HashOrStringOrUrl>, message_id:Message<Void>):Void

Post a message to a receiving URL. The most common case is to send messages to a component. If the component part of the receiver is omitted, the message is broadcast to all components in the game object.

The following receiver shorthands are available:

  • "." the current game object
  • "#" the current component

NOTE: There is a 2 kilobyte limit to the message parameter table size.

Parameters:

receiver

The receiver must be a string in URL-format, a URL object, a hashed string or nil.

message_id

The id must be a string or a hashed string.

message

a lua table with message parameters to send.

staticurl(urlstring:String):Url

staticurl():Url

staticurl(socket:HashOrString, path:HashOrString, fragment:HashOrString):Url

Creates a new URL.

The format of the string must be "[socket:][path][#fragment]", which is similar to a http URL.

When addressing instances, socket is the name of the collection. path is the id of the instance, which can either be relative the instance of the calling script or global. fragment would be the id of the desired component.

Calling without urlstring is equivalent to Msg.url("").

Parameters:

urlstring

string to create the url from

socket

socket of the URL

path

path of the URL

fragment

fragment of the URL

Returns:

a new URL