Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

Server API

Pablo Tejada edited this page Aug 25, 2013 · 1 revision

RAWS

  • pipe.sendRaw » Send a custom RAW on the pipe string pipe.sendRaw ( string name, object data, [object options] )

  • sendResponse » Send a response to a command.

  • subuser.sendRaw » Send a raw to a subuser.

Commands

  • registerCmd » Register a new server command.
  • registerHookBadCmd » Catch all commands that are not registered
  • registerHookCmd » Register a hook on an user command.

MySQL

  • Ape.MySQL.escape » Escape a string for mysql
  • MySQL.errorString » Get mysql error message
  • MySQL.getInsertId » Get the last id insert with auto-increment
  • MySQL.query » Execute a mysql query
  • Mysql (callback)
  • MySQL.onConnect » Mysql connection established callback
  • MySQL.onError » Error occurred callback
  • Mysql (object) MySQL » A mysql connection class

Events

  • addEvent » Listen an APE event
  • Events (event)
  • adduser » Fired when an user is added to APE
  • afterJoin » Alias of join event.
  • beforeJoin » Fired just before an user joins a channel.
  • deluser » Fired when an user is deleted from APE
  • init » Fired when server is ready
  • join » This event is called just after an user joins a channel
  • left » Fired when an user leaves a channel
  • mkchan » Fired when a new channel is created
  • rmchan » Fired when a user is removed

Users

  • getUserByPubid » Get an user object giving his pubid
  • left » Forces the user to leave a channel.
  • subuser.getUser » Get the parent user
  • subuser.sendRaw » Send a raw to a subuser.
  • user.getProperty » Get a public property
  • user.join » Make a user join a channel
  • user.setProperty » Set a public property
  • Users (object)
  • subuser » A sub user object
  • user » An user object
  • user.pipe » The user's pipe

Channels

  • channel.getProperty » Get a public property
  • channel.setProperty » Set a public property
  • getChannelByName » Get the channel from its name
  • getChannelByPubid » Get a channel by its pubid
  • mkChan » Instantiate a channel object
  • rmChan » Remove a channel
  • Channels (variable)
  • userslist » List of users on the channel
  • Channels (object)
  • channel » A channel object

Sockets

  • sockClient.close » Closes the socket
  • sockClient.write » Writes on the socket
  • Sockets (callback)
  • sockClient.onConnect » Connection has been established callback
  • sockClient.onDisconnect » Connection closed callback
  • sockClient.onRead » Data received callback
  • sockServer.onAccept » Client connected callback
  • sockServer.onDisconnect » Client disconnected callback
  • sockServer.onRead » Client data received callback
  • Sockets (object)
  • sockClient » A client socket class
  • sockServer » A server socket class

More

  • base64.decode » Decode a base64 encoded string
  • base64.encode » Encode a string in base64
  • clearTimeout » Cancel a timeout created by setTimeout
  • config » Get a configuration value
  • include » Include another javascript file
  • log » Log a message in console
  • pipe.destroy » Destroy the custom pipe
  • pipe.getProperty » Get a public property
  • pipe.sendRaw » Send a custom RAW on the pipe
  • pipe.setProperty » Set a public property
  • setInterval » Calls a function repeatedly
  • setTimeout » Execute a function after specified delay
  • sha1.bin » Hash a string using sha1 algorithm as binary
  • sha1.str » Hash a string using sha1 algorithm xorize » Apply a 'XOR' between two string (or binary)
  • More (callback)
  • pipe.onSend » Raw "SEND" received callback
  • More (object)
  • pipe » A pipe object
Clone this wiki locally