pipe.sendRaw
(since 1.0)
Send a custom RAW on the pipe
Description
string
pipe.sendRaw
(
string name, object data, [object options] )
Used to send a custom RAW on the pipe.
Does not work with custom pipes.
Parameters
name
The raw's name
data
An object that will be JSON encoded and sent with the raw.
options
Options, here is a list:
- from - (pipe) An user pipe or a custom pipe that will be added in the from field, if an user pipe, the raw will not be sent to this user.
- restrict - (user|subuser) A user (if sending to a channel), or a subuser (if sending to n user) which will not receive the raw.
Examples
Basic
pipe.sendRaw("CUSTOM_RAW", {"foo":"bar"});
//This will send this raw: {"time":"1255281320","raw":"CUSTOM_RAW","data":{"foo":"bar"}}
Send a raw to an user
Ape.registerCmd("foocmd", true, function(params, info) {
Ape.log("The user ip : ("+infos.ip+"), foo : " + params.foo);
info.user.pipe.sendRaw("CUSTOM_RAW", {"foo":"bar"});
});
Send a raw to a pipe
Ape.registerCmd("foocmd", true, function(params, info) {
Ape.log("The user ip : ("+info.ip+"), foo : " + params.foo);
Ape.getPipe(params.pubid).sendRaw("CUSTOM_RAW", {"foo":"bar"});
});
User notes
# No comment
Post a note
CollaborAPE to our wiki !
Find the information you need on the APE Official Wiki : Install, Server, JSF, Help...
