Console is helper class that lets the developer control the game from TCP connection. More...
#include <CCConsole.h>
Classes | |
struct | Command |
Public Member Functions | |
Console () | |
Constructor. More... | |
virtual | ~Console () |
Destructor. More... | |
var | ~Console () |
Destructor. More... | |
local | ~Console () |
Destructor. More... | |
bool | listenOnTCP (int port) |
starts listening to specifed TCP port More... | |
var | listenOnTCP ( var port) |
starts listening to specifed TCP port More... | |
local | listenOnTCP ( local port) |
starts listening to specifed TCP port More... | |
bool | listenOnFileDescriptor (int fd) |
starts listening to specifed file descriptor More... | |
var | listenOnFileDescriptor ( var fd) |
starts listening to specifed file descriptor More... | |
local | listenOnFileDescriptor ( local fd) |
starts listening to specifed file descriptor More... | |
void | stop () |
stops the Console. More... | |
var | stop () |
stops the Console. More... | |
local | stop () |
stops the Console. More... | |
void | addCommand (const Command &cmd) |
add custom command More... | |
var | addCommand ( var cmd) |
add custom command More... | |
local | addCommand ( local cmd) |
add custom command More... | |
void | log (const char *buf) |
log something in the console More... | |
Protected Member Functions | |
void | loop () |
ssize_t | readline (int fd, char *buf, size_t maxlen) |
var | readline ( var fd, var buf, var maxlen) |
local | readline ( local fd, local buf, local maxlen) |
ssize_t | readBytes (int fd, char *buffer, size_t maxlen, bool *more) |
var | readBytes ( var fd, var buffer, var maxlen, var more) |
local | readBytes ( local fd, local buffer, local maxlen, local more) |
bool | parseCommand (int fd) |
var | parseCommand ( var fd) |
local | parseCommand ( local fd) |
void | addClient () |
var | addClient () |
local | addClient () |
void | commandHelp (int fd, const std::string &args) |
var | commandHelp ( var fd, var args) |
local | commandHelp ( local fd, local args) |
void | commandExit (int fd, const std::string &args) |
var | commandExit ( var fd, var args) |
local | commandExit ( local fd, local args) |
void | commandSceneGraph (int fd, const std::string &args) |
var | commandSceneGraph ( var fd, var args) |
local | commandSceneGraph ( local fd, local args) |
void | commandFileUtils (int fd, const std::string &args) |
var | commandFileUtils ( var fd, var args) |
local | commandFileUtils ( local fd, local args) |
void | commandConfig (int fd, const std::string &args) |
var | commandConfig ( var fd, var args) |
local | commandConfig ( local fd, local args) |
void | commandTextures (int fd, const std::string &args) |
var | commandTextures ( var fd, var args) |
local | commandTextures ( local fd, local args) |
void | commandResolution (int fd, const std::string &args) |
var | commandResolution ( var fd, var args) |
local | commandResolution ( local fd, local args) |
void | commandProjection (int fd, const std::string &args) |
var | commandProjection ( var fd, var args) |
local | commandProjection ( local fd, local args) |
void | commandDirector (int fd, const std::string &args) |
var | commandDirector ( var fd, var args) |
local | commandDirector ( local fd, local args) |
void | commandTouch (int fd, const std::string &args) |
var | commandTouch ( var fd, var args) |
local | commandTouch ( local fd, local args) |
void | commandUpload (int fd) |
Protected Attributes | |
int | _listenfd |
int | _maxfd |
var | _maxfd |
local | _maxfd |
std::vector< int > | _fds |
var | _fds |
local | _fds |
std::thread | _thread |
var | _thread |
local | _thread |
fd_set | _read_set |
var | _read_set |
local | _read_set |
bool | _running |
var | _running |
local | _running |
bool | _endThread |
var | _endThread |
local | _endThread |
std::string | _writablePath |
var | _writablePath |
local | _writablePath |
std::map< std::string, Command > | _commands |
var | _commands |
local | _commands |
bool | _sendDebugStrings |
var | _sendDebugStrings |
local | _sendDebugStrings |
std::mutex | _DebugStringsMutex |
var | _DebugStringsMutex |
local | _DebugStringsMutex |
std::vector< std::string > | _DebugStrings |
var | _DebugStrings |
local | _DebugStrings |
intptr_t | _touchId |
var | _touchId |
local | _touchId |
Console is helper class that lets the developer control the game from TCP connection.
Console will spawn a new thread that will listen to a specified TCP port. Console has a basic token parser. Each token is associated with an std::function<void(int)>. If the std::function<> needs to use the cocos2d API, it needs to call
``` scheduler->performFunctionInCocosThread( ... ); ```
Console | ( | ) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
protected |
|
protected |
|
protected |
void addCommand | ( | const Command & | cmd) |
add custom command
var addCommand | ( | var | cmd) |
add custom command
local addCommand | ( | local | cmd) |
add custom command
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool listenOnFileDescriptor | ( | int | fd) |
starts listening to specifed file descriptor
var listenOnFileDescriptor | ( | var | fd) |
starts listening to specifed file descriptor
local listenOnFileDescriptor | ( | local | fd) |
starts listening to specifed file descriptor
bool listenOnTCP | ( | int | port) |
starts listening to specifed TCP port
var listenOnTCP | ( | var | port) |
starts listening to specifed TCP port
local listenOnTCP | ( | local | port) |
starts listening to specifed TCP port
void log | ( | const char * | buf) |
log something in the console
var log | ( | var | buf) |
log something in the console
local log | ( | local | buf) |
log something in the console
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
void stop | ( | ) |
stops the Console.
'stop' will be called at destruction time as well
var stop | ( | ) |
stops the Console.
'stop' will be called at destruction time as well
local stop | ( | ) |
stops the Console.
'stop' will be called at destruction time as well
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |