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... | |
Console () | |
Constructor. More... | |
virtual | ~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 | setUserCommands (Command *commands, int numberOfCommands) |
sets user tokens More... | |
var | setUserCommands ( var commands, var numberOfCommands) |
sets user tokens More... | |
local | setUserCommands ( local commands, local numberOfCommands) |
sets user tokens More... | |
void | log (const char *buf) |
log something in the console More... | |
Protected Member Functions | |
void | loop () |
ssize_t | readline (int fd) |
var | readline ( var fd) |
local | readline ( local fd) |
bool | parseCommand (int fd) |
var | parseCommand ( var fd) |
local | parseCommand ( local fd) |
void | sendPrompt (int fd) |
var | sendPrompt ( var fd) |
local | sendPrompt ( local fd) |
void | addClient () |
void | commandHelp (int fd, const char *command) |
var | commandHelp ( var fd, var command) |
local | commandHelp ( local fd, local command) |
void | commandExit (int fd, const char *command) |
local | commandExit ( local fd, local command) |
void | commandSceneGraph (int fd, const char *command) |
var | commandSceneGraph ( var fd, var command) |
local | commandSceneGraph ( local fd, local command) |
void | commandFileUtilsDump (int fd, const char *command) |
var | commandFileUtilsDump ( var fd, var command) |
local | commandFileUtilsDump ( local fd, local command) |
void | commandConfig (int fd, const char *command) |
var | commandConfig ( var fd, var command) |
local | commandConfig ( local fd, local command) |
void | commandTextures (int fd, const char *command) |
var | commandTextures ( var fd, var command) |
local | commandTextures ( local fd, local command) |
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 |
char | _buffer [512] |
var | _buffer () |
local | _buffer () |
struct Command | _commands [64] |
var | _commands () |
local | _commands () |
int | _maxCommands |
var | _maxCommands |
local | _maxCommands |
struct Command * | _userCommands |
var | _userCommands |
local | _userCommands |
int | _maxUserCommands |
var | _maxUserCommands |
local | _maxUserCommands |
bool | _sendDebugStrings |
var | _sendDebugStrings |
local | _sendDebugStrings |
std::mutex | _DebugStringsMutex |
var | _DebugStringsMutex |
local | _DebugStringsMutex |
std::vector< std::string > | _DebugStrings |
var | _DebugStrings |
local | _DebugStrings |
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.
var Console | ( | ) |
Constructor.
local Console | ( | ) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
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 setUserCommands | ( | Command * | commands, |
int | numberOfCommands | ||
) |
sets user tokens
var setUserCommands | ( | var | commands, |
var | numberOfCommands | ||
) |
sets user tokens
local setUserCommands | ( | local | commands, |
local | numberOfCommands | ||
) |
sets user tokens
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 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |