From 3160d63c696612f460e5d0ebe1eb4dfb2bb3e5a1 Mon Sep 17 00:00:00 2001 From: Vincent Petithory Date: Sun, 6 Jul 2014 23:32:57 +0200 Subject: Add IPC: Manaplus now accepts connections on the 44007 port. * Uses SDL_Net/SDL_Thread. * Port can be changed with envvar IPC_PORT. * Default port is first checked then incremented until one is available. * start on demand with /ipctoggle (shuts down server socket) It has a simple text protocol: TYPE arg1 [args]... Message types: * CMD: execs a command supported by manaplus, e.g /emote * LTALK: talks in general tab * TALK: talks in current focused tab * [TODO] KEY: do as if the KEY was pressed on keyboard --- src/commands.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/commands.h') diff --git a/src/commands.h b/src/commands.h index f4bbf84d3..bdf4f76c4 100644 --- a/src/commands.h +++ b/src/commands.h @@ -53,6 +53,7 @@ namespace Commands { decHandler(announce); decHandler(help); + decHandler(ipcToggle); decHandler(where); decHandler(who); decHandler(msg); @@ -146,6 +147,7 @@ enum COMMAND_IGNOREALL, COMMAND_HELP, COMMAND_ANNOUNCE, + COMMAND_IPC_TOGGLE, COMMAND_WHERE, COMMAND_WHO, COMMAND_MSG, @@ -247,6 +249,7 @@ static const CommandInfo commands[] = {"ignoreall", &Commands::ignoreAll, -1, false}, {"help", &Commands::help, -1, false}, {"announce", &Commands::announce, -1, true}, + {"ipctoggle", &Commands::ipcToggle, -1, false}, {"where", &Commands::where, -1, false}, {"who", &Commands::who, -1, false}, {"msg", Commands::msg, -1, true}, -- cgit v1.2.3-60-g2f50