diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
commit | 48b4b813a51c374fce43a553608c67c6ca08ea37 (patch) | |
tree | 853cfe0c7551b44d3544f776e926e70e9382b121 /game.cpp | |
parent | b44b2cb4c16995d218e8d4c767c01c7b87c89816 (diff) |
Added a say() function to lua.
Diffstat (limited to 'game.cpp')
-rw-r--r-- | game.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -10,12 +10,19 @@ Game* Game::game = NULL; Game::Game() : socket(io_service) { scene = new Scene(); + + scene->lua->set_say_func(boost::bind(&Game::say, this, _1)); } Game::~Game() { delete scene; } +void Game::say(const std::string msg) { + message::Message m(msg); + m.send(socket); +} + void Game::run(const std::string host, const unsigned int port) { run(host, boost::lexical_cast<std::string>(port)); } |