Console is helper class that lets the developer control the game from TCP connection. More...
#include <CCConsole.h>
Classes | |
| struct | Command |
Public Member Functions | |
| 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 | cancel () |
| cancels the Console. More... | |
| var | cancel () |
| cancels the Console. More... | |
| local | cancel () |
| cancels 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... | |
Public Member Functions inherited from Object | |
| Object () | |
| Constructor. More... | |
| Object () | |
| Constructor. More... | |
| virtual | ~Object () |
| void | release () |
| Release the ownership immediately. More... | |
| void | retain () |
| Retains the ownership. More... | |
| Object * | autorelease () |
| Release the ownership sometime soon automatically. More... | |
| bool | isSingleReference () const |
| Returns a boolean value that indicates whether there is only one reference to the object. More... | |
| unsigned int | retainCount () const |
| Returns the object's current reference count. More... | |
| local | retainCount () |
| Returns the object's current reference count. More... | |
| virtual bool | isEqual (const Object *object) |
| Returns a boolean value that indicates whether this object and a given object are equal. More... | |
| virtual void | acceptVisitor (DataVisitor &visitor) |
| virtual void | update (float dt) |
Static Public Member Functions | |
| static Console * | create () |
| creates a new instnace of the Console More... | |
Protected Member Functions | |
| Console () | |
| Console () | |
| Console () | |
| virtual | ~Console () |
| local | ~Console () |
| void | loop () |
| var | loop () |
| local | 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) |
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 [15] |
| var | _commands () |
| local | _commands () |
| int | _maxCommands |
| var | _maxCommands |
| local | _maxCommands |
| struct Command * | _userCommands |
| var | _userCommands |
| local | _userCommands |
| int | _maxUserCommands |
| var | _maxUserCommands |
| local | _maxUserCommands |
Protected Attributes inherited from Object | |
| unsigned int | _reference |
| count of references More... | |
| var | _reference |
| count of references More... | |
| local | _reference |
| count of references More... | |
| unsigned int | _autoReleaseCount |
| count of autorelease More... | |
| var | _autoReleaseCount |
| count of autorelease More... | |
| local | _autoReleaseCount |
| count of autorelease More... | |
Additional Inherited Members | |
Public Attributes inherited from Object | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID More... | |
| int | _luaID |
| Lua reference id. More... | |
| var | _luaID |
| Lua reference id. More... | |
| local | _luaID |
| Lua reference id. More... | |
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( ... ); ```
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
| void cancel | ( | ) |
cancels the Console.
Cancel will be called at destruction time as well
| var cancel | ( | ) |
cancels the Console.
Cancel will be called at destruction time as well
| local cancel | ( | ) |
cancels the Console.
Cancel will be called at destruction time as well
|
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
|
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
|
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 |