CALifeSimulator::CALifeSimulator (xrServer *server, shared_str *command_line) : CALifeUpdateManager(server, alife_section), CALifeSimulatorBase (server,alife_section) { restart_all (); ai().set_alife (this); setup_command_line (command_line); typedef IGame_Persistent::params params; params &p = g_pGamePersistent->m_game_params; R_ASSERT2 ( xr_strlen(p.m_game_or_spawn) && !xr_strcmp(p.m_alife,"alife") && !xr_strcmp(p.m_game_type,"single"), "Invalid server options!" ); string256 temp; xr_strcpy (temp,p.m_game_or_spawn); xr_strcat (temp,"/"); xr_strcat (temp,p.m_game_type); xr_strcat (temp,"/"); xr_strcat (temp,p.m_alife); *command_line = temp; LPCSTR start_game_callback = pSettings->r_string(alife_section,"start_game_callback"); luabind::functor<void> functor; R_ASSERT2 (ai().script_engine().functor(start_game_callback,functor),"failed to get start game callback"); functor (); load (p.m_game_or_spawn,!xr_strcmp(p.m_new_or_load,"load") ? false : true, !xr_strcmp(p.m_new_or_load,"new")); }
int tray_command_cb (UINT message, WPARAM wParam, LPARAM lParam) { switch(wParam) { case IDM_OPEN: if (applet->web_status == WEB_READY) { open_web_browser (SEAF_HTTP_ADDR); } break; case IDM_DISABLE_AUTO_SYNC: { seafile_disable_auto_sync(); break; } case IDM_ENABLE_AUTO_SYNC: { seafile_enable_auto_sync(); break; } case IDM_RESTART: trayicon_rotate (FALSE); restart_all(); break; case IDM_EXIT: PostQuitMessage(0); applet_exit(0); break; default: break; } return TRUE; }