mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-21 17:17:06 +02:00
Code cleanup
This commit is contained in:
parent
a909d7ddde
commit
eba4347cbb
@ -58,15 +58,6 @@ public class ServerService extends Service
|
||||
void onClientRegistered(Messenger client);
|
||||
}
|
||||
|
||||
private static class ServerStartThread extends Thread
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
NativeMethods.createServer();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IncomingClientMessageHandler extends Handler
|
||||
{
|
||||
private WeakReference<IncomingClientMessageHandlerCallback> mCallbackRef;
|
||||
@ -88,7 +79,6 @@ public class ServerService extends Service
|
||||
callback.onClientRegistered(msg.replyTo);
|
||||
}
|
||||
NativeMethods.setupMsg(msg.replyTo);
|
||||
new ServerStartThread().start();
|
||||
break;
|
||||
default:
|
||||
super.handleMessage(msg);
|
||||
|
@ -93,10 +93,6 @@ public class VcmiSDLActivity extends SDLActivity
|
||||
protected void onNewIntent(final Intent intent)
|
||||
{
|
||||
Log.i(this, "Got new intent with action " + intent.getAction());
|
||||
if (NATIVE_ACTION_CREATE_SERVER.equals(intent.getAction()))
|
||||
{
|
||||
initService();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,25 +18,24 @@
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
const std::string SERVER_NAME_AFFIX = "server";
|
||||
const std::string SERVER_NAME = GameConstants::VCMI_VERSION + std::string(" (") + SERVER_NAME_AFFIX + ')';
|
||||
static const std::string SERVER_NAME_AFFIX = "server";
|
||||
static const std::string SERVER_NAME = GameConstants::VCMI_VERSION + std::string(" (") + SERVER_NAME_AFFIX + ')';
|
||||
|
||||
static void handleCommandOptions(int argc, const char * argv[], boost::program_options::variables_map & options)
|
||||
{
|
||||
namespace po = boost::program_options;
|
||||
po::options_description opts("Allowed options");
|
||||
boost::program_options::options_description opts("Allowed options");
|
||||
opts.add_options()
|
||||
("help,h", "display help and exit")
|
||||
("version,v", "display version information and exit")
|
||||
("run-by-client", "indicate that server launched by client on same machine")
|
||||
("port", po::value<ui16>(), "port at which server will listen to connections from client")
|
||||
("port", boost::program_options::value<ui16>(), "port at which server will listen to connections from client")
|
||||
("lobby", "start server in lobby mode in which server connects to a global lobby");
|
||||
|
||||
if(argc > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
po::store(po::parse_command_line(argc, argv, opts), options);
|
||||
boost::program_options::store(boost::program_options::parse_command_line(argc, argv, opts), options);
|
||||
}
|
||||
catch(boost::program_options::error & e)
|
||||
{
|
||||
@ -44,7 +43,7 @@ static void handleCommandOptions(int argc, const char * argv[], boost::program_o
|
||||
}
|
||||
}
|
||||
|
||||
po::notify(options);
|
||||
boost::program_options::notify(options);
|
||||
|
||||
if(options.count("help"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user