From f84813911bda2ae2e065f6d2b4137f399e358f78 Mon Sep 17 00:00:00 2001 From: Matt Raykowski Date: Tue, 8 Jun 2010 10:07:33 -0500 Subject: [PATCH] merge --- code/nel/CMakeModules/FindXF86VidMode.cmake | 2 +- code/nel/include/nel/3d/animation_set_user.h | 4 +- code/nel/include/nel/3d/driver_user.h | 2 +- code/nel/include/nel/3d/mesh_multi_lod.h | 1 + code/nel/include/nel/3d/u_driver.h | 2 +- code/nel/samples/3d/cegui/cegui_demo.sln | 88 +- code/nel/samples/3d/cegui/cegui_demo.vcproj | 172 +- code/nel/src/3d/async_texture_manager.cpp | 2 +- code/nel/src/3d/bezier_patch.cpp | 18 +- .../src/3d/driver/opengl/driver_opengl.cpp | 153 +- .../src/3d/driver/opengl/driver_opengl.vcproj | 4 + .../driver/opengl/driver_opengl_material.cpp | 57 +- .../src/3d/driver/opengl/mac/cocoa_adapter.mm | 9 +- .../3d/driver/opengl/mac/cocoa_opengl_view.h | 26 +- .../3d/driver/opengl/mac/cocoa_opengl_view.m | 101 +- .../src/3d/driver/opengl/unix_event_emitter.h | 2 +- code/nel/src/3d/driver_user2.cpp | 9 +- code/nel/src/3d/shadow_map_manager.cpp | 2 +- code/nel/src/cegui.vcproj | 225 +- .../src/sound/driver/dsound/source_dsound.h | 84 +- code/nel/src/sound/driver/source.cpp | 7 +- .../build_coarse_mesh/build_coarse_mesh.cpp | 12 +- .../3d/ig_lighter_lib/ig_lighter_lib.vcproj | 140 +- .../nel/tools/3d/ligo/plugin_max/DllEntry.cpp | 9 + .../ligo/plugin_max/ligoscape_utility.vcproj | 167 +- .../nel_3dsmax_shared/nel_3dsmax_shared.cpp | 17 +- .../nel_3dsmax_shared/nel_3dsmax_shared.h | 5 +- .../3d/plugin_max/nel_export/DllEntry.cpp | 6 +- .../3d/plugin_max/nel_export/nel_export.cpp | 8 +- .../plugin_max/nel_export/nel_export.vcproj | 176 +- .../nel_export/nel_export_export.cpp | 14 +- .../nel_export/nel_export_script.cpp | 131 +- .../3d/plugin_max/nel_mesh_lib/calc_lm.cpp | 4 +- .../nel_mesh_lib/export_collision.cpp | 2 +- .../plugin_max/nel_mesh_lib/export_light.cpp | 2 +- .../nel_mesh_lib/export_lod_character.cpp | 2 +- .../plugin_max/nel_mesh_lib/export_mesh.cpp | 10 +- .../nel_mesh_lib/export_mesh_interface.cpp | 6 +- .../plugin_max/nel_mesh_lib/export_misc.cpp | 2 +- .../plugin_max/nel_mesh_lib/export_scene.cpp | 1 + .../nel_mesh_lib/export_skinning.cpp | 2 +- .../nel_mesh_lib/export_vegetable.cpp | 2 +- .../nel_mesh_lib/nel_mesh_lib.vcproj | 145 +- .../nel_patch_converter/DllEntry.cpp | 7 + .../nel_patch_converter.vcproj | 167 +- .../nel_patch_edit/nel_patch_edit.vcproj | 168 +- .../3d/plugin_max/nel_patch_edit/np_mods.cpp | 8 + .../nel_patch_edit_adv.vcproj | 1879 +---------------- .../nel_patch_lib/nel_patch_lib.vcproj | 145 +- .../plugin_max/nel_patch_paint/DllEntry.cpp | 6 +- .../nel_patch_paint/nel_patch_paint.vcproj | 268 +-- .../nel_vertex_tree_paint/dllmain.cpp | 30 +- .../nel_vertex_tree_paint.vcproj | 171 +- .../vertex_tree_paint.cpp | 5 + .../nel_vertex_tree_paint/vertex_tree_paint.h | 9 + .../tools/3d/plugin_max/plugin_max_public.sln | 6 +- .../scripts/nel_assets_png_batched.ms | 183 ++ .../scripts/nel_batched_mergesave.ms | 251 +++ .../3d/plugin_max/tile_utility/DllEntry.cpp | 7 +- .../tile_utility/tile_utility.vcproj | 167 +- code/nel/tools/build_gamedata/0_setup.py | 169 ++ code/nel/tools/build_gamedata/1_export.py | 73 + code/nel/tools/build_gamedata/2_build.py | 73 + code/nel/tools/build_gamedata/3_install.py | 72 + .../build_gamedata/configuration/buildsite.py | 65 + .../build_gamedata/configuration/scripts.py | 232 ++ .../build_gamedata/configuration/tools.py | 81 + .../tools/build_gamedata/processes/0_setup.py | 80 + .../build_gamedata/processes/1_export.py | 64 + .../tools/build_gamedata/processes/2_build.py | 64 + .../build_gamedata/processes/3_install.py | 63 + .../build_gamedata/processes/anim/0_setup.py | 66 + .../build_gamedata/processes/anim/1_export.py | 63 + .../build_gamedata/processes/anim/2_build.py | 65 + .../processes/anim/3_install.py | 57 + .../processes/anim/todo_export_maxscript | 0 .../build_gamedata/processes/cegui/0_setup.py | 65 + .../processes/cegui/1_export.py | 67 + .../build_gamedata/processes/cegui/2_build.py | 67 + .../processes/cegui/3_install.py | 56 + .../clodbank/maxscript/clod_export.ms | 269 +++ .../processes/displace/0_setup.py | 65 + .../processes/displace/1_export.py | 55 + .../processes/displace/2_build.py | 49 + .../processes/displace/3_install.py | 57 + .../processes/farbank/0_setup.py | 66 + .../processes/farbank/1_export.py | 49 + .../processes/farbank/2_build.py | 74 + .../processes/farbank/3_install.py | 55 + .../build_gamedata/processes/font/0_setup.py | 64 + .../build_gamedata/processes/font/1_export.py | 51 + .../build_gamedata/processes/font/2_build.py | 51 + .../processes/font/3_install.py | 61 + .../processes/ig_light/0_setup.py | 67 + .../processes/ig_light/1_export.py | 49 + .../processes/ig_light/2_build.py | 65 + .../processes/ig_light/3_install.py | 57 + .../processes/interface/0_setup.py | 76 + .../processes/interface/1_export.py | 96 + .../processes/interface/2_build.py | 73 + .../processes/interface/3_install.py | 69 + .../build_gamedata/processes/ligo/0_setup.py | 119 ++ .../build_gamedata/processes/ligo/1_export.py | 104 + .../build_gamedata/processes/ligo/2_build.py | 69 + .../processes/ligo/3_install.py | 50 + .../ligo/maxscript/nel_ligo_export.ms | 957 +++++++++ .../build_gamedata/processes/map/0_setup.py | 68 + .../build_gamedata/processes/map/1_export.py | 49 + .../build_gamedata/processes/map/2_build.py | 108 + .../build_gamedata/processes/map/3_install.py | 69 + .../build_gamedata/processes/rbank/0_setup.py | 79 + .../processes/rbank/1_export.py | 60 + .../build_gamedata/processes/rbank/2_build.py | 250 +++ .../processes/rbank/3_install.py | 68 + .../build_gamedata/processes/shape/0_setup.py | 72 + .../processes/shape/1_export.py | 136 ++ .../build_gamedata/processes/shape/2_build.py | 118 ++ .../processes/shape/3_install.py | 70 + .../processes/shape/maxscript/shape_export.ms | 511 +++++ .../processes/sheet_id/0_setup.py | 65 + .../processes/sheet_id/1_export.py | 49 + .../processes/sheet_id/2_build.py | 64 + .../processes/sheet_id/3_install.py | 57 + .../processes/sheets/0_setup.py | 66 + .../processes/sheets/1_export.py | 49 + .../processes/sheets/2_build.py | 65 + .../processes/sheets/3_install.py | 57 + .../build_gamedata/processes/skel/0_setup.py | 65 + .../build_gamedata/processes/skel/1_export.py | 63 + .../build_gamedata/processes/skel/2_build.py | 49 + .../processes/skel/3_install.py | 57 + .../processes/skel/todo_export_maxscript | 0 .../processes/smallbank/0_setup.py | 64 + .../processes/smallbank/1_export.py | 72 + .../processes/smallbank/2_build.py | 49 + .../processes/smallbank/3_install.py | 57 + .../build_gamedata/processes/sound/0_setup.py | 68 + .../processes/sound/1_export.py | 49 + .../build_gamedata/processes/sound/2_build.py | 67 + .../processes/sound/3_install.py | 60 + .../build_gamedata/processes/swt/0_setup.py | 65 + .../build_gamedata/processes/swt/1_export.py | 63 + .../build_gamedata/processes/swt/2_build.py | 49 + .../build_gamedata/processes/swt/3_install.py | 57 + .../processes/swt/maxscript/swt_export.ms | 139 ++ .../processes/swt/todo_export_maxscript | 0 .../build_gamedata/processes/tiles/0_setup.py | 65 + .../processes/tiles/1_export.py | 84 + .../build_gamedata/processes/tiles/2_build.py | 49 + .../processes/tiles/3_install.py | 55 + .../build_gamedata/processes/veget/0_setup.py | 66 + .../processes/veget/1_export.py | 91 + .../build_gamedata/processes/veget/2_build.py | 49 + .../processes/veget/3_install.py | 57 + .../processes/veget/maxscript/veget_export.ms | 249 +++ .../processes/vegetset/0_setup.py | 65 + .../processes/vegetset/1_export.py | 57 + .../processes/vegetset/2_build.py | 49 + .../processes/vegetset/3_install.py | 57 + .../build_gamedata/processes/zone/0_setup.py | 65 + .../build_gamedata/processes/zone/1_export.py | 69 + .../build_gamedata/processes/zone/2_build.py | 102 + .../processes/zone/3_install.py | 50 + .../processes/zone/todo_build_dependencies | 0 .../processes/zone/todo_export_maxscript | 0 .../processes/zone_light/0_setup.py | 98 + .../processes/zone_light/1_export.py | 102 + .../processes/zone_light/2_build.py | 103 + .../processes/zone_light/3_install.py | 71 + .../zone_light/todo_patch_tile_water | 0 .../nel/tools/build_gamedata/work_in_progress | 0 .../nel/tools/pacs/build_rbank/build_surf.cpp | 50 +- code/nel/tools/pacs/build_rbank/build_surf.h | 7 +- code/nel/tools/pacs/build_rbank/main.cpp | 3 + code/nelns/admin/admin.vcproj | 135 +- code/ryzom/CMakeModules/FindLibwww.cmake | 70 +- code/ryzom/client/client.sln | 11 - code/ryzom/client/src/CMakeLists.txt | 3 +- code/ryzom/client/src/Makefile.am | 21 - code/ryzom/client/src/actions.cpp | 4 - code/ryzom/client/src/debug_client.cpp | 3 +- code/ryzom/client/src/init.cpp | 1 + .../src/interface_v3/action_handler_game.cpp | 2 +- .../interface_v3/action_handler_outpost.cpp | 4 +- .../src/interface_v3/ctrl_text_button.cpp | 3 - .../client/src/interface_v3/group_editbox.cpp | 4 - .../client/src/interface_v3/music_player.cpp | 29 - code/ryzom/client/src/login.cpp | 2 +- code/ryzom/client/src/main_loop.cpp | 9 +- code/ryzom/client/src/r2/editor.cpp | 19 +- .../ryzom/common/src/game_share/bnp_patch.cpp | 7 - .../common/src/game_share/game_share.vcproj | 150 +- .../src/game_share/ring_session_manager_itf.h | 2 +- .../src/game_share/welcome_service_itf.cpp | 458 ++++ .../src/game_share/welcome_service_itf.h | 541 +++++ .../ryzom/server/dynamic_scenario_service.cfg | 320 +++ .../dynamic_scenario_service_default.cfg | 9 + .../player_manager/character.cpp | 3 +- .../server/src/frontend_service/client_host.h | 2 +- .../ryzom_naming_service.cpp | 1141 +++++++++- .../ryzom_welcome_service.cpp | 1570 +++++++++++++- .../ryzom_welcome_service.h | 112 + .../ryzom_welcome_service.vcproj | 156 +- .../shard_unifier_service/login_service.cpp | 4 +- .../ring_session_manager.cpp | 2 +- code/ryzom/tools/all.sln | 142 +- .../tools/build_gamedata/work_in_progress | 0 .../continents/newbieland/directories.py | 113 + .../continents/newbieland/process.py | 105 + .../newbieland/zone_lighter_base.cfg | 52 + .../newbieland/zone_lighter_draft.cfg | 93 + .../newbieland/zone_lighter_final.cfg | 93 + .../ecosystems/jungle/directories.py | 245 +++ .../workspace/ecosystems/jungle/process.py | 108 + .../build_gamedata/workspace/projects.py | 33 + .../georges_convert/georges_convert.vcproj | 830 ++------ .../leveldesign/georges_exe/georges_exe.rc | 2 +- .../named_items_2_csv.vcproj | 204 +- .../land_export/land_export.vcproj | 208 +- .../land_export_lib/land_export_lib.vcproj | 220 +- 220 files changed, 17702 insertions(+), 4148 deletions(-) create mode 100644 code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms create mode 100644 code/nel/tools/3d/plugin_max/scripts/nel_batched_mergesave.ms create mode 100644 code/nel/tools/build_gamedata/0_setup.py create mode 100644 code/nel/tools/build_gamedata/1_export.py create mode 100644 code/nel/tools/build_gamedata/2_build.py create mode 100644 code/nel/tools/build_gamedata/3_install.py create mode 100644 code/nel/tools/build_gamedata/configuration/buildsite.py create mode 100644 code/nel/tools/build_gamedata/configuration/scripts.py create mode 100644 code/nel/tools/build_gamedata/configuration/tools.py create mode 100644 code/nel/tools/build_gamedata/processes/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/cegui/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/cegui/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/displace/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/displace/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/farbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/font/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/font/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/font/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/font/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/ig_light/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/interface/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/map/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/map/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/map/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/map/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/rbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sheet_id/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/smallbank/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sound/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/tiles/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/tiles/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/vegetset/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies create mode 100644 code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/3_install.py create mode 100644 code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water create mode 100644 code/nel/tools/build_gamedata/work_in_progress delete mode 100644 code/ryzom/client/src/Makefile.am create mode 100644 code/ryzom/common/src/game_share/welcome_service_itf.cpp create mode 100644 code/ryzom/common/src/game_share/welcome_service_itf.h create mode 100644 code/ryzom/server/dynamic_scenario_service.cfg create mode 100644 code/ryzom/server/dynamic_scenario_service_default.cfg create mode 100644 code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.h create mode 100644 code/ryzom/tools/build_gamedata/work_in_progress create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py create mode 100644 code/ryzom/tools/build_gamedata/workspace/projects.py diff --git a/code/nel/CMakeModules/FindXF86VidMode.cmake b/code/nel/CMakeModules/FindXF86VidMode.cmake index c84765bdd..88fa40ad7 100644 --- a/code/nel/CMakeModules/FindXF86VidMode.cmake +++ b/code/nel/CMakeModules/FindXF86VidMode.cmake @@ -11,7 +11,7 @@ ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR) FIND_PATH(XF86VidMode_INCLUDE_DIR - xf86vm.h + xf86vmode.h PATHS $ENV{XF86VidMode_DIR}/include /usr/include/X11/ diff --git a/code/nel/include/nel/3d/animation_set_user.h b/code/nel/include/nel/3d/animation_set_user.h index f885eeb1e..3209956ec 100644 --- a/code/nel/include/nel/3d/animation_set_user.h +++ b/code/nel/include/nel/3d/animation_set_user.h @@ -54,7 +54,7 @@ private: public: /// Constructor - CAnimationSetUser(CDriverUser *owner) + CAnimationSetUser(CDriverUser *owner, bool headerOptim = true) { nlassert(owner); _Owner= owner; @@ -62,7 +62,7 @@ public: nlassert((uint)UAnimationSet::NotFound == (uint)CAnimationSet::NotFound ); // create a smartptred animation set. Allow header compression - _AnimationSet= new CAnimationSet(true); + _AnimationSet= new CAnimationSet(headerOptim); } /// Constructor diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index 7070b62f8..e5a662d9a 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -229,7 +229,7 @@ public: /// \name AnimationSet gestion. // @{ /// Create an empty AnimationSet. - virtual UAnimationSet *createAnimationSet(); + virtual UAnimationSet *createAnimationSet(bool headerOptim = true); /// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found. virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile); /// Delete a AnimationSet. diff --git a/code/nel/include/nel/3d/mesh_multi_lod.h b/code/nel/include/nel/3d/mesh_multi_lod.h index 5e891b7b2..d56383f26 100644 --- a/code/nel/include/nel/3d/mesh_multi_lod.h +++ b/code/nel/include/nel/3d/mesh_multi_lod.h @@ -61,6 +61,7 @@ public: class CBuildSlot { public: + CBuildSlot() : MeshGeom(NULL) { } /** * Flags for the build of a slot * diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 02342bf54..4e3126c4b 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -294,7 +294,7 @@ public: /// \name AnimationSet gestion. // @{ /// Create an empty AnimationSet. - virtual UAnimationSet *createAnimationSet() =0; + virtual UAnimationSet *createAnimationSet(bool headerOptim = true) =0; /// Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found. virtual UAnimationSet *createAnimationSet(const std::string &animationSetFile) =0; /// Delete a AnimationSet. NB: actually, this animation set is internally deleted only when no more UPlayList use it. diff --git a/code/nel/samples/3d/cegui/cegui_demo.sln b/code/nel/samples/3d/cegui/cegui_demo.sln index 1c66bf719..ccdeb6212 100644 --- a/code/nel/samples/3d/cegui/cegui_demo.sln +++ b/code/nel/samples/3d/cegui/cegui_demo.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "misc", "..\..\..\src\misc.vcproj", "{44B21233-EFCC-4825-B5E5-3A3BD6CC5516}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3d", "..\..\..\src\3d.vcproj", "{2B48BE83-108B-4E8E-8A55-6627CF09AC5A}" @@ -55,20 +55,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "driver_opengl", "..\..\..\s {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} = {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nel", "nel", "{7CFF6C36-8DE1-49F9-8921-7BAA0D57FEDA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3d_driver", "3d_driver", "{C691380A-F9FB-4E3F-B640-952637A14364}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sound_driver", "sound_driver", "{A5F89936-1FC0-4BB6-8797-81772E5F3289}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{FF586E33-A74E-4DD1-B6AA-82C840BE6232}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "library", "library", "{BA027DE9-5253-43FD-8E5F-36F23CA5A7FB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{2E0BF6A2-C1AF-49EF-A010-C5B77C67471B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{9254FD6A-988B-406D-B483-BC34C63D59AC}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cegui", "..\..\..\src\cegui.vcproj", "{CEF983A5-610E-49C9-A122-05557EEC4E34}" ProjectSection(ProjectDependencies) = postProject {263C0F2E-112D-437F-A6AB-DEA151A7A1F0} = {263C0F2E-112D-437F-A6AB-DEA151A7A1F0} @@ -77,8 +63,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cegui", "..\..\..\src\cegui {1D9576F6-3321-4036-8C86-B5361CCCD4FB} = {1D9576F6-3321-4036-8C86-B5361CCCD4FB} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3d", "3d", "{AC16724F-3D8A-46D3-AD72-25577462BB56}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cegui_demo", "cegui_demo.vcproj", "{F055BA8A-C3CF-4990-B3F8-39660350B9F6}" ProjectSection(ProjectDependencies) = postProject {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} @@ -89,77 +73,147 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Debug|Win32.ActiveCfg = Debug|Win32 {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Debug|Win32.Build.0 = Debug|Win32 + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Debug|x64.ActiveCfg = Debug|x64 + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Debug|x64.Build.0 = Debug|x64 {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Release|Win32.ActiveCfg = Release|Win32 {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Release|Win32.Build.0 = Release|Win32 + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Release|x64.ActiveCfg = Release|x64 + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516}.Release|x64.Build.0 = Release|x64 {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Debug|Win32.ActiveCfg = Debug|Win32 {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Debug|Win32.Build.0 = Debug|Win32 + {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Debug|x64.ActiveCfg = Debug|x64 + {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Debug|x64.Build.0 = Debug|x64 {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Release|Win32.ActiveCfg = Release|Win32 {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Release|Win32.Build.0 = Release|Win32 + {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Release|x64.ActiveCfg = Release|x64 + {2B48BE83-108B-4E8E-8A55-6627CF09AC5A}.Release|x64.Build.0 = Release|x64 {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Debug|Win32.ActiveCfg = Debug|Win32 {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Debug|Win32.Build.0 = Debug|Win32 + {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Debug|x64.ActiveCfg = Debug|x64 + {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Debug|x64.Build.0 = Debug|x64 {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Release|Win32.ActiveCfg = Release|Win32 {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Release|Win32.Build.0 = Release|Win32 + {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Release|x64.ActiveCfg = Release|x64 + {9D284C6B-BE12-4549-87E5-2337D64F31BE}.Release|x64.Build.0 = Release|x64 {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Debug|Win32.ActiveCfg = Debug|Win32 {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Debug|Win32.Build.0 = Debug|Win32 + {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Debug|x64.ActiveCfg = Debug|x64 + {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Debug|x64.Build.0 = Debug|x64 {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Release|Win32.ActiveCfg = Release|Win32 {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Release|Win32.Build.0 = Release|Win32 + {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Release|x64.ActiveCfg = Release|x64 + {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C}.Release|x64.Build.0 = Release|x64 {0E723473-FDBB-48D7-8141-1273B917D681}.Debug|Win32.ActiveCfg = Debug|Win32 {0E723473-FDBB-48D7-8141-1273B917D681}.Debug|Win32.Build.0 = Debug|Win32 + {0E723473-FDBB-48D7-8141-1273B917D681}.Debug|x64.ActiveCfg = Debug|x64 + {0E723473-FDBB-48D7-8141-1273B917D681}.Debug|x64.Build.0 = Debug|x64 {0E723473-FDBB-48D7-8141-1273B917D681}.Release|Win32.ActiveCfg = Release|Win32 {0E723473-FDBB-48D7-8141-1273B917D681}.Release|Win32.Build.0 = Release|Win32 + {0E723473-FDBB-48D7-8141-1273B917D681}.Release|x64.ActiveCfg = Release|x64 + {0E723473-FDBB-48D7-8141-1273B917D681}.Release|x64.Build.0 = Release|x64 {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Debug|Win32.ActiveCfg = Debug|Win32 {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Debug|Win32.Build.0 = Debug|Win32 + {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Debug|x64.ActiveCfg = Debug|x64 + {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Debug|x64.Build.0 = Debug|x64 {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Release|Win32.ActiveCfg = Release|Win32 {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Release|Win32.Build.0 = Release|Win32 + {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Release|x64.ActiveCfg = Release|x64 + {4AF7ADB2-DAF8-4F04-9793-F92010001470}.Release|x64.Build.0 = Release|x64 {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Debug|Win32.ActiveCfg = Debug|Win32 {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Debug|Win32.Build.0 = Debug|Win32 + {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Debug|x64.ActiveCfg = Debug|x64 + {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Debug|x64.Build.0 = Debug|x64 {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Release|Win32.ActiveCfg = Release|Win32 {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Release|Win32.Build.0 = Release|Win32 + {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Release|x64.ActiveCfg = Release|x64 + {67AF56A4-A228-4BFB-BDA8-026CBEDE8BF9}.Release|x64.Build.0 = Release|x64 {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Debug|Win32.ActiveCfg = Debug|Win32 {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Debug|Win32.Build.0 = Debug|Win32 + {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Debug|x64.ActiveCfg = Debug|x64 + {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Debug|x64.Build.0 = Debug|x64 {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Release|Win32.ActiveCfg = Release|Win32 {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Release|Win32.Build.0 = Release|Win32 + {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Release|x64.ActiveCfg = Release|x64 + {C5253970-8728-4A6F-8BF2-E1D9CF0F3861}.Release|x64.Build.0 = Release|x64 {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Debug|Win32.ActiveCfg = Debug|Win32 {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Debug|Win32.Build.0 = Debug|Win32 + {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Debug|x64.ActiveCfg = Debug|x64 + {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Debug|x64.Build.0 = Debug|x64 {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Release|Win32.ActiveCfg = Release|Win32 {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Release|Win32.Build.0 = Release|Win32 + {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Release|x64.ActiveCfg = Release|x64 + {89064E9B-14E9-4FB2-8536-A9151DF55C68}.Release|x64.Build.0 = Release|x64 {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Debug|Win32.ActiveCfg = Debug|Win32 {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Debug|Win32.Build.0 = Debug|Win32 + {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Debug|x64.ActiveCfg = Debug|x64 + {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Debug|x64.Build.0 = Debug|x64 {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Release|Win32.ActiveCfg = Release|Win32 {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Release|Win32.Build.0 = Release|Win32 + {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Release|x64.ActiveCfg = Release|x64 + {23DCF574-1CEB-4DF4-9C59-D614580AC0C0}.Release|x64.Build.0 = Release|x64 {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Debug|Win32.ActiveCfg = Debug|Win32 {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Debug|Win32.Build.0 = Debug|Win32 + {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Debug|x64.ActiveCfg = Debug|x64 + {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Debug|x64.Build.0 = Debug|x64 {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Release|Win32.ActiveCfg = Release|Win32 {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Release|Win32.Build.0 = Release|Win32 + {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Release|x64.ActiveCfg = Release|x64 + {46CD3ED8-A9E1-49ED-BA1B-586CF147143A}.Release|x64.Build.0 = Release|x64 {9440443B-97BA-43C2-A762-31EEC8958BEE}.Debug|Win32.ActiveCfg = Debug|Win32 {9440443B-97BA-43C2-A762-31EEC8958BEE}.Debug|Win32.Build.0 = Debug|Win32 + {9440443B-97BA-43C2-A762-31EEC8958BEE}.Debug|x64.ActiveCfg = Debug|x64 + {9440443B-97BA-43C2-A762-31EEC8958BEE}.Debug|x64.Build.0 = Debug|x64 {9440443B-97BA-43C2-A762-31EEC8958BEE}.Release|Win32.ActiveCfg = Release|Win32 {9440443B-97BA-43C2-A762-31EEC8958BEE}.Release|Win32.Build.0 = Release|Win32 + {9440443B-97BA-43C2-A762-31EEC8958BEE}.Release|x64.ActiveCfg = Release|x64 + {9440443B-97BA-43C2-A762-31EEC8958BEE}.Release|x64.Build.0 = Release|x64 {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Debug|Win32.ActiveCfg = Debug|Win32 {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Debug|Win32.Build.0 = Debug|Win32 + {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Debug|x64.ActiveCfg = Debug|x64 + {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Debug|x64.Build.0 = Debug|x64 {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Release|Win32.ActiveCfg = Release|Win32 {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Release|Win32.Build.0 = Release|Win32 + {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Release|x64.ActiveCfg = Release|x64 + {309F8A55-BFBA-433B-8C3E-CB2223F799C3}.Release|x64.Build.0 = Release|x64 {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Debug|Win32.ActiveCfg = Debug|Win32 {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Debug|Win32.Build.0 = Debug|Win32 + {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Debug|x64.ActiveCfg = Debug|x64 + {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Debug|x64.Build.0 = Debug|x64 {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Release|Win32.ActiveCfg = Release|Win32 {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Release|Win32.Build.0 = Release|Win32 + {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Release|x64.ActiveCfg = Release|x64 + {263C0F2E-112D-437F-A6AB-DEA151A7A1F0}.Release|x64.Build.0 = Release|x64 {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Debug|Win32.ActiveCfg = Debug|Win32 {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Debug|Win32.Build.0 = Debug|Win32 + {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Debug|x64.ActiveCfg = Debug|x64 + {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Debug|x64.Build.0 = Debug|x64 {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Release|Win32.ActiveCfg = Release|Win32 {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Release|Win32.Build.0 = Release|Win32 + {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Release|x64.ActiveCfg = Release|x64 + {1D9576F6-3321-4036-8C86-B5361CCCD4FB}.Release|x64.Build.0 = Release|x64 {CEF983A5-610E-49C9-A122-05557EEC4E34}.Debug|Win32.ActiveCfg = Debug|Win32 {CEF983A5-610E-49C9-A122-05557EEC4E34}.Debug|Win32.Build.0 = Debug|Win32 + {CEF983A5-610E-49C9-A122-05557EEC4E34}.Debug|x64.ActiveCfg = Debug|x64 + {CEF983A5-610E-49C9-A122-05557EEC4E34}.Debug|x64.Build.0 = Debug|x64 {CEF983A5-610E-49C9-A122-05557EEC4E34}.Release|Win32.ActiveCfg = Release|Win32 {CEF983A5-610E-49C9-A122-05557EEC4E34}.Release|Win32.Build.0 = Release|Win32 + {CEF983A5-610E-49C9-A122-05557EEC4E34}.Release|x64.ActiveCfg = Release|x64 + {CEF983A5-610E-49C9-A122-05557EEC4E34}.Release|x64.Build.0 = Release|x64 {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Debug|Win32.ActiveCfg = Debug|Win32 {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Debug|Win32.Build.0 = Debug|Win32 + {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Debug|x64.ActiveCfg = Debug|x64 + {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Debug|x64.Build.0 = Debug|x64 {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Release|Win32.ActiveCfg = Release|Win32 {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Release|Win32.Build.0 = Release|Win32 + {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Release|x64.ActiveCfg = Release|x64 + {F055BA8A-C3CF-4990-B3F8-39660350B9F6}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/code/nel/samples/3d/cegui/cegui_demo.vcproj b/code/nel/samples/3d/cegui/cegui_demo.vcproj index 28b9f4de8..cdda961dd 100644 --- a/code/nel/samples/3d/cegui/cegui_demo.vcproj +++ b/code/nel/samples/3d/cegui/cegui_demo.vcproj @@ -1,7 +1,7 @@  + @@ -180,6 +183,173 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/nel/src/3d/async_texture_manager.cpp b/code/nel/src/3d/async_texture_manager.cpp index a08375371..0888c8ede 100644 --- a/code/nel/src/3d/async_texture_manager.cpp +++ b/code/nel/src/3d/async_texture_manager.cpp @@ -57,7 +57,7 @@ void CAsyncTextureManager::CTextureEntry::createCoarseBitmap() CoarseBitmap= *Texture; // remove all mipmaps, and convert to DXTC1 (if possible, ie if was DXTC5 or DXTC3 as example) CoarseBitmap.releaseMipMaps(); - // TODODO: consersion to DXTC1 + // TODODO: conversion to DXTC1 CoarseBitmap.convertToType(CBitmap::DXTC1); } diff --git a/code/nel/src/3d/bezier_patch.cpp b/code/nel/src/3d/bezier_patch.cpp index 751f9bbb8..d27ed2cc1 100644 --- a/code/nel/src/3d/bezier_patch.cpp +++ b/code/nel/src/3d/bezier_patch.cpp @@ -17,12 +17,11 @@ #include "std3d.h" #include "nel/3d/bezier_patch.h" + using namespace NLMISC; - namespace NL3D { - // *************************************************************************** void CBezierPatch::make(CVector vertices[4], CVector normals[4]) { @@ -48,6 +47,7 @@ void CBezierPatch::make(CVector vertices[4], CVector normals[4]) makeInteriors(); } + // *************************************************************************** void CBezierPatch::makeInteriors() { @@ -60,6 +60,7 @@ void CBezierPatch::makeInteriors() Interiors[2] = Tangents[3] + Tangents[4] - c; Interiors[3] = Tangents[5] + Tangents[6] - d; } + // *************************************************************************** void CBezierPatch::applyMatrix(const CMatrix &m) { @@ -73,7 +74,6 @@ void CBezierPatch::applyMatrix(const CMatrix &m) Interiors[i]= m*Interiors[i]; } - // *************************************************************************** static inline void mulAdd(CVector &tgt, const CVector &src, float f) { @@ -82,7 +82,6 @@ static inline void mulAdd(CVector &tgt, const CVector &src, float f) tgt.z+= src.z*f; } - // *************************************************************************** static inline void mulAddD(CVectorD &tgt, const CVector &src, double f) { @@ -91,7 +90,6 @@ static inline void mulAddD(CVectorD &tgt, const CVector &src, double f) tgt.z+= src.z*f; } - // *************************************************************************** CVector CBezierPatch::eval(float ps, float pt) const { @@ -132,6 +130,7 @@ CVector CBezierPatch::eval(float ps, float pt) const return p; } + // *************************************************************************** CVectorD CBezierPatch::evalDouble(double ps, double pt) const { @@ -173,7 +172,6 @@ CVectorD CBezierPatch::evalDouble(double ps, double pt) const return p; } - // *************************************************************************** CVector CBezierPatch::evalNormal(float ps, float pt) const { @@ -250,14 +248,12 @@ CVector CBezierPatch::evalNormal(float ps, float pt) const mulAdd(tgtT, Tangents[3] , s2 * t3); mulAdd(tgtT, Vertices[2] , s3 * t3); - // Return the normal. CVector norm= tgtT^tgtS; norm.normalize(); return norm; } - // *************************************************************************** CVector CBezierPatch::evalTangentS(float ps, float pt) const { @@ -307,7 +303,6 @@ CVector CBezierPatch::evalTangentS(float ps, float pt) const return tgtS.normed(); } - // *************************************************************************** CVector CBezierPatch::evalTangentT(float ps, float pt) const { @@ -357,7 +352,6 @@ CVector CBezierPatch::evalTangentT(float ps, float pt) const return tgtT.normed(); } - // *************************************************************************** void CBezierPatch::CBezierCurve::subdivide(CBezierCurve &left, CBezierCurve &right, float t) { @@ -377,7 +371,6 @@ void CBezierPatch::CBezierCurve::subdivide(CBezierCurve &left, CBezierCurve &ri left.P3= right.P0= t1*left.P2 + t*right.P1; } - // *************************************************************************** void CBezierPatch::subdivideS(CBezierPatch &left, CBezierPatch &right, float s) const { @@ -408,7 +401,6 @@ void CBezierPatch::subdivideS(CBezierPatch &left, CBezierPatch &right, float s) curveTRight[3].get(right.Vertices[1], right.Tangents[2] , right.Tangents[3] , right.Vertices[2]); } - // *************************************************************************** void CBezierPatch::subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t) const { @@ -439,6 +431,4 @@ void CBezierPatch::subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t) curveSBottom[3].get(bottom.Vertices[3], bottom.Tangents[5] , bottom.Tangents[4] , bottom.Vertices[2]); } - - } // NL3D diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 9f7725b12..e203af049 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -264,7 +264,6 @@ static Bool WndProc(Display *d, XEvent *e, char *arg) */ #endif // NL_OS_UNIX - GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = { GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, @@ -279,9 +278,9 @@ GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = CDriverGL::CDriverGL() { H_AUTO_OGL(CDriverGL_CDriverGL) - _OffScreen = false; #ifdef NL_OS_WINDOWS + _PBuffer = NULL; _hWnd = NULL; _hRC = NULL; @@ -290,10 +289,13 @@ CDriverGL::CDriverGL() _Interval = 1; #elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE) + NL3D::MAC::ctor(); #elif defined (NL_OS_UNIX) cursor = None; + win = 0; + dpy = 0; # ifdef XF86VIDMODE // zero the old screen mode @@ -302,7 +304,8 @@ CDriverGL::CDriverGL() # endif //XF86VIDMODE #endif // NL_OS_UNIX - _FullScreen= false; + _OffScreen = false; + _FullScreen = false; _CurrentMaterial=NULL; _Initialized = false; @@ -347,7 +350,6 @@ CDriverGL::CDriverGL() _NVTextureShaderEnabled = false; - // Compute the Flag which say if one texture has been changed in CMaterial. _MaterialAllTextureTouchedFlag= 0; for(i=0; i < IDRV_MAT_MAXTEXTURES; i++) @@ -356,7 +358,6 @@ CDriverGL::CDriverGL() _CurrentTexAddrMode[i] = GL_NONE; } - _UserTexMatEnabled = 0; // Ligtmap preca. @@ -415,7 +416,6 @@ CDriverGL::CDriverGL() _TextureTargetUpload = false; } - // *************************************************************************** CDriverGL::~CDriverGL() { @@ -502,21 +502,18 @@ bool CDriverGL::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect } // *************************************************************************** - bool CDriverGL::supportBloomEffect() const { return (isVertexProgramSupported() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle()); } // *************************************************************************** - bool CDriverGL::supportNonPowerOfTwoTextures() const { return _Extensions.ARBTextureNonPowerOfTwo; } // *************************************************************************** - bool CDriverGL::isTextureRectangle(ITexture * tex) const { return (supportTextureRectangle() && tex->isBloomTexture() && tex->mipMapOff() @@ -524,7 +521,6 @@ bool CDriverGL::isTextureRectangle(ITexture * tex) const } // *************************************************************************** - bool CDriverGL::activeFrameBufferObject(ITexture * tex) { if(supportFrameBufferObject()/* && supportPackedDepthStencil()*/) @@ -545,7 +541,6 @@ bool CDriverGL::activeFrameBufferObject(ITexture * tex) } // -------------------------------------------------- - void CDriverGL::disableHardwareVertexProgram() { H_AUTO_OGL(CDriverGL_disableHardwareVertexProgram) @@ -565,7 +560,6 @@ void CDriverGL::disableHardwareTextureShader() } // -------------------------------------------------- - bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) { H_AUTO_OGL(CDriverGL_setDisplay) @@ -677,8 +671,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re return false; } - - // Make the context current if (!wglMakeCurrent(tempHDC,tempGLRC)) { @@ -1051,11 +1043,12 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re { GLX_RGBA, GLX_DOUBLEBUFFER, - //GLX_BUFFER_SIZE, 16, GLX_DEPTH_SIZE, 16, GLX_RED_SIZE, 4, GLX_GREEN_SIZE, 4, GLX_BLUE_SIZE, 4, + GLX_ALPHA_SIZE, 4, + GLX_STENCIL_SIZE, 8, None }; @@ -1063,31 +1056,17 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re { GLX_RGBA, GLX_DOUBLEBUFFER, - //GLX_BUFFER_SIZE, 16, GLX_DEPTH_SIZE, 24, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, - None - }; - - static int sAttribList32bpp[] = - { - GLX_RGBA, - GLX_DOUBLEBUFFER, - //GLX_BUFFER_SIZE, 32, - GLX_DEPTH_SIZE, 32, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, GLX_ALPHA_SIZE, 8, + GLX_STENCIL_SIZE, 8, None }; - // first try 32bpp and if that fails 24bpp or 16bpp - XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList32bpp); - if (visual_info == NULL) - visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList24bpp); + // first try 24bpp and if that fails 16bpp + XVisualInfo *visual_info = glXChooseVisual (dpy, DefaultScreen(dpy), sAttribList24bpp); if (visual_info == NULL) visual_info = glXChooseVisual(dpy, DefaultScreen(dpy), sAttribList16bpp); if(visual_info == NULL) @@ -1203,7 +1182,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re nlwarning("Missing Important GL extension: GL_EXT_texture_env_combine => All envcombine are setup to GL_MODULATE!!!"); } - // Get num of light for this driver int numLight; glGetIntegerv (GL_MAX_LIGHTS, &numLight); @@ -1219,7 +1197,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re // init _DriverGLStates _DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight); - // Init OpenGL/Driver defaults. //============================= glViewport(0,0,width,height); @@ -1261,7 +1238,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _VertexProgramEnabled= false; _LastSetupGLArrayVertexProgram= false; - // Init VertexArrayRange according to supported extenstion. _SupportVBHard= false; _SlowUnlockVBHard= false; @@ -1310,7 +1286,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _CurrentVertexBufferHard= NULL; _NVCurrentVARPtr= NULL; _NVCurrentVARSize= 0; - if(_SupportVBHard) + + if (_SupportVBHard) { // try to allocate 16Mo by default of AGP Ram. initVertexBufferHard(NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE, 0); @@ -1342,8 +1319,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re //=========================================================== initFragmentShaders(); - - // Activate the default texture environnments for all stages. //=========================================================== for(uint stage=0;stage0 && rect.Height>0; } - - void CDriverGL::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) { H_AUTO_OGL(CDriverGL_getBufferPart ) @@ -2776,9 +2722,6 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap) } // *************************************************************************** - - - void CDriverGL::copyFrameBufferToTexture(ITexture *tex, uint32 level, uint32 offsetx, @@ -2824,7 +2767,7 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, // gltext->activeFrameBufferObject(tex); } - +// *************************************************************************** void CDriverGL::setPolygonMode (TPolygonMode mode) { H_AUTO_OGL(CDriverGL_setPolygonMode ) @@ -2845,21 +2788,23 @@ void CDriverGL::setPolygonMode (TPolygonMode mode) } } - -bool CDriverGL::fogEnabled() +// *************************************************************************** +bool CDriverGL::fogEnabled() { H_AUTO_OGL(CDriverGL_fogEnabled) return _FogEnabled; } -void CDriverGL::enableFog(bool enable) +// *************************************************************************** +void CDriverGL::enableFog(bool enable) { H_AUTO_OGL(CDriverGL_enableFog) _DriverGLStates.enableFog(enable); _FogEnabled= enable; } -void CDriverGL::setupFog(float start, float end, CRGBA color) +// *************************************************************************** +void CDriverGL::setupFog(float start, float end, CRGBA color) { H_AUTO_OGL(CDriverGL_setupFog) glFogf(GL_FOG_MODE, GL_LINEAR); @@ -2894,23 +2839,22 @@ void CDriverGL::setupFog(float start, float end, CRGBA color) _FogEnd = end; } - // *************************************************************************** -float CDriverGL::getFogStart() const +float CDriverGL::getFogStart() const { H_AUTO_OGL(CDriverGL_getFogStart) return _FogStart; } // *************************************************************************** -float CDriverGL::getFogEnd() const +float CDriverGL::getFogEnd() const { H_AUTO_OGL(CDriverGL_getFogEnd) return _FogEnd; } // *************************************************************************** -CRGBA CDriverGL::getFogColor() const +CRGBA CDriverGL::getFogColor() const { H_AUTO_OGL(CDriverGL_getFogColor) CRGBA ret; @@ -3094,7 +3038,7 @@ bool CDriverGL::supportPerPixelLighting(bool specular) const } // *************************************************************************** -void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess) +void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess) { H_AUTO_OGL(CDriverGL_setPerPixelLightingLight) @@ -3104,7 +3048,7 @@ void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float sh } // *************************************************************************** -NLMISC::IMouseDevice *CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) +NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) { H_AUTO_OGL(CDriverGL_enableLowLevelMouse) @@ -3139,7 +3083,7 @@ NLMISC::IMouseDevice *CDriverGL::enableLowLevelMouse(bool enable, bool exclusive } // *************************************************************************** -NLMISC::IKeyboardDevice *CDriverGL::enableLowLevelKeyboard(bool enable) +NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) { H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard) #ifdef NL_OS_WINDOWS @@ -3173,7 +3117,7 @@ NLMISC::IKeyboardDevice *CDriverGL::enableLowLevelKeyboard(bool enable) } // *************************************************************************** -NLMISC::IInputDeviceManager *CDriverGL::getLowLevelInputDeviceManager() +NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() { H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager) #ifdef NL_OS_WINDOWS @@ -3229,14 +3173,14 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) } // *************************************************************************** -bool CDriverGL::supportBlendConstantColor() const +bool CDriverGL::supportBlendConstantColor() const { H_AUTO_OGL(CDriverGL_supportBlendConstantColor) return _Extensions.EXTBlendColor; } // *************************************************************************** -void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) +void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) { H_AUTO_OGL(CDriverGL_setBlendConstantColor) @@ -3251,7 +3195,7 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) } // *************************************************************************** -NLMISC::CRGBA CDriverGL::getBlendConstantColor() const +NLMISC::CRGBA CDriverGL::getBlendConstantColor() const { H_AUTO_OGL(CDriverGL_CDriverGL) @@ -3265,7 +3209,6 @@ uint CDriverGL::getNbTextureStages() const return inlGetNumTextStages(); } - // *************************************************************************** void CDriverGL::refreshProjMatrixFromGL() { @@ -3279,7 +3222,7 @@ void CDriverGL::refreshProjMatrixFromGL() } // *************************************************************************** -bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties) +bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties) { H_AUTO_OGL(CDriverGL_setMonitorColorProperties ) @@ -3432,9 +3375,6 @@ void CDriverGL::initEMBM() } } - - - // *************************************************************************** /** Water fragment program with extension ARB_fragment_program */ @@ -3496,8 +3436,6 @@ MAD_SAT tmpFog, fogValue.x, fogFactor.x, fogFactor.y; \n\ LRP oCol, tmpFog.x, envMap, fogColor; \n\ END "; - - // ************************************************************************************** /** Water fragment program with extension ARB_fragment_program and a diffuse map applied */ @@ -3569,7 +3507,6 @@ MUL diffuse, diffuse, envMap; \n\ LRP oCol, tmpFog.x, diffuse, fogColor; \n\ END "; - // *************************************************************************** /** Load a ARB_fragment_program_code, and ensure it is loaded natively */ @@ -3608,7 +3545,6 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra return 0; } - // *************************************************************************** /** R200 Fragment Shader : * Send fragment shader to fetch a perturbed envmap from the addition of 2 bumpmap @@ -3640,6 +3576,7 @@ void CDriverGL::forceNativeFragmentPrograms(bool nativeOnly) _ForceNativeFragmentPrograms = nativeOnly; } +// *************************************************************************** void CDriverGL::initFragmentShaders() { H_AUTO_OGL(CDriverGL_initFragmentShaders) @@ -3794,7 +3731,6 @@ void CDriverGL::deleteFragmentShaders() } } - // *************************************************************************** void CDriverGL::finish() { @@ -4108,7 +4044,6 @@ void CDriverGL::retrieveATIDriverVersion() #endif } - // *************************************************************************** bool CDriverGL::supportMADOperator() const { @@ -4117,7 +4052,6 @@ bool CDriverGL::supportMADOperator() const return _Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3; } - // *************************************************************************** uint CDriverGL::getNumAdapter() const { @@ -4127,7 +4061,6 @@ uint CDriverGL::getNumAdapter() const } // *************************************************************************** - bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const { H_AUTO_OGL(CDriverGL_getAdapter) @@ -4150,7 +4083,6 @@ bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const } // *************************************************************************** - bool CDriverGL::setAdapter(uint adapter) { H_AUTO_OGL(CDriverGL_setAdapter) @@ -4159,7 +4091,6 @@ bool CDriverGL::setAdapter(uint adapter) } // *************************************************************************** - CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const { H_AUTO_OGL(CDriverGL_CDriverGL) @@ -4168,7 +4099,6 @@ CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const } // *************************************************************************** - bool CDriverGL::activeShader(CShader * /* shd */) { H_AUTO_OGL(CDriverGL_activeShader) @@ -4177,21 +4107,18 @@ bool CDriverGL::activeShader(CShader * /* shd */) } // *************************************************************************** - void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset) { CHTimer::startBench (wantStandardDeviation, quick, reset); } // *************************************************************************** - void CDriverGL::endBench () { CHTimer::endBench (); } // *************************************************************************** - void CDriverGL::displayBench (class NLMISC::CLog *log) { // diplay @@ -4373,7 +4300,6 @@ uint COcclusionQueryGL::getVisibleCount() return VisibleCount; } - // *************************************************************************** void CDriverGL::setDepthRange(float znear, float zfar) { @@ -4479,12 +4405,10 @@ void CDriverGL::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) default: nlstop; } - _DriverGLStates.stencilOp(glFail, glZFail, glZPass); } // *************************************************************************** - void CDriverGL::stencilMask(uint mask) { H_AUTO_OGL(CDriverGL_CDriverGL) @@ -4511,6 +4435,7 @@ void CDriverGL::endDialogMode() } // NL3D +// *************************************************************************** void displayGLError(GLenum error) { switch(error) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.vcproj b/code/nel/src/3d/driver/opengl/driver_opengl.vcproj index 2802bdc8e..ad7e0e227 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.vcproj +++ b/code/nel/src/3d/driver/opengl/driver_opengl.vcproj @@ -427,6 +427,10 @@ RelativePath="driver_opengl_light.cpp" > + + diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index b5bdc2bec..8870170c8 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -21,8 +21,6 @@ #include "nel/3d/texture_bump.h" #include "nel/3d/material.h" - - namespace NL3D { static void convBlend(CMaterial::TBlend blend, GLenum& glenum) @@ -86,7 +84,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV }; - static const GLenum glTexCubeAddrModesNV[] = { GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, @@ -107,8 +104,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode } } - - // -------------------------------------------------- void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) { @@ -152,7 +147,6 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) } } - //-------------------------------- void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat) { @@ -219,7 +213,6 @@ void CDriverGL::disableUserTextureMatrix() } } - // -------------------------------------------------- CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) { @@ -235,9 +228,6 @@ CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) } } - - - // -------------------------------------------------- void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr *textures) { @@ -256,10 +246,7 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr< } } - - // -------------------------------------------------- - bool CDriverGL::setupMaterial(CMaterial& mat) { H_AUTO_OGL(CDriverGL_setupMaterial) @@ -268,7 +255,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) uint32 touched=mat.getTouched(); uint stage; - // profile. _NbSetupMaterialCall++; @@ -287,7 +273,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) } pShader=static_cast((IMaterialDrvInfos*)(mat._MatDrvInfo)); - // 1. Setup modified fields of material. //===================================== if( touched ) @@ -329,7 +314,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) pShader->SupportedShader= getSupportedShader(mat.getShader()); } - // Since modified, must rebind all openGL states. And do this also for the delete/new problem. /* If an old material is deleted, _CurrentMaterial is invalid. But this is grave only if a new material is created, with the same pointer (bad luck). Since an newly allocated material always @@ -342,7 +326,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) mat.clearTouched(0xFFFFFFFF); } - // Now we can get the supported shader from the cache. CMaterial::TShader matShader = pShader->SupportedShader; @@ -417,7 +400,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) } } - // 3. Bind OpenGL States. //======================= if (_CurrentMaterial!=&mat) @@ -446,7 +428,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) _DriverGLStates.alphaFunc(mat.getAlphaTestThreshold()); } - // Bind ZBuffer Part. //=================== _DriverGLStates.enableZWrite(mat.getFlags()&IDRV_MAT_ZWRITE); @@ -526,7 +507,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) _CurrentMaterial=&mat; } - // 4. Misc //===================================== @@ -547,7 +527,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat) return true; } - // *************************************************************************** sint CDriverGL::beginMultiPass() { @@ -574,6 +553,7 @@ sint CDriverGL::beginMultiPass() default: return 1; } } + // *************************************************************************** void CDriverGL::setupPass(uint pass) { @@ -607,7 +587,6 @@ void CDriverGL::setupPass(uint pass) } } - // *************************************************************************** void CDriverGL::endMultiPass() { @@ -640,7 +619,6 @@ void CDriverGL::endMultiPass() } } - // *************************************************************************** void CDriverGL::computeLightMapInfos (const CMaterial &mat) { @@ -682,7 +660,6 @@ void CDriverGL::computeLightMapInfos (const CMaterial &mat) // NB: _NLightMaps==0 means there is no lightmaps at all. } - // *************************************************************************** sint CDriverGL::beginLightMapMultiPass () { @@ -714,13 +691,13 @@ sint CDriverGL::beginLightMapMultiPass () // Manage too if no lightmaps. return std::max (_NLightMapPass, (uint)1); } + // *************************************************************************** void CDriverGL::setupLightMapPass(uint pass) { H_AUTO_OGL(CDriverGL_setupLightMapPass) const CMaterial &mat= *_CurrentMaterial; - // common colors static uint32 packedColorBlack= CRGBA(0,0,0,255).getPacked(); static GLfloat glcolBlack[4]= {0.f,0.f,0.f,1.f}; @@ -759,7 +736,6 @@ void CDriverGL::setupLightMapPass(uint pass) nlassert(pass<_NLightMapPass); - // setup Texture Pass. //========================= uint lmapId; @@ -953,7 +929,6 @@ void CDriverGL::setupLightMapPass(uint pass) } } - // setup blend / lighting. //========================= @@ -1012,7 +987,6 @@ void CDriverGL::setupLightMapPass(uint pass) } } - // Dynamic lighting: The influence of the dynamic light must be added only in the first pass (only one time) if(pass==0) { @@ -1026,6 +1000,7 @@ void CDriverGL::setupLightMapPass(uint pass) else if(pass==1) _DriverGLStates.setDiffuse(packedColorBlack, glcolBlack); } + // *************************************************************************** void CDriverGL::endLightMapMultiPass() { @@ -1057,7 +1032,6 @@ void CDriverGL::endLightMapMultiPass() } } - // *************************************************************************** void CDriverGL::resetLightMapVertexSetup() { @@ -1079,7 +1053,6 @@ void CDriverGL::resetLightMapVertexSetup() _LastVertexSetupIsLightMap= false; } - // *************************************************************************** void CDriverGL::startSpecularBatch() { @@ -1185,6 +1158,7 @@ sint CDriverGL::beginSpecularMultiPass() else return 2; } + // *************************************************************************** void CDriverGL::setupSpecularPass(uint pass) { @@ -1308,10 +1282,9 @@ void CDriverGL::setupSpecularPass(uint pass) } } else - { // We have to do it in 2 passes - + { + // We have to do it in 2 passes // For Both Pass, setup correct Env. - if( pass == 0 ) { // Just display the texture _DriverGLStates.enableBlend(false); @@ -1333,7 +1306,6 @@ void CDriverGL::setupSpecularPass(uint pass) activateTexEnvMode(0, env); - // Set stage 1 if( mat.getTexture(0) == NULL ) { @@ -1355,6 +1327,7 @@ void CDriverGL::setupSpecularPass(uint pass) } } } + // *************************************************************************** void CDriverGL::endSpecularMultiPass() { @@ -1364,7 +1337,6 @@ void CDriverGL::endSpecularMultiPass() setupSpecularEnd(); } - // a functor that can is used to generate a cube map used for specular / diffuse lighting struct CSpecCubeMapFunctor : ICubeMapFunctor { @@ -1380,13 +1352,11 @@ struct CSpecCubeMapFunctor : ICubeMapFunctor float Exp; }; - /* /// parameters for specular cube map generation const uint MaxSpecularExp = 64; const uint SpecularExpStep = 8; const uint SpecularMapSize = 32; */ - // *************************************************************************** CTextureCube *CDriverGL::getSpecularCubeMap(uint exp) { @@ -1434,7 +1404,6 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp) NLMISC::clamp(exp, 1u, (MaxExponent - 1)); - uint cubeMapIndex = expToCubeMap[exp]; nlassert(cubeMapIndex < numCubeMap); @@ -1542,7 +1511,6 @@ void CDriverGL::setupPPLPass(uint pass) // setup the tex envs - // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0) { @@ -1591,8 +1559,6 @@ void CDriverGL::setupPPLPass(uint pass) env.Env.SrcArg1Alpha = CMaterial::Diffuse; activateTexEnvMode(1, env); - - // Stage 2 is rgb = SpecularCubeMap * SpecularLightColor + Prec * 1 // alpha = prec alpha @@ -1674,7 +1640,6 @@ void CDriverGL::endPPLMultiPass() // nothing to do there ... } - // ******PER PIXEL LIGHTING, NO SPECULAR************************************** sint CDriverGL::beginPPLNoSpecMultiPass() { @@ -1704,7 +1669,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass) activateTexture(0, tex0); activateTexture(1, mat.getTexture(0)); - for (uint k = 2; k < inlGetNumTextStages(); ++k) { activateTexture(k, NULL); @@ -1712,7 +1676,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass) // setup the tex envs - // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 (TODO : EnvCombine3) if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0) { @@ -1784,7 +1747,6 @@ void CDriverGL::endPPLNoSpecMultiPass() } }*/ - // *************************************************************************** /*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat) { @@ -1999,7 +1961,6 @@ void CDriverGL::endCloudMultiPass() } } - // *************************************************************************** sint CDriverGL::beginWaterMultiPass() { @@ -2088,7 +2049,6 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) } } - // *************************************************************************** /** water setup for ARB_fragment_program */ @@ -2175,7 +2135,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat) } } - // *************************************************************************** /** Presetupped texture shader for water shader on NV20 */ @@ -2187,7 +2146,6 @@ static const uint8 WaterNoDiffuseTexAddrMode[IDRV_MAT_MAXTEXTURES] = CMaterial::TextureOff }; - static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] = { CMaterial::FetchTexture, @@ -2198,7 +2156,6 @@ static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] = static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f }; - // *************************************************************************** void CDriverGL::setupWaterPassNV20(const CMaterial &mat) { diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm index 02b90c589..a4eb72077 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm @@ -319,7 +319,7 @@ bool isTextKeyEvent(NSEvent* event) /* TODO check why iswprint(character) does not solve it. - it always returns false, even for π é ... + it always returns false, even for π, é, ... */ // > 127 but not printable if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 || @@ -408,13 +408,6 @@ void submitEvents(NLMISC::CEventServer& server, case NSMouseEntered:break; case NSMouseExited:break; case NSKeyDown: - /* - TODO dead keys - http://developer.apple.com/mac/library/documentation/Carbon/Reference/ - Unicode_Utilities_Ref/Reference/reference.html#//apple_ref/c/func/ - UCKeyTranslate - */ - // push the key press event to the new event server server.postEvent(new NLMISC::CEventKeyDown( virtualKeycodeToNelKey([event keyCode]), diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h index db1eb5323..6557128e1 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.h @@ -21,12 +21,36 @@ /** * derived to configure the NSOpenGLView */ -@interface CocoaOpenGLView : NSOpenGLView +@interface CocoaOpenGLView : NSOpenGLView { + NSMutableAttributedString* backingStore; + NSRange markedRange; } +-(id)initWithFrame:(NSRect)frame; +-(void)dealloc; + -(BOOL)acceptsFirstResponder; -(BOOL)needsPanelToBecomeKey; -(void)keyDown:(NSEvent*)event; +/******************************************************************************/ +/* NSTextInputClient Protocol */ + +-(BOOL)hasMarkedText; +-(NSRange)markedRange; +-(NSRange)selectedRange; +-(void)setMarkedText:(id)aString + selectedRange:(NSRange)newSelection + replacementRange:(NSRange)replacementRange; +-(void)unmarkText; +-(NSArray*)validAttributesForMarkedText; +-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange; +-(void)insertText:(id)aString replacementRange:(NSRange)replacementRange; +-(NSUInteger)characterIndexForPoint:(NSPoint)aPoint; +-(NSRect)firstRectForCharacterRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange; +-(void)doCommandBySelector:(SEL)aSelector; + @end diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m index 954c9c89e..0c816a4d4 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_opengl_view.m @@ -20,6 +20,21 @@ @implementation CocoaOpenGLView +- (id)initWithFrame:(NSRect)frame +{ + if(self = [super initWithFrame:frame]) + { + backingStore = [[NSMutableAttributedString alloc] initWithString:@""]; + return self; + } + return nil; +} + +- (void)dealloc +{ + [backingStore release]; + [super dealloc]; +} -(BOOL)acceptsFirstResponder { return YES; @@ -32,11 +47,87 @@ -(void)keyDown:(NSEvent*)event { - // we handle the key here, so os x does not make a sound :) - /* - TODO do it in the event emitter? eg do not forward key down? - does command+q / command+m still work then? - */ + [[self inputContext] handleEvent:event]; +} + +/******************************************************************************/ +/* NSTextInputClient Protocol */ + +-(BOOL)hasMarkedText +{ + return (markedRange.location == NSNotFound ? NO : YES); +} + +-(NSRange)markedRange +{ + return markedRange; +} + +-(NSRange)selectedRange +{ + return NSMakeRange(NSNotFound, 0); +} + +-(void)setMarkedText:(id)aString + selectedRange:(NSRange)newSelection + replacementRange:(NSRange)replacementRange +{ + if(replacementRange.location == NSNotFound) + replacementRange = markedRange; + + if([aString length] == 0) + { + [backingStore deleteCharactersInRange:replacementRange]; + [self unmarkText]; + } + else + { + markedRange = NSMakeRange(replacementRange.location, [aString length]); + [backingStore replaceCharactersInRange:replacementRange withString:aString]; + } +} + +-(void)unmarkText +{ + markedRange = NSMakeRange(NSNotFound, 0); + [[self inputContext] discardMarkedText]; +} + +-(NSArray*)validAttributesForMarkedText +{ + return [NSArray arrayWithObjects: + NSMarkedClauseSegmentAttributeName, NSGlyphInfoAttributeName, nil]; +} + +-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange +{ + return [backingStore attributedSubstringFromRange:aRange]; +} + +-(void)insertText:(id)aString + replacementRange:(NSRange)replacementRange +{ + if(replacementRange.location == NSNotFound) + replacementRange = markedRange; + + [backingStore replaceCharactersInRange:replacementRange withString:aString]; +} + +-(NSUInteger)characterIndexForPoint:(NSPoint)aPoint +{ + return 0; +} + +-(NSRect)firstRectForCharacterRange:(NSRange)aRange + actualRange:(NSRangePointer)actualRange +{ + return NSMakeRect(0, 0, 0, 0); +} + +-(void)doCommandBySelector:(SEL)aSelector +{ + [super doCommandBySelector:aSelector]; } @end diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.h b/code/nel/src/3d/driver/opengl/unix_event_emitter.h index 9b28aa67e..ea0dde021 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.h +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.h @@ -32,7 +32,7 @@ namespace NLMISC { /** - * TODO Class description + * CEventEmitter UNIX implementation * \author Vianney Lecroart * \author Nevrax France * \date 2000 diff --git a/code/nel/src/3d/driver_user2.cpp b/code/nel/src/3d/driver_user2.cpp index 7ab303f09..0999ef975 100644 --- a/code/nel/src/3d/driver_user2.cpp +++ b/code/nel/src/3d/driver_user2.cpp @@ -135,17 +135,16 @@ UMaterial CDriverUser::createMaterial() // *************************************************************************** void CDriverUser::deleteMaterial(UMaterial &umat) { - delete umat.getObjectPtr(); umat.detach(); } // *************************************************************************** -UAnimationSet *CDriverUser::createAnimationSet() +UAnimationSet *CDriverUser::createAnimationSet(bool headerOptim) { - - return _AnimationSets.insert(new CAnimationSetUser(this)); + return _AnimationSets.insert(new CAnimationSetUser(this, headerOptim)); } + // *************************************************************************** UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSetFile) { @@ -157,10 +156,10 @@ UAnimationSet *CDriverUser::createAnimationSet(const std::string &animationSet f.open(path); return _AnimationSets.insert(new CAnimationSetUser(this, f)); } + // *************************************************************************** void CDriverUser::deleteAnimationSet(UAnimationSet *animationSet) { - _AnimationSets.erase((CAnimationSetUser*)animationSet, "deleteAnimationSet(): Bad AnimationSet ptr"); } diff --git a/code/nel/src/3d/shadow_map_manager.cpp b/code/nel/src/3d/shadow_map_manager.cpp index 34ab87bcd..55a4b272f 100644 --- a/code/nel/src/3d/shadow_map_manager.cpp +++ b/code/nel/src/3d/shadow_map_manager.cpp @@ -257,7 +257,7 @@ void CShadowMapManager::renderGenerate(CScene *scene) if(driverForShadowGeneration) driverForShadowGeneration->getWindowSize(wndW, wndH); uint baseTextureSize= scene->getShadowMapTextureSize(); - // Minimize the Dest Texture size, so the blurTexture don't get to heavy in VRAM. + // Minimize the Dest Texture size, so the blurTexture don't get too heavy in VRAM. uint32 textDestW= min(wndW, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE); uint32 textDestH= min(wndH, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE); diff --git a/code/nel/src/cegui.vcproj b/code/nel/src/cegui.vcproj index 5535984ae..b207fa1d8 100644 --- a/code/nel/src/cegui.vcproj +++ b/code/nel/src/cegui.vcproj @@ -1,7 +1,7 @@  + @@ -22,6 +25,21 @@ ConfigurationType="4" CharacterSet="2" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/nel/src/sound/driver/dsound/source_dsound.h b/code/nel/src/sound/driver/dsound/source_dsound.h index 028317a21..153fcecdb 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.h +++ b/code/nel/src/sound/driver/dsound/source_dsound.h @@ -459,51 +459,51 @@ private: #if EAX_AVAILABLE == 1 LPKSPROPERTYSET _EAXSource; #endif - - + + #if NLSOUND_PROFILE - + public: - - static double _LastSwapTime; - static double _TotalSwapTime; - static double _MaxSwapTime; - static double _MinSwapTime; - static uint32 _SwapCount; - - static double _TotalUpdateTime; - static double _MaxUpdateTime; - static double _MinUpdateTime; - static uint32 _UpdateCount; - static uint32 _TotalUpdateSize; - - static double _PosTime; - static double _LockTime; - static double _CopyTime; - static double _UnlockTime; - static uint32 _CopyCount; - + + static double _LastSwapTime; + static double _TotalSwapTime; + static double _MaxSwapTime; + static double _MinSwapTime; + static uint32 _SwapCount; + + static double _TotalUpdateTime; + static double _MaxUpdateTime; + static double _MinUpdateTime; + static uint32 _UpdateCount; + static uint32 _TotalUpdateSize; + + static double _PosTime; + static double _LockTime; + static double _CopyTime; + static double _UnlockTime; + static uint32 _CopyCount; + public: - - static double getTestLast() { return 1000.0f * _LastSwapTime; }; - static double getTestMax() { return 1000.0f * _MaxSwapTime; }; - static double getTestMin() { return 1000.0f * _MinSwapTime; }; - static double getTestAverage() { return (_SwapCount > 0) ? 1000.0f * _TotalSwapTime / _SwapCount : 0.0; }; - - static double getAveragePosTime() { return (_CopyCount > 0) ? 1000.0f * _PosTime / _CopyCount : 0.0; }; - static double getAverageLockTime() { return (_CopyCount > 0) ? 1000.0f * _LockTime / _CopyCount : 0.0; }; - static double getAverageCopyTime() { return (_CopyCount > 0) ? 1000.0f * _CopyTime / _CopyCount : 0.0; }; - static double getAverageUnlockTime() { return (_CopyCount > 0) ? 1000.0f * _UnlockTime / _CopyCount : 0.0; }; - static double getAverageCumulTime() { return (_CopyCount > 0) ? 1000.0f * (_PosTime + _LockTime + _CopyTime + _UnlockTime) / _CopyCount : 0.0; }; - static uint getAverageUpdateSize() { return (_CopyCount > 0) ? (uint) (_TotalUpdateSize / _CopyCount) : 0; }; - - static double getMaxUpdateTime() { return 1000.0f * _MaxUpdateTime; }; - static double getMinUpdateTime() { return 1000.0f * _MinUpdateTime; }; - static double getAverageUpdateTime() { return (_UpdateCount > 0) ? 1000.0f * _TotalUpdateTime / _UpdateCount : 0.0; }; - - static double getTotalUpdateTime() { return 1000.0f * _TotalUpdateTime; }; - static double getUpdateBytesPerMsec() { return (_UpdateCount > 0) ? _TotalUpdateSize / _TotalUpdateTime / 1000.0 : 0.0; } - + + static double getTestLast() { return 1000.0f * _LastSwapTime; }; + static double getTestMax() { return 1000.0f * _MaxSwapTime; }; + static double getTestMin() { return 1000.0f * _MinSwapTime; }; + static double getTestAverage() { return (_SwapCount > 0) ? 1000.0f * _TotalSwapTime / _SwapCount : 0.0; }; + + static double getAveragePosTime() { return (_CopyCount > 0) ? 1000.0f * _PosTime / _CopyCount : 0.0; }; + static double getAverageLockTime() { return (_CopyCount > 0) ? 1000.0f * _LockTime / _CopyCount : 0.0; }; + static double getAverageCopyTime() { return (_CopyCount > 0) ? 1000.0f * _CopyTime / _CopyCount : 0.0; }; + static double getAverageUnlockTime() { return (_CopyCount > 0) ? 1000.0f * _UnlockTime / _CopyCount : 0.0; }; + static double getAverageCumulTime() { return (_CopyCount > 0) ? 1000.0f * (_PosTime + _LockTime + _CopyTime + _UnlockTime) / _CopyCount : 0.0; }; + static uint getAverageUpdateSize() { return (_CopyCount > 0) ? (uint) (_TotalUpdateSize / _CopyCount) : 0; }; + + static double getMaxUpdateTime() { return 1000.0f * _MaxUpdateTime; }; + static double getMinUpdateTime() { return 1000.0f * _MinUpdateTime; }; + static double getAverageUpdateTime() { return (_UpdateCount > 0) ? 1000.0f * _TotalUpdateTime / _UpdateCount : 0.0; }; + + static double getTotalUpdateTime() { return 1000.0f * _TotalUpdateTime; }; + static double getUpdateBytesPerMsec() { return (_UpdateCount > 0) ? _TotalUpdateSize / _TotalUpdateTime / 1000.0 : 0.0; } + #endif }; diff --git a/code/nel/src/sound/driver/source.cpp b/code/nel/src/sound/driver/source.cpp index 7c422b701..31fc14445 100644 --- a/code/nel/src/sound/driver/source.cpp +++ b/code/nel/src/sound/driver/source.cpp @@ -17,6 +17,8 @@ #include "nel/sound/driver/source.h" #include "nel/misc/common.h" +#include + using namespace NLMISC; namespace NLSOUND @@ -25,12 +27,15 @@ namespace NLSOUND // common method used only with OptionManualRolloff. return the volume in 1/100th DB ( = mB) modified sint32 ISource::computeManualRollOff(sint32 volumeMB, sint32 mbMin, sint32 mbMax, double alpha, float sqrdist, float distMin, float distMax) { + // root square of max float value + static float maxSqrt = sqrt(std::numeric_limits::max()); + if (sqrdist < distMin * distMin) { // no attenuation return volumeMB; } - else if (sqrdist > distMax * distMax) + else if ((distMax < maxSqrt) && (sqrdist > distMax * distMax)) { // full attenuation return mbMin; diff --git a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp index 3d58a0cac..236c2727e 100644 --- a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp +++ b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp @@ -50,7 +50,7 @@ int main(int argc, char* argv[]) if (argc!=2) { // Doc.. - printf("build_coarse_mesh [config_file.cfg]\n"); + nlinfo("build_coarse_mesh [config_file.cfg]\n"); } else { @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) std::string outputPath=list_mesh.asString (i*2+1); // Output - printf ("Loading %s...\n", intputPath.c_str()); + nlinfo ("Loading %s...\n", intputPath.c_str()); // File CIFile inputFile; @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) if (coarseMeshes.size()>0) { // Output text - printf ("Compute the coarse meshes...\n"); + nlinfo ("Compute the coarse meshes...\n"); // A bitmap vector coarseBitmap; @@ -200,7 +200,7 @@ int main(int argc, char* argv[]) for (i=0; i + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - +#include "../../plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.h" extern ClassDesc2* GetLigoscapeDesc(); @@ -26,6 +28,13 @@ int controlsInit = FALSE; BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { + // initialize nel context + if (!NLMISC::INelContext::isContextInitialised()) + { + new NLMISC::CLibraryContext(GetSharedNelContext()); + nldebug("NeL Ligoscape Utility: DllMain"); + } + hInstance = hinstDLL; // Hang on to this DLL's instance handle. if (!controlsInit) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.vcproj b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.vcproj index 91edfce38..33c58daaf 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.vcproj +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + . +class CPatchAllocator; + #ifdef NEL_3DSMAX_SHARED_EXPORTS #define NEL_3DSMAX_SHARED_API __declspec(dllexport) #else #define NEL_3DSMAX_SHARED_API __declspec(dllimport) #endif -extern NEL_3DSMAX_SHARED_API CPatchAllocator& GetAllocator (); +extern NEL_3DSMAX_SHARED_API CPatchAllocator& GetAllocator(); +extern NEL_3DSMAX_SHARED_API NLMISC::INelContext &GetSharedNelContext(); diff --git a/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp index ac9868e97..61337b328 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp @@ -18,6 +18,7 @@ #include "nel_export.h" #include "nel/3d/register_3d.h" #include "nel/misc/app_context.h" +#include "../nel_3dsmax_shared/nel_3dsmax_shared.h" extern ClassDesc2* GetCNelExportDesc(); @@ -30,7 +31,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { // initialize nel context if (!NLMISC::INelContext::isContextInitialised()) - new NLMISC::CApplicationContext(); + { + new NLMISC::CLibraryContext(GetSharedNelContext()); + nldebug("NeL Export: DllMain"); + } hInstance = hinstDLL; // Hang on to this DLL's instance handle. diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index 35a9bd6a0..04e815eac 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -317,9 +317,15 @@ static BOOL CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA // Get the node INode* pNode=theCNelExport._Ip->GetSelNode (nNode); + if (pNode == NULL) + nlwarning("pNode == NULL"); + + if (pNode->GetName() == NULL) + nlwarning("pNode->GetName()"); + // Name of the node char sNodeMsg[256]; - sprintf (sNodeMsg, "Save %s model...", pNode->GetName()); + nlwarning (sNodeMsg, "Save %s model...", pNode->GetName()); // It is a zone ? if (RPO::isZone (*pNode, time)) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.vcproj b/code/nel/tools/3d/plugin_max/nel_export/nel_export.vcproj index 65fadc12d..565fde7c8 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.vcproj +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + deleteLM( *node); - if (theCNelExport.exportMesh (sPath, *node, ip->GetTime())) - ret = &true_value; + // Is the flag dont export set ? + if (CExportNel::getScriptAppData (node, NEL3D_APPDATA_DONTEXPORT, 0)) + return ret; + // Object is flagged as a collision? + int bCol= CExportNel::getScriptAppData(node, NEL3D_APPDATA_COLLISION, BST_UNCHECKED); + if(bCol == BST_CHECKED) + return ret; + + // Export + theCNelExport._ExportNel->deleteLM( *node); + if (theCNelExport.exportMesh (sPath, *node, ip->GetTime())) + ret = &true_value; + } + catch (Exception &e) + { + nlwarning ("ERROR (NelExportShape) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportShape) catch (...)"); + } + nlinfo("ret"); return ret; } @@ -129,7 +142,8 @@ Value* export_shape_ex_cf (Value** arg_list, int count) // Get a INode pointer from the argument passed to us INode *node = arg_list[0]->to_node(); - nlassert (node); + nlassert(node); + nlassert(node->GetName()); // Export path std::string sPath=arg_list[1]->to_string(); @@ -167,9 +181,13 @@ Value* export_shape_ex_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportShapeEx) %s", e.what()); } - + catch (...) + { + nlwarning ("ERROR (NelExportShapeEx) catch (...)"); + } + nlinfo("ret"); return ret; } @@ -207,7 +225,11 @@ Value* export_skeleton_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportSkeleton) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportSkeleton) catch (...)"); } return ret; @@ -274,7 +296,11 @@ Value* export_animation_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportAnimation) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportAnimation) catch (...)"); } return ret; } @@ -328,7 +354,11 @@ Value* export_ig_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportInstanceGroup) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportInstanceGroup) catch (...)"); } return ret; @@ -383,7 +413,11 @@ Value* export_skeleton_weight_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportSkeletonWeight) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportSkeletonWeight) catch (...)"); } return ret; @@ -397,9 +431,20 @@ Value* view_shape_cf (Value** arg_list, int count) // Get a good interface pointer Interface *ip = MAXScript_interface; - theCNelExport.init (true, true, ip, true); + try + { + theCNelExport.init (true, true, ip, true); - theCNelExport.viewMesh (ip->GetTime()); + theCNelExport.viewMesh (ip->GetTime()); + } + catch (Exception &e) + { + nlwarning ("ERROR %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR catch (...)"); + } return &true_value; } @@ -496,9 +541,20 @@ Value* export_vegetable_cf (Value** arg_list, int count) // Ok ? Boolean *ret=&false_value; - // Export - if (theCNelExport.exportVegetable (sPath, *node, ip->GetTime())) - ret = &true_value; + try + { + // Export + if (theCNelExport.exportVegetable (sPath, *node, ip->GetTime())) + ret = &true_value; + } + catch (Exception &e) + { + nlwarning ("ERROR (NelExportVegetable) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportVegetable) catch (...)"); + } return ret; } @@ -586,7 +642,11 @@ Value* export_collision_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportCollision) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportCollision) catch (...)"); } return ret; } @@ -639,7 +699,11 @@ Value* export_pacs_primitives_cf (Value** arg_list, int count) } catch (Exception &e) { - nlwarning ("ERROR %s", e.what()); + nlwarning ("ERROR (NelExportPACSPrimitives) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportPACSPrimitives) catch (...)"); } return ret; } @@ -674,9 +738,20 @@ Value* export_lod_character_cf (Value** arg_list, int count) // Ok ? Boolean *ret=&false_value; - // Export - if (theCNelExport.exportLodCharacter (sPath, *node, ip->GetTime())) - ret = &true_value; + try + { + // Export + if (theCNelExport.exportLodCharacter (sPath, *node, ip->GetTime())) + ret = &true_value; + } + catch (Exception &e) + { + nlwarning ("ERROR (NelExportLodCharacter) %s", e.what()); + } + catch (...) + { + nlwarning ("ERROR (NelExportLodCharacter) catch (...)"); + } return ret; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index 16f426e1f..9f5d95441 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -98,7 +98,7 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) return false; if( deleteIt ) - delete maxLight; + maxLight->DeleteMe(); return true; } @@ -295,7 +295,7 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) this->rSoftShadowConeLength = (float)atof(sTmp.c_str()); if( deleteIt ) - delete maxLight; + maxLight->DeleteMe(); } // *********************************************************************************************** diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp index 1724c7661..b0264a8e9 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp @@ -135,7 +135,7 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector & // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp index a9d30a002..14b38ad78 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp @@ -237,7 +237,7 @@ void CExportNel::getLights (std::vector& vectLight, TimeValue time, INod // Delete the triObject if we should... if (deleteIt) - delete maxLight; + maxLight->DeleteMe(); } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp index 0e7ff71a0..baccbe17b 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp @@ -177,7 +177,7 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp index d4e2f9358..afa742b61 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp @@ -107,7 +107,7 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); } } @@ -441,7 +441,7 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); } } @@ -1388,7 +1388,7 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); } } @@ -2033,7 +2033,7 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); nlinfo("WaterShape : build succesful"); return ws; } @@ -2074,7 +2074,7 @@ bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue t if (deleteIt) { #ifndef NL_DEBUG - delete tri; + tri->DeleteMe(); #endif // NL_DEBUG } return true; diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp index 08d4ef5e1..4ec4f5ba3 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp @@ -178,7 +178,7 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) // if (deleteIt) { - delete tri; + tri->DeleteMe(); } return true; } @@ -358,7 +358,7 @@ static void AddNodeToQuadGrid(const NLMISC::CAABBox &delimiter, TNodeFaceQG &des // if (deleteIt) { - delete tri; + tri->DeleteMe(); } } } @@ -487,7 +487,7 @@ static bool SelectVerticesInMeshFromInterfaces(const std::vector if (obj != tri) { // not a mesh object, so do nothing - delete tri; + tri->DeleteMe(); return false; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 37e9b94c7..0f2ebdc18 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -1257,7 +1257,7 @@ void CExportNel::buildCamera(NL3D::CCameraInfo &cameraInfo, INode& node, TimeVal cameraInfo.Fov = genCamera->GetFOV(time); if (deleteIt) - delete genCamera; + genCamera->DeleteMe(); } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp index a3f9b532a..8395d11ce 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp @@ -597,6 +597,7 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v else { // What??? + nlerror("sLightBuild.Type == %i", (uint32)(sLightBuild.Type)); nlstop; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index bb5d9ee4f..c48b840c7 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -1423,7 +1423,7 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st // Delete the triObject if we should... if (deleteIt) - delete tri; + tri->DeleteMe(); // ok! ok= true; diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp index 7db4cb7df..6c054404a 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp @@ -151,7 +151,7 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo } if (deleteIt) - delete tri; + tri->DeleteMe(); } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/nel_mesh_lib.vcproj b/code/nel/tools/3d/plugin_max/nel_mesh_lib/nel_mesh_lib.vcproj index ced78d327..b2b18fcc2 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/nel_mesh_lib.vcproj +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/nel_mesh_lib.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +#include "../nel_3dsmax_shared/nel_3dsmax_shared.h" HINSTANCE hInstance; int controlsInit = FALSE; @@ -24,6 +25,13 @@ using namespace NLMISC; /** public functions **/ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { + // initialize nel context + if (!NLMISC::INelContext::isContextInitialised()) + { + new NLMISC::CLibraryContext(GetSharedNelContext()); + nldebug("NeL Patch Edit: DllMain"); + } + if (fdwReason == DLL_PROCESS_ATTACH) { hInstance = hinstDLL; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/nel_patch_edit_adv.vcproj b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/nel_patch_edit_adv.vcproj index 384b04e89..a55e06453 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/nel_patch_edit_adv.vcproj +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/nel_patch_edit_adv.vcproj @@ -11,116 +11,18 @@ + - - - - - - - - - - - - - - - - - - - @@ -219,7 +121,6 @@ OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -316,11 +217,10 @@ /> @@ -338,29 +238,28 @@ /> @@ -439,31 +336,31 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2338,28 +581,28 @@ /> - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + #define VERTEX_TREE_PAINT_CLASS_ID Class_ID(0x40c7005e, 0x2a95082c) #define CID_PAINT (CID_USER+0x439c) diff --git a/code/nel/tools/3d/plugin_max/plugin_max_public.sln b/code/nel/tools/3d/plugin_max/plugin_max_public.sln index fa33445c2..732bb0430 100644 --- a/code/nel/tools/3d/plugin_max/plugin_max_public.sln +++ b/code/nel/tools/3d/plugin_max/plugin_max_public.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nel_3dsmax_shared", "nel_3dsmax_shared\nel_3dsmax_shared.vcproj", "{CDFC60B0-9D01-4822-ACAD-B66F7130FCAD}" ProjectSection(ProjectDependencies) = postProject {263C0F2E-112D-437F-A6AB-DEA151A7A1F0} = {263C0F2E-112D-437F-A6AB-DEA151A7A1F0} @@ -155,6 +155,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nel_patch_edit", "nel_patch EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nel_vertex_tree_paint", "nel_vertex_tree_paint\nel_vertex_tree_paint.vcproj", "{680F9C48-975D-425A-89DF-D7AC3C093968}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + {CDFC60B0-9D01-4822-ACAD-B66F7130FCAD} = {CDFC60B0-9D01-4822-ACAD-B66F7130FCAD} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms new file mode 100644 index 000000000..b6b5e0434 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -0,0 +1,183 @@ + + +include "nel_utility.ms" + +fn getAbsoluteSource t = +( + return (mapPaths.getFullFilePath ((getFilenameFile (filenameFromPath t)) + ".png")) +) + +fn getAbsoluteDestination t = +( + if ((findString t "\\\\Amiga") != undefined) then + ( + return ("W:\\" + (substring (getFilenamePath t) 11 -1) + "\\" + (getFilenameFile (filenameFromPath t)) + ".png") + ) + else if ((findString t "\\\\amiga") != undefined) then + ( + return ("W:\\" + (substring (getFilenamePath t) 11 -1) + "\\" + (getFilenameFile (filenameFromPath t)) + ".png") + ) + else if ((findString t "W:\\") != undefined) then + ( + return ((getFilenamePath t) + "\\" + (getFilenameFile (filenameFromPath t)) + ".png") + ) + else if ((findString t "\\tronc.") != undefined) then + ( + return "W:\\database\\database_proto\\stuff\\fyros\\objects\\tronc.png" + ) + else if ((findString t "\\trame.") != undefined) then + ( + return "W:\\database\\stuff\\lod_actors\\texture_lod\\trame.png" + ) + else if ((findString t "\\PR_MO_phytopsy_tete01_Boss.") != undefined) then + ( + return "W:\\database\\Stuff\\Tryker\\Agents\\_textures\\monster\\PR_MO_phytopsy_tete01_Boss.png" + ) + else + ( + return t + ) +) + +fn getFixedTexturePath t = +( + if (doesFileExist (getAbsoluteSource t)) then + ( + if not (doesFileExist (getAbsoluteDestination t)) then + ( + makeDir (getFilenamePath (getAbsoluteDestination t)) all:true + renameFile (getAbsoluteSource t) (getAbsoluteDestination t) + ) + if (doesFileExist (getAbsoluteDestination t)) then + ( + if (getAbsoluteDestination t) != (getAbsoluteSource t) then + ( + deleteFile (getAbsoluteSource t) + ) + ) + ) + return (getAbsoluteDestination t) +) + +fn renameTexture t = +( + try + ( + if (t != undefined) then + ( + if (classof t == NelBitmapTexture) then + ( + if (t.bitmap1FileName != "") then (t.bitmap1FileName = getFixedTexturePath t.bitmap1FileName) + if (t.bitmap2FileName != "") then (t.bitmap2FileName = getFixedTexturePath t.bitmap2FileName) + if (t.bitmap3FileName != "") then (t.bitmap3FileName = getFixedTexturePath t.bitmap3FileName) + if (t.bitmap4FileName != "") then (t.bitmap4FileName = getFixedTexturePath t.bitmap4FileName) + if (t.bitmap5FileName != "") then (t.bitmap5FileName = getFixedTexturePath t.bitmap5FileName) + if (t.bitmap6FileName != "") then (t.bitmap6FileName = getFixedTexturePath t.bitmap6FileName) + if (t.bitmap7FileName != "") then (t.bitmap7FileName = getFixedTexturePath t.bitmap7FileName) + if (t.bitmap8FileName != "") then (t.bitmap8FileName = getFixedTexturePath t.bitmap8FileName) + renameTexture t.bitmap + if (t.bitmap.fileName == undefined) then + ( + if (doesFileExist (mapPaths.getFullFilePath t.bitmap1FileName)) then (t.bitmap.fileName = t.bitmap1FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap2FileName)) then (t.bitmap.fileName = t.bitmap2FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap3FileName)) then (t.bitmap.fileName = t.bitmap3FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap4FileName)) then (t.bitmap.fileName = t.bitmap4FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap5FileName)) then (t.bitmap.fileName = t.bitmap5FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap6FileName)) then (t.bitmap.fileName = t.bitmap6FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap7FileName)) then (t.bitmap.fileName = t.bitmap7FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap8FileName)) then (t.bitmap.fileName = t.bitmap8FileName) + ) + else if not (doesFileExist (mapPaths.getFullFilePath t.bitmap.fileName)) then + ( + if (doesFileExist (mapPaths.getFullFilePath t.bitmap1FileName)) then (t.bitmap.fileName = t.bitmap1FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap2FileName)) then (t.bitmap.fileName = t.bitmap2FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap3FileName)) then (t.bitmap.fileName = t.bitmap3FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap4FileName)) then (t.bitmap.fileName = t.bitmap4FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap5FileName)) then (t.bitmap.fileName = t.bitmap5FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap6FileName)) then (t.bitmap.fileName = t.bitmap6FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap7FileName)) then (t.bitmap.fileName = t.bitmap7FileName) + else if (doesFileExist (mapPaths.getFullFilePath t.bitmap8FileName)) then (t.bitmap.fileName = t.bitmap8FileName) + ) + t.delegate.RGBOutput = 0 + t.delegate.monoOutput = 1 + t.delegate.alphasource = 2 + ) + else if (classof t == Reflect_Refract) then + ( + if (t.bitmapName[1] != undefined) then (t.bitmapName[1] = getFixedTexturePath t.bitmapName[1]) + if (t.bitmapName[2] != undefined) then (t.bitmapName[2] = getFixedTexturePath t.bitmapName[2]) + if (t.bitmapName[3] != undefined) then (t.bitmapName[3] = getFixedTexturePath t.bitmapName[3]) + if (t.bitmapName[4] != undefined) then (t.bitmapName[4] = getFixedTexturePath t.bitmapName[4]) + if (t.bitmapName[5] != undefined) then (t.bitmapName[5] = getFixedTexturePath t.bitmapName[5]) + if (t.bitmapName[6] != undefined) then (t.bitmapName[6] = getFixedTexturePath t.bitmapName[6]) + if (t.outputname != undefined) then (t.outputname = getFixedTexturePath t.outputname) + ) + else + ( + if (t.fileName != undefined) then (t.fileName = getFixedTexturePath t.fileName) + if (classof t == BitmapTexture) then + ( + t.RGBOutput = 0 + t.monoOutput = 1 + t.alphasource = 2 + ) + ) + ) + ) + catch + ( + + ) +) + + +rollout assets_png_rollout "Properties" +( + fn do_it = + ( + for m in getClassInstances BitmapTexture do + ( + renameTexture m + ) + + for m in getClassInstances NelBitmapTexture do + ( + renameTexture m + ) + + for m in getClassInstances NelMaterial do + ( + renameTexture m.tTexture_1 + renameTexture m.tTexture_2 + renameTexture m.tTexture_3 + renameTexture m.tTexture_4 + renameTexture m.tTexture_5 + renameTexture m.tTexture_6 + renameTexture m.tTexture_7 + renameTexture m.tTexture_8 + m.delegate.DiffuseMapEnable = m.bEnableSlot_1 + m.delegate.DiffuseMap = m.tTexture_1 + m.delegate.AmbientMapEnable = m.bEnableSlot_1 + m.delegate.AmbientMap = m.tTexture_1 + m.delegate.SpecularMapEnable = m.bEnableSlot_2 + m.delegate.SpecularMap = m.tTexture_2 + m.delegate.SelfIllumMap = undefined + m.delegate.OpacityMap = undefined + m.delegate.FilterMap = undefined + m.delegate.BumpMap = undefined + m.delegate.DisplacementMap = undefined + m.delegate.ReflectionMap = undefined + m.delegate.RefractionMap = undefined + ) + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40021" -- Selection: Select All + actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + return 1 + ) + + include "nel_batched_mergesave.ms" +) + +assets_png_floater = newRolloutFloater "NeL Assets PNG Database" 550 874 +addrollout assets_png_rollout assets_png_floater rolledUp:false + diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_batched_mergesave.ms b/code/nel/tools/3d/plugin_max/scripts/nel_batched_mergesave.ms new file mode 100644 index 000000000..5555a93f2 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_batched_mergesave.ms @@ -0,0 +1,251 @@ +-- This script is a base script to include to add multiple functionality to your script + +-- To use this script +-- Include it in your script into the rollout at the begining. +-- Implement a do_it function to do the job in your rollout. +-- The function should retun -1 if an arror occured, else the count of modification done +-- It the function returns <1, the project will not be overwritten + +Group "Running properties" +( + RadioButtons SourceFiles "Source projects" labels:#("Current project", "All Projects in a folder") align:#left + + Label DirectoryLabel "Source directory" align:#left + EditText Directory "" width:500 align:#left enabled:false + Button BrowseDirectory "Browse..." align:#left enabled:false + + CheckBox Recurse "Look in subfolders" checked:false enabled:false + CheckBox Test "Test only, do not save" checked:true enabled:false + CheckBox BackupFiles "Backup files" checked:true enabled:false + CheckBox StopOnError "Stop on error" checked:true enabled:false + + Label ProgressText width:500 align:#left + ProgressBar Progress width:500 align:#left + + Button GoButton "Go" width:500 align:#left +) + local countModifications + local countErrors + local fileModified + local fileParsed + + fn UpdateData = + ( + if SourceFiles.state == 2 then + isSourceDir = true + else + isSourceDir = false + if Test.checked == true then + isTest = true + else + isTest = false + + Directory.enabled = isSourceDir + BrowseDirectory.enabled = isSourceDir + Recurse.enabled = isSourceDir + Test.enabled = isSourceDir + BackupFiles.enabled = isSourceDir and (isTest == false) + StopOnError.enabled = isSourceDir + ) + + on SourceFiles changed state do + ( + UpdateData () + ) + + on Test changed state do + ( + UpdateData () + ) + + fn call_do_it = + ( + local result + + -- One more project + fileParsed = fileParsed + 1 + + -- Call it + result = do_it () + + -- Error ? + if result < 0 then + countErrors = countErrors + 1 + else + countModifications = countModifications + result + + -- Return result + return result + ) + + fn BackupFile file = + ( + local i + local newFilename + + i = 0 + while true do + ( + -- New file name + newFilename = file + ".backup_" + (i as string) + + -- File exist ? + if (fileExist newFilename) == false then + ( + if (copyFile file newFilename) == false then + return false + else + return true + ) + i = i + 1 + ) + ) + + fn RecurseFolder currentDirectory = + ( + local result + local file + local files + + -- Parse files + files = getFiles (currentDirectory+"/*.max") + + -- For each files + for i = 1 to files.count do + ( + -- File name + file = files[i] + + -- Progress bar + ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" + Progress.value = i*100/files.count + + resetMAXFile #noprompt + + -- Open the max project + if mergeMaxFile file quiet:true == true then + ( + result = call_do_it () + + -- Error ? + if result < 0 then + ( + if StopOnError.checked == true then + Messagebox ("Error in file " + file) + ) + else + ( + -- Save the max project ? + if (Test.checked == false) and (result != 0) then + ( + -- Backup the max project ? + local ok + ok = true + if BackupFiles.checked == true then + ( + -- Backup the file + if (BackupFile file) == false then + ( + -- Don't save the file because backup has failed + ok = false + + if StopOnError.checked == true then + Messagebox ("Can't backup file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + + -- Save the max project ? + if ok == true then + ( + if (saveMaxFile file) == true then + ( + fileModified = fileModified + 1 + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't write file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + ) + ) + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't load file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + + -- Parse sub directory ? + if (Recurse.checked == true) then + ( + local directories + + -- Get the directories + directories = getDirectories (currentDirectory+"/*") + + -- For each directories + for dir in directories do + ( + RecurseFolder dir + ) + ) + ) + + on BrowseDirectory pressed do + ( + local dir + try + ( + dir = getSavePath () -- caption:"Select the projects directory" + if dir != undefined then + Directory.text = dir + ) + catch + ( + ) + ) + + on GoButton pressed do + ( + -- Reset count + countModifications = 0 + countErrors = 0 + fileModified = 0 + fileParsed = 0 + + -- Get files in the shape_source_directory + if SourceFiles.state == 2 then + ( + -- Should warning user ? + if (SourceFiles.state == 2) and (Test.checked == false) then + ( + -- Warning ! + if ((queryBox "Warning, all the files in the specified folders will be overwrited.\nYou should backup your files before executing this script.\nDo you want to continue executing this script ?" beep:true) == true) then + RecurseFolder (adjustPathStringForScript Directory.text) + ) + else + ( + RecurseFolder (adjustPathStringForScript Directory.text) + ) + ) + else + ( + -- Just compute the current project + call_do_it () + ) + + -- Show errors + ProgressText.text = (fileParsed as string) + " project(s) opened, " + (countModifications as string) + " project modification(s), " + (fileModified as string) + " project(s) saved, " + (countErrors as string) + " error(s)." + Progress.value = 100 + ) diff --git a/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp b/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp index 71a8372dd..d1c6c7d6b 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp @@ -16,7 +16,9 @@ #include "tile_utility.h" #include +#include #include "nel/misc/app_context.h" +#include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include extern ClassDesc2* GetTile_utilityDesc(); @@ -35,7 +37,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { // initialize nel context if (!NLMISC::INelContext::isContextInitialised()) - new NLMISC::CApplicationContext(); + { + new NLMISC::CLibraryContext(GetSharedNelContext()); + nldebug("NeL Tile Utility: DllMain"); + } hInstance = hinstDLL; // Hang on to this DLL's instance handle. diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.vcproj b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.vcproj index 2fdeb4366..6ec61edd2 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.vcproj +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("configuration") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup build site") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +printLog(log, "This script will set up the buildsite configuration, and create needed directories.") +printLog(log, "To use the defaults, simply hit ENTER, else type in the new value.") +printLog(log, "Use -- if you need to insert an empty value.") +printLog(log, "") +BuildQuality = int(askVar(log, "Build Quality", str(BuildQuality))) +ToolDirectories[0] = askVar(log, "Primary Tool Directory", ToolDirectories[0]).replace("\\", "/") +ToolDirectories[1] = askVar(log, "Secondary Tool Directory", ToolDirectories[1]).replace("\\", "/") +ToolSuffix = askVar(log, "Tool Suffix", ToolSuffix) +ScriptDirectory = askVar(log, "Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/") +WorkspaceDirectory = askVar(log, "Workspace Directory", WorkspaceDirectory).replace("\\", "/") +DatabaseDirectory = askVar(log, "Database Directory", DatabaseDirectory).replace("\\", "/") +ExportBuildDirectory = askVar(log, "Export Build Directory", ExportBuildDirectory).replace("\\", "/") +ClientDataDirectory = askVar(log, "Client Data Directory", ClientDataDirectory).replace("\\", "/") +LeveldesignDirectory = askVar(log, "Leveldesign Directory", LeveldesignDirectory).replace("\\", "/") +LeveldesignDfnDirectory = askVar(log, "Leveldesign DFN Directory", LeveldesignDfnDirectory).replace("\\", "/") +LeveldesignWorldDirectory = askVar(log, "Leveldesign World Directory", LeveldesignWorldDirectory).replace("\\", "/") +MaxAvailable = int(askVar(log, "3dsMax Available", str(MaxAvailable))) +if MaxAvailable: + MaxDirectory = askVar(log, "3dsMax Directory", MaxDirectory).replace("\\", "/") + MaxUserDirectory = askVar(log, "3dsMax User Directory", MaxUserDirectory).replace("\\", "/") + MaxExecutable = askVar(log, "3dsMax Executable", MaxExecutable) +if os.path.isfile("configuration/buildsite.py"): + os.remove("configuration/buildsite.py") +sf = open("configuration/buildsite.py", "w") +sf.write("#!/usr/bin/python\n") +sf.write("# \n") +sf.write("# \\file site.py\n") +sf.write("# \\brief Site configuration\n") +sf.write("# \\date " + time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "\n") +sf.write("# \\author Jan Boon (Kaetemi)\n") +sf.write("# Python port of game data build pipeline.\n") +sf.write("# Site configuration.\n") +sf.write("# \n") +sf.write("# NeL - MMORPG Framework \n") +sf.write("# Copyright (C) 2010 Winch Gate Property Limited\n") +sf.write("# \n") +sf.write("# This program is free software: you can redistribute it and/or modify\n") +sf.write("# it under the terms of the GNU Affero General Public License as\n") +sf.write("# published by the Free Software Foundation, either version 3 of the\n") +sf.write("# License, or (at your option) any later version.\n") +sf.write("# \n") +sf.write("# This program is distributed in the hope that it will be useful,\n") +sf.write("# but WITHOUT ANY WARRANTY; without even the implied warranty of\n") +sf.write("# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n") +sf.write("# GNU Affero General Public License for more details.\n") +sf.write("# \n") +sf.write("# You should have received a copy of the GNU Affero General Public License\n") +sf.write("# along with this program. If not, see .\n") +sf.write("# \n") +sf.write("\n") +sf.write("\n") +sf.write("# *** SITE INSTALLATION ***\n") +sf.write("\n") +sf.write("# Use '/' in path name, not '\'\n") +sf.write("# Don't put '/' at the end of a directory name\n") +sf.write("\n") +sf.write("\n") +sf.write("# Quality option for this site (1 for BEST, 0 for DRAFT)\n") +sf.write("BuildQuality = " + str(BuildQuality) + "\n") +sf.write("\n") +sf.write("ToolDirectories = " + str(ToolDirectories) + "\n") +sf.write("ToolSuffix = \"" + str(ToolSuffix) + "\"\n") +sf.write("\n") +sf.write("# Build script directory\n") +sf.write("ScriptDirectory = \"" + str(ScriptDirectory) + "\"\n") +sf.write("WorkspaceDirectory = \"" + str(WorkspaceDirectory) + "\"\n") +sf.write("\n") +sf.write("# Data build directories\n") +sf.write("DatabaseDirectory = \"" + str(DatabaseDirectory) + "\"\n") +sf.write("ExportBuildDirectory = \"" + str(ExportBuildDirectory) + "\"\n") +sf.write("\n") +sf.write("# Client data install directory (client/data)\n") +sf.write("ClientDataDirectory = \"" + str(ClientDataDirectory) + "\"\n") +sf.write("\n") +sf.write("# TODO: NETWORK RECONNECT NOT IMPLEMENTED :)\n") +sf.write("\n") +sf.write("# Leveldesign directories\n") +sf.write("LeveldesignDirectory = \"" + str(LeveldesignDirectory) + "\"\n") +sf.write("LeveldesignDfnDirectory = \"" + str(LeveldesignDfnDirectory) + "\"\n") +sf.write("LeveldesignWorldDirectory = \"" + str(LeveldesignWorldDirectory) + "\"\n") +sf.write("\n") +sf.write("# 3dsMax directives\n") +sf.write("MaxAvailable = " + str(MaxAvailable) + "\n") +sf.write("MaxDirectory = \"" + str(MaxDirectory) + "\"\n") +sf.write("MaxUserDirectory = \"" + str(MaxUserDirectory) + "\"\n") +sf.write("MaxExecutable = \"" + str(MaxExecutable) + "\"\n") +sf.write("\n") +sf.write("\n") +sf.write("# end of file\n") +sf.close() + +sys.path.append(WorkspaceDirectory) +from projects import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the setup projects") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "0_setup.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("0_setup.log"): + os.remove("0_setup.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_setup.log") +shutil.move("log.log", "0_setup.log") diff --git a/code/nel/tools/build_gamedata/1_export.py b/code/nel/tools/build_gamedata/1_export.py new file mode 100644 index 000000000..697e175dd --- /dev/null +++ b/code/nel/tools/build_gamedata/1_export.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Run all export processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all export processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("configuration") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the export processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "1_export.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("1_export.log"): + os.remove("1_export.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_export.log") +shutil.move("log.log", "1_export.log") diff --git a/code/nel/tools/build_gamedata/2_build.py b/code/nel/tools/build_gamedata/2_build.py new file mode 100644 index 000000000..914ccf522 --- /dev/null +++ b/code/nel/tools/build_gamedata/2_build.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Run all build processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all build processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("configuration") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the build processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "2_build.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("2_build.log"): + os.remove("2_build.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_build.log") +shutil.move("log.log", "2_build.log") diff --git a/code/nel/tools/build_gamedata/3_install.py b/code/nel/tools/build_gamedata/3_install.py new file mode 100644 index 000000000..6a2a3f3ac --- /dev/null +++ b/code/nel/tools/build_gamedata/3_install.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Run all install processes +# \date 2009-02-18 16:19GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all install processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("configuration") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the install processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +mkPath(log, "configuration/project") +removeFilesRecursive(log, "configuration/project") +# For each project +for projectName in ProjectsToProcess: + copyFilesRecursive(log, WorkspaceDirectory + "/" + projectName, "configuration/project") + os.chdir("processes") + try: + subprocess.call([ "python", "3_install.py" ]) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + os.chdir("..") + try: + projectLog = open("processes/log.log", "r") + projectLogData = projectLog.read() + projectLog.close() + log.write(projectLogData) + except Exception, e: + printLog(log, "<" + projectName + "> " + str(e)) + removeFilesRecursive(log, WorkspaceDirectory + "/" + projectName) + copyFilesRecursive(log, "configuration/project", WorkspaceDirectory + "/" + projectName) + removeFilesRecursive(log, "configuration/project") +printLog(log, "") + +log.close() +if os.path.isfile("3_install.log"): + os.remove("3_install.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_install.log") +shutil.move("log.log", "3_install.log") diff --git a/code/nel/tools/build_gamedata/configuration/buildsite.py b/code/nel/tools/build_gamedata/configuration/buildsite.py new file mode 100644 index 000000000..35b585057 --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/buildsite.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file site.py +# \brief Site configuration +# \date 2010-06-04-21-25-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Site configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** SITE INSTALLATION *** + +# Use '/' in path name, not '' +# Don't put '/' at the end of a directory name + + +# Quality option for this site (1 for BEST, 0 for DRAFT) +BuildQuality = 1 + +ToolDirectories = ['R:/code/nel', 'R:/code/ryzom/tools'] +ToolSuffix = "_r.exe" + +# Build script directory +ScriptDirectory = "W:/build_gamedata" +WorkspaceDirectory = "R:/code/ryzom/tools/build_gamedata/workspace" + +# Data build directories +DatabaseDirectory = "W:/database" +ExportBuildDirectory = "W:/export" + +# Client data install directory (client/data) +ClientDataDirectory = "S:/ryzom_client_open/user" + +# TODO: NETWORK RECONNECT NOT IMPLEMENTED :) + +# Leveldesign directories +LeveldesignDirectory = "L:/leveldesign" +LeveldesignDfnDirectory = "L:/leveldesign/dfn" +LeveldesignWorldDirectory = "L:/leveldesign/world" + +# 3dsMax directives +MaxAvailable = 1 +MaxDirectory = "C:/Program Files (x86)/Autodesk/3ds Max 2010" +MaxUserDirectory = "C:/Users/Kaetemi/AppData/Local/Autodesk/3dsMax/2010 - 32bit/enu" +MaxExecutable = "3dsmax.exe" + + +# end of file diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py new file mode 100644 index 000000000..f07a94839 --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -0,0 +1,232 @@ +#!/usr/bin/python +# +# \file export.py +# \brief Useful scripts +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Useful scripts +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util + +def printLog(log, text): + log.write(text + "\n") + print text + +def mkPath(log, path): + printLog(log, "DIR " + path) + distutils.dir_util.mkpath(path) + +def needUpdate(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + return 1 + else: + return 0 + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + return 0 + +def needUpdateRemoveDest(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + os.remove(dest) + return 1 + else: + return 0 + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + return 0 + +def needUpdateLogRemoveDest(log, source, dest): + if (os.path.isfile(source)): + if (os.path.isfile(dest)): + if (os.stat(source).st_mtime > os.stat(dest).st_mtime): + os.remove(dest) + printLog(log, source + " -> " + dest) + return 1 + else: + printLog(log, "SKIP " + dest) + return 0 + printLog(log, source + " -> " + dest) + return 1 + printLog(log, "needUpdate: source doest not exist?! " + source) + printLog(log, "SKIP " + dest) + return 0 + +def copyFileList(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFileListNoTree(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + os.path.basename(fileName)) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + os.path.basename(fileName)) + +def copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + srcFile = dir_source + "/" + fileName + destFile = dir_target + "/" + os.path.basename(fileName) + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def removeFilesRecursive(log, dir_files): + files = os.listdir(dir_files) + for fileName in files: + if (fileName != ".svn"): + if os.path.isdir(dir_files + "/" + fileName): + removeFilesRecursive(log, dir_files + "/" + fileName) + else: + printLog(log, "RM " + dir_files + "/" + fileName) + os.remove(dir_files + "/" + fileName) + +def copyFilesRecursive(log, dir_source, dir_target): + files = os.listdir(dir_source) + mkPath(log, dir_target) + for fileName in files: + if (fileName != ".svn"): + if os.path.isdir(dir_source + "/" + fileName): + copyFilesRecursive(log, dir_source + "/" + fileName, dir_target + "/" + fileName) + else: + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFiles(log, dir_source, dir_target): + copyFileList(log, dir_source, dir_target, os.listdir(dir_source)) + +def copyFilesExt(log, dir_source, dir_target, file_ext): + files = os.listdir(dir_source) + len_file_ext = len(file_ext) + for fileName in files: + if (fileName != ".svn") and (fileName[-len_file_ext:].lower() == file_ext.lower()): + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + fileName) + shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName) + +def copyFilesExtNoTree(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListNoTree(log, dir_source, dir_target, files) + +def copyFilesExtNoTreeIfNeeded(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListNoTreeIfNeeded(log, dir_source, dir_target, files) + +def copyFilesNoTreeIfNeeded(log, dir_source, dir_target): + copyFileListNoTreeIfNeeded(log, dir_source, dir_target, os.listdir(dir_source)) + +def copyFileListExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, files, file_ext, target_ext): + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + srcFile = dir_source + "/" + fileName + destFile = dir_target + "/" + os.path.basename(fileName)[0:-len(file_ext)] + target_ext + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def copyFilesExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, file_ext, target_ext): + files = findFiles(log, dir_source, "", file_ext) + copyFileListExtReplaceNoTreeIfNeeded(log, dir_source, dir_target, files, file_ext, target_ext) + +def copyFileIfNeeded(log, srcFile, destFile): + if needUpdateLogRemoveDest(log, srcFile, destFile): + shutil.copy(srcFile, destFile) + +def moveFileListNoTree(log, dir_source, dir_target, files): + for fileName in files: + if fileName != ".svn": + printLog(log, dir_source + "/" + fileName + " -> " + dir_target + "/" + os.path.basename(fileName)) + shutil.move(dir_source + "/" + fileName, dir_target + "/" + os.path.basename(fileName)) + +def moveFilesExtNoTree(log, dir_source, dir_target, file_ext): + files = findFiles(log, dir_source, "", file_ext) + moveFileListNoTree(log, dir_source, dir_target, files) + +def findFiles(log, dir_where, dir_sub, file_ext): + result = [ ] + files = os.listdir(dir_where + "/" + dir_sub) + len_file_ext = len(file_ext) + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + filePath = dir_sub + fileName + fileFull = dir_where + "/" + dir_sub + fileName + if os.path.isfile(fileFull): + if fileName[-len_file_ext:].lower() == file_ext.lower(): + result += [ filePath ] + elif os.path.isdir(fileFull): + result += findFiles(log, dir_where, filePath + "/", file_ext) + else: + printLog(log, "findFiles: file not dir or file?!" + filePath) + return result + +def findFile(log, dir_where, file_name): + files = os.listdir(dir_where) + for fileName in files: + if fileName != ".svn" and fileName != "*.*": + filePath = dir_where + "/" + fileName + if os.path.isfile(filePath): + if fileName == file_name: + return filePath + elif os.path.isdir(filePath): + result = findFile(log, filePath, file_name) + if result != "": + return result + else: + printLog(log, "findFile: file not dir or file?! " + filePath) + return "" + +def findTool(log, dirs_where, file_name, suffix): + try: + for dir in dirs_where: + tool = findFile(log, dir, file_name + suffix) + if tool != "": + printLog(log, "TOOL " + tool) + return tool + except Exception, e: + printLog(log, "EXCEPTION " + str(e)) + printLog(log, "TOOL NOT FOUND " + file_name + suffix) + return "" + +def findMax(log, dir, file): + tool = dir + "/" + file + if os.path.isfile(tool): + printLog(log, "3DSMAX " + tool) + return tool + printLog(log, "3DSMAX NOT FOUND " + file) + return "" + +def toolLogFail(log, tool, suffix): + printLog(log, "FAIL " + tool + suffix + " is not found") + +def askVar(log, name, default): + sys.stdout.write(name + " (" + default + "): ") + line = sys.stdin.readline() + linestrip = line.strip() + if linestrip == "--": + log.write(name + " (" + default + "): ''\n") + return "" + elif linestrip == "": + log.write(name + " (" + default + "): '" + default + "'\n") + return default + else: + log.write(name + " (" + default + "): '" + linestrip + "'\n") + return linestrip diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py new file mode 100644 index 000000000..3b9d916a7 --- /dev/null +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# +# \file process.py +# \brief Tools configuration +# \date 2009-03-10 11:33GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Tools configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS TIMEOUT *** +SkelExportTimeout = 600000 +SwtExportTimeout = 600000 +ShapeExportTimeout = 3600000 +ZoneExportTimeout = 1800000 +ZoneBuildDependTimeout = 1800000 +ZoneBuildWeldTimeout = 60000 +ZoneLightBuildTimeout = 600000 +ZoneIgLightBuildTimeout = 600000 +SmallbankBuildTimeout = 60000 +FarbankBuildTimeout = 180000 +AnimExportTimeout = 1800000 +IgExportTimeout = 600000 +MapsBuildTimeout = 10000 +CmbExportTimeout = 60000 +RbankBuildTesselTimeout = 6000000 +RbankBuildSmoothTimeout = 6000000 +RbankBuildProclocalTimeout = 6000000 +RbankBuildProcglobalTimeout = 18000000 +RbankBuildIndoorTimeout = 18000000 +# WmapBuildTimeout = 60000 +LigoExportTimeout = 3600000 +LigoBuildTimeout = 1800000 +PacsPrimExportTimeout = 600000 + +# *** TOOLS CONFIGURATION *** + +TgaToDdsTool = "tga2dds" +BuildInterfaceTool = "build_interface" +ExecTimeoutTool = "exec_timeout" +BuildSmallbankTool = "build_smallbank" +BuildFarbankTool = "build_far_bank" +ZoneDependenciesTool = "zone_dependencies" +ZoneWelderTool = "zone_welder" +BuildRbankTool = "build_rbank" +BuildIndoorRbankTool = "build_indoor_rbank" +BuildIgBoxesTool = "build_ig_boxes" +AiBuildWmapTool = "ai_build_wmap" +GetNeighborsTool = "get_neighbors" +ZoneLighterTool = "zone_lighter" +ZoneIgLighterTool = "zone_ig_lighter" +IgLighterTool = "ig_lighter" +AnimBuilderTool = "anim_builder" +TileEditTool = "tile_edit" +BuildImagesetTool = "th_build_imageset" +MakeSheetIdTool = "make_sheet_id" +BuildSheetsTool = "th_build_sheets" +BuildSoundTool = "th_build_sound" +BuildCoarseMeshTool = "build_coarse_mesh" +LightmapOptimizerTool = "lightmap_optimizer" +BuildClodtexTool = "build_clodtex" +BuildShadowSkinTool = "build_shadow_skin" +PanoplyMakerTool = "panoply_maker" +HlsBankMakerTool = "hls_bank_maker" +LandExportTool = "land_export" diff --git a/code/nel/tools/build_gamedata/processes/0_setup.py b/code/nel/tools/build_gamedata/processes/0_setup.py new file mode 100644 index 000000000..e973547f5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/0_setup.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +sys.path.append("../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +#printLog(log, "") +#printLog(log, "-------") +#printLog(log, "--- Setup project") +#printLog(log, "-------") +#printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +#printLog(log, "") + +#printLog(log, "") +#printLog(log, "-------") +#printLog(log, "--- Setup client directories") +#printLog(log, "-------") +#printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +#printLog(log, "") +#for dir in ClientSetupDirectories: +# mkPath(log, ClientDataDirectory + "/" + dir) +#printLog(log, "") + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the setup processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "0_setup.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/1_export.py b/code/nel/tools/build_gamedata/processes/1_export.py new file mode 100644 index 000000000..2730b560a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/1_export.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Run all export processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all export processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +sys.path.append("../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the export processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "1_export.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/2_build.py b/code/nel/tools/build_gamedata/processes/2_build.py new file mode 100644 index 000000000..3952074b5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/2_build.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Run all build processes +# \date 2009-02-18 09:22GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all build processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +sys.path.append("../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the build processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "2_build.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/3_install.py b/code/nel/tools/build_gamedata/processes/3_install.py new file mode 100644 index 000000000..5b2464e27 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/3_install.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Run all install processes +# \date 2009-02-18 16:19GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all install processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +sys.path.append("../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Run the install processes") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") +# For each process +for processName in ProcessToComplete: + os.chdir(processName) + try: + subprocess.call([ "python", "3_install.py" ]) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + os.chdir("..") + try: + processLog = open(processName + "/log.log", "r") + processLogData = processLog.read() + processLog.close() + log.write(processLogData) + except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) + # subprocess.call("idle.bat") +printLog(log, "") + +log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/0_setup.py b/code/nel/tools/build_gamedata/processes/anim/0_setup.py new file mode 100644 index 000000000..fc26202e6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup anim +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup anim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AnimBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + AnimClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py new file mode 100644 index 000000000..fd95fe95b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export anim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +printLog(log, "") + +# For each anim directory +printLog(log, ">>> Export anim 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) +for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/2_build.py b/code/nel/tools/build_gamedata/processes/anim/2_build.py new file mode 100644 index 000000000..8d07a3993 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build anim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +AnimBuilder = findTool(log, ToolDirectories, AnimBuilderTool, ToolSuffix) +printLog(log, "") + +# For each anim directory +printLog(log, ">>> Build anim <<<") +if AnimBuilder == "": + toolLogFail(log, AnimBuilderTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + AnimExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + AnimBuildDirectory + mkPath(log, destDir) + subprocess.call([ AnimBuilder, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/3_install.py b/code/nel/tools/build_gamedata/processes/anim/3_install.py new file mode 100644 index 000000000..ebf40642e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install anim +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install anim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install anim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install anim <<<") +srcDir = ExportBuildDirectory + "/" + AnimBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + AnimClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/cegui/0_setup.py b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py new file mode 100644 index 000000000..429063d3b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Setup cegui +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in CeguiImagesetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + CeguiImagesetExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + CeguiImagesetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/1_export.py b/code/nel/tools/build_gamedata/processes/cegui/1_export.py new file mode 100644 index 000000000..329a27dbb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/1_export.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Export cegui +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each cegui imageset directory +printLog(log, ">>> Export cegui imagesets <<<") +destDir = ExportBuildDirectory + "/" + CeguiImagesetExportDirectory +mkPath(log, destDir) +for dir in CeguiImagesetSourceDirectories: + srcDir = DatabaseDirectory + "/" + dir + mkPath(log, srcDir) + imagesets = findFiles(log, srcDir, "", ".imageset") + if (len(imagesets) != 1): + printLog(log, "FAIL Cannot find *.imageset, folder must contain at least one and only one imageset xml file") + else: + niouname = dir.replace("/", "_") + newpath = destDir + "/" + niouname + mkPath(log, newpath) + copyFileIfNeeded(log, srcDir + "/" + imagesets[0], newpath + ".imageset") + copyFilesExtNoTreeIfNeeded(log, srcDir, newpath, ".tga") + copyFilesExtNoTreeIfNeeded(log, srcDir, newpath, ".png") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/2_build.py b/code/nel/tools/build_gamedata/processes/cegui/2_build.py new file mode 100644 index 000000000..0f4653d0e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/2_build.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Build cegui +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildImageset = findTool(log, ToolDirectories, BuildImagesetTool, ToolSuffix) +printLog(log, "") + +# For each cegui imageset directory +printLog(log, ">>> Build cegui imagesets <<<") +if BuildImageset == "": + toolLogFail(log, BuildImagesetTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + CeguiImagesetExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory + mkPath(log, destDir) + for dir in os.listdir(srcDir): + if (os.path.isdir(srcDir + "/" + dir)) and dir != ".svn" and dir != "*.*": + mkPath(log, srcDir + "/" + dir) + subprocess.call([ BuildImageset, destDir + "/" + dir + ".tga", srcDir + "/" + dir ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/3_install.py b/code/nel/tools/build_gamedata/processes/cegui/3_install.py new file mode 100644 index 000000000..7d458dced --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cegui/3_install.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install cegui +# \date 2009-03-14-17-46-GMT +# \author Jan Boon (Kaetemi) +# Install cegui +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install cegui") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install cegui imagesets <<<") +srcDir = ExportBuildDirectory + "/" + CeguiImagesetBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + CeguiImagesetClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms new file mode 100644 index 000000000..49326a260 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -0,0 +1,269 @@ +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- Must export this node ? +fn isToBeExported node = +( + if ((classof node) == RklPatch) then + return false + + if ((classof node) == nel_ps) then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + return true +) + +-- is this node flagged as a LodCharacter ?? +fn isLodCharacter node = +( + isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD + if (isCLod == undefined) then + return false + if (isCLod == "1") then + return true + return false +) + +fn goClodExport = +( + try + ( + -- Get files in the shape_source_directory + files = getFiles "shape_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Ok ? + ok = false + + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag files[i]) == true then + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] quiet:true == true then + ( + -- Unhide category + unhidecategory() + + tagThisFile = true + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Is a Lod character? + if ((isLodCharacter node) == true) then + ( + -- Output directory + output = ("output_directory_clod/"+(node.name)+".clod") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + try + ( + -- Export the shape + if (NelExportLodCharacter node output false) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting .clod "+node.name+" in file "+files[i]) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting .clod "+node.name+" in file "+files[i]) + tagThisFile = false + return 0 + ) + ) + else + ( + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 + ) + ) + ) + ) + ) + + -- Something exported + if (exported == 0) then + ( + -- Error + nlerror ("WARNING no .clod exported from the file "+files[i]) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting .clod: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting .clod in file " + files[i]) + -- break + ) + ) + ) + else + ( + nlerror ("WARNING no max file in folder shape_source_directory") + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting .clod in folder shape_source_directory") + return 0 + ) +) + +goClodExport() + +nlerror ("BYE") + +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/displace/0_setup.py b/code/nel/tools/build_gamedata/processes/displace/0_setup.py new file mode 100644 index 000000000..e84c6d787 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup displace +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in DisplaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + DisplaceClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/displace/1_export.py b/code/nel/tools/build_gamedata/processes/displace/1_export.py new file mode 100644 index 000000000..ba7b29708 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/1_export.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export displace +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) +for dir in DisplaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + DisplaceExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + DisplaceExportDirectory, ".png") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/displace/2_build.py b/code/nel/tools/build_gamedata/processes/displace/2_build.py new file mode 100644 index 000000000..caa094059 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build displace +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/displace/3_install.py b/code/nel/tools/build_gamedata/processes/displace/3_install.py new file mode 100644 index 000000000..de5b34a9e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/displace/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install displace +# \date 2009-03-10-21-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install displace +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install displace") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install displace <<<") +clientPath = ClientDataDirectory + "/" + DisplaceClientDirectory +mkPath(log, clientPath) +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + DisplaceExportDirectory, clientPath, ".tga") +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + DisplaceExportDirectory, clientPath, ".png") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/0_setup.py b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py new file mode 100644 index 000000000..d3786d179 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup farbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for postfix in MultipleTilesPostfix: + mkPath(log, DatabaseDirectory + "/" + TileRootSourceDirectory + postfix) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/1_export.py b/code/nel/tools/build_gamedata/processes/farbank/1_export.py new file mode 100644 index 000000000..cbe55ea11 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export farbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/2_build.py b/code/nel/tools/build_gamedata/processes/farbank/2_build.py new file mode 100644 index 000000000..cc62bc0a0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/2_build.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build farbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildFarbank = findTool(log, ToolDirectories, BuildFarbankTool, ToolSuffix) +printLog(log, "") + +# For each bank export farbank +printLog(log, ">>> Build farbank <<<") +if ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +elif BuildFarbank == "": + toolLogFail(log, BuildFarbankTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + SmallbankExportDirectory, "", ".smallbank") + for file in files: + sourceFile = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + file + if os.path.isfile(sourceFile): + for postfix in MultipleTilesPostfix: + destFile = ExportBuildDirectory + "/" + FarbankBuildDirectory + "/" + file[0:-len(".smallbank")] + postfix + ".farbank" + if (needUpdateLogRemoveDest(log, sourceFile, destFile)): + mkPath(log, DatabaseDirectory + "/" + TileRootSourceDirectory + postfix) + subprocess.call([ ExecTimeout, str(FarbankBuildTimeout), BuildFarbank, sourceFile, destFile, "-d" + DatabaseDirectory + "/" + TileRootSourceDirectory + postfix + "/", "-p" + postfix ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/farbank/3_install.py b/code/nel/tools/build_gamedata/processes/farbank/3_install.py new file mode 100644 index 000000000..debd350e6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/farbank/3_install.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install farbank +# \date 2009-03-10-21-12-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install farbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install farbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install farbank <<<") +mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + FarbankBuildDirectory, ClientDataDirectory + "/" + BankClientDirectory, ".farbank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/0_setup.py b/code/nel/tools/build_gamedata/processes/font/0_setup.py new file mode 100644 index 000000000..466444bd6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/0_setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# setup font +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + FontClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/1_export.py b/code/nel/tools/build_gamedata/processes/font/1_export.py new file mode 100644 index 000000000..a44ae3bbb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/1_export.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export font +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/2_build.py b/code/nel/tools/build_gamedata/processes/font/2_build.py new file mode 100644 index 000000000..bdc823e81 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/2_build.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build font +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/font/3_install.py b/code/nel/tools/build_gamedata/processes/font/3_install.py new file mode 100644 index 000000000..b56978ff1 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/font/3_install.py @@ -0,0 +1,61 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install font +# \date 2009-03-10-19-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install font +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install font") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + FontClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install font <<<") +for dir in FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".ttf") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".afm") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfb") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfm") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py new file mode 100644 index 000000000..27f875bab --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ig_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +#for dir in ig_lightSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +#mkPath(log, ExportBuildDirectory + "/" + ig_lightExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLightVillageBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + IgClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/1_export.py b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py new file mode 100644 index 000000000..c3229ca85 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ig_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py new file mode 100644 index 000000000..0dac110d3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ig_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +IgLighter = findTool(log, ToolDirectories, IgLighterTool, ToolSuffix) +printLog(log, "") + +# For each ig_light directory +printLog(log, ">>> Build ig_light <<<") +if IgLighter == "": + toolLogFail(log, IgLighterTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + IgVillageBuildDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + IgLightVillageBuildDirectory + mkPath(log, destDir) + subprocess.call([ IgLighter, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ig_light/3_install.py b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py new file mode 100644 index 000000000..2406ab170 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ig_light +# \date 2009-03-11-15-16-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ig_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install ig_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install ig_light <<<") +srcDir = ExportBuildDirectory + "/" + IgLightVillageBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + IgClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/0_setup.py b/code/nel/tools/build_gamedata/processes/interface/0_setup.py new file mode 100644 index 000000000..49de11f0d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/0_setup.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup interface +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup interface +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in InterfaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in InterfaceDxtcSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in InterfaceFullscreenSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in Interface3DSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + InterfaceClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/1_export.py b/code/nel/tools/build_gamedata/processes/interface/1_export.py new file mode 100644 index 000000000..a5eef4d0c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/1_export.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export interface +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +printLog(log, "") + +# For each interface directory +printLog(log, ">>> Export interface <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) +for dir in InterfaceSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + niouname = dir.replace("/", "_") + newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname + mkPath(log, newpath) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") +printLog(log, "") + +# For each interface directory to compress in one DXTC +printLog(log, ">>> Export interface dxtc <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) +for dir in InterfaceDxtcSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga") +printLog(log, "") + +# For each interface fullscreen directory compress independently all in dds +printLog(log, ">>> Export interface fullscreen <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) + for dir in InterfaceFullscreenSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) +printLog(log, "") + +# For each interface 3d directory +printLog(log, ">>> Export interface 3d <<<") +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) +for dir in Interface3DSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/2_build.py b/code/nel/tools/build_gamedata/processes/interface/2_build.py new file mode 100644 index 000000000..2b17b7a54 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/2_build.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build interface +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildInterface = findTool(log, ToolDirectories, BuildInterfaceTool, ToolSuffix) +printLog(log, "") + +# For each interface directory +printLog(log, ">>> Build interface <<<") +if BuildInterface == "": + toolLogFail(log, BuildInterfaceTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) + for dir in os.listdir(ExportBuildDirectory + "/" + InterfaceExportDirectory): + if (os.path.isdir(ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + dir)) and dir != ".svn" and dir != "*.*": + subprocess.call([ BuildInterface, ExportBuildDirectory + "/" + InterfaceBuildDirectory + "/texture_" + dir + ".tga", ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + dir ]) +printLog(log, "") + +# For each interface directory to compress in one DXTC +printLog(log, ">>> Build interface dxtc <<<") +if BuildInterface == "": + toolLogFail(log, BuildInterfaceTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) + subprocess.call([ BuildInterface, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory + "/texture_interfaces_dxtc.tga", ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/interface/3_install.py b/code/nel/tools/build_gamedata/processes/interface/3_install.py new file mode 100644 index 000000000..a727b0afc --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/interface/3_install.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install interface +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install interface +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install interface") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + InterfaceClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install interface <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory, clientPath) + +printLog(log, ">>> Install interface dxtc <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory, clientPath) + +printLog(log, ">>> Install interface fullscreen <<<") +mkPath(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory, clientPath) + +printLog(log, ">>> Install interface 3d <<<") +mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + Interface3DExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py new file mode 100644 index 000000000..ecdc297f7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -0,0 +1,119 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ligo +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) +mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +if LigoExportLand != "": + mkPath(log, ExportBuildDirectory + "/" + LigoZoneBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoIgLandBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoIgOtherBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + RbankCmbBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") + +# Setup land exporter cfg +if LigoExportLand != "": + printLog(log, ">>> Setup land exporter cfg <<<") + mkPath(log, ScriptDirectory + "/configuration/project/generated") + cf = open(ScriptDirectory + "/configuration/project/generated/land_exporter.cfg", "w") + cf.write("\n") + cf.write("// Ligo settings\n") + cf.write("\n") + cf.write("OutZoneDir = \"" + ExportBuildDirectory + "/" + LigoZoneBuildDirectory + "\";\n") + cf.write("OutIGDir = \"" + ExportBuildDirectory + "/" + LigoIgLandBuildDirectory + "\";\n") + cf.write("AdditionnalIGOutDir = \"" + ExportBuildDirectory + "/" + LigoIgOtherBuildDirectory + "\";\n") + cf.write("\n") + cf.write("RefZoneDir = \"" + DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory+ "\";\n") # FIXME + cf.write("RefIGDir = \"" + DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory + "\";\n") + cf.write("AdditionnalIGInDir = \"" + DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory + "\";\n") # FIXME + cf.write("ContinentsDir = \"" + LeveldesignWorldDirectory + "\";\n") + cf.write("LigoBankDir = \"" + DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory + "\";\n") # FIXME + cf.write("\n") + cf.write("TileBankFile = \"" + DatabaseDirectory + "/" + LigoTileBankFile + "\";\n") + cf.write("\n") + cf.write("ColorMapFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportColormap + "\";\n") + cf.write("HeightMapFile1 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap1 + "\";\n") + cf.write("ZFactor1 = " + LigoExportZFactor1 + ";\n") + cf.write("HeightMapFile2 = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportHeightmap2 + "\";\n") + cf.write("ZFactor2 = " + LigoExportZFactor2 + ";\n") + cf.write("\n") + cf.write("ZoneLight = 0;\n") + cf.write("CellSize = 160;\n") + cf.write("Threshold = 1;\n") + cf.write("\n") + cf.write("DFNDir = \"" + LeveldesignDfnDirectory + "\";\n") + cf.write("RefCMBDir = \"" + DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory + "\";\n") # FIXME + cf.write("OutCMBDir = \"" + ExportBuildDirectory + "/" + RbankCmbBuildDirectory + "\";\n") # FIXME + cf.write("\n") + cf.write("ContinentFile = \"" + LeveldesignWorldDirectory + "/" + ContinentFile + "\";\n") + cf.write("\n") + cf.write("ExportCollisions = 1;\n") + cf.write("ExportAdditionnalIGs = 1;\n") + cf.write("\n") + cf.write("ZoneRegionFile = \"" + DatabaseDirectory + "/" + LigoBaseSourceDirectory + "/" + LigoExportLand + "\";\n") + cf.write("\n") + cf.close() + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py new file mode 100644 index 000000000..77c3c9bff --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ligo +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +if LigoExportLand == "" or LigoExportOnePass == 1: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + printLog(log, "") + + # For each directory + printLog(log, ">>> Export ligo 3dsmax <<<") + + ligoIniPath = MaxUserDirectory + "/plugcfg/nelligo.ini" + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseIgExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) + mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) + mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) + printLog(log, "WRITE " + ligoIniPath) + ligoIni = open(ligoIniPath, "w") + ligoIni.write("[LigoConfig]\n") + ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") + ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") + ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") + ligoIni.close() + + outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory + logFile = ScriptDirectory + "/processes/ligo/log.log" + smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + + scriptSrc = "maxscript/nel_ligo_export.ms" + scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + + if os.path.isfile(scriptDst): + os.remove(scriptDst) + + printLog(log, "WRITE " + scriptDst) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("bankFilename", smallBank) + sDst.write(newline) + sSrc.close() + sDst.close() + + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) + + os.remove(scriptDst) + + printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/2_build.py b/code/nel/tools/build_gamedata/processes/ligo/2_build.py new file mode 100644 index 000000000..6ec37813c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/2_build.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ligo +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +if LigoExportLand != "": + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + LandExport = findTool(log, ToolDirectories, LandExportTool, ToolSuffix) + + printLog(log, ">>> Generate ligo zone <<<") + if LandExport == "": + toolLogFail(log, LandExportTool, ToolSuffix) + elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) + else: + subprocess.call([ ExecTimeout, str(LigoExportTimeout), LandExport, ScriptDirectory + "/configuration/project/generated/land_exporter.cfg" ]) + + printLog(log, ">>> Copy to zone builder <<<") + dirSource = ExportBuildDirectory + "/" + LigoZoneBuildDirectory + dirTarget = ExportBuildDirectory + "/" + ZoneExportDirectory + mkPath(log, dirSource) + mkPath(log, dirTarget) + copyFilesExtReplaceNoTreeIfNeeded(log, dirSource, dirTarget, ".zonel", ".zone") + copyFilesExtNoTreeIfNeeded(log, dirSource, dirTarget, ".zonenh") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/3_install.py b/code/nel/tools/build_gamedata/processes/ligo/3_install.py new file mode 100644 index 000000000..d4bbc433c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/3_install.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ligo +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ligo +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install ligo") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms new file mode 100644 index 000000000..a4aff1cb5 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -0,0 +1,957 @@ +-- Export zones and transzones + +ligo = 1304892483 +ligo_passable_app = ligo +ligo_rotate_app = 1266703978 +ligo_scale_app = 1266703979 +ligo_instance_app = 1266703980 + +TransitionScale = #( false, false, false, false, true, false, false, false, false) +TransitionRot = #( 2, 1, 3, 0, 1, 3, 0, 0, 0) +TransitionPos = #( [0, 0, 0], [-1, 0, 0], [-1, -1, 0], [-1, -2, 0], [0, -2, 0], [0, -3, 0], [-1, -3, 0], [-2, -3, 0], [-3, -3, 0]) +TransitionIds = #( #( 1, 2 ), #( undefinded, 3 ), #( 5, 4 ), #( 6, 7, 8, 9 ) ) +TransitionType = #( "CornerA", "CornerA", "Flat", "CornerA", "CornerB", "CornerB", "Flat", "Flat", "CornerB") +TransitionNumBis = #( 5, 4, 2, 3, 7, 6, 0, 1, 8) + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +tagThisFile = true + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- Add properties +fn addProperties node propsArray = +( + -- The passable properties + if (getappdata node ligo_passable_app) != undefined then + append propsArray #( "passable", "yes") + else + append propsArray #( "passable", "no") +) + +-- Is this node a debug markers ? +fn isDebugMarker node = +( + return matchPattern node.name pattern:"[NELLIGO]*" +) + +-- Delete debug markers +fn DeleteDebugMarkersFn = +( + -- Array to delete + arrayToDelete = #() + + -- For each error names + for i = 1 to rootNode.children.count do + ( + -- Node id + id = rootNode.children.count-i+1 + + if (isDebugMarker rootNode.children[id]) == true then + ( + append arrayToDelete rootNode.children[id] + ) + ) + + -- For each node to delete + for i = 1 to arrayToDelete.count do + ( + -- Node id + delete arrayToDelete[i] + ) +) + +-- Get the transition zone coordinate +fn getTransitionZoneCoordinates node x y = +( + -- Get nelsize + cellSize = NeLLigoGetCellSize () + + -- Object center + center = node.center + + -- Get X and Y coordinates + x[1] = (center.x / cellSize) as Integer + y[1] = (center.y / cellSize) as Integer + + -- Valid Y coordinate ? + if (y[1] < 0) or (y[1] >= TransitionIds.count) then + ( + if (nodeArray != undefined) then + messageBox ("The zone "+nodeArray[zone].name+" is not well positionned. Check the transition scheme.") title:title_msgbox beep:true + return false + ) + else + ( + -- Valid X coordinate ? + if (x[1] < 0) or (x[1] >= TransitionIds[y[1]+1].count) then + ( + if (nodeArray != undefined) then + messageBox ("The zone "+nodeArray[zone].name+" is not well positionned. Check the transition scheme.") title:title_msgbox beep:true + return false + ) + ) + + return true +) + +fn selectAllPatch = +( + clearselection () + for i in geometry do + ( + if (classof i) == RklPatch then + ( + if (i.isFrozen == false) then + ( + selectmore i + ) + ) + ) +) + + +-- Get the ig name of this object +fn getIg node = +( + igName = (getappdata node NEL3D_APPDATA_IGNAME) + if igName == "" then + ( + return undefined + ) + if (igName != undefined) then + return (lowercase (igName)) + else + return undefined +) + + + + +-- Export collisions from the current loaded zone +fn exportCollisionsFromZone outputPath filename = +( + max select all + -- Export the collision + if (NelExportCollision ($selection as array) outputPath) == false then + ( + -- nlerror ("WARNING No collision exported from file "+filename) + ) + else + ( + nlerror ("OK collision in folder "+outputPath) + ) +) + +fn buildTransitionMatrix mt transitionZone cellSize = +( + copyMt = mt + backupPos = copyMt.pos + copyMt.pos = [0,0,0] + + -- Scale ? + if TransitionScale[transitionZone] == true then + ( + copyMt = scale copyMt [-1,1,1] + ) + + -- Rotate + if TransitionRot[transitionZone] != 0 then + ( + copyMt = rotateZ copyMt (90*TransitionRot[transitionZone]) + ) + + -- Translation + return translate copyMt ( (TransitionPos[transitionZone] * cellSize) + backupPos) +) + +fn buildTransitionMatrixObj mt transitionZone cellSize = +( + -- Place at the origine + copyMt = transMatrix (TransitionPos[transitionZone] * cellSize) + + -- Center the zone + copyMt = translate copyMt [-cellSize/2, -cellSize/2, 0] + + -- Scale ? + if TransitionScale[transitionZone] == true then + ( + copyMt = scale copyMt [-1,1,1] true + ) + + -- Rotate + if TransitionRot[transitionZone] != 0 then + ( + copyMt = rotateZ copyMt (90*TransitionRot[transitionZone]) + ) + + -- Translation + copyMt = translate copyMt [cellSize/2,cellSize/2,0] + + -- Compose + return (mt * copyMt) +) + +-- Export instance groups from the current loaded zone +fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSize = +( + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in geometry do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then + ( + -- Transition ? + if ( ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + for node in lights do + ( + ig = getIg node + + if ( (ig != undefined) and (ig != "") and ( (igName == "") or ( ig == igName) ) ) then + ( + -- Transition ? + if ( ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + for node in helpers do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then + ( + -- Transition ? + if (ig == IgName) then + ( + -- Transform the object + node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize + ) + + -- Found ? + found = false + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + ) + ) + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + if ( (igName == "") or (ig_array[ig] == IgName) ) then + ( + -- Output filename + output = (outputPath + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate output inputFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ( (getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ( (getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all helpers in this ig + for node in helpers do + ( + -- Select it if in the ig + if ( (getIg node) == ig_array[ig]) then + selectmore node + ) + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export output) == true then + ( + nlerror ("OK "+output) + ) + else + ( + -- Error + nlerror ("ERROR exporting ig "+ig_array[ig]+" in file "+inputFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+inputFile) + tagThisFile = false + ) + ) + else + ( + nlerror ("SKIPPED ligo ig "+output) + tagThisFile = false + ) + ) + ) + ) +) + +------------------------------------------------------------------------------------------------------------------ +-- ENTRY POINT +-- *********** + +ligopath = getINISetting ((GetDir #plugcfg)+"\\nelligo.ini") "LigoConfig" "LigoPath" +if ligopath != "" then ligo_root_path = ligopath +ligopath = getINISetting ((GetDir #plugcfg)+"\\nelligo.ini") "LigoConfig" "LigoExportPath" +if ligopath != "" then ligo_export_path = ligopath + +MaxFilesList = getFiles (ligo_root_path + "*.max") + + +-- EXPORT ZONES + +try +( + -- Set the bank pathname + bank_filename = "bankFilename" + NelSetTileBank bank_filename + + cellSize = NeLLigoGetCellSize () + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + resetMAXFile #noprompt + + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 3) and (tokenArray[1] == "zonematerial") then + ( + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + props = #( #("zone", (tokenArray[2] + "-" + tokenArray[3])), #("material", tokenArray[2]) ) + + if (selection as array).count > 1 then + ( + nlerror ("ERROR In file "+(getFilenameFile curFileName)+", multiple NelPatchMesh. Can't export."); + tagThisFile = false + ) + else + ( + if (selection as array).count == 0 then + ( + nlerror ("WARNING In file "+(getFilenameFile curFileName)+", no NelPatchMesh to export."); + ) + else + ( + addProperties $ props + + dstFileName = ligo_export_path + tokenArray[2] + "-" + tokenArray[3] + ".ligozone" + + -- Error catching + try + ( + -- export ligo zone + if (NeLLigoExportZone $ dstFileName props false false) then + ( + nlerror ("OK "+ (getFilenameFile curFileName)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile curFileName)) + tagThisFile = false + ) + + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + + ) + ) + + -- export matching igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG ligozone "+ (getFilenameFile curFileName)) + ) + ) + ) + + -- EXPORT TRANSZONES + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 4) and (tokenArray[1] == "zonetransition") then + ( + HaveToExport = #() + for zone = 1 to 9 do + ( + filename = tokenArray[2] + "-" + tokenArray[3] + "-" + tokenArray[4] + "-" + ((zone-1) as string) + filename = ligo_export_path + "zoneLigos\\" + filename + ".ligozone" + + if (nelTestFileDate filename curFileName) == true then + ( + append HaveToExport true + ) + else + ( + append HaveToExport false + ) + ) + + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + -- Array of selection + nodeArray = #() + if $ == $selection then + ( + nodeArray = $selection as array + ) + else + ( + append nodeArray $ + ) + + -- Ok flag + ok = true + findOne = false + + -- Cell Size + if cellSize != undefined then + ( + -- Array of transitions zones + transitionZone = #() + for zone = 1 to 9 do + append transitionZone undefined + for zone = 1 to nodeArray.count do + ( + -- Find one + findOne = true; + + -- Get the zone coordinates + x = #() + y = #() + ok = getTransitionZoneCoordinates nodeArray[zone] x y + + -- No error ? + if ok == true then + ( + -- Transition number + id = TransitionIds[y[1]+1][x[1]+1] + + -- Store it + if (id == undefined) then + ( + nlerror ("ERROR A zone is not at the right position in "+ (getFilenameFile curFileName)) + tagThisFile = false + ok = false + ) + else + ( + transitionZone[id] = nodeArray[zone] + ) + ) + ) + + -- Continue ? + if (ok == true) and (findOne == true) then + ( + -- For each zone selected + for zone = 1 to 9 do + ( + -- Zone name + zoneBaseName = tokenArray[2] + "-" + tokenArray[3] + "-" + tokenArray[4] + "-" + ((zone-1) as string) + + -- Get the destination filename for export + filename = ligo_export_path + zoneBaseName + ".ligozone" + + if (HaveToExport[zone] == true) then + ( + -- Defined ? + if (transitionZone[zone] != undefined) then + ( + -- Make an array of properties + props = #( #("zone", zoneBaseName), #("transname", (tokenArray[2]+"-"+tokenArray[3]) ), #("transtype", TransitionType[zone] ), #("transtype", TransitionType[zone] ), #("transnum", (TransitionNumBis[zone] as string) ) ) + + -- Add the properties + addProperties transitionZone[zone] props + + -- Transform the zone + c = instance transitionZone[zone] + + -- Change the name + c.name = "[NELLIGO] tmp export" + + -- The matrix + mt = buildTransitionMatrix transitionZone[zone].transform zone cellSize + + -- Scale ? + if TransitionScale[zone] == true then + ( + setappdata c ligo_scale_app "1" + ) + + -- Rotate + if TransitionRot[zone] != 0 then + ( + setappdata c ligo_rotate_app (TransitionRot[zone] as string) + ) + + -- Transform the node + c.transform = mt + + -- Export the zone + + -- Error catching + try + ( + -- nlerror ("EXPORT "+ (getFilenameFile filename)) + if (NeLLigoExportZone c filename props false false) then + ( + nlerror ("OK "+ (getFilenameFile filename)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile filename)) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + + -- Delete + delete c + ) + ) + else + ( + nlerror ("SKIPPED ligozone transition "+ (getFilenameFile filename)) + ) + + -- export igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") (lowercase (zoneBaseName)) zone cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + ) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG transition "+ (getFilenameFile curFileName)) + ) + ) + ) + + -- EXPORT SPECIAL ZONES + + for curFileName in MaxFilesList do + ( + -- Free memory and file handles + gc () + resetMAXFile #noprompt + + tokenArray = filterString (getFilenameFile curFileName) "-" + if (tokenArray.count == 2) and (tokenArray[1] == "zonespecial") then + ( + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag curFileName) == true then + ( + -- Try to tag this file + tagThisFile = true + + resetMAXFile #noprompt + + nlerror ("Scanning file "+curFileName+" ...") + mergeMaxFile curFileName quiet:true + + -- Unhide category + unhidecategory() + + DeleteDebugMarkersFn () + selectAllPatch () + -- nlerror ("EXPORT "+ (getFilenameFile curFileName)) + + props = #( #("zone", tokenArray[2]), #("material", "special") ) + + if (selection as array).count > 1 then + ( + nlerror ("ERROR In file "+(getFilenameFile curFileName)+", multiple NelPatchMesh. Can't export."); + tagThisFile = false + ) + else + ( + if (selection as array).count == 0 then + ( + nlerror ("WARNING In file "+(getFilenameFile curFileName)+", no NelPatchMesh to export."); + ) + else + ( + addProperties $ props + + dstFileName = ligo_export_path + tokenArray[2] + ".ligozone" + + -- Error catching + try + ( + if (NeLLigoExportZone $ dstFileName props false false) then + ( + nlerror ("OK "+ (getFilenameFile curFileName)) + ) + else + ( + nlerror ("ERROR Error exporting ligo zone from file "+ (getFilenameFile curFileName)) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting ligo zone "+curFileName) + tagThisFile = false + ) + ) + ) + + -- export matching igs + try + ( + exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize + ) + catch + ( + nlerror("couldn't export ig for " + curFileName) + tagThisFile = false + ) + + -- export collisions + try + ( + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + + resetMAXFile #noprompt + ) + else + ( + nlerror ("SKIPPED BY TAG ligozone special "+ (getFilenameFile curFileName)) + ) + ) + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + tagThisFile = false +) + + + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/map/0_setup.py b/code/nel/tools/build_gamedata/processes/map/0_setup.py new file mode 100644 index 000000000..a1e6dc63f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/0_setup.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup map +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup map +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in MapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in MapUncompressedSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + MapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + MapClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/map/1_export.py b/code/nel/tools/build_gamedata/processes/map/1_export.py new file mode 100644 index 000000000..e8c3004c9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export map +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/map/2_build.py b/code/nel/tools/build_gamedata/processes/map/2_build.py new file mode 100644 index 000000000..275cc1303 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/2_build.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build map +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +PanoplyMaker = findTool(log, ToolDirectories, PanoplyMakerTool, ToolSuffix) +HlsBankMaker = findTool(log, ToolDirectories, HlsBankMakerTool, ToolSuffix) +printLog(log, "") + +# For each map directory +printLog(log, ">>> Build map compressed: compress tga and png to dds <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + MapBuildDirectory) + for dir in MapSourceDirectories: + sourcePath = DatabaseDirectory + "/" + dir + mkPath(log, sourcePath) + destPath = ExportBuildDirectory + "/" + MapBuildDirectory + mkPath(log, destPath) + files = findFiles(log, sourcePath, "", ".tga") + for file in files: + sourceFile = sourcePath + "/" + file + destFile = destPath + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) + files = findFiles(log, sourcePath, "", ".png") + for file in files: + sourceFile = sourcePath + "/" + file + destFile = destPath + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) +printLog(log, "") + +printLog(log, ">>> Build map uncompressed: copy tga, png, dds <<<") +for dir in MapSourceDirectories: + sourcePath = DatabaseDirectory + "/" + dir + mkPath(log, sourcePath) + destPath = ExportBuildDirectory + "/" + MapBuildDirectory + mkPath(log, destPath) + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".dds") + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".png") + copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".tga") + +printLog(log, ">>> Build panoply <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> Build panoply dds <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> Build hls map <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/map/3_install.py b/code/nel/tools/build_gamedata/processes/map/3_install.py new file mode 100644 index 000000000..f69df3db2 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/map/3_install.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install map +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install map +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install map") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + MapClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install map <<<") +sourcePath = ExportBuildDirectory + "/" + MapBuildDirectory +mkPath(log, sourcePath) +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".dds") +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".png") +copyFilesExtNoTreeIfNeeded(log, sourcePath, clientPath, ".tga") + +printLog(log, ">>> Install map panoply <<<") +mkPath(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + MapPanoplyBuildDirectory, clientPath, ".dds") + +printLog(log, ">>> Install map hlsbank <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py new file mode 100644 index 000000000..793a369ba --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup rbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, LeveldesignWorldDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) +for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) +mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankTessellationBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankRawBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankPreprocBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + RbankOutputBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PacsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py new file mode 100644 index 000000000..49ca653a9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export rbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +printLog(log, "") + +# For each rbank directory +printLog(log, ">>> Export rbank 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/2_build.py b/code/nel/tools/build_gamedata/processes/rbank/2_build.py new file mode 100644 index 000000000..718e5013b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/2_build.py @@ -0,0 +1,250 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build rbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildIgBoxes = findTool(log, ToolDirectories, BuildIgBoxesTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildRbank = findTool(log, ToolDirectories, BuildRbankTool, ToolSuffix) +GetNeighbors = findTool(log, ToolDirectories, GetNeighborsTool, ToolSuffix) +BuildIndoorRbank = findTool(log, ToolDirectories, BuildIndoorRbankTool, ToolSuffix) +# AiBuildWmap = findTool(log, ToolDirectories, AiBuildWmapTool, ToolSuffix) +printLog(log, "") + +# Build rbank bbox +printLog(log, ">>> Build rbank bbox <<<") +if BuildIgBoxes == "": + toolLogFail(log, BuildIgBoxesTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory) + cf = open("build_ig_boxes.cfg", "w") + cf.write("\n") + cf.write("Pathes = {\n") + for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") + for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("IGs = {\n") + for dir in RbankIgPaths: + files = findFiles(log, ExportBuildDirectory + "/" + dir, "", ".ig") + for file in files: + cf.write("\t\"" + os.path.basename(file)[0:-len(".ig")] + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("Output = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n") + cf.write("\n") + cf.close() + subprocess.call([ BuildIgBoxes ]) + os.remove("build_ig_boxes.cfg") +printLog(log, "") + +printLog(log, ">>> Build rbank build config <<<") +cf = open("build_rbank.cfg", "w") +cf.write("\n") +cf.write("// Rbank settings\n") +cf.write("\n") +cf.write("Verbose = " + str(RBankVerbose) + ";\n") +cf.write("ConsistencyCheck = " + str(RBankConsistencyCheck) + ";\n") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +cf.write("ZonePath = \"" + ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +cf.write("BanksPath = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/\";\n") +cf.write("Bank = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank\";\n") +cf.write("ZoneExt = \".zonew\";\n") +cf.write("ZoneNHExt = \".zonenhw\";\n") +cf.write("IGBoxes = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n") +mkPath(log, LeveldesignWorldDirectory) +cf.write("LevelDesignWorldPath = \"" + LeveldesignWorldDirectory + "\";\n") +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) +cf.write("IgLandPath = \"" + ExportBuildDirectory + "/" + IgLandBuildDirectory + "\";\n") +mkPath(log, ExportBuildDirectory + "/" + IgVillageBuildDirectory) +cf.write("IgVillagePath = \"" + ExportBuildDirectory + "/" + IgVillageBuildDirectory + "\";\n") +cf.write("\n") +mkPath(log, ExportBuildDirectory + "/" + RbankTessellationBuildDirectory) +cf.write("TessellationPath = \"" + ExportBuildDirectory + "/" + RbankTessellationBuildDirectory + "/\";\n") +cf.write("TessellateLevel = " + str(BuildQuality) + ";\n") # BuildQuality +cf.write("\n") +cf.write("WaterThreshold = 1.0;\n") +cf.write("\n") +cf.write("OutputRootPath = \"" + ExportBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) +cf.write("SmoothDirectory = \"" + RbankSmoothBuildDirectory + "/\";\n") +mkPath(log, ExportBuildDirectory + "/" + RbankRawBuildDirectory) +cf.write("RawDirectory = \"" + RbankRawBuildDirectory + "/\";\n") +cf.write("\n") +cf.write("ReduceSurfaces = " + str(RbankReduceSurfaces) + ";\n") +cf.write("SmoothBorders = " + str(RbankSmoothBorders) + ";\n") +cf.write("\n") +cf.write("ComputeElevation = " + str(RbankComputeElevation) + ";\n") +cf.write("ComputeLevels = " + str(RbankComputeLevels) + ";\n") +cf.write("\n") +cf.write("LinkElements = " + str(RbankLinkElements) + ";\n") +cf.write("\n") +cf.write("CutEdges = " + str(RbankCutEdges) + ";\n") +cf.write("\n") +cf.write("UseZoneSquare = " + str(RbankUseZoneSquare) + ";\n") +cf.write("\n") +cf.write("// The whole landscape\n") +cf.write("ZoneUL = \"" + RbankZoneUl + "\";\n") +cf.write("ZoneDR = \"" + RbankZoneDr + "\";\n") +cf.write("\n") +mkPath(log, ExportBuildDirectory + "/" + RbankPreprocBuildDirectory) +cf.write("PreprocessDirectory = \"" + ExportBuildDirectory + "/" + RbankPreprocBuildDirectory + "/\";\n") +cf.write("\n") +cf.write("// The global retriever processing settings\n") +cf.write("GlobalRetriever = \"temp.gr\";\n") +cf.write("RetrieverBank = \"temp.rbank\";\n") +cf.write("\n") +cf.write("GlobalUL = \"" + RbankZoneUl + "\";\n") +cf.write("GlobalDR = \"" + RbankZoneDr + "\";\n") +cf.write("\n") +cf.write("// Which kind of stuff to do\n") +cf.write("TessellateZones = 0;\n") +cf.write("MoulineZones = 0;\n") +cf.write("ProcessRetrievers = 0;\n") +cf.write("ProcessGlobal = 0;\n") +cf.write("\n") +cf.write("Zones = {\n") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +files = findFiles(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory, "", ".zonew") +for file in files: + cf.write("\t\"" + os.path.basename(file) + "\", \n") +cf.write("};\n") +cf.write("\n") +cf.write("Pathes = {\n") +for dir in RbankIgPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") +for dir in RbankShapePaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + cf.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") +cf.write("};\n") +cf.write("\n") +cf.close() +printLog(log, "") + +printLog(log, ">>> Build rbank check prims <<<") +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + subprocess.call([ ExecTimeout, str(RbankBuildTesselTimeout), BuildRbank, "-C", "-p", "-g" ]) +printLog(log, "") + +printLog(log, ">>> Build rbank process all passes <<<") +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +if GetNeighbors == "": + toolLogFail(log, GetNeighborsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + zonefiles = findFiles(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory, "", ".zonew") + for zonefile in zonefiles: + zone = os.path.basename(zonefile)[0:-len(".zonew")] + lr1 = ExportBuildDirectory + "/" + RbankSmoothBuildDirectory + "/" + zone + ".lr" + nearzones = subprocess.Popen([ GetNeighbors, zone ], stdout = subprocess.PIPE).communicate()[0].strip().split(" ") + printLog(log, "ZONE " + zone + ": " + str(nearzones)) + zone_to_build = 0 + for nearzone in nearzones: + sourcePath = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + nearzone + ".zonew" + if (os.path.isfile(sourcePath)): + if (needUpdate(log, sourcePath, lr1)): + zone_to_build = 1 + sourcePath = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + zone + ".zonew" + if zone_to_build: + printLog(log, sourcePath + " -> " + lr1) + subprocess.call([ ExecTimeout, str(RbankBuildTesselTimeout), BuildRbank, "-c", "-P", "-g", os.path.basename(zonefile) ]) + else: + printLog(log, "SKIP " + lr1) +printLog(log, "") + +printLog(log, ">>> Build rbank process global <<<") # TODO: Check if the LR changed? +if BuildRbank == "": + toolLogFail(log, BuildRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + subprocess.call([ ExecTimeout, str(RbankBuildProcglobalTimeout), BuildRbank, "-c", "-P", "-G" ]) +printLog(log, "") +os.remove("build_rbank.cfg") + +printLog(log, ">>> Build rbank indoor <<<") +if BuildIndoorRbank == "": + toolLogFail(log, BuildIndoorRbankTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + cf = open("build_indoor_rbank.cfg", "w") + cf.write("\n") + mkPath(log, ExportBuildDirectory + "/" + RbankMeshBuildDirectory) + cf.write("MeshPath = \"" + ExportBuildDirectory + "/" + RbankMeshBuildDirectory + "/\";\n") + cf.write("Meshes = { };\n") # *********************** TODO export CMB ******************************************** + # mkPath(log, ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory) + # cf.write("OutputPath = \"" + ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory + "/\";\n") + mkPath(log, ExportBuildDirectory + "/" + RbankOutputBuildDirectory) + cf.write("OutputPath = \"" + ExportBuildDirectory + "/" + RbankOutputBuildDirectory + "/\";\n") + cf.write("OutputPrefix = \"unused\";\n") + cf.write("Merge = 1;\n") + mkPath(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory) + cf.write("MergePath = \"" + ExportBuildDirectory + "/" + RbankSmoothBuildDirectory + "/\";\n") + cf.write("MergeInputPrefix = \"temp\";\n") + # cf.write("MergeOutputPrefix = \"tempMerged\";\n") + cf.write("MergeOutputPrefix = \"" + RbankRbankName + "\";\n") + cf.write("AddToRetriever = 1;\n") + cf.write("\n") + cf.close() + subprocess.call([ ExecTimeout, str(RbankBuildIndoorTimeout), BuildIndoorRbank ]) + os.remove("build_indoor_rbank.cfg") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/3_install.py b/code/nel/tools/build_gamedata/processes/rbank/3_install.py new file mode 100644 index 000000000..c929820cd --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/3_install.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install rbank +# \date 2009-03-10-22-43-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install rbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install rbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install rbank <<<") +clientPath = ClientDataDirectory + "/" + PacsClientDirectory +mkPath(log, clientPath) +srcPath = ExportBuildDirectory + "/" + RbankOutputBuildDirectory +mkPath(log, srcPath) +copyFilesNoTreeIfNeeded(log, srcPath, clientPath) +#clientPath = ClientDataDirectory + "/" + PacsClientDirectory +#mkPath(log, clientPath) +#srcPath = ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory +#mkPath(log, srcPath) +#copyFileIfNeeded(log, srcPath + "/tempMerged.rbank", clientPath + "/" + RbankRbankName + ".rbank") +#copyFileIfNeeded(log, srcPath + "/tempMerged.gr", clientPath + "/" + RbankRbankName + ".gr") +#for file in findFiles(log, srcPath, "", ".lr"): +# copyFileIfNeeded(log, srcPath + "/" + file, clientPath + "/" + file.replace("tempMerged", RbankRbankName)) +# mkPath(log, ExportBuildDirectory + "/" + rbankBuildDirectory) +# copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + rbankBuildDirectory, clientPath) +#copyFileIfNeeded +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py new file mode 100644 index 000000000..d3674c746 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup shape +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in ShapeSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +for dir in MapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py new file mode 100644 index 000000000..362af5ed8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -0,0 +1,136 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export shape +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Override config values for draft mode +if BuildQuality == 0: + ShapeExportOptExportLighting = "false" + ShapeExportOptShadow = "false" + ShapeExportOptLightingLimit = 0 + ShapeExportOptLumelSize = "0.25" + ShapeExportOptOversampling = 1 + +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + # ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + printLog(log, "") + + # Export shape 3dsmax + printLog(log, ">>> Export shape 3dsmax <<<") + + # Build paths + scriptSrc = "maxscript/shape_export.ms" + # scriptDst = MaxDirectory + "/scripts/shape_export.ms" + scriptDst = MaxUserDirectory + "/scripts/shape_export.ms" + logFile = ScriptDirectory + "/processes/shape/log.log" + outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory + mkPath(log, outDirTag) + outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeExportDirectory + mkPath(log, outDirWithoutCoarse) + outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory + mkPath(log, outDirWithCoarse) + outDirLightmap = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory + mkPath(log, outDirLightmap) + outDirAnim = ExportBuildDirectory + "/" + ShapeAnimExportDirectory + mkPath(log, outDirAnim) + + tagList = findFiles(log, outDirTag, "", ".tag") + tagLen = len(tagList) + + # For each directoy + if os.path.isfile(scriptDst): + os.remove(scriptDst) + for dir in ShapeSourceDirectories: + tagDiff = 1 + shapeSourceDir = DatabaseDirectory + "/" + dir + mkPath(log, shapeSourceDir) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("shape_source_directory", shapeSourceDir) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) + newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) + newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) + newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) + newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) + newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) + newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) + newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) + newline = newline.replace("shape_lightmap_path", outDirLightmap) + newline = newline.replace("output_directory_anim", outDirAnim) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outDirTag, "", ".tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + + # Export clod 3dsmax + printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + + # cat ../clodbank/maxscript/clod_export.ms + #| sed -e "s&shape_source_directory&$database_directory/$i&g" + #| sed -e "s&output_directory_clod&$build_gamedata_directory/processes/shape/clod&g" + #| sed -e "s&output_directory_tag&$build_gamedata_directory/processes/shape/tag&g" + # > $max_directory/scripts/clod_export.ms + + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py new file mode 100644 index 000000000..10f52735f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build shape +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildShadowSkin = findTool(log, ToolDirectories, BuildShadowSkinTool, ToolSuffix) +BuildClodtex = findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix) +LightmapOptimizer = findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSuffix) +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +BuildCoarseMesh = findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix) + +if DoBuildShadowSkin: + printLog(log, ">>> BuildShadowSkin <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + +if ClodConfigFile != "": + printLog(log, ">>> BuildClodtex <<<") + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") + +printLog(log, ">>> LightmapOptimizer <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +printLog(log, ">>> TgaToDds <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") + +if 1: # todo: CoarseMeshTextureNames length > 0 ... + printLog(log, ">>> Build coarse meshes <<<") + shapeWithCoarseMesh = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory + mkPath(log, shapeWithCoarseMesh) + shapeWithCoarseMeshBuilded = ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory + mkPath(log, shapeWithCoarseMeshBuilded) + cf = open("config_generated.cfg", "w") + cf.write("texture_mul_size = " + TextureMulSizeValue + ";\n") + cf.write("\n") + cf.write("search_path = \n") + cf.write("{\n") + cf.write("\t\"" + shapeWithCoarseMesh + "\", \n") + for dir in MapSourceDirectories: + cf.write("\t\"" + DatabaseDirectory + "/" + dir + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("list_mesh = \n") + cf.write("{\n") + # For each shape with coarse mesh + files = findFiles(log, shapeWithCoarseMesh, "", ".shape") + for file in files: + sourceFile = shapeWithCoarseMesh + "/" + file + if os.path.isfile(sourceFile): + destFile = shapeWithCoarseMeshBuilded + "/" + file + cf.write("\t\"" + file + "\", \"" + destFile + "\", \n") + cf.write("};\n") + cf.write("\n") + cf.write("output_textures = \n") + cf.write("{\n") + # For each shape with coarse mesh + for tn in CoarseMeshTextureNames: + cf.write("\t\"" + shapeWithCoarseMesh + "/" + tn + ".tga\", \n") + cf.write("};\n") + cf.close() + subprocess.call([ BuildCoarseMesh, "config_generated.cfg" ]) + os.remove("config_generated.cfg") + for tn in CoarseMeshTextureNames: + subprocess.call([ TgaToDds, shapeWithCoarseMesh + "/" + tn + ".tga", "-o", shapeWithCoarseMeshBuilded + "/" + tn + ".dds", "-a", "5" ]) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py new file mode 100644 index 000000000..de352fcab --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install shape +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install shape +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install shape") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + ShapeClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install shape <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeExportDirectory, clientPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".shape") +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".dds") + +#if test "$lightmap_install_directory"; then +# mkdir $client_directory/$lightmap_install_directory 2>> log.log 2> /dev/null +# cp -u -p -R lightmap_16_bits/. $client_directory/$lightmap_install_directory 2>> log.log +#fi + +mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory, clientPath, ".anim") + +# ls anim | grep ".anim" >> $client_directory/auto_animations_list.txt + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms new file mode 100644 index 000000000..f8af9e878 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -0,0 +1,511 @@ +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 +NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- This node is n accelerator ? +fn isAccelerator node = +( + accel = getappdata node NEL3D_APPDATA_ACCEL + if (accel != undefined) then + ( + if (accel == "0") or (accel == "32") then + return false + else + return true + ) + return false +) + +-- Must export this node ? +fn isToBeExported node = +( + if (isAccelerator node) == true then + return false + + if ((classof node) == RklPatch) then + return false + + if ((classof node) == nel_ps) then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + return true +) + +-- Must export this node ? +fn isAnimToBeExported node = +( + automaticAnimation = getappdata node NEL3D_APPDATA_AUTOMATIC_ANIMATION + if (automaticAnimation == undefined) then + return false + if (automaticAnimation == "0") then + return false + + if (isAccelerator node) == true then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + return true +) + +-- Cast shadow ? +fn isCastShadow node = +( + if (classof node == nel_ps) then + return false + + if (isAccelerator node) == true then + ( + return false + ) + else + ( + return true + ) +) + +-- List the lod +lod_array = #() + +-- is a lod ? +fn isLod node = +( + for i = 1 to lod_array.count do + ( + if (lod_array[i] == node) then + return true + ) + return false +) + +-- have a coarse mesh ? +fn haveCoarseMesh node = +( + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then + ( + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do + ( + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then + ( + -- Select a node + nd = execute ("$'"+lod+"'") + + -- Node exist ? + if (nd != undefined) then + ( + -- Is a coarse mesh ? + if (getappdata nd NEL3D_APPDATA_LOD_COARSE_MESH == "1") then + return true + ) + ) + ) + ) + return false +) + +fn goShapeExport = +( + try + ( + -- Get files in the shape_source_directory + files = getFiles "shape_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Delete lod files + lod_array = #() + + -- Ok ? + ok = false + + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag files[i]) == true then + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] quiet:true == true then + ( + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Add the lod + for node in geometry do + ( + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then + ( + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do + ( + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then + ( + -- Select a node + try + ( + nd = execute ("$'"+lod+"'") + ) + catch + ( + nlerror ("Error in Execute $'"+lod+"' from node "+node.name) + nd = undefined + ) + + -- Node exist ? + if (nd != undefined) then + ( + append lod_array nd + ) + ) + ) + ) + ) + + -- Select objects for shadows + for node in geometry do + ( + if (node.parent == undefined) then + ( + -- Cast shadow ? + if (isCastShadow node == true) then + ( + -- Select this node + selectmore node + ) + ) + ) + + -- Tag this file ? + tagThisFile = true + + -- Array of node to export + array_node = #() + + -- Add geometry + for node in geometry do + append array_node node + + -- Add shapes + for node in shapes do + append array_node node + + -- For each node + for node in array_node do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Not a lod ? + if ((isLod node) == false) then + ( + -- Output directory + if (haveCoarseMesh node) == true then + output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") + else + output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + try + ( + -- Export the shape + if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting shape "+node.name+" in file "+files[i]) + tagThisFile = false + return 0 + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+files[i]) + tagThisFile = false + return 0 + ) + ) + else + ( + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 + ) + ) + ) + ) + ) + ) + + -- Export default animations + + for node in objects do + ( + -- Can export it ? + if (isAnimToBeExported node) == true then + ( + -- Anim output directory + output = ("output_directory_anim/"+(node.name)+".anim") + + -- Export the animation + if (NelExportAnimation #(node) output false) == false then + ( + nlerror ("ERROR exporting animation "+output) + return 0 + ) + else + ( + nlerror ("OK "+output) + ) + ) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror ("WARNING no shape exported from the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting shape: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape in file " + files[i]) + -- return 0 + ) + ) + ) + else + ( + nlerror ("WARNING no max file in folder shape_source_directory") + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape in folder shape_source_directory") + return 0 + ) +) + +goShapeExport() + +nlerror ("BYE") + +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py new file mode 100644 index 000000000..93b8d3d7c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sheet_id +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SheetIdClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py new file mode 100644 index 000000000..183664f26 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sheet_id +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py new file mode 100644 index 000000000..f2f210b99 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sheet_id +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +MakeSheetId = findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix) +printLog(log, "") + +# For each sheet_id directory +printLog(log, ">>> Build sheet_id <<<") +if MakeSheetId == "": + toolLogFail(log, MakeSheetIdTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + subprocess.call([ MakeSheetId, "-c" + ScriptDirectory + "/configuration/make_sheet_id.cfg", "-o" + ExportBuildDirectory + "/" + SheetIdBuildDirectory + "/" + "sheet_id.bin", LeveldesignDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py new file mode 100644 index 000000000..e79124c61 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sheet_id +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sheet_id +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install sheet_id") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SheetIdClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install sheet_id <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory, clientPath, ".bin") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/0_setup.py b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py new file mode 100644 index 000000000..4151a89ee --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SheetsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/1_export.py b/code/nel/tools/build_gamedata/processes/sheets/1_export.py new file mode 100644 index 000000000..22c067ae3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/2_build.py b/code/nel/tools/build_gamedata/processes/sheets/2_build.py new file mode 100644 index 000000000..8530d8604 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/2_build.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildSheets = findTool(log, ToolDirectories, BuildSheetsTool, ToolSuffix) +printLog(log, "") + +# For each sheets directory +printLog(log, ">>> Build sheets <<<") +if BuildSheets == "": + toolLogFail(log, BuildSheetsTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetIdBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) + subprocess.call([ BuildSheets, LeveldesignDirectory, LeveldesignDfnDirectory, ExportBuildDirectory + "/" + SheetIdBuildDirectory, ExportBuildDirectory + "/" + SheetsBuildDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets/3_install.py b/code/nel/tools/build_gamedata/processes/sheets/3_install.py new file mode 100644 index 000000000..326af190a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sheets +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SheetsClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install sheets <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SheetsBuildDirectory, clientPath, ".packed_sheets") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/0_setup.py b/code/nel/tools/build_gamedata/processes/skel/0_setup.py new file mode 100644 index 000000000..43de0b7ca --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup skel +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup skel") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SkelClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py new file mode 100644 index 000000000..643bfc556 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export skel +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export skel") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +printLog(log, "") + +# For each skel directory +printLog(log, ">>> Export skel 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/2_build.py b/code/nel/tools/build_gamedata/processes/skel/2_build.py new file mode 100644 index 000000000..9557f3b29 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build skel +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build skel") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/3_install.py b/code/nel/tools/build_gamedata/processes/skel/3_install.py new file mode 100644 index 000000000..d96b7d5e0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install skel +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install skel +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install skel") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SkelClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install skel <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SkelExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py new file mode 100644 index 000000000..d68485a6d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup smallbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, DatabaseDirectory + "/" + BankSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + BankClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/smallbank/1_export.py b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py new file mode 100644 index 000000000..5598dab23 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export smallbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +BuildSmallbank = findTool(log, ToolDirectories, BuildSmallbankTool, ToolSuffix) +printLog(log, "") + +# For each bank export smallbank +printLog(log, ">>> Export smallbank <<<") +if ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +elif BuildSmallbank == "": + toolLogFail(log, BuildSmallbankTool, ToolSuffix) +else: + mkPath(log, DatabaseDirectory + "/" + BankSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) + files = findFiles(log, DatabaseDirectory + "/" + BankSourceDirectory, "", ".bank") + for file in files: + sourceFile = DatabaseDirectory + "/" + BankSourceDirectory + "/" + file + if os.path.isfile(sourceFile): + destFile = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + file[0:-len(".bank")] + ".smallbank" + if (needUpdateLogRemoveDest(log, sourceFile, destFile)): + subprocess.call([ ExecTimeout, str(SmallbankBuildTimeout), BuildSmallbank, sourceFile, destFile, DatabaseDirectory + "/" + TileRootSourceDirectory + "/" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/smallbank/2_build.py b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py new file mode 100644 index 000000000..a158ada96 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build smallbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/smallbank/3_install.py b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py new file mode 100644 index 000000000..84b30b47d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install smallbank +# \date 2009-03-10-20-54-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install smallbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install smallbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + BankClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install smallbank <<<") +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SmallbankExportDirectory, clientPath, ".smallbank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/0_setup.py b/code/nel/tools/build_gamedata/processes/sound/0_setup.py new file mode 100644 index 000000000..b9e467725 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/0_setup.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup sound +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) +mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SoundSheetsClientDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/1_export.py b/code/nel/tools/build_gamedata/processes/sound/1_export.py new file mode 100644 index 000000000..60193669e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export sound +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/2_build.py b/code/nel/tools/build_gamedata/processes/sound/2_build.py new file mode 100644 index 000000000..95aa0e9e4 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/2_build.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build sound +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildSound = findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) +printLog(log, "") + +# For each sound directory +printLog(log, ">>> Build sound <<<") +if BuildSound == "": + toolLogFail(log, BuildSoundTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) + mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) + mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) + subprocess.call([ BuildSound, LeveldesignDirectory, LeveldesignDfnDirectory, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory ]) + moveFilesExtNoTree(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ".sample_bank") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sound/3_install.py b/code/nel/tools/build_gamedata/processes/sound/3_install.py new file mode 100644 index 000000000..c32415bd7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sound/3_install.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sound +# \date 2009-06-03 10:47GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install sound +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install sound") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install sound packed_sheets <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSheetsClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory, ClientDataDirectory + "/" + SoundSheetsClientDirectory, ".packed_sheets") + +printLog(log, ">>> Install sound samplebanks <<<") +mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) +mkPath(log, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ClientDataDirectory + "/" + SoundSamplebanksClientDirectory, ".sample_bank") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/0_setup.py b/code/nel/tools/build_gamedata/processes/swt/0_setup.py new file mode 100644 index 000000000..6f67165f3 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup swt +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup skeleton weigths") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + SwtClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py new file mode 100644 index 000000000..cb5a5b162 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -0,0 +1,63 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export swt +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export skeleton weigths") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +printLog(log, "") + +# For each swt directory +printLog(log, ">>> Export skeleton weigths 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) +for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/2_build.py b/code/nel/tools/build_gamedata/processes/swt/2_build.py new file mode 100644 index 000000000..c2b2e7d9c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build swt +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build skeleton weigths") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/3_install.py b/code/nel/tools/build_gamedata/processes/swt/3_install.py new file mode 100644 index 000000000..7d1f0c779 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install swt +# \date 2009-03-10-20-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install swt +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install skeleton weigths") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + SwtClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install skeleton weigths <<<") +mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SwtExportDirectory, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms new file mode 100644 index 000000000..98cdb0c30 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -0,0 +1,139 @@ +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +try +( + -- Get files in the swt_source_directory + files = getFiles "swt_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Output file + output = ("output_directory/"+(getFilenameFile files[i])+".swt") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] == true then + ( + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) output == false then + ( + nlerror ("ERROR exporting skeleton weight "+files[i]) + ) + else + ( + nlerror ("OK "+output) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting skeleton weight: can't open the file "+files[i]) + ) + ) + else + ( + nlerror ("SKIPPED "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting skeleton weight in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no skeleton weight file in folder swt_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR error exporting skeleton weight in folder swt_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/tiles/0_setup.py b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py new file mode 100644 index 000000000..a15122e91 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup tiles +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in TilesSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + TilesClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/tiles/1_export.py b/code/nel/tools/build_gamedata/processes/tiles/1_export.py new file mode 100644 index 000000000..d6b78b2f0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/1_export.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export tiles +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +printLog(log, "") + +# For each tiles directory +printLog(log, ">>> Export tiles as DDS <<<") +if TgaToDds == "": + toolLogFail(log, TgaToDdsTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) + for dir in TilesSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + TilesExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-a", "5", "-m" ]) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".png") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + TilesExportDirectory + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-a", "5", "-m" ]) + +#printLog(log, ">>> Copy PNG tiles <<<") +#mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) +#for dir in TilesSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + TilesExportDirectory, ".png") +#printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/tiles/2_build.py b/code/nel/tools/build_gamedata/processes/tiles/2_build.py new file mode 100644 index 000000000..c40803a2b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build tiles +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/tiles/3_install.py b/code/nel/tools/build_gamedata/processes/tiles/3_install.py new file mode 100644 index 000000000..2a971b9f0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/tiles/3_install.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install tiles +# \date 2009-03-10-21-31-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install tiles +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install tiles") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install tiles <<<") +mkPath(log, ClientDataDirectory + "/" + TilesClientDirectory) +mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + TilesExportDirectory, ClientDataDirectory + "/" + TilesClientDirectory) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py new file mode 100644 index 000000000..8a25227d6 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup veget +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in VegetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + VegetTagExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + VegetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py new file mode 100644 index 000000000..44cd0b931 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -0,0 +1,91 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export veget +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + printLog(log, "") + + # Export veget 3dsmax + printLog(log, ">>> Export veget 3dsmax <<<") + + # Build paths + scriptSrc = "maxscript/veget_export.ms" + # scriptDst = MaxDirectory + "/scripts/veget_export.ms" + scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" + logFile = ScriptDirectory + "/processes/veget/log.log" + outputDirVeget = ExportBuildDirectory + "/" + VegetExportDirectory + mkPath(log, outputDirVeget) + outputDirTag = ExportBuildDirectory + "/" + VegetTagExportDirectory + mkPath(log, outputDirTag) + + # For each directoy + mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + for dir in VegetSourceDirectories: + vegetSourceDir = DatabaseDirectory + "/" + dir + mkPath(log, vegetSourceDir) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("veget_source_directory", vegetSourceDir) + newline = newline.replace("output_directory_veget", outputDirVeget) + newline = newline.replace("output_directory_tag", outputDirTag) + sDst.write(newline) + sSrc.close() + sDst.close() + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + os.remove(scriptDst) + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py new file mode 100644 index 000000000..30ad86fc8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build veget +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py new file mode 100644 index 000000000..fad4ea33b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install veget +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install veget +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install veget") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + VegetClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install veget <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetExportDirectory, clientPath, ".veget") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms new file mode 100644 index 000000000..404f6e2ed --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -0,0 +1,249 @@ +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "output_logfile" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +-- Must export this node ? +fn isToBeExported node = +( + if (classof node == nel_ps) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + vegetable = getappdata node NEL3D_APPDATA_VEGETABLE + if (vegetable != undefined) then + if (vegetable == "1") then + return true + + -- Do not export + return false +) + +try +( + -- Get files in the veget_source_directory + files = getFiles "veget_source_directory/*.max" + + -- Sort files + sort files + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + try + ( + -- Delete lod files + lod_array = #() + + -- Ok ? + ok = false + + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Get the tag file name + tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") + + -- Compare date with the tag file + if (NeLTestFileDate tag files[i]) == true then + ( + -- Open the max project + nlerror ("Scanning file "+files[i]+" ...") + if loadMaxFile files[i] quiet:true == true then + ( + -- Unhide category + unhidecategory() + + tagThisFile = true + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + output = ("output_directory_veget/"+(node.name)+".veget") + + -- Compare file date + if (NeLTestFileDate output files[i]) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node output false) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting veget "+node.name+" in file "+files[i]) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror ("ERROR fata error exporting veget "+node.name+" in file "+files[i]) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror ("WARNING no veget exported from the file "+files[i]) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) + else + ( + print "toto" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror ("ERROR exporting veget: can't open the file "+files[i]) + ) + ) + else + ( + -- Error + nlerror ("SKIPPED BY TAG "+files[i]) + ) + ) + catch + ( + -- Error + nlerror ("ERROR error exporting veget in files " + files[i]) + ) + ) + ) + else + ( + nlerror ("WARNING no max file in folder veget_source_directory") + ) +) +catch +( + -- Error + nlerror ("ERROR fatal error exporting veget in folder veget_source_directory") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX () #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py new file mode 100644 index 000000000..bd8df545b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup vegetset +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in VegetSetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + VegetSetClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/vegetset/1_export.py b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py new file mode 100644 index 000000000..63ea405ef --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export vegetset +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each vegetset directoy +printLog(log, ">>> Export vegetset <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) +for dir in VegetSetSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + VegetSetExportDirectory, ".vegetset") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/vegetset/2_build.py b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py new file mode 100644 index 000000000..2bc216775 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build vegetset +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/vegetset/3_install.py b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py new file mode 100644 index 000000000..6e5f5506a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install vegetset +# \date 2010-05-24 08:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install vegetset +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install vegetset") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + VegetSetClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install vegetset <<<") +mkPath(log, ExportBuildDirectory + "/" + VegetSetExportDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetSetExportDirectory, clientPath, ".vegetset") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py new file mode 100644 index 000000000..7ec4e5c5f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup zone +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ZoneClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py new file mode 100644 index 000000000..564c47bb7 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export zone +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +Max = findMax(log, MaxDirectory, MaxExecutable) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +printLog(log, "") + +# For each zone directory +printLog(log, ">>> Export zone 3dsmax <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +printLog(log, "") + +printLog(log, ">>> Export zone ligo <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/2_build.py b/code/nel/tools/build_gamedata/processes/zone/2_build.py new file mode 100644 index 000000000..60f8d034f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/2_build.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build zone +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ZoneDependencies = findTool(log, ToolDirectories, ZoneDependenciesTool, ToolSuffix) +ZoneWelder = findTool(log, ToolDirectories, ZoneWelderTool, ToolSuffix) +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +printLog(log, "") + +# We are in BEST mode +# TODO if (high quality) blahblahblah +printLog(log, ">>> Build zone dependencies <<<") +if ZoneDependencies == "": + toolLogFail(log, ZoneDependenciesTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + printLog(log, "********************************") + printLog(log, "******** TODO ********") + printLog(log, "********************************") +printLog(log, "") + +# For each zone directory +printLog(log, ">>> Build zone weld <<<") +if ZoneWelder == "": + toolLogFail(log, ZoneWelderTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + ZoneExportDirectory, "", ".zone") + for file in files: + sourceFile = ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + file + destFile = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + os.path.basename(file)[0:-len(".zone")] + ".zonew" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(ZoneBuildWeldTimeout), ZoneWelder, sourceFile, destFile ]) +printLog(log, "") + +# For each zone directory +printLog(log, ">>> Build zone weld no heightmap <<<") +if ZoneWelder == "": + toolLogFail(log, ZoneWelderTool, ToolSuffix) +elif ExecTimeout == "": + toolLogFail(log, ExecTimeoutTool, ToolSuffix) +else: + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) + files = findFiles(log, ExportBuildDirectory + "/" + ZoneExportDirectory, "", ".zonenh") + for file in files: + sourceFile = ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + file + destFile = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + "/" + os.path.basename(file)[0:-len(".zonenh")] + ".zonenhw" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ ExecTimeout, str(ZoneBuildWeldTimeout), ZoneWelder, sourceFile, destFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/3_install.py b/code/nel/tools/build_gamedata/processes/zone/3_install.py new file mode 100644 index 000000000..d305974c4 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/3_install.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install zone +# \date 2009-03-10-22-23-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install zone +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install zone") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies b/code/nel/tools/build_gamedata/processes/zone/todo_build_dependencies new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript b/code/nel/tools/build_gamedata/processes/zone/todo_export_maxscript new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py new file mode 100644 index 000000000..0626bb784 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup zone_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +mkPath(log, ScriptDirectory + "/configuration/project/generated") +zlp = open(ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", "w") +ps = open(ScriptDirectory + "/configuration/project/zone_lighter_base.cfg", "r") +for line in ps: + newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) + newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) + newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) + newline = newline.replace("%EcosystemName%", EcosystemName) + newline = newline.replace("%EcosystemPath%", EcosystemPath) + newline = newline.replace("%BankTileBankName%", BankTileBankName) + newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) + newline = newline.replace("%IgVillageBuildDirectory%", IgVillageBuildDirectory) + newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) + newline = newline.replace("%RbankRbankName%", RbankRbankName) + newline = newline.replace("%BuildQuality%", str(BuildQuality)) + zlp.write(newline) +ps.close() +if (BuildQuality == 1): + ps = open(ScriptDirectory + "/configuration/project/zone_lighter_final.cfg", "r") +else: + ps = open(ScriptDirectory + "/configuration/project/zone_lighter_draft.cfg", "r") +for line in ps: + zlp.write(line) +zlp.close() +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in WaterMapSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ZoneClientDirectory) +mkPath(log, ClientDataDirectory + "/" + IgClientDirectory) +mkPath(log, ClientDataDirectory + "/" + WaterMapsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/1_export.py b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py new file mode 100644 index 000000000..50e1d6e36 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export zone_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +#TgaToDds = findTool(log, ToolDirectories, TgaToDdsTool, ToolSuffix) +printLog(log, "") + +# For each zone_light directory +printLog(log, ">>> Export zone_light water maps <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory +mkPath(log, srcDir) +for dir in WaterMapSourceDirectories: + destDir = DatabaseDirectory + "/" + dir + mkPath(log, destDir) + copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".tga") +#mkPath(log, ExportBuildDirectory + "/" + zone_lightExportDirectory) +#for dir in zone_lightSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# niouname = dir.replace("/", "_") +# newpath = ExportBuildDirectory + "/" + zone_lightExportDirectory + "/" + niouname +# mkPath(log, newpath) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") +printLog(log, "") + +# For each zone_light directory to compress in one DXTC +#printLog(log, ">>> Export zone_light dxtc <<<") +#mkPath(log, ExportBuildDirectory + "/" + zone_lightDxtcExportDirectory) +#for dir in zone_lightDxtcSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + zone_lightDxtcExportDirectory, ".tga") +#printLog(log, "") + +# For each zone_light fullscreen directory compress independently all in dds +#printLog(log, ">>> Export zone_light fullscreen <<<") +#if TgaToDds == "": +# toolLogFail(log, TgaToDdsTool, ToolSuffix) +#else: +# mkPath(log, ExportBuildDirectory + "/" + zone_lightFullscreenExportDirectory) +# for dir in zone_lightFullscreenSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".tga") +# for file in files: +# sourceFile = DatabaseDirectory + "/" + dir + "/" + file +# destFile = ExportBuildDirectory + "/" + zone_lightFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" +# if needUpdateLogRemoveDest(log, sourceFile, destFile): +# subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) +#printLog(log, "") + +# For each zone_light 3d directory +#printLog(log, ">>> Export zone_light 3d <<<") +#mkPath(log, ExportBuildDirectory + "/" + zone_light3DExportDirectory) +#for dir in zone_light3DSourceDirectories: +# mkPath(log, DatabaseDirectory + "/" + dir) +# copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + zone_light3DExportDirectory, ".tga") +#printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py new file mode 100644 index 000000000..124e7cf4f --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build zone_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) +ZoneLighter = findTool(log, ToolDirectories, ZoneLighterTool, ToolSuffix) +ZoneIgLighter = findTool(log, ToolDirectories, ZoneIgLighterTool, ToolSuffix) +printLog(log, "") + +# For each zone_light directory +printLog(log, ">>> Build zone_light <<<") +if ZoneLighter == "": + toolLogFail(log, ZoneLighterTool, ToolSuffix) +elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ZoneWeldBuildDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory + mkPath(log, destDir) + dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + mkPath(log, dependDir) + files = findFiles(log, srcDir, "", ".zonew") + for file in files: + srcFile = srcDir + "/" + file + destFile = destDir + "/" + file[0:-len(".zonew")] + ".zonel" + if (needUpdateLogRemoveDest(log, srcFile, destFile)): + dependFile = destDir + "/" + file[0:-len(".zonew")] + ".depend" + subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", dependFile ]) +printLog(log, "") + +# For each zone_light ig +printLog(log, ">>> Build zone_light ig <<<") +if ZoneIgLighter == "": + toolLogFail(log, ZoneIgLighterTool, ToolSuffix) +elif ExecTimeout == "": + toolLogfail(log, ExecTimeoutTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory + mkPath(log, srcDir) + igsrcDir = ExportBuildDirectory + "/" + IgLandBuildDirectory + mkPath(log, igsrcDir) + destDir = ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory + mkPath(log, destDir) + dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + mkPath(log, dependDir) + files = findFiles(log, srcDir, "", ".zonel") + for file in files: + igsrcFile = igsrcDir + os.path.basename(file)[0:-len(".zonel")] + ".ig" + destFile = destDir + "/" + os.path.basename(file)[0:-len(".zonel")] + ".ig" + if (os.path.isfile(igsrcFile)): + if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): + srcFile = srcDir + "/" + file # ************************* TODO CHECK IF THIS REALLY WORKS ************************************* + dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" + subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ScriptDirectory + "/configuration/project/generated/zone_lighter.cfg", dependFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/3_install.py b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py new file mode 100644 index 000000000..5027dd8bb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py @@ -0,0 +1,71 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install zone_light +# \date 2009-03-11-13-45-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install zone_light +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") +sys.path.append("../../configuration/project") +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install zone_light") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install zone_light zones <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + ZoneClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, ">>> Install zone_light water maps <<<") +srcDir = ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + WaterMapsClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, ">>> Install zone_light igs <<<") +srcDir = ExportBuildDirectory + "/" + IgLandBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + IgClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water b/code/nel/tools/build_gamedata/processes/zone_light/todo_patch_tile_water new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/work_in_progress b/code/nel/tools/build_gamedata/work_in_progress new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 98e452a03..1500e9543 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -1614,21 +1614,23 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth) sint lsurf = cborder.Left; sint rsurf = cborder.Right; - if (lsurf >= 0) + if (CheckConsistency) { - CComputableSurface& surf = Surfaces[lsurf]; - if (!surf.checkConsistency()) + if (lsurf >= 0) { - nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, lsurf); + CComputableSurface& surf = Surfaces[lsurf]; + if (!surf.checkConsistency()) + { + nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, lsurf); + } } - } - - if (rsurf >= 0) - { - CComputableSurface& surf = Surfaces[rsurf]; - if (!surf.checkConsistency()) + if (rsurf >= 0) { - nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, rsurf); + CComputableSurface& surf = Surfaces[rsurf]; + if (!surf.checkConsistency()) + { + nlwarning("Before smooth of border '%d', surface '%d' not consistent", border, rsurf); + } } } @@ -1642,22 +1644,24 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth) uint after = (uint)Borders[border].Vertices.size(); totalBefore += before; totalAfter += after; - - if (lsurf >= 0) + + if (CheckConsistency) { - CComputableSurface& surf = Surfaces[lsurf]; - if (!surf.checkConsistency()) + if (lsurf >= 0) { - nlwarning("After smooth of border '%d', surface '%d' not consistent", border, lsurf); + CComputableSurface& surf = Surfaces[lsurf]; + if (!surf.checkConsistency()) + { + nlwarning("After smooth of border '%d', surface '%d' not consistent", border, lsurf); + } } - } - - if (rsurf >= 0) - { - CComputableSurface& surf = Surfaces[rsurf]; - if (!surf.checkConsistency()) + if (rsurf >= 0) { - nlwarning("After smooth of border '%d', surface '%d' not consistent", border, rsurf); + CComputableSurface& surf = Surfaces[rsurf]; + if (!surf.checkConsistency()) + { + nlwarning("After smooth of border '%d', surface '%d' not consistent", border, rsurf); + } } } } diff --git a/code/nel/tools/pacs/build_rbank/build_surf.h b/code/nel/tools/pacs/build_rbank/build_surf.h index 2a62268fe..0e8849bb5 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.h +++ b/code/nel/tools/pacs/build_rbank/build_surf.h @@ -77,6 +77,7 @@ extern std::string GlobalUL; extern std::string GlobalDR; extern bool ProcessGlobal; extern bool Verbose; +extern bool CheckConsistency; extern CPrimChecker PrimChecker; @@ -392,7 +393,8 @@ public: template void floodFill(CSurfElement *first, sint32 surfId, const A &cmp, CZoneTessellation *zoneTessel) { - nldebug("flood fill surface %d", surfId); + if (Verbose) + nldebug("flood fill surface %d", surfId); std::vector stack; sint i; @@ -433,7 +435,8 @@ public: } } - nldebug("%d elements added", Elements.size()); + if (Verbose) + nldebug("%d elements added", Elements.size()); Center = NLMISC::CVector::Null; for (i=0; i<(sint)Elements.size(); ++i) diff --git a/code/nel/tools/pacs/build_rbank/main.cpp b/code/nel/tools/pacs/build_rbank/main.cpp index e5f5be80f..82e6a5724 100644 --- a/code/nel/tools/pacs/build_rbank/main.cpp +++ b/code/nel/tools/pacs/build_rbank/main.cpp @@ -86,6 +86,7 @@ string LevelDesignWorldPath; string IgLandPath; string IgVillagePath; bool Verbose = false; +bool CheckConsistency = true; CPrimChecker PrimChecker; @@ -187,6 +188,8 @@ void initMoulinette() WaterThreshold = getFloat(cf, "WaterThreshold", 1.0); + CheckConsistency = getBool(cf, "CheckConsistency", true); + //if (TessellateZones || MoulineZones) { ZoneExt = getString(cf, "ZoneExt", ".zonew"); diff --git a/code/nelns/admin/admin.vcproj b/code/nelns/admin/admin.vcproj index 2d0411d39..325e9eab6 100644 --- a/code/nelns/admin/admin.vcproj +++ b/code/nelns/admin/admin.vcproj @@ -1,7 +1,7 @@ + @@ -47,6 +50,8 @@ /> - @@ -106,6 +108,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -#endif - #include "actions.h" #include "events_listener.h" #include "interface_v3/interface_manager.h" diff --git a/code/ryzom/client/src/debug_client.cpp b/code/ryzom/client/src/debug_client.cpp index ec3fd117c..8ab6c99dd 100644 --- a/code/ryzom/client/src/debug_client.cpp +++ b/code/ryzom/client/src/debug_client.cpp @@ -26,9 +26,8 @@ // OS. #ifdef NL_OS_WINDOWS +# define NOMINMAX # include -# undef min -# undef max #endif // Misc diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index e5c59324d..c03bfcce5 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -761,6 +761,7 @@ void prelogInit() // Remap tga files on dds files. CPath::remapExtension ("dds", "tga", true); + CPath::remapExtension ("dds", "png", true); FPU_CHECKER_ONCE uint i; diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index b3ada0105..6580b4f0d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -2785,7 +2785,7 @@ public: } // If no modes are available, display a message and exit - if (nFoundMode == -1) + if (!ClientCfg.Windowed && nFoundMode == -1) { Driver->systemMessageBox("No Video Modes available!\n" "Minimum Video mode to play Ryzom is 800x600.\n", diff --git a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp index beb24608c..8d8aaec9d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_outpost.cpp @@ -684,9 +684,7 @@ public: return; // *** must update time zone, in case of user changed it during play -#ifdef NL_OS_WINDOWS - _tzset(); -#endif + tzset(); // *** Get the difference of time => timezone time_t tGmt=0, tLocal=0; diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp index 58ad09392..358532c0e 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp @@ -247,7 +247,6 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) if (prop) _TextShadowColorOver = convertColor(prop); - // *** Read Text Global Color // Default: take "global_color" param interface_element option. _TextModulateGlobalColorNormal= _TextModulateGlobalColorPushed= _TextModulateGlobalColorOver= getModulateGlobalColor(); @@ -262,12 +261,10 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"force_text_over" ); if (prop) _ForceTextOver= convertBool(prop); - // read Text header color prop = (char*) xmlGetProp( cur, (xmlChar*)"text_header_color" ); if (prop) _TextHeaderColor= convertBool(prop); - return true; } diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index fce01798f..402b83688 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -31,10 +31,6 @@ #include "../time_client.h" #include "lua_ihm.h" -#ifdef NL_OS_WINDOWS -#include -#endif - using namespace std; using namespace NLMISC; using namespace NL3D; diff --git a/code/ryzom/client/src/interface_v3/music_player.cpp b/code/ryzom/client/src/interface_v3/music_player.cpp index e74f6d2b9..2223a6073 100644 --- a/code/ryzom/client/src/interface_v3/music_player.cpp +++ b/code/ryzom/client/src/interface_v3/music_player.cpp @@ -160,35 +160,6 @@ void CMusicPlayer::update () // *************************************************************************** -bool supportUnicode() -{ - static bool init = false; - static bool unicodeSupported = false; - if (!init) - { - init = true; -#ifdef NL_OS_WINDOWS - OSVERSIONINFO osvi; - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (::GetVersionEx (&osvi)) - { - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) - { - if (osvi.dwMajorVersion >= 4) - { - unicodeSupported = true; - } - } - } -#else - unicodeSupported = true; -#endif - } - return unicodeSupported; -} - -// *************************************************************************** - class CMusicPlayerPlaySongs: public IActionHandler { public: diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 9f8f5c3bf..81de7e8e8 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -734,7 +734,7 @@ void initLoginScreen() ClientApp = ClientCfg.ConfigFile.getVar("Application").asString(0); - CSystemUtils::setRootKey("SOFTWARE\\Nevrax\\Ryzom"); + CSystemUtils::setRootKey("Software\\Nevrax\\Ryzom"); string l = CSystemUtils::getRegKey("Login"); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 4ebb7ad9b..7c9084b95 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -322,7 +322,7 @@ std::string DebugUIFilter; bool ShowHelp = false; // Do the Help have to be displayed. uint8 ShowInfos = 0; // 0=no info 1=text info 2=graph info -bool bZeroCpu = 0; // For no Cpu use if application is minimize TODO: intercept minimize message, called by CTRL + Z at this +bool bZeroCpu = false; // For no Cpu use if application is minimize TODO: intercept minimize message, called by CTRL + Z at this bool Profiling = false; // Are we in Profile mode? uint ProfileNumFrame = 0; @@ -2287,8 +2287,11 @@ bool mainLoop() smoothFPS.addValue((float)deltaTime); moreSmoothFPS.addValue((float)deltaTime); deltaTime = smoothFPS.getSmoothValue (); - CCDBNodeLeaf*pNL = pIMinstance->getDbProp("UI:VARIABLES:FPS"); - pNL->setValue64((sint64)(1.f/deltaTime)); + if (deltaTime > 0.0) + { + CCDBNodeLeaf*pNL = pIMinstance->getDbProp("UI:VARIABLES:FPS"); + pNL->setValue64((sint64)(1.f/deltaTime)); + } } // Detect disconnection / server down: display information text diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index db355193c..bb7679f07 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -3076,12 +3076,8 @@ void CEditor::reset() if (ClientCfg.R2EDExtendedDebug) { Driver->setWindowTitle(CI18N::get("TheSagaOfRyzom")); - Driver->showWindow(); - // TODO: check - // Get the window // Show the window -// ShowWindow (hWnd, SW_SHOW); -// SetForegroundWindow(hWnd); + Driver->showWindow(); } getUI().displaySystemInfo(CI18N::get("uiR2EDEditorReseted"), "BC"); @@ -4491,24 +4487,12 @@ void CEditor::updatePreCamera() { //H_AUTO(R2_CEditor_updatePreCamera) - /* - #ifdef NL_DEBUG - #ifdef NL_OS_WINDOWS - _CrtCheckMemory(); - #endif - #endif - */ - - - if (_Mode == EditionMode) { - static uint32 loop = 0; ++loop; if (loop % 200 == 0) // minimal wait between to save = 20 seconds { - if ( (CTime::getLocalTime() -_LastAutoSaveTime)/1000 > ClientCfg.R2EDAutoSaveWait) // 5 minutes if not change in Confile { autoSave(); @@ -4525,7 +4509,6 @@ void CEditor::updatePreCamera() _DMC->getActionHistoric().flushPendingAction(); } } - } // ********************************************************************************************************* diff --git a/code/ryzom/common/src/game_share/bnp_patch.cpp b/code/ryzom/common/src/game_share/bnp_patch.cpp index 4a4643be6..431f9dcc7 100644 --- a/code/ryzom/common/src/game_share/bnp_patch.cpp +++ b/code/ryzom/common/src/game_share/bnp_patch.cpp @@ -19,13 +19,6 @@ //----------------------------------------------------------------------------- #include "stdpch.h" -#ifdef NL_OS_WINDOWS -//#include -#else -//#include -//#define _utimbuf utimbuf -//#define _utime utime -#endif #include "nel/misc/path.h" #include "nel/misc/sha1.h" #include "bnp_patch.h" diff --git a/code/ryzom/common/src/game_share/game_share.vcproj b/code/ryzom/common/src/game_share/game_share.vcproj index 3e699d301..9c336674c 100644 --- a/code/ryzom/common/src/game_share/game_share.vcproj +++ b/code/ryzom/common/src/game_share/game_share.vcproj @@ -86,75 +86,6 @@ Name="VCPostBuildEventTool" /> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/common/src/game_share/ring_session_manager_itf.h b/code/ryzom/common/src/game_share/ring_session_manager_itf.h index b03471403..6530ce008 100644 --- a/code/ryzom/common/src/game_share/ring_session_manager_itf.h +++ b/code/ryzom/common/src/game_share/ring_session_manager_itf.h @@ -25,7 +25,7 @@ #include "nel/net/login_cookie.h" -#include "../../nelns/welcome_service/welcome_service_itf.h" +#include "game_share/welcome_service_itf.h" #include "game_share/character_sync_itf.h" diff --git a/code/ryzom/common/src/game_share/welcome_service_itf.cpp b/code/ryzom/common/src/game_share/welcome_service_itf.cpp new file mode 100644 index 000000000..a8fdaea87 --- /dev/null +++ b/code/ryzom/common/src/game_share/welcome_service_itf.cpp @@ -0,0 +1,458 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + + +#include "stdpch.h" + +///////////////////////////////////////////////////////////////// +// WARNING : this is a generated file, don't change it ! +///////////////////////////////////////////////////////////////// + +#include "welcome_service_itf.h" + +namespace WS +{ + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + + const CWelcomeServiceSkel::TMessageHandlerMap &CWelcomeServiceSkel::getMessageHandlers() const + { + static TMessageHandlerMap handlers; + static bool init = false; + + if (!init) + { + std::pair < TMessageHandlerMap::iterator, bool > res; + + res = handlers.insert(std::make_pair(std::string("WU"), &CWelcomeServiceSkel::welcomeUser_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + res = handlers.insert(std::make_pair(std::string("DU"), &CWelcomeServiceSkel::disconnectUser_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + init = true; + } + + return handlers; + } + bool CWelcomeServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message) + { + const TMessageHandlerMap &mh = getMessageHandlers(); + + TMessageHandlerMap::const_iterator it(mh.find(message.getName())); + + if (it == mh.end()) + { + return false; + } + + TMessageHandler cmd = it->second; + (this->*cmd)(sender, message); + + return true; + } + + + void CWelcomeServiceSkel::welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceSkel_welcomeUser_WU); + uint32 charId; + nlRead(__message, serial, charId); + std::string userName; + nlRead(__message, serial, userName); + NLNET::CLoginCookie cookie; + nlRead(__message, serial, cookie); + std::string priviledge; + nlRead(__message, serial, priviledge); + std::string exPriviledge; + nlRead(__message, serial, exPriviledge); + WS::TUserRole mode; + nlRead(__message, serial, mode); + uint32 instanceId; + nlRead(__message, serial, instanceId); + welcomeUser(sender, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId); + } + + void CWelcomeServiceSkel::disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceSkel_disconnectUser_DU); + uint32 userId; + nlRead(__message, serial, userId); + disconnectUser(sender, userId); + } + // ask the welcome service to welcome a character + void CWelcomeServiceProxy::welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->welcomeUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), charId, userName, cookie, priviledge, exPriviledge, mode, instanceId); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_welcomeUser(__message, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + // ask the welcome service to disconnect a user + void CWelcomeServiceProxy::disconnectUser(NLNET::IModule *sender, uint32 userId) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->disconnectUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_disconnectUser(__message, userId); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) + { + __message.setType("WU"); + nlWrite(__message, serial, charId); + nlWrite(__message, serial, const_cast < std::string& > (userName)); + nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie)); + nlWrite(__message, serial, const_cast < std::string& > (priviledge)); + nlWrite(__message, serial, const_cast < std::string& > (exPriviledge)); + nlWrite(__message, serial, mode); + nlWrite(__message, serial, instanceId); + + + return __message; + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId) + { + __message.setType("DU"); + nlWrite(__message, serial, userId); + + + return __message; + } + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + + const CLoginServiceSkel::TMessageHandlerMap &CLoginServiceSkel::getMessageHandlers() const + { + static TMessageHandlerMap handlers; + static bool init = false; + + if (!init) + { + std::pair < TMessageHandlerMap::iterator, bool > res; + + res = handlers.insert(std::make_pair(std::string("PUL"), &CLoginServiceSkel::pendingUserLost_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + init = true; + } + + return handlers; + } + bool CLoginServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message) + { + const TMessageHandlerMap &mh = getMessageHandlers(); + + TMessageHandlerMap::const_iterator it(mh.find(message.getName())); + + if (it == mh.end()) + { + return false; + } + + TMessageHandler cmd = it->second; + (this->*cmd)(sender, message); + + return true; + } + + + void CLoginServiceSkel::pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CLoginServiceSkel_pendingUserLost_PUL); + NLNET::CLoginCookie cookie; + nlRead(__message, serial, cookie); + pendingUserLost(sender, cookie); + } + // An awaited user did not connect before the allowed timeout expire + void CLoginServiceProxy::pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->pendingUserLost(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), cookie); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_pendingUserLost(__message, cookie); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CLoginServiceProxy::buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie) + { + __message.setType("PUL"); + nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie)); + + + return __message; + } + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + + const CWelcomeServiceClientSkel::TMessageHandlerMap &CWelcomeServiceClientSkel::getMessageHandlers() const + { + static TMessageHandlerMap handlers; + static bool init = false; + + if (!init) + { + std::pair < TMessageHandlerMap::iterator, bool > res; + + res = handlers.insert(std::make_pair(std::string("RWS"), &CWelcomeServiceClientSkel::registerWS_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + res = handlers.insert(std::make_pair(std::string("RWSOS"), &CWelcomeServiceClientSkel::reportWSOpenState_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + res = handlers.insert(std::make_pair(std::string("WUR"), &CWelcomeServiceClientSkel::welcomeUserResult_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + res = handlers.insert(std::make_pair(std::string("UCP"), &CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel)); + // if this assert, you have a doubly message name in your interface definition ! + nlassert(res.second); + + init = true; + } + + return handlers; + } + bool CWelcomeServiceClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message) + { + const TMessageHandlerMap &mh = getMessageHandlers(); + + TMessageHandlerMap::const_iterator it(mh.find(message.getName())); + + if (it == mh.end()) + { + return false; + } + + TMessageHandler cmd = it->second; + (this->*cmd)(sender, message); + + return true; + } + + + void CWelcomeServiceClientSkel::registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceClientSkel_registerWS_RWS); + uint32 shardId; + nlRead(__message, serial, shardId); + uint32 fixedSessionId; + nlRead(__message, serial, fixedSessionId); + bool isOnline; + nlRead(__message, serial, isOnline); + registerWS(sender, shardId, fixedSessionId, isOnline); + } + + void CWelcomeServiceClientSkel::reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceClientSkel_reportWSOpenState_RWSOS); + bool isOnline; + nlRead(__message, serial, isOnline); + reportWSOpenState(sender, isOnline); + } + + void CWelcomeServiceClientSkel::welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceClientSkel_welcomeUserResult_WUR); + uint32 userId; + nlRead(__message, serial, userId); + bool ok; + nlRead(__message, serial, ok); + std::string shardAddr; + nlRead(__message, serial, shardAddr); + std::string errorMsg; + nlRead(__message, serial, errorMsg); + welcomeUserResult(sender, userId, ok, shardAddr, errorMsg); + } + + void CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message) + { + H_AUTO(CWelcomeServiceClientSkel_updateConnectedPlayerCount_UCP); + uint32 nbOnlinePlayers; + nlRead(__message, serial, nbOnlinePlayers); + uint32 nbPendingPlayers; + nlRead(__message, serial, nbPendingPlayers); + updateConnectedPlayerCount(sender, nbOnlinePlayers, nbPendingPlayers); + } + // Register the welcome service in the ring session manager + // The provided sessionId will be non-zero only for a shard with a fixed sessionId + void CWelcomeServiceClientProxy::registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->registerWS(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), shardId, fixedSessionId, isOnline); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_registerWS(__message, shardId, fixedSessionId, isOnline); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + // WS report it's current open state + void CWelcomeServiceClientProxy::reportWSOpenState(NLNET::IModule *sender, bool isOnline) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->reportWSOpenState(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), isOnline); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_reportWSOpenState(__message, isOnline); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + // return for welcome user + void CWelcomeServiceClientProxy::welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->welcomeUserResult(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId, ok, shardAddr, errorMsg); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_welcomeUserResult(__message, userId, ok, shardAddr, errorMsg); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + // transmits the current player counts + void CWelcomeServiceClientProxy::updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers) + { + if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported()) + { + // immediate local synchronous dispatching + _LocalModuleSkel->updateConnectedPlayerCount(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), nbOnlinePlayers, nbPendingPlayers); + } + else + { + // send the message for remote dispatching and execution or local queing + NLNET::CMessage __message; + + buildMessageFor_updateConnectedPlayerCount(__message, nbOnlinePlayers, nbPendingPlayers); + + _ModuleProxy->sendModuleMessage(sender, __message); + } + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline) + { + __message.setType("RWS"); + nlWrite(__message, serial, shardId); + nlWrite(__message, serial, fixedSessionId); + nlWrite(__message, serial, isOnline); + + + return __message; + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline) + { + __message.setType("RWSOS"); + nlWrite(__message, serial, isOnline); + + + return __message; + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg) + { + __message.setType("WUR"); + nlWrite(__message, serial, userId); + nlWrite(__message, serial, ok); + nlWrite(__message, serial, const_cast < std::string& > (shardAddr)); + nlWrite(__message, serial, const_cast < std::string& > (errorMsg)); + + + return __message; + } + + // Message serializer. Return the message received in reference for easier integration + const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers) + { + __message.setType("UCP"); + nlWrite(__message, serial, nbOnlinePlayers); + nlWrite(__message, serial, nbPendingPlayers); + + + return __message; + } + +} diff --git a/code/ryzom/common/src/game_share/welcome_service_itf.h b/code/ryzom/common/src/game_share/welcome_service_itf.h new file mode 100644 index 000000000..81a498a06 --- /dev/null +++ b/code/ryzom/common/src/game_share/welcome_service_itf.h @@ -0,0 +1,541 @@ + +///////////////////////////////////////////////////////////////// +// WARNING : this is a generated file, don't change it ! +///////////////////////////////////////////////////////////////// + +#ifndef WELCOME_SERVICE_ITF +#define WELCOME_SERVICE_ITF +#include "nel/misc/types_nl.h" +#ifdef NL_COMP_VC8 + #include +#endif +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/string_conversion.h" +#include "nel/net/message.h" +#include "nel/net/module.h" +#include "nel/net/module_builder_parts.h" +#include "nel/net/module_message.h" +#include "nel/net/module_gateway.h" + +#include "nel/net/login_cookie.h" + +namespace WS +{ + + + + struct TUserRole + { + enum TValues + { + ur_player, + ur_editor, + ur_animator, + /// the highest valid value in the enum + last_enum_item = ur_animator, + /// a value equal to the last enum item +1 + end_of_enum, + + invalid_val, + + /// Number of enumerated values + nb_enum_items = 3 + }; + + /// Index table to convert enum value to linear index table + const std::map &getIndexTable() const + { + static std::map indexTable; + static bool init = false; + if (!init) + { + // fill the index table + indexTable.insert(std::make_pair(ur_player, 0)); + indexTable.insert(std::make_pair(ur_editor, 1)); + indexTable.insert(std::make_pair(ur_animator, 2)); + + init = true; + } + + return indexTable; + } + + + static const NLMISC::CStringConversion &getConversionTable() + { + NL_BEGIN_STRING_CONVERSION_TABLE(TValues) + NL_STRING_CONVERSION_TABLE_ENTRY(ur_player) + NL_STRING_CONVERSION_TABLE_ENTRY(ur_editor) + NL_STRING_CONVERSION_TABLE_ENTRY(ur_animator) + NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val) + }; + static NLMISC::CStringConversion + conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table) + / sizeof(TValues_nl_string_conversion_table[0]), invalid_val); + + return conversionTable; + } + + TValues _Value; + + public: + TUserRole() + : _Value(invalid_val) + { + } + TUserRole(TValues value) + : _Value(value) + { + } + + TUserRole(const std::string &str) + { + _Value = getConversionTable().fromString(str); + } + + void serial(NLMISC::IStream &s) + { + s.serialEnum(_Value); + } + + bool operator == (const TUserRole &other) const + { + return _Value == other._Value; + } + bool operator != (const TUserRole &other) const + { + return ! (_Value == other._Value); + } + bool operator < (const TUserRole &other) const + { + return _Value < other._Value; + } + + bool operator <= (const TUserRole &other) const + { + return _Value <= other._Value; + } + + bool operator > (const TUserRole &other) const + { + return !(_Value <= other._Value); + } + bool operator >= (const TUserRole &other) const + { + return !(_Value < other._Value); + } + + const std::string &toString() const + { + return getConversionTable().toString(_Value); + } + static const std::string &toString(TValues value) + { + return getConversionTable().toString(value); + } + + TValues getValue() const + { + return _Value; + } + + // return true if the actual value of the enum is valid, otherwise false + bool isValid() + { + if (_Value == invalid_val) + return false; + + // not invalid, check other enum value + return getConversionTable().isValid(_Value); + } + + + uint32 asIndex() + { + std::map::const_iterator it(getIndexTable().find(_Value)); + nlassert(it != getIndexTable().end()); + return it->second; + } + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CWelcomeServiceSkel + { + public: + /// the interceptor type + typedef NLNET::CInterceptorForwarder < CWelcomeServiceSkel> TInterceptor; + protected: + CWelcomeServiceSkel() + { + // do early run time check for message table + getMessageHandlers(); + } + virtual ~CWelcomeServiceSkel() + { + } + + void init(NLNET::IModule *module) + { + _Interceptor.init(this, module); + } + + // unused interceptors + std::string fwdBuildModuleManifest() const { return std::string(); } + void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {} + + // process module message interceptor + bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + private: + + typedef void (CWelcomeServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + typedef std::map TMessageHandlerMap; + + const TMessageHandlerMap &getMessageHandlers() const; + + + void welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + void disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + // declare one interceptor member of the skeleton + TInterceptor _Interceptor; + + // declare the interceptor forwarder as friend of this class + friend class NLNET::CInterceptorForwarder < CWelcomeServiceSkel>; + public: + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + // ask the welcome service to welcome a character + virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) =0; + // ask the welcome service to disconnect a user + virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId) =0; + + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CWelcomeServiceProxy + { + /// Smart pointer on the module proxy + NLNET::TModuleProxyPtr _ModuleProxy; + + // Pointer on the local module that implement the interface (if the proxy is for a local module) + NLNET::TModulePtr _LocalModule; + // Direct pointer on the server implementation interface for collocated module + CWelcomeServiceSkel *_LocalModuleSkel; + + + public: + CWelcomeServiceProxy(NLNET::IModuleProxy *proxy) + { + nlassert(proxy->getModuleClassName() == "WelcomeService"); + _ModuleProxy = proxy; + + // initialize collocated servant interface + if (proxy->getModuleDistance() == 0) + { + _LocalModule = proxy->getLocalModule(); + nlassert(_LocalModule != NULL); + CWelcomeServiceSkel::TInterceptor *interceptor = NULL; + interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor); + nlassert(interceptor != NULL); + + _LocalModuleSkel = interceptor->getParent(); + nlassert(_LocalModuleSkel != NULL); + } + else + _LocalModuleSkel = 0; + + } + virtual ~CWelcomeServiceProxy() + { + } + + NLNET::IModuleProxy *getModuleProxy() + { + return _ModuleProxy; + } + + // ask the welcome service to welcome a character + void welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId); + // ask the welcome service to disconnect a user + void disconnectUser(NLNET::IModule *sender, uint32 userId); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId); + + + + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CLoginServiceSkel + { + public: + /// the interceptor type + typedef NLNET::CInterceptorForwarder < CLoginServiceSkel> TInterceptor; + protected: + CLoginServiceSkel() + { + // do early run time check for message table + getMessageHandlers(); + } + virtual ~CLoginServiceSkel() + { + } + + void init(NLNET::IModule *module) + { + _Interceptor.init(this, module); + } + + // unused interceptors + std::string fwdBuildModuleManifest() const { return std::string(); } + void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {} + + // process module message interceptor + bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + private: + + typedef void (CLoginServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + typedef std::map TMessageHandlerMap; + + const TMessageHandlerMap &getMessageHandlers() const; + + + void pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + // declare one interceptor member of the skeleton + TInterceptor _Interceptor; + + // declare the interceptor forwarder as friend of this class + friend class NLNET::CInterceptorForwarder < CLoginServiceSkel>; + public: + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + // An awaited user did not connect before the allowed timeout expire + virtual void pendingUserLost(NLNET::IModuleProxy *sender, const NLNET::CLoginCookie &cookie) =0; + + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CLoginServiceProxy + { + /// Smart pointer on the module proxy + NLNET::TModuleProxyPtr _ModuleProxy; + + // Pointer on the local module that implement the interface (if the proxy is for a local module) + NLNET::TModulePtr _LocalModule; + // Direct pointer on the server implementation interface for collocated module + CLoginServiceSkel *_LocalModuleSkel; + + + public: + CLoginServiceProxy(NLNET::IModuleProxy *proxy) + { + + _ModuleProxy = proxy; + + // initialize collocated servant interface + if (proxy->getModuleDistance() == 0) + { + _LocalModule = proxy->getLocalModule(); + nlassert(_LocalModule != NULL); + CLoginServiceSkel::TInterceptor *interceptor = NULL; + interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor); + nlassert(interceptor != NULL); + + _LocalModuleSkel = interceptor->getParent(); + nlassert(_LocalModuleSkel != NULL); + } + else + _LocalModuleSkel = 0; + + } + virtual ~CLoginServiceProxy() + { + } + + NLNET::IModuleProxy *getModuleProxy() + { + return _ModuleProxy; + } + + // An awaited user did not connect before the allowed timeout expire + void pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie); + + + + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CWelcomeServiceClientSkel + { + public: + /// the interceptor type + typedef NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel> TInterceptor; + protected: + CWelcomeServiceClientSkel() + { + // do early run time check for message table + getMessageHandlers(); + } + virtual ~CWelcomeServiceClientSkel() + { + } + + void init(NLNET::IModule *module) + { + _Interceptor.init(this, module); + } + + // unused interceptors + std::string fwdBuildModuleManifest() const { return std::string(); } + void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {} + + // process module message interceptor + bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + private: + + typedef void (CWelcomeServiceClientSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); + typedef std::map TMessageHandlerMap; + + const TMessageHandlerMap &getMessageHandlers() const; + + + void registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + void reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + void welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + void updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message); + + // declare one interceptor member of the skeleton + TInterceptor _Interceptor; + + // declare the interceptor forwarder as friend of this class + friend class NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel>; + public: + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + + // Register the welcome service in the ring session manager + // The provided sessionId will be non-zero only for a shard with a fixed sessionId + virtual void registerWS(NLNET::IModuleProxy *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline) =0; + // WS report it's current open state + virtual void reportWSOpenState(NLNET::IModuleProxy *sender, bool isOnline) =0; + // return for welcome user + virtual void welcomeUserResult(NLNET::IModuleProxy *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg) =0; + // transmits the current player counts + virtual void updateConnectedPlayerCount(NLNET::IModuleProxy *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers) =0; + + + }; + + ///////////////////////////////////////////////////////////////// + // WARNING : this is a generated file, don't change it ! + ///////////////////////////////////////////////////////////////// + class CWelcomeServiceClientProxy + { + /// Smart pointer on the module proxy + NLNET::TModuleProxyPtr _ModuleProxy; + + // Pointer on the local module that implement the interface (if the proxy is for a local module) + NLNET::TModulePtr _LocalModule; + // Direct pointer on the server implementation interface for collocated module + CWelcomeServiceClientSkel *_LocalModuleSkel; + + + public: + CWelcomeServiceClientProxy(NLNET::IModuleProxy *proxy) + { + + _ModuleProxy = proxy; + + // initialize collocated servant interface + if (proxy->getModuleDistance() == 0) + { + _LocalModule = proxy->getLocalModule(); + nlassert(_LocalModule != NULL); + CWelcomeServiceClientSkel::TInterceptor *interceptor = NULL; + interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor); + nlassert(interceptor != NULL); + + _LocalModuleSkel = interceptor->getParent(); + nlassert(_LocalModuleSkel != NULL); + } + else + _LocalModuleSkel = 0; + + } + virtual ~CWelcomeServiceClientProxy() + { + } + + NLNET::IModuleProxy *getModuleProxy() + { + return _ModuleProxy; + } + + // Register the welcome service in the ring session manager + // The provided sessionId will be non-zero only for a shard with a fixed sessionId + void registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline); + // WS report it's current open state + void reportWSOpenState(NLNET::IModule *sender, bool isOnline); + // return for welcome user + void welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg); + // transmits the current player counts + void updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg); + + // Message serializer. Return the message received in reference for easier integration + static const NLNET::CMessage &buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers); + + + + + }; + +} + +#endif diff --git a/code/ryzom/server/dynamic_scenario_service.cfg b/code/ryzom/server/dynamic_scenario_service.cfg new file mode 100644 index 000000000..d264d0f73 --- /dev/null +++ b/code/ryzom/server/dynamic_scenario_service.cfg @@ -0,0 +1,320 @@ +// Auto generated config file +// Use with commandline: dynamic_scenario_service -C. -L. --nobreak --writepid +AESAliasName= "dss"; + +ASWebPort="46700"; +ASPort="46701"; +AESPort="46702"; +SUPort = 50505; +SUGlobalPort = 50503; +L3BSPort = "49950"; +L3SlaveBSPort = "49951"; +L3MasterLGSPort = 49992; +LGSBSPort = 49994; +L3LGSBSPort = 49995; +SUHost = "localhost"; +MFSHost = "localhost"; +BSHost = "localhost:49990"; +SlaveBSHost = ""; +MasterLGSHost = "localhost"; +SlaveLGSHost = "localhost"; +LGSBSHost = "localhost"; +DBHost = "localhost"; +#define DONT_USE_LGS_SLAVE +// Configure module gateway for layer 5 module comm +StartCommands += +{ +// Create a gateway module +"moduleManager.createModule StandardGateway gw", +// add a layer 5 transport +"gw.transportAdd L5Transport l5", +// open the transport +"gw.transportCmd l5(open)", + +/// Create default connection with admin executor service +// Create a gateway module +"moduleManager.createModule StandardGateway gw_aes", +// create the admin executor service module +"moduleManager.createModule AdminExecutorServiceClient aes_client", +"aes_client.plug gw_aes", + +// create a layer 3 client to connect to aes gateway +"gw_aes.transportAdd L3Client aes_l3c", +"gw_aes.transportCmd aes_l3c(connect addr=localhost:"+AESPort+")", +}; + +/// A list of vars to graph for any service +GraphVars = +{ +"ProcessUsedMemory", "60000", // every minute +}; + + +/* Force default value for PDLib directory (e.g. SaveFilesDirectory...) +* PLEASE NOTICE THAT THIS LINE MUST BE LEFT TO "" +* Only log analyser must have the $shard parameter to find all shards root directory +*/ +PDRootDirectory = ""; + +// Log PD updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableLog = 1; + +// Log PD StringManager updates to log file (1 enabled, 0 disabled), see PDLogSaveDirectory to choose where to log +PDEnableStringLog = 0; + +// Number of seconds between 2 logs to file +PDLogUpdate = 10; + +// MySGL wrapper strict mode - controls use of asserts if SQL requests fail +MSWStrictMode=0; + +// This is the mapping for logical continent to physical one +ContinentNameTranslator = +{ +"matis_newbie", "matis", +"zorai_newbie", "zorai", +"terre", "terre_oubliee", +"sources", "sources_interdites" +}; + +NegFiltersDebug = { "ZZZZZZZZZZZ" }; +NegFiltersInfo = { "ZZZZZZZZZZZ" }; +NegFiltersWarning = { "ZZZZZZZZZZZ", "Missing log context for log" }; +//NegFiltersDebug = { "NET", "ADMIN", "MIRROR", "NC", "PATH" }; +//NegFiltersInfo = { "NET", "ADMIN", "MIRROR", "NC", "CF", "TimerManagerUpdate" }; +// NegFiltersWarning = { "CT_LRC", "AnimalSpawned" }; + +// Block the system in the tick service that provokes stalls when overloaded +WaitForBSThreshold=0; + +// Only produce log*.log files and not *.log +DontLog=1; + +IgnoredFiles = { "continent.cfg", "__read_me.txt", "bandit.html", "flora_primr.primitive" }; + +// If the update loop is too slow, a thread will produce an assertion. +// By default, the value is set to 10 minutes. +// Set to 0 for no assertion. +UpdateAssertionThreadTimeout = 6000000; + +DefaultMaxExpectedBlockSize = 200000000; // 200 M ! +DefaultMaxSentBlockSize = 200000000; // 200 M ! + +// MS Packet size limit in bytes, PER DATASET (warning: depending on the weights, limits per property may be very small) +MaxOutBandwidth = 100000000; + +// how to sleep between 2 network updates +// 0 = pipe +// 1 = usleep +// 2 = nanosleep +// 3 = sched_yield +// 4 = nothing +UseYieldMethod = 0; + +// The privileges needed to access any ring session +PrivilegeForSessionAccess = ":DEV:SGM:GM:SG:"; + +// The max number of ring points (aka ring access) for each ecosystem +MaxRingPoints = "A1:D7:F7:J8:L6:R13"; + +// Level limit for newb scenarios +FreeTrialSkillLimit=21; + +// Level limit for newb scenarios +DefaultInterShardExchangeLevelCap=0; + +// Configureation for DSS +MaxNpcs = 300; +MaxStaticObjects = 200; + +// the following variable must be defined but should be empty - it's presence is used to change the behaviour +// of the packed sheet reader +GeorgePaths = { "" }; + +// Dissable nel net verbose logging +VerboseNETTC = 0; +VerboseLNETL0 = 0; +VerboseLNETL1 = 0; +VerboseLNETL2 = 0; +VerboseLNETL3 = 0; +VerboseLNETL4 = 0; +VerboseLNETL5 = 0; +VerboseLNETL6 = 0; + +// Dissable ryzom verbose logging +VerboseMIRROR = 0; +VerboseRingRPLog = 0; +VerboseCDBGroup = 0; + +// What to do with characters coming from another mainland shard? +// 0: teleport to the stored session id +// 1: let the character play anyway, but leave the stored session id unchanged +// 2: assign the stored session id with FixedSessionId and let play +AllowCharsFromAllSessions = 0; + +// Use Shard Unifier or not +DontUseSU = 0; + +// the domain's set of useful addresses +LSHost = SUHost; +RSMHost = SUHost; + +// MFS config +WebSrvUsersDirectory = ""; +WebRootDirectory = "/home/nevrax/live/save_shard/www"; +HoFHDTDirectory = "/local/www/hof/hdt"; + +// BS Specifics -------------------------------------------------------------------------- +// BS - set to 1 if a BS is not part of a naming service group (then BS not disclosed +// to other services by the Layer 5, i.e. the services sending requests to BS have +// to know its/their address(es) by another mean) +BSDontUseNS = 1; +// BS - set the host of the naming service where the BS register +BSNSHost = "localhost"; +UseBS = 1; +XMLSave = 0; + +// Where to save specific shard data (ie: player backup), relatively to SaveShardRoot +SaveFilesDirectory = ""; + +// where to save generic shard data (ie: packed_sheet) +WriteFilesDirectory = "r2_shard/data_shard"; + +// Will SaveFilesDirectory will be converted to a full path? +ConvertSaveFilesDirectoryToFullPath = 0; + +// BS - Root directory where data are backuped to +IncrementalBackupDirectory = "../incremental_backup"; + +// IOS - Directory to store ios.string_cache file +StringManagerCacheDirectory = "../data_shard_local"; + +// IOS - Directory to log chat into +LogChatDirectory = "../data_shard_local"; + +// MFS - Directories +WebRootDirectory = "../www"; + +// Root directory where data from shards are stored into +SaveShardRoot = "../save_shard/"; + +// SU Specifics -------------------------------------------------------------------------- +// SU - set to 1 if SU didn't use a naming service +SUDontUseNS = 1; +// SU - host for the NS used by SU +SUNSHost = "localhost"; +// SU - listen address of the SU service (for L5 connections) +SUAddress = SUHost+":"+SUPort; +// SU - nel and ring database names +DBNelName = "nel"; +DBRingName = "ring_open"; +// Nel DB user +DBNelUser = "open"; +// Ring DB user +DBRingUser = "open"; +// SU - password to access to the nel database with DBNelUseruser (default is no password) +DBNelPass = ""; +// SU - password to access to the ring database with DBRingUser (default is no password) +DBRingPass = ""; + +// WS Specifics -------------------------------------------------------------------------- +// WS - use or not the legacy WelcomeService from nel ns (only for backward compatibility during transition to ring) +DontUseLSService = 1; + +// Global config -------------------------------------------------------------------------- +// set to 0 if you want to use the admin system +DontUseAES = 1; + +// Dissable generation / display of nldebug messages +DissableNLDebug = 1; +DisableNLDebug = 1; +ShardId = 201; +BasePort = 51400; +SaveFilesDirectory="open_ring01/"; +NSHost = "localhost"; +// Player limits (AIS, EGS, WS, FS) +NbPlayersLimit = 5000; +NbGuildLimit = 15000; +PlayerLimit = NbPlayersLimit; +ClientLimit = 1000; + +// Set this shard as a ring (1) or mainland (0) shard (main behavior switch) +IsRingShard = 1; + +// Set a mainland SessionId. +// Live: Must be 0 for ring shards, non-zero (usually ShardId) for mainland shards +// Dev: Can be non-zero to initially connect a client to a ring shard +NoWSShardId = ShardId; +FixedSessionId = 0; + +// Mirror limits +DatasetSizefe_temp = 600000; +DatasetSizefame = 26000; + +// FS Specifics -------------------------------------------------------------------------- +// Client bandwidth ratio, set to 1 for standard operation, more than one allocate more bandwidth +BandwidthRatio = 2; + +// EGS Specifics -------------------------------------------------------------------------- +// Entity Limits (EGS) +NbObjectsLimit = 2000; +NbNpcSpawnedByEGSLimit = 5000; +NbForageSourcesLimit = 10000; +NbToxicCloudsLimit = 5000; + +// AIS Specifics -------------------------------------------------------------------------- +// Entity Limits (AIS) +NbPetLimit = NbPlayersLimit*4; +NbFaunaLimit = 50000; +NbNpcLimit = 50000; +NbFxLimit = 500; + +// This is the list of continent to use with their unique instance number +UsedContinents = +{ +"r2_desert", "10000", +"r2_forest", "10001", +"r2_jungle", "10002", +"r2_lakes", "10003", +"r2_roots", "10004", +}; + +// define the primitives configuration used. +UsedPrimitives = +{ +}; +FSListenHost = "localhost"; +#include "dynamic_scenario_service_default.cfg" +WriteFilesDirectory="../live/service_dynamic_scenario_service/"; +DontLog = 1; +WebSrvHost = "http://localhost:50000/"; +Mainlands = { + "302", "Open", "(Open Developer Community)", "en", +}; +HomeMainlandNames = +{ + "302", "Open", "open", +}; +RRDVarPath = "../rrd_graphs"; +NegFiltersInfo+= {"FESTATS", "FETIME", "FERECV", "FESEND: sent SYNC message to client 1", "EIT: Register EId"}; +NegFiltersWarning+= {"PIPO_SESSION1", "casino_session_matis01", "invalid damage type 10", "_log_Item_Delete", +"_log_Item_Money", "_log_Item_Create", "_log_Item_Move", "botChatMissionAdvance> invalid index 0", +"_MaxRange(0) < _MinRange(1)", "Can't find craft plan sheet 'unknown.unknown'"}; +DontUseAES=1; +RingRPEnabled=0; +DomainName = "ryzom_open"; +EnableStlAllocatorChecker = 0; +// start commands for setting up the exchange level caps of different ryzom shards +StartCommands += { "setShardExchangeLimit 101 250" }; +StartCommands += { "setShardExchangeLimit 102 250" }; +StartCommands += { "setShardExchangeLimit 103 250" }; +StartCommands += { "setShardExchangeLimit 104 0" }; +StartCommands += { "setShardExchangeLimit 105 0" }; +StartCommands += { "displayShardExchangeLimits" }; +StartCommands += { "EnableStlAllocatorChecker 0" }; + +Paths = { + ".", + "../common/data_common", + "../common/data_leveldesign", +}; diff --git a/code/ryzom/server/dynamic_scenario_service_default.cfg b/code/ryzom/server/dynamic_scenario_service_default.cfg new file mode 100644 index 000000000..e6d5942ac --- /dev/null +++ b/code/ryzom/server/dynamic_scenario_service_default.cfg @@ -0,0 +1,9 @@ + +DelayBeforeStartAct = 1; +MaxNpcs = 300; +MaxStaticObjects = 200; + +StartCommands += +{ + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", +}; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 0288a67ef..f45122431 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -5660,7 +5660,8 @@ bool CCharacter::onAnimalHungry( uint petIndex, bool justBecameHungry ) { // Consume to full satiety (last useful unit is entirely consumed) animal.Satiety = animal.MaxSatiety; - nbUnits = (sint)((caloriesNeeded / caloriesPerUnit) + 1); + nbUnits = (sint)ceil(caloriesNeeded / caloriesPerUnit); + } nbItemsLeftToConsume -= nbUnits; diff --git a/code/ryzom/server/src/frontend_service/client_host.h b/code/ryzom/server/src/frontend_service/client_host.h index c284567d9..a8e377a29 100644 --- a/code/ryzom/server/src/frontend_service/client_host.h +++ b/code/ryzom/server/src/frontend_service/client_host.h @@ -33,7 +33,7 @@ #include "entity_container.h" #include "game_share/ryzom_entity_id.h" #include "game_share/entity_types.h" -#include "../../nelns/welcome_service/welcome_service_itf.h" +#include "game_share/welcome_service_itf.h" #include #include diff --git a/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp b/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp index 857d6b847..42287fb87 100644 --- a/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp +++ b/code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service.cpp @@ -1,12 +1,1147 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// Includes +// + +#include "nel/misc/types_nl.h" + +#include +#include + +#include "nel/misc/debug.h" +#include "nel/misc/command.h" +#include "nel/misc/variable.h" +#include "nel/misc/displayer.h" + +#include "nel/net/callback_server.h" +#include "nel/net/service.h" +#include "nel/net/module_manager.h" + +// +// Namespaces +// + +using namespace std; + +using namespace NLMISC; +using namespace NLNET; + + +NLMISC_COMMAND(test, "none", "none") +{ + log.displayNL("Raw cmd line : '%s'", rawCommandString.c_str()); + log.displayNL("Dumping %u parameters :", args.size()); + for (uint i=0; i &a, const string &n, TServiceId s) : SockId(sock), Addr(a), Name(n), SId (s), WaitingUnregistration(false) { } + + TSockId SockId; // the connection between the service and the naming service + vector Addr; // address to send to the service who wants to lookup this service + // it s possible to have more than one addr, anyway, the naming service + // will send good address depending of the sub net address of the service + string Name; // name of the service + TServiceId SId; // id of the service + + bool WaitingUnregistration; // true if this service is in unregistration process (wait other service ACK) + TTime WaitingUnregistrationTime; // time of the beginning of the inregistration process + list WaitingUnregistrationServices; // list of service that we wait the answer +}; + + + +// Helper that emulates layer5's send() +//void sendToService( uint16 sid, CMessage& msgout ); + +// Helper that emulate layer5's getServiceName() +string getServiceName( TServiceId sid ); + +// Helper that returns the first address of a service +CInetAddress getHostAddress( TServiceId sid ); + +// Asks a service to stop and tell every one +void doUnregisterService (TServiceId sid); extern void admin_modules_forceLink(); - - void foo() { admin_modules_forceLink(); } +/** + * Manager for services instances + * (Moved from the TICKS to the NS) + * Implementable with layer 5, here implemented in NS (layer 3) + * \author Olivier Cado + * \author Nevrax France + * \date 2003 + */ +class CServiceInstanceManager +{ +public: + + /// Constructor + CServiceInstanceManager(); -#include "../../nelns/naming_service/naming_service.cpp" + /** Add the name of a service which must not be duplicated + * If uniqueOnShard is true, only one service is allowed. + * If uniqueOnShard is false, one service is allowed by physical machine. + */ + void addUniqueService( const std::string& serviceName, bool uniqueOnShard ) + { + _UniqueServices.insert( std::make_pair( serviceName, uniqueOnShard ) ); + } + + /// Check if a service is allowed to start (if so, add it) + bool queryStartService( const std::string& serviceName, TServiceId serviceId, const std::vector &addr, string& reason ); + + /// Release a service instance + void releaseService( NLNET::TServiceId serviceId ); + + /// Display information + void displayInfo( NLMISC::CLog *log = NLMISC::InfoLog ) const; + + /// Make all controlled services quit + void killAllServices(); + +private: + + /// List of restricted services + std::map< std::string, bool > _UniqueServices; + + /// List of granted (online) services + std::set< TServiceId > _OnlineServices; +}; + + +CServiceInstanceManager *SIMInstance = NULL; + + +/* + * Constructor + */ +CServiceInstanceManager::CServiceInstanceManager() +{ + nlassert( ! SIMInstance ); + SIMInstance = this; + + // Note: addCallbackArray() done in CRangeMirrorManager::init() +} + + +/* + * Check if a service is allowed to start. Answer with a GSTS (Grant Start Service) message + */ +bool CServiceInstanceManager::queryStartService( const std::string& serviceName, TServiceId serviceId, const vector &addr, string& reason ) +{ + bool grantStarting = true; + std::map< std::string, bool >::iterator ius = _UniqueServices.find( serviceName ); + if ( ius != _UniqueServices.end() ) + { + // Service is restricted + set< TServiceId >::iterator ios; + bool uniqueOnShard = (*ius).second; + for ( ios=_OnlineServices.begin(); ios!=_OnlineServices.end(); ++ios ) + { + string name = getServiceName( *ios ); + if ( name == serviceName ) + { + if ( uniqueOnShard ) + { + // Only one service by shard is allowed => deny + grantStarting = false; + reason = toString( "Service %s already found as %hu, must be unique on shard", serviceName.c_str(), ios->get() ); + nlinfo( reason.c_str() ); + break; + } + else + { + // Only one service by physical machine is allowed + + // Implementation for layer5 + //TSockId hostid1, hostid2; + /*CCallbackNetBase *cnb1 = CUnifiedNetwork::getInstance()->getNetBase( serviceId, hostid1 ); + CCallbackNetBase *cnb2 = CUnifiedNetwork::getInstance()->getNetBase( *ios, hostid2 ); + if ( cnb1->hostAddress( hostid1 ).internalIPAddress() == cnb2->hostAddress( hostid2 ).internalIPAddress() )*/ + + // Implementation for NS + if ( addr[0].internalIPAddress() == getHostAddress( *ios ).internalIPAddress() ) + { + grantStarting = false; + reason = toString( "Service %s already found as %hu on same machine", serviceName.c_str(), ios->get() ); + nlinfo( reason.c_str() ); + break; + } + } + } + } + } + + if ( grantStarting ) + { + _OnlineServices.insert( serviceId ); + } + return grantStarting; +} + + +/* + * Release a service instance + */ +void CServiceInstanceManager::releaseService( NLNET::TServiceId serviceId ) +{ + _OnlineServices.erase( serviceId ); // not a problem if not found +} + + +/* + * Display information + */ +void CServiceInstanceManager::displayInfo( NLMISC::CLog *log ) const +{ + log->displayNL( "Restricted services:" ); + std::map< std::string, bool >::const_iterator ius; + for ( ius=_UniqueServices.begin(); ius!=_UniqueServices.end(); ++ius ) + { + log->displayNL( "%s -> only one per %s", (*ius).first.c_str(), (*ius).second?"shard":"machine" ); + } + log->displayNL( "Online registered services:" ); + std::set< TServiceId >::const_iterator ios; + for ( ios=_OnlineServices.begin(); ios!=_OnlineServices.end(); ++ios ) + { + log->displayNL( "%s", CUnifiedNetwork::getInstance()->getServiceUnifiedName( *ios ).c_str() ); + } +} + + +/* + * Make all controlled services quit + */ +void CServiceInstanceManager::killAllServices() +{ + // Send to all known online services + std::set< TServiceId >::const_iterator ios; + for ( ios=_OnlineServices.begin(); ios!=_OnlineServices.end(); ++ios ) + { + doUnregisterService( (TServiceId)(*ios) ); + } +} + + + +// +// Variables +// + +list RegisteredServices; /// List of all registred services + +uint16 MinBasePort = 51000; /// Ports begin at 51000 +uint16 MaxBasePort = 52000; /// (note: in this implementation there can be no more than 1000 services) + +const TServiceId BaseSId(128); /// Allocated SIds begin at 128 (except for Agent Service) + +const TTime UnregisterTimeout = 10000; /// After 10s we remove an unregister service if every server didn't ACK the message + +CCallbackServer *CallbackServer = NULL; + +// +// Functions +// + +bool canAccess (const vector &addr, const CServiceEntry &entry, vector &accessibleAddr) +{ + accessibleAddr.clear (); + + if (entry.WaitingUnregistration) + return false; + + for (uint i = 0; i < addr.size(); i++) + { + uint32 net = addr[i].internalNetAddress(); + for (uint j = 0; j < entry.Addr.size(); j++) + { + if (net == entry.Addr[j].internalNetAddress()) + { + accessibleAddr.push_back (entry.Addr[j]); + } + } + } + + if (accessibleAddr.empty()) + { + nldebug ("service %s-%hu is not accessible by '%s'", entry.Name.c_str(), entry.SId.get(), vectorCInetAddressToString (addr).c_str ()); + } + else + { + nldebug ("service %s-%hu is accessible by '%s'", entry.Name.c_str(), entry.SId.get(), vectorCInetAddressToString (accessibleAddr).c_str ()); + } + + return !accessibleAddr.empty (); +} + +void displayRegisteredServices (CLog *log = InfoLog) +{ + log->displayNL ("Display the %d registered services :", RegisteredServices.size()); + for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + TSockId id = (*it).SockId; + if (id == NULL) + { + log->displayNL ("> %s-%hu %s '%s' %s %d addr", (*it).Name.c_str(), it->SId.get(), "", "", (*it).WaitingUnregistration?"WaitUnreg":"", (*it).Addr.size()); + for(uint i = 0; i < (*it).Addr.size(); i++) + log->displayNL (" '%s'", (*it).Addr[i].asString().c_str()); + } + else + { + log->displayNL ("> %s-%hu %s '%s' %s %d addr", (*it).Name.c_str(), it->SId.get(), (*it).SockId->asString().c_str(), CallbackServer->hostAddress((*it).SockId).asString().c_str(), (*it).WaitingUnregistration?"WaitUnreg":"", (*it).Addr.size()); + for(uint i = 0; i < (*it).Addr.size(); i++) + log->displayNL (" '%s'", (*it).Addr[i].asString().c_str()); + } + } + log->displayNL ("End of the list"); +} + + +list::iterator effectivelyRemove (list::iterator &it) +{ + // remove the service from the registered service list + nlinfo ("Effectively remove the service %s-%hu", (*it).Name.c_str(), it->SId.get()); + return RegisteredServices.erase (it); +} + +/* + * Helper procedure for cbLookupAlternate and cbUnregister. + * Note: name is used for a LOGS. + */ +list::iterator doRemove (list::iterator it) +{ + nldebug ("Unregister the service %s-%hu '%s'", (*it).Name.c_str(), it->SId.get(), (*it).Addr[0].asString().c_str()); + + // tell to everybody that this service is unregistered + + CMessage msgout ("UNB"); + msgout.serial ((*it).Name); + msgout.serial ((*it).SId); + + vector accessibleAddress; + nlinfo ("Broadcast the Unregistration of %s-%hu to all registered services", (*it).Name.c_str(), it->SId.get()); + for (list::iterator it3 = RegisteredServices.begin(); it3 != RegisteredServices.end (); it3++) + { + if (canAccess((*it).Addr, (*it3), accessibleAddress)) + { + CallbackServer->send (msgout, (*it3).SockId); + //CNetManager::send ("NS", msgout, (*it3).SockId); + nldebug ("Broadcast to %s-%hu", (*it3).Name.c_str(), it3->SId.get()); + } + } + + // new system, after the unregistation broadcast, we wait ACK from all services before really remove + // the service, before, we tag the service as 'wait before unregister' + // if everybody didn't answer before the time out, we remove it + + (*it).SockId = NULL; + + (*it).WaitingUnregistration = true; + (*it).WaitingUnregistrationTime = CTime::getLocalTime(); + + // we remove all services awaiting his ACK because this service is down so it'll never ACK + for (list::iterator itr = RegisteredServices.begin(); itr != RegisteredServices.end (); itr++) + { + for (list::iterator itw = (*itr).WaitingUnregistrationServices.begin(); itw != (*itr).WaitingUnregistrationServices.end ();) + { + if ((*itw) == (*it).SId) + { + itw = (*itr).WaitingUnregistrationServices.erase (itw); + } + else + { + itw++; + } + } + } + + string res; + for (list::iterator it2 = RegisteredServices.begin(); it2 != RegisteredServices.end (); it2++) + { + if (!(*it2).WaitingUnregistration) + { + (*it).WaitingUnregistrationServices.push_back ((*it2).SId); + res += toString((*it2).SId.get()) + " "; + } + } + + nlinfo ("Before removing the service %s-%hu, we wait the ACK of '%s'", (*it).Name.c_str(), (*it).SId.get(), res.c_str()); + + if ((*it).WaitingUnregistrationServices.empty()) + { + return effectivelyRemove (it); + } + else + { + return ++it; + } + + // Release from the service instance manager + SIMInstance->releaseService( (*it).SId ); +} + +void doUnregisterService (TServiceId sid) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + // found it, remove it + doRemove (it); + return; + } + } + nlwarning ("Service %hu not found", sid.get()); +} + +void doUnregisterService (TSockId from) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end ();) + { + if ((*it).SockId == from) + { + // it's possible that one "from" have more than one registred service, so we have to find in all the list + // found it, remove it + it = doRemove (it); + } + else + { + it++; + } + } +} + +/*void doUnregisterService (const CInetAddress &addr) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).Addr == addr) + { + // found it, remove it + doRemove (it); + return; + } + } + nlwarning ("Service %s not found", addr.asString().c_str()); +}*/ + +/* + * Helper function for cbRegister. + * If alloc_sid is true, sid is ignored + * Returns false in case of failure of sid allocation or bad sid provided + * Note: the reply is included in this function, because it must be done before things such as syncUniTime() + */ +bool doRegister (const string &name, const vector &addr, TServiceId sid, TSockId from, CCallbackNetBase &netbase, bool reconnection = false) +{ + // Find if the service is not already registered + string reason; + uint8 ok = true; + bool needRegister = true; + /*for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).Addr.asIPString() == addr.asIPString() ) + { + // we already have a service on this address, remplace it if it's the same name + if ((*it).Name == name) + { + // it's the same service, replace it + (*it).SockId = from; + sid = (*it).SId; + nlinfo ("Replace the service %s", name.c_str()); + } + else + { + nlwarning ("Try to register %s to %s but the service %s already on this address. ignore it!", name.c_str(), addr.asIPString().c_str(), (*it).Name.c_str()); + ok = false; + } + needRegister = false; + break; + } + }*/ + + if (needRegister) + { + if (sid.get() == 0) + { + // we have to find a sid + sid = BaseSId; + bool found = false; + while (!found) + { + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + break; + } + } + if (it == RegisteredServices.end ()) + { + // ok, we have an empty sid + found = true; + } + else + { + sid.set(sid.get()+1); + if (sid.get() == 0) // round the clock + { + nlwarning ("Service identifier allocation overflow"); + ok = false; + break; + } + } + } + + } + else + { + // we have to check that the user provided sid is available + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + nlwarning ("Sid %d already used by another service", sid.get()); + ok = false; + break; + } + } + if (it != RegisteredServices.end ()) + { + ok = true; + } + } + + // if ok, register the service and send a broadcast to other people + if (ok) + { + // Check if the instance is allowed to start, according to the restriction in the config file + if ( SIMInstance->queryStartService( name, sid, addr, reason ) ) + { + // add him in the registered list + RegisteredServices.push_back (CServiceEntry(from, addr, name, sid)); + + // tell to everybody but not him that this service is registered + if (!reconnection) + { + CMessage msgout ("RGB"); + TServiceId::size_type s = 1; + msgout.serial (s); + msgout.serial (const_cast(name)); + msgout.serial (sid); + // we need to send all addr to all services even if the service can't access because we use the address index + // to know which connection comes. + msgout.serialCont (const_cast &>(addr)); + nlinfo ("The service is %s-%d, broadcast the Registration to everybody", name.c_str(), sid.get()); + + vector accessibleAddress; + for (list::iterator it3 = RegisteredServices.begin(); it3 != RegisteredServices.end (); it3++) + { + // send only services that can be accessed and not itself + if ((*it3).SId != sid && canAccess(addr, (*it3), accessibleAddress)) + { + CallbackServer->send (msgout, (*it3).SockId); + //CNetManager::send ("NS", msgout, (*it3).SockId); + nldebug ("Broadcast to %s-%hu", (*it3).Name.c_str(), it3->SId.get()); + } + } + } + + // set the sid only if it s ok + from->setAppId (sid.get()); + } + else + { + // Reply "startup denied", and do not send registration to other services + ok = false; + } + } + + // send the message to the service to say if it s ok or not + if (!reconnection) + { + // send the answer to the client + CMessage msgout ("RG"); + msgout.serial (ok); + if (ok) + { + msgout.serial (sid); + + // send him all services available (also itself) + TServiceId::size_type nb = 0; + + vector accessibleAddress; + + for (list::iterator it2 = RegisteredServices.begin(); it2 != RegisteredServices.end (); it2++) + { + // send only services that are available + if (canAccess(addr, (*it2), accessibleAddress)) + nb++; + } + msgout.serial (nb); + + for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + // send only services that are available + if (canAccess(addr, (*it), accessibleAddress)) + { + msgout.serial ((*it).Name); + msgout.serial ((*it).SId); + msgout.serialCont ((*it).Addr); + } + } + } + else + { + msgout.serial( reason ); + } + + netbase.send (msgout, from); + netbase.flush (from); + } + } + + //displayRegisteredServices (); + + return ok!=0; +} + +void checkWaitingUnregistrationServices () +{ + for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end ();) + { + if ((*it).WaitingUnregistration && ((*it).WaitingUnregistrationServices.empty() || CTime::getLocalTime() > (*it).WaitingUnregistrationTime + UnregisterTimeout)) + { + if ((*it).WaitingUnregistrationServices.empty()) + { + nlinfo ("Removing the service %s-%hu because all services ACKd the removal", (*it).Name.c_str(), (*it).SId.get()); + } + else + { + string res; + for (list::iterator it2 = (*it).WaitingUnregistrationServices.begin(); it2 != (*it).WaitingUnregistrationServices.end (); it2++) + { + res += toString(it2->get()) + " "; + } + nlwarning ("Removing the service %s-%hu because time out occurs (service numbers %s didn't ACK)", (*it).Name.c_str(), (*it).SId.get(), res.c_str()); + } + it = effectivelyRemove (it); + } + else + { + it++; + } + } +} + + +/** + * Callback for service unregistration ACK. Mean that a service was ACK the unregistration broadcast + */ +static void cbACKUnregistration (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + TServiceId sid; + msgin.serial (sid); + + for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid && (*it).WaitingUnregistration) + { + for (list::iterator it2 = (*it).WaitingUnregistrationServices.begin(); it2 != (*it).WaitingUnregistrationServices.end (); it2++) + { + if (*it2 == TServiceId(uint16(from->appId()))) + { + // remove the acked service + (*it).WaitingUnregistrationServices.erase (it2); + checkWaitingUnregistrationServices (); + return; + } + } + } + } +} + + +/** + * Callback for service registration when the naming service goes down and up (don't need to broadcast) + */ +static void cbResendRegisteration (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string name; + vector addr; + TServiceId sid; + msgin.serial (name); + msgin.serialCont (addr); + msgin.serial (sid); + + doRegister (name, addr, sid, from, netbase, true); +} + + + +/** + * Callback for service registration. + * + * Message expected : RG + * - Name of service to register (string) + * - Address of service (CInetAddress) + * + * Message emitted : RG + * - Allocated service identifier (TServiceId) or 0 if failed + */ +static void cbRegister (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + string name; + vector addr; + TServiceId sid; + msgin.serial (name); + msgin.serialCont (addr); + msgin.serial (sid); + + doRegister (name, addr, sid, from, netbase); +} + + +/** + * Callback for service unregistration. + * + * Message expected : UNI + * - Service identifier (TServiceId) + */ +static void cbUnregisterSId (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + TServiceId sid; + msgin.serial( sid ); + + doUnregisterService (sid); + //displayRegisteredServices (); +} + + +/* + * Helper function for cbQueryPort + * + * \warning QueryPort + Registration is not atomic so more than one service could ask a port before register + */ +uint16 doAllocatePort (const CInetAddress &addr) +{ + static uint16 nextAvailablePort = MinBasePort; + + // check if nextavailableport is free + + if (nextAvailablePort >= MaxBasePort) nextAvailablePort = MinBasePort; + + bool ok; + do + { + ok = true; + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).Addr[0].port () == nextAvailablePort) + { + nextAvailablePort++; + ok = false; + break; + } + } + } + while (!ok); + + return nextAvailablePort++; +} + + +/** + * Callback for port allocation + * Note: if a service queries a port but does not register itself to the naming service, the + * port will remain allocated and unused. + * + * Message expected : QP + * - Name of service to register (string) + * - Address of service (CInetAddress) (its port can be 0) + * + * Message emitted : QP + * - Allocated port number (uint16) + */ +static void cbQueryPort (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + // Allocate port + uint16 port = doAllocatePort (netbase.hostAddress (from)); + + // Send port back + CMessage msgout ("QP"); + msgout.serial (port); + netbase.send (msgout, from); + + nlinfo ("The service got port %hu", port); +} + + +/* + * Unregisters a service if it has not been done before. + * Note: this callback is called whenever someone disconnects from the NS. + * May be there are too many calls if many clients perform many transactional lookups. + */ +static void cbDisconnect /*(const string &serviceName, TSockId from, void *arg)*/ ( TSockId from, void *arg ) +{ + doUnregisterService (from); + //displayRegisteredServices (); +} + +/* + * a service is connected, send him all services infos + */ +static void cbConnect /*(const string &serviceName, TSockId from, void *arg)*/ ( TSockId from, void *arg ) +{ + // we have to wait the registred services message to send all services because it this points, we can't know which sub net + // the service can use + + //displayRegisteredServices (); + + // set the appid with a bad id (-1) + from->setAppId (~0); +} + +/*// returns the list of accessible services with a list of address +static void cbRegisteredServices(CMessage& msgin, TSockId from, CCallbackNetBase &netbase) +{ + vector addr; + msgin.serialCont (addr); + + nlinfo ("New service ask me the available services, sending him all services available"); + // send to the new service the list of all services that this service can access (depending of his sub net) + + CMessage msgout ("RGB"); + + uint8 nb = 0; + + vector accessibleAddress; + + for (list::iterator it2 = RegisteredServices.begin(); it2 != RegisteredServices.end (); it2++) + { + // send only services that are available + if (canAccess(addr, (*it2), accessibleAddress)) + nb++; + } + + msgout.serial (nb); + + for (list::iterator it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + // send only services that are available + if (canAccess(addr, (*it), accessibleAddress)) + { + msgout.serial ((*it).Name); + msgout.serial ((*it).SId); + msgout.serialCont (accessibleAddress); + } + } + + CNetManager::send ("NS", msgout, from); +}*/ + + +/* + * Helper that emulates layer5 send() + */ +/*void sendToService( uint16 sid, CMessage& msgout ) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + CallbackServer->send (msgout, (*it).SockId); + } + } +}*/ + + +/* + * Helper that emulate layer5's getServiceName() + */ +string getServiceName( TServiceId sid ) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + return (*it).Name; + } + } + return ""; // not found +} + + +/* + * Helper that returns the first address of a service + */ +CInetAddress getHostAddress( TServiceId sid ) +{ + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).SId == sid) + { + return (*it).Addr[0]; + } + } + return CInetAddress(); +} + + +// +// Callback array +// + +TCallbackItem CallbackArray[] = +{ + { "RG", cbRegister }, + { "RRG", cbResendRegisteration }, + { "QP", cbQueryPort }, + { "UNI", cbUnregisterSId }, + { "ACK_UNI", cbACKUnregistration }, +// { "RS", cbRegisteredServices }, +}; + + +// +// Service +// + +class CNamingService : public NLNET::IService +{ +public: + + /** + * Init + */ + void init() + { + // if a baseport is available in the config file, get it + CConfigFile::CVar *var; + if ((var = ConfigFile.getVarPtr ("BasePort")) != NULL) + { + uint16 newBasePort = var->asInt (); + nlinfo ("Changing the MinBasePort number from %hu to %hu", MinBasePort, newBasePort); + sint32 delta = MaxBasePort - MinBasePort; + nlassert (delta > 0); + MinBasePort = newBasePort; + MaxBasePort = MinBasePort + uint16 (delta); + } + + // Parameters for the service instance manager + try + { + CConfigFile::CVar& uniqueServices = ConfigFile.getVar("UniqueOnShardServices"); + for ( uint i=0; i!=uniqueServices.size(); ++i ) + { + _ServiceInstances.addUniqueService( uniqueServices.asString(i), true ); + } + } + catch(Exception &) + {} + try + { + CConfigFile::CVar& uniqueServicesM = ConfigFile.getVar("UniqueByMachineServices"); + for ( uint i=0; i!=uniqueServicesM.size(); ++i ) + { + _ServiceInstances.addUniqueService( uniqueServicesM.asString(i), false ); + } + } + catch(Exception &) + {} + +/* + // we don't try to associate message from client + CNetManager::getNetBase ("NS")->ignoreAllUnknownId (true); + + // add the callback in case of disconnection + CNetManager::setConnectionCallback ("NS", cbConnect, NULL); + + // add the callback in case of disconnection + CNetManager::setDisconnectionCallback ("NS", cbDisconnect, NULL); +*/ + // DEBUG + // DebugLog->addDisplayer( new CStdDisplayer() ); + + vector v = CInetAddress::localAddresses(); + nlinfo ("%d detected local addresses:", v.size()); + for (uint i = 0; i < v.size(); i++) + { + nlinfo (" %d - '%s'",i, v[i].asString().c_str()); + } + + uint16 nsport = 50000; + if ((var = ConfigFile.getVarPtr ("NSPort")) != NULL) + { + nsport = var->asInt (); + } + + CallbackServer = new CCallbackServer; + CallbackServer->init(nsport); + CallbackServer->addCallbackArray(CallbackArray, sizeof(CallbackArray)/sizeof(CallbackArray[0])); + CallbackServer->setConnectionCallback(cbConnect, NULL); + CallbackServer->setDisconnectionCallback(cbDisconnect, NULL); + } + + /** + * Update + */ + bool update () + { + checkWaitingUnregistrationServices (); + + CallbackServer->update (); + + return true; + } + + void release() + { + if (CallbackServer != NULL) + delete CallbackServer; + CallbackServer = NULL; + } + +private: + + /// Service instance manager singleton + CServiceInstanceManager _ServiceInstances; +}; + + +static const char* getCompleteServiceName(const IService* theService) +{ + static std::string s; + s= "naming_service"; + + if (theService->haveLongArg("nsname")) + { + s+= "_"+theService->getLongArg("nsname"); + } + + if (theService->haveLongArg("fullnsname")) + { + s= theService->getLongArg("fullnsname"); + } + + return s.c_str(); +} + +static const char* getShortServiceName(const IService* theService) +{ + static std::string s; + s= "NS"; + + if (theService->haveLongArg("shortnsname")) + { + s= theService->getLongArg("shortnsname"); + } + + return s.c_str(); +} +// +/// Naming Service +// +NLNET_SERVICE_MAIN( CNamingService, getShortServiceName(scn), getCompleteServiceName(scn), 0, EmptyCallbackArray, "", "") + + +// +// Commands +// + + +NLMISC_COMMAND (nsServices, "displays the list of all registered services", "") +{ + if(args.size() != 0) return false; + + displayRegisteredServices (&log); + + return true; +} + +NLMISC_COMMAND (kill, "kill a service and send an unregister broadcast to other service", "|") +{ + if(args.size() != 1) return false; + + // try with number + + TServiceId sid(atoi(args[0].c_str())); + + if(sid.get() == 0) + { + // not a number, try a name + list::iterator it; + for (it = RegisteredServices.begin(); it != RegisteredServices.end (); it++) + { + if ((*it).Name == args[0]) + { + sid = (*it).SId; + break; + } + } + if (it == RegisteredServices.end()) + { + log.displayNL ("Bad service name or id '%s'", args[0].c_str()); + return false; + } + } + + doUnregisterService (sid); + return true; +} + +NLMISC_DYNVARIABLE(uint32, NbRegisteredServices, "display the number of service that are registered in naming service") +{ + if (get) *pointer = RegisteredServices.size(); +} + +NLMISC_COMMAND( displayServiceInstances, "SIM: Display info on service instances", "" ) +{ + SIMInstance->displayInfo( &log ); + return true; +} + +NLMISC_COMMAND( killAllServices, "SIM: Make all the controlled services quit", "" ) +{ + SIMInstance->killAllServices(); + return true; +} diff --git a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp index 23166383a..bc2e366e2 100644 --- a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp +++ b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp @@ -1,4 +1,48 @@ +// NeLNS - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +#include "nel/misc/types_nl.h" + +#include +#include +#include + +#include + +#include "nel/misc/debug.h" +#include "nel/misc/config_file.h" +#include "nel/misc/displayer.h" +#include "nel/misc/command.h" +#include "nel/misc/variable.h" +#include "nel/misc/log.h" +#include "nel/misc/file.h" +#include "nel/misc/path.h" + +#include "nel/net/service.h" +#include "nel/net/unified_network.h" +#include "nel/net/login_cookie.h" + +#include "ryzom_welcome_service.h" + +#include "game_share/welcome_service_itf.h" + +using namespace std; +using namespace NLMISC; +using namespace NLNET; +using namespace WS; extern void admin_modules_forceLink(); @@ -8,5 +52,1527 @@ void foo() } -#include "../../../../nelns/welcome_service/welcome_service.cpp" -#include "../../../../nelns/welcome_service/welcome_service_itf.cpp" +CVariable PlayerLimit( + "ws","PlayerLimit", "Rough max number of players accepted on this shard (-1 for Unlimited)", + 5000, + 0, true ); + +// Forward declaration of callback cbShardOpen (see ShardOpen variable) +void cbShardOpen(IVariable &var); + +// Forward declaration of callback cbShardOpenStateFile (see ShardOpenStateFile variable) +void cbShardOpenStateFile(IVariable &var); + +// Forward declaration of callback cbUsePatchMode +void cbUsePatchMode(IVariable &var); + +// Types of open state +enum TShardOpenState +{ + ClosedForAll = 0, + OpenOnlyForAllowed = 1, + OpenForAll = 2 +}; + +static bool AllowDispatchMsgToLS = false; + +/** + * ShardOpen + * true if shard is open to public + * 0 means closed for all but :DEV: + * 1 means open only for groups in config file (see OpenGroups variable) and :DEV: + * 2 means open for all + */ +CVariable ShardOpen("ws", "ShardOpen", "Indicates if shard is open to public (0 closed for all but :DEV:, 1 open only for groups in cfg, 2 open for all)", 2, 0, true, cbShardOpen); + +/** + * ShardOpenStateFile + * true if shard is open to public + */ +CVariable ShardOpenStateFile("ws", "ShardOpenStateFile", "Name of the file that contains ShardOpen state", "", 0, true, cbShardOpenStateFile); + +/** + * OpenGroups + */ +CVariable OpenGroups("ws", "OpenGroups", "list of groups allowed at ShardOpen Level 1", "", 0, true); + +/** + * OpenFrontEndThreshold + * The FS balance algorithm works like this: + * - select the least loaded frontend + * - if this frontend has more than the OpenFrontEndThreshold + * - try to open a new frontend + * - reselect least loaded frontend + */ +CVariable OpenFrontEndThreshold("ws", "OpenFrontEndThreshold", "Limit number of players on all FS to decide to open a new FS", 800, 0, true ); + + +/** + * Use Patch mode + */ +CVariable UsePatchMode("ws", "UsePatchMode", "Use Frontends as Patch servers (at FS startup)", true, 0, true, cbUsePatchMode ); + +/** + * Use Patch mode + */ +CVariable DontUseLS("ws", "DontUseLS", "Don't use the login service", false, 0, true); + + +// Shortcut to the module instance +//CWelcomeServiceMod *CWelcomeServiceMod::_Instance = NULL; + + +/** + * Using expected services and current running service instances, this class + * reports a main "online status". + */ +class COnlineServices +{ +public: + + /// Set expected instances. Ex: { "TICKS", "FS", "FS", "FS" } + void setExpectedInstances( CConfigFile::CVar& var ) + { + // Reset "expected" counters (but don't clear the map, keep the running instances) + CInstances::iterator ici; + for ( ici=_Instances.begin(); ici!=_Instances.end(); ++ici ) + { + (*ici).second.Expected = 0; + } + // Rebuild "expected" counters + for ( uint i=0; i!=var.size(); ++i ) + { + ++_Instances[var.asString(i)].Expected; + } + } + + /// Add a service instance + void addInstance( const std::string& serviceName ) + { + ++_Instances[serviceName].Running; + } + + /// Remove a service instance + void removeInstance( const std::string& serviceName ) + { + CInstances::iterator ici = _Instances.find( serviceName ); + if ( ici != _Instances.end() ) + { + --(*ici).second.Running; + + // Remove from the map only if not part of the expected list + if ( ((*ici).second.Expected == 0) && ((*ici).second.Running == 0) ) + { + _Instances.erase( ici ); + } + } + else + { + nlwarning( "Can't remove instance of %s", serviceName.c_str() ); + } + } + + /// Check if all expected instances are online + bool getOnlineStatus() const + { + CInstances::const_iterator ici; + for ( ici=_Instances.begin(); ici!=_Instances.end(); ++ici ) + { + if ( ! ici->second.isOnlineAsExpected() ) + return false; + } + return true; + } + + /// Display contents + void display( NLMISC::CLog& log = *NLMISC::DebugLog ) + { + CInstances::const_iterator ici; + for ( ici=_Instances.begin(); ici!=_Instances.end(); ++ici ) + { + log.displayNL( "%s: %s (%u expected, %u running)", + (*ici).first.c_str(), + (*ici).second.Expected ? ((*ici).second.isOnlineAsExpected() ? "ONLINE" : "MISSING") : "OPTIONAL", + (*ici).second.Expected, (*ici).second.Running ); + } + } + +private: + + struct TInstanceCounters + { + TInstanceCounters() : Expected(0), Running(0) {} + + // If not expected, count as online as well + bool isOnlineAsExpected() const { return Running >= Expected; } + + uint Expected; + uint Running; + }; + + typedef std::map< std::string, TInstanceCounters > CInstances; + + CInstances _Instances; +}; + +/// Online services +COnlineServices OnlineServices; + + +/// Main online status +bool OnlineStatus; + +/// Send changes of status to the LS +void reportOnlineStatus( bool newStatus ) +{ + if ( newStatus != OnlineStatus && AllowDispatchMsgToLS ) + { + if (!DontUseLS) + { + CMessage msgout( "OL_ST" ); + msgout.serial( newStatus ); + CUnifiedNetwork::getInstance()->send( "LS", msgout ); + } + + if (CWelcomeServiceMod::isInitialized()) + { + // send a status report to welcome service client + CWelcomeServiceMod::getInstance()->reportWSOpenState(newStatus); + } + + OnlineStatus = newStatus; + } +} + + + +/// Set the version of the shard. you have to increase it each time the client-server protocol changes. +/// You have to increment the client too (the server and client version must be the same to run correctly) +static const uint32 ServerVersion = 1; + +/// Contains the correspondance between userid and the FES connection where the userid is connected. +map UserIdSockAssociations; + +// ubi hack +string FrontEndAddress; + + + +enum TFESState +{ + PatchOnly, + AcceptClientOnly +}; + +struct CFES +{ + CFES (TServiceId sid) : SId(sid), NbPendingUsers(0), NbUser(0), State(PatchOnly) { } + + TServiceId SId; // Connection to the front end + uint32 NbPendingUsers; // Number of not yet connected users (but rooted to this frontend) + uint32 NbUser; // Number of user currently connected on this front end + + TFESState State; // State of frontend (patching/accepting clients) + std::string PatchAddress; // Address of frontend patching server + + uint32 getUsersCountHeuristic() const + { + return NbUser + NbPendingUsers; + } + + void setToAcceptClients() + { + if (State == AcceptClientOnly) + return; + + // tell FS to accept client + State = AcceptClientOnly; + CMessage msgOpenFES("FS_ACCEPT"); + CUnifiedNetwork::getInstance()->send(SId, msgOpenFES); + + // report state to LS + bool dummy; + reportStateToLS(dummy, true); + } + + void reportStateToLS(bool& reportPatching, bool alive = true) + { + // report to LS + + bool patching = (State == PatchOnly); + if (alive && patching) + reportPatching = true; + + if ( AllowDispatchMsgToLS ) + { + if (!DontUseLS) + { + CMessage msgout("REPORT_FS_STATE"); + msgout.serial(SId); + msgout.serial(alive); + msgout.serial(patching); + msgout.serial(PatchAddress); + CUnifiedNetwork::getInstance()->send("LS", msgout); + } + } + } +}; + +list FESList; + +/* + * Find the best front end service for a new connecting user (return NULL if there is no suitable FES). + * Additionally, calculate totalNbUsers. + */ +CFES *findBestFES ( uint& totalNbUsers ) +{ + totalNbUsers = 0; + + CFES* best = NULL; + + for (list::iterator it=FESList.begin(); it!=FESList.end(); ++it) + { + CFES &fes = *it; + if (fes.State == AcceptClientOnly) + { + if (best == NULL || best->getUsersCountHeuristic() > fes.getUsersCountHeuristic()) + best = &fes; + + totalNbUsers += fes.NbUser; + } + + } + + return best; +} + +/** + * Select a frontend in patch mode to open + * Returns true if a new FES was open, false if no FES could be open + */ +bool openNewFES() +{ + for (list::iterator it=FESList.begin(); it!=FESList.end(); ++it) + { + if ((*it).State == PatchOnly) + { + nlinfo("openNewFES: ask the FS %d to accept clients", it->SId.get()); + + // switch FES to AcceptClientOnly + (*it).setToAcceptClients(); + return true; + } + } + + return false; +} + + + +void displayFES () +{ + nlinfo ("There's %d FES in the list:", FESList.size()); + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + nlinfo(" > %u NbUser:%d NbPendingUser:%d", it->SId.get(), it->NbUser, it->NbPendingUsers); + } + nlinfo ("End of the list"); +} + + + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////// CONNECTION TO THE FRONT END SERVICE /////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void cbFESShardChooseShard (CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // the WS answer a user authorize + string reason; + CLoginCookie cookie; + string addr; + + // + // S09: receive "SCS" message from FES and send the "SCS" message to the LS + // + + CMessage msgout ("SCS"); + + msgin.serial (reason); + msgout.serial (reason); + + msgin.serial (cookie); + msgout.serial (cookie); + + if (reason.empty()) + { + msgin.serial (addr); + + // if we set the FontEndAddress in the welcome_service.cfg we use this address + if (FrontEndAddress.empty()) + { + msgout.serial (addr); + } + else + { + msgout.serial (FrontEndAddress); + } + + uint32 nbPendingUser; + msgin.serial(nbPendingUser); + + // update the pending user count for this shard + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if (it->SId == sid) + { + it->NbPendingUsers = nbPendingUser; + break; + } + } + + /* + // OBSOLETE: LS doesn't read patching URLs + // build patch server list + std::string PatchURLS; + for (list::iterator it=FESList.begin(); it!=FESList.end(); ++it) + { + if ((*it).State == PatchOnly && !(*it).PatchAddress.empty()) + { + if (!PatchURLS.empty()) + PatchURLS += '|'; + PatchURLS += (*it).PatchAddress; + } + } + + + msgout.serial(PatchURLS); + */ + } + + if (PendingFeResponse.find(cookie) != PendingFeResponse.end()) + { + nldebug( "ERLOG: SCS recvd from %s-%hu => sending %s to SU", serviceName.c_str(), sid.get(), cookie.toString().c_str()); + + // this response is not waited by LS + TPendingFEResponseInfo &pfri = PendingFeResponse.find(cookie)->second; + + pfri.WSMod->frontendResponse(pfri.WaiterModule, pfri.UserId, reason, cookie, addr); + // cleanup pending record + PendingFeResponse.erase(cookie); + } + else + { + nldebug( "ERLOG: SCS recvd from %s-%hu, but pending %s not found", serviceName.c_str(), sid.get(), cookie.toString().c_str()); + + // return the result to the LS + if (!DontUseLS) + { + CUnifiedNetwork::getInstance()->send ("LS", msgout); + } + } + +} + +// This function is call when a FES accepted a new client or lost a connection to a client +void cbFESClientConnected (CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // + // S15: receive "CC" message from FES and send "CC" message to the "LS" + // + + CMessage msgout ("CC"); + + uint32 userid; + msgin.serial (userid); + msgout.serial (userid); + + uint8 con; + msgin.serial (con); + msgout.serial (con); + + if (!DontUseLS) + { + CUnifiedNetwork::getInstance()->send ("LS", msgout); + } + + // add or remove the user number really connected on this shard + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if (it->SId == sid) + { + if (con) + { + (*it).NbUser++; + + // the client connected, it's no longer pending + if ((*it).NbPendingUsers > 0) + (*it).NbPendingUsers--; + } + else + { + if ( (*it).NbUser != 0 ) + (*it).NbUser--; + } + } + totalNbOnlineUsers += (*it).NbUser; + totalNbPendingUsers += (*it).NbPendingUsers; + } + + if (CWelcomeServiceMod::isInitialized()) + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); + + if (con) + { + // we know that this user is on this FES + UserIdSockAssociations.insert (make_pair (userid, sid)); + } + else + { + // remove the user + UserIdSockAssociations.erase (userid); + } + +} + +// This function is called when a FES rejected a client' cookie +void cbFESRemovedPendingCookie(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + CLoginCookie cookie; + msgin.serial(cookie); + nldebug( "ERLOG: RPC recvd from %s-%hu => %s removed", serviceName.c_str(), sid.get(), cookie.toString().c_str(), cookie.toString().c_str()); + + + // client' cookie rejected, no longer pending + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if ((*it).SId == sid) + { + if ((*it).NbPendingUsers > 0) + --(*it).NbPendingUsers; + } + totalNbOnlineUsers += (*it).NbUser; + totalNbPendingUsers += (*it).NbPendingUsers; + } + + if (CWelcomeServiceMod::isInitialized()) + { + CWelcomeServiceMod::getInstance()->pendingUserLost(cookie); + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); + } +} + +// This function is called by FES to setup its PatchAddress +void cbFESPatchAddress(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + std::string address; + msgin.serial(address); + + bool acceptClients; + msgin.serial(acceptClients); + + nldebug("Received patch server address '%s' from service %s %d", address.c_str(), serviceName.c_str(), sid.get()); + + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if ((*it).SId == sid) + { + nldebug("Affected patch server address '%s' to frontend %s %d", address.c_str(), serviceName.c_str(), sid.get()); + + if (!UsePatchMode.get() && !acceptClients) + { + // not in patch mode, force fs to accept clients + acceptClients = true; + (*it).setToAcceptClients(); + } + + (*it).PatchAddress = address; + (*it).State = (acceptClients ? AcceptClientOnly : PatchOnly); + if (acceptClients) + nldebug("Frontend %s %d reported to accept client, patching unavailable for that server", address.c_str(), serviceName.c_str(), sid.get()); + else + nldebug("Frontend %s %d reported to be in patching mode", address.c_str(), serviceName.c_str(), sid.get()); + + bool dummy; + (*it).reportStateToLS(dummy); + break; + } + } +} + +// This function is called by FES to setup the right number of players (if FES was already present before WS launching) +void cbFESNbPlayers(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // *********** WARNING ******************* + // This version of the callback is deprecated, the system + // now use cbFESNbPlayers2 that report the pending user count + // as well as the number of connected players. + // It is kept for backward compatibility only. + // *************************************** + + uint32 nbPlayers; + msgin.serial(nbPlayers); + + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if ((*it).SId == sid) + { + nldebug("Frontend '%d' reported %d online users", sid.get(), nbPlayers); + (*it).NbUser = nbPlayers; + if (nbPlayers != 0 && (*it).State == PatchOnly) + { + nlwarning("Frontend %d is in state PatchOnly, yet reports to have online %d players, state AcceptClientOnly is forced (FS_ACCEPT message sent)"); + (*it).setToAcceptClients(); + } + } + totalNbOnlineUsers += (*it).NbUser; + totalNbPendingUsers += (*it).NbPendingUsers; + } + + if (CWelcomeServiceMod::isInitialized()) + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); +} + + +// This function is called by FES to setup the right number of players (if FES was already present before WS launching) +void cbFESNbPlayers2(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + uint32 nbPlayers; + uint32 nbPendingPlayers; + msgin.serial(nbPlayers); + msgin.serial(nbPendingPlayers); + + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + CFES &fes = *it; + if (fes.SId == sid) + { + nldebug("Frontend '%d' reported %d online users", sid.get(), nbPlayers); + fes.NbUser = nbPlayers; + fes.NbPendingUsers = nbPendingPlayers; + if (nbPlayers != 0 && fes.State == PatchOnly) + { + nlwarning("Frontend %d is in state PatchOnly, yet reports to have online %d players, state AcceptClientOnly is forced (FS_ACCEPT message sent)"); + (*it).setToAcceptClients(); + } + } + totalNbOnlineUsers += fes.NbUser; + totalNbPendingUsers += fes.NbPendingUsers; + } + + if (CWelcomeServiceMod::isInitialized()) + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); +} + +/* + * Set Shard open state + */ +void setShardOpenState(TShardOpenState state, bool writeInVar = true) +{ + if (writeInVar) + ShardOpen = state; + + if ( AllowDispatchMsgToLS ) + { + if (!DontUseLS) + { + // send to LS current shard state + CMessage msgout ("SET_SHARD_OPEN"); + uint8 shardOpenState = (uint8)state; + + msgout.serial (shardOpenState); + CUnifiedNetwork::getInstance()->send ("LS", msgout); + } + } +} + + +/* + * Set Shard Open State + * uint8 Open State (0 closed for all, 1 open for groups in cfg, 2 open for all) + */ +void cbSetShardOpen(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + uint8 shardOpenState; + msgin.serial (shardOpenState); + + if (shardOpenState > OpenForAll) + { + shardOpenState = OpenForAll; + } + + setShardOpenState((TShardOpenState)shardOpenState); +} + +// forward declaration to callback +void cbShardOpenStateFile(IVariable &var); + +/* + * Restore Shard Open state from config file or from file if found + */ +void cbRestoreShardOpen(CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // first restore state from config file + CConfigFile::CVar* var = IService::getInstance()->ConfigFile.getVarPtr("ShardOpen"); + if (var != NULL) + { + setShardOpenState((TShardOpenState)var->asInt()); + } + + // then restore state from state file, if it exists + cbShardOpenStateFile(ShardOpenStateFile); +} + + + + + +// a new front end connecting to me, add it +void cbFESConnection (const std::string &serviceName, TServiceId sid, void *arg) +{ + FESList.push_back (CFES ((TServiceId)sid)); + nldebug("new FES connection: sid %u", sid.get()); + displayFES (); + + bool dummy; + FESList.back().reportStateToLS(dummy); + + if (!UsePatchMode.get()) + { + FESList.back().setToAcceptClients(); + } +} + + +// a front end closes the connection, deconnect him +void cbFESDisconnection (const std::string &serviceName, TServiceId sid, void *arg) +{ + nldebug("new FES disconnection: sid %u", sid.get()); + + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + if ((*it).SId == sid) + { + // send a message to the LS to say that all players from this FES are offline + map::iterator itc = UserIdSockAssociations.begin(); + map::iterator nitc = itc; + while (itc != UserIdSockAssociations.end()) + { + nitc++; + if ((*itc).second == sid) + { + // bye bye little player + uint32 userid = (*itc).first; + nlinfo ("Due to a frontend crash, removed the player %d", userid); + if (!DontUseLS) + { + CMessage msgout ("CC"); + msgout.serial (userid); + uint8 con = 0; + msgout.serial (con); + CUnifiedNetwork::getInstance()->send ("LS", msgout); + } + UserIdSockAssociations.erase (itc); + } + itc = nitc; + } + + bool dummy; + (*it).reportStateToLS(dummy, false); + + // remove the FES + FESList.erase (it); + + break; + } + } + + // Update the welcome service client with the new count of connection + + uint32 totalNbOnlineUsers =0, totalNbPendingUsers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end(); it++) + { + const CFES &fes = *it; + totalNbOnlineUsers += fes.NbUser; + totalNbPendingUsers += fes.NbPendingUsers; + } + + if (CWelcomeServiceMod::isInitialized()) + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); + + displayFES (); +} + + +// +void cbServiceUp (const std::string &serviceName, TServiceId sid, void *arg) +{ + OnlineServices.addInstance( serviceName ); + bool online = OnlineServices.getOnlineStatus(); + reportOnlineStatus( online ); + + // send shard id to service + sint32 shardId; + if (IService::getInstance()->haveArg('S')) + { + // use the command line param if set + shardId = atoi(IService::getInstance()->getArg('S').c_str()); + } + else if (IService::getInstance()->ConfigFile.exists ("ShardId")) + { + // use the config file param if set + shardId = IService::getInstance()->ConfigFile.getVar ("ShardId").asInt(); + } + else + { + shardId = -1; + } + + if (shardId == -1) + { + nlerror ("ShardId variable must be valid (>0)"); + } + + CMessage msgout("R_SH_ID"); + msgout.serial(shardId); + CUnifiedNetwork::getInstance()->send (sid, msgout); +} + + +// +void cbServiceDown (const std::string &serviceName, TServiceId sid, void *arg) +{ + OnlineServices.removeInstance( serviceName ); + bool online = OnlineServices.getOnlineStatus(); + reportOnlineStatus( online ); +} + + +// Callback Array for message from FES +TUnifiedCallbackItem FESCallbackArray[] = +{ + { "SCS", cbFESShardChooseShard }, + { "CC", cbFESClientConnected }, + { "RPC", cbFESRemovedPendingCookie }, + { "FEPA", cbFESPatchAddress }, + { "NBPLAYERS", cbFESNbPlayers }, + { "NBPLAYERS2", cbFESNbPlayers2 }, + + { "SET_SHARD_OPEN", cbSetShardOpen }, + { "RESTORE_SHARD_OPEN", cbRestoreShardOpen }, +}; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////// CONNECTION TO THE LOGIN SERVICE /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void cbLSChooseShard (CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // the LS warns me that a new client want to come in my shard + + nldebug( "ERLOG: CS recvd from %s-%hu", serviceName.c_str(), sid.get()); + + // + // S07: receive the "CS" message from LS and send the "CS" message to the selected FES + // + + CLoginCookie cookie; + msgin.serial (cookie); + string userName, userPriv, userExtended; + msgin.serial (userName); + + try + { + msgin.serial (userPriv); + } + catch (Exception &) + { + nlwarning ("LS didn't give me the user privilege for user '%s', set to empty", userName.c_str()); + } + + try + { + msgin.serial (userExtended); + } + catch (Exception &) + { + nlwarning ("LS didn't give me the extended data for user '%s', set to empty", userName.c_str()); + } + + + string ret = lsChooseShard(userName, cookie, userPriv, userExtended, WS::TUserRole::ur_player, 0xffffffff, ~0); + + if (!ret.empty()) + { + // send back an error message to LS + CMessage msgout ("SCS"); + msgout.serial (ret); + msgout.serial (cookie); + CUnifiedNetwork::getInstance()->send(sid, msgout); + } +} + +//void cbLSChooseShard (CMessage &msgin, const std::string &serviceName, uint16 sid) +std::string lsChooseShard (const std::string &userName, + const CLoginCookie &cookie, + const std::string &userPriv, + const std::string &userExtended, + WS::TUserRole userRole, + uint32 instanceId, + uint32 charSlot) +{ + // the LS warns me that a new client want to come in my shard + + // + // S07: receive the "CS" message from LS and send the "CS" message to the selected FES + // + +/* + uint totalNbUsers; + CFES *best = findBestFES( totalNbUsers ); + if (best == NULL) + { + // answer the LS that we can't accept the user + CMessage msgout ("SCS"); + string reason = "No front-end server available"; + msgout.serial (reason); + msgout.serial (cookie); + CUnifiedNetwork::getInstance()->send(sid, msgout); + return; + } +*/ + + uint totalNbUsers; + CFES* best = findBestFES( totalNbUsers ); + + // could not find a good FES or best FES has more players than balance limit + if (best == NULL || best->getUsersCountHeuristic() >= OpenFrontEndThreshold) + { + // open a new frontend + openNewFES(); + + // reselect best FES (will return newly open FES, or previous if no more FES available) + best = findBestFES(totalNbUsers); + + // check there is a FES available + if (best == NULL) + { + // answer the LS that we can't accept the user + return "No front-end server available"; + } + } + + + bool authorizeUser = false; + bool forceAuthorize = false; + + if (userPriv == ":DEV:") + { + // devs have all privileges + authorizeUser = true; + forceAuthorize = true; + } + else if (ShardOpen != ClosedForAll) + { + const std::string& allowedGroups = OpenGroups; + bool userInOpenGroups = (!userPriv.empty() && !allowedGroups.empty() && allowedGroups.find(userPriv) != std::string::npos); + + // open for all or user is privileged + authorizeUser = (ShardOpen == OpenForAll || userInOpenGroups); + // let authorized users to force access even if limit is reached + forceAuthorize = userInOpenGroups; + } + + bool shardLimitReached = ( (PlayerLimit.get() != -1) && (totalNbUsers >= (uint)PlayerLimit.get()) ); + + if (!forceAuthorize && (!authorizeUser || shardLimitReached)) + { + // answer the LS that we can't accept the user + CMessage msgout ("SCS"); + string reason; + if (shardLimitReached) + return "The shard is currently full, please try again in 5 minutes."; + else + return "The shard is closed."; + } + + + CMessage msgout ("CS"); + msgout.serial (const_cast(cookie)); + msgout.serial (const_cast(userName), const_cast(userPriv), const_cast(userExtended)); + msgout.serial (instanceId); + msgout.serial (charSlot); + + CUnifiedNetwork::getInstance()->send (best->SId, msgout); + best->NbPendingUsers++; + + // Update counts + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it=FESList.begin(); it!=FESList.end(); ++it) + { + totalNbOnlineUsers += (*it).NbUser; + totalNbPendingUsers += (*it).NbPendingUsers; + } + if (CWelcomeServiceMod::isInitialized()) + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); + + return ""; +} + +void cbFailed (CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // I can't connect to the Login Service, just nlerror (); + string reason; + msgin.serial (reason); + nlerror (reason.c_str()); +} + + +bool disconnectClient(uint32 userId) +{ + map::iterator it = UserIdSockAssociations.find (userId); + if (it == UserIdSockAssociations.end ()) + { + nlinfo ("Login service ask to disconnect user %d, he is not connected here, so ignoring", userId); + return false; + } + else + { + CMessage msgout ("DC"); + msgout.serial (userId); + CUnifiedNetwork::getInstance()->send (it->second, msgout); + + return true; + } +} + +void cbLSDisconnectClient (CMessage &msgin, const std::string &serviceName, TServiceId sid) +{ + // the LS tells me that i have to disconnect a client + + uint32 userid; + msgin.serial (userid); + + disconnectClient(userid); + +} + +// connection to the LS, send the identification message +void cbLSConnection (const std::string &serviceName, TServiceId sid, void *arg) +{ + sint32 shardId; + + if (IService::getInstance()->haveArg('S')) + { + // use the command line param if set + shardId = atoi(IService::getInstance()->getArg('S').c_str()); + } + else if (IService::getInstance()->ConfigFile.exists ("ShardId")) + { + // use the config file param if set + shardId = IService::getInstance()->ConfigFile.getVar ("ShardId").asInt(); + } + else + { + shardId = -1; + } + + if (shardId == -1) + { + nlerror ("ShardId variable must be valid (>0)"); + } + + CMessage msgout ("WS_IDENT"); + msgout.serial (shardId); + CUnifiedNetwork::getInstance()->send (sid, msgout); + + nlinfo ("Connected to %s-%hu and sent identification with shardId '%d'", serviceName.c_str(), sid.get(), shardId); + + // send state to LS + setShardOpenState((TShardOpenState)(ShardOpen.get()), false); + + // + if (!DontUseLS) + { + CMessage msgrpn("REPORT_NO_PATCH"); + CUnifiedNetwork::getInstance()->send("LS", msgrpn); + } + + bool reportPatching = false; + list::iterator itfs; + for (itfs=FESList.begin(); itfs!=FESList.end(); ++itfs) + (*itfs).reportStateToLS(reportPatching); +} + + +// Callback for detection of config file change about "ExpectedServices" +void cbUpdateExpectedServices( CConfigFile::CVar& var ) +{ + OnlineServices.setExpectedInstances( var ); +} + + +/* + * ShardOpen update functions/callbacks etc. + */ + +/** + * updateShardOpenFromFile() + * Update ShardOpen from a file. + * Read a line of text in the file, converts it to int (atoi), then casts into bool for ShardOpen. + */ +void updateShardOpenFromFile(const std::string& filename) +{ + CIFile f; + + if (!f.open(filename)) + { + nlwarning("Failed to update ShardOpen from file '%s', couldn't open file", filename.c_str()); + return; + } + + try + { + char readBuffer[256]; + f.getline(readBuffer, 256); + setShardOpenState((TShardOpenState)atoi(readBuffer)); + + nlinfo("Updated ShardOpen state to '%u' from file '%s'", ShardOpen.get(), filename.c_str()); + } + catch (Exception& e) + { + nlwarning("Failed to update ShardOpen from file '%s', exception raised while getline() '%s'", filename.c_str(), e.what()); + } +} + +std::string ShardOpenStateFileName; + +/** + * cbShardOpen() + * Callback for ShardOpen + */ +void cbShardOpen(IVariable &var) +{ + setShardOpenState((TShardOpenState)(ShardOpen.get()), false); +} + + +/** + * cbShardOpenStateFile() + * Callback for ShardOpenStateFile + */ +void cbShardOpenStateFile(IVariable &var) +{ + // remove previous file change callback + if (!ShardOpenStateFileName.empty()) + { + CFile::removeFileChangeCallback(ShardOpenStateFileName); + nlinfo("Removed callback for ShardOpenStateFileName file '%s'", ShardOpenStateFileName.c_str()); + } + + ShardOpenStateFileName = var.toString(); + + if (!ShardOpenStateFileName.empty()) + { + // set new callback for the file + CFile::addFileChangeCallback(ShardOpenStateFileName, updateShardOpenFromFile); + nlinfo("Set callback for ShardOpenStateFileName file '%s'", ShardOpenStateFileName.c_str()); + + // and update state from file... + updateShardOpenFromFile(ShardOpenStateFileName); + } +} + +/** + * cbUsePatchMode() + * Callback for UsePatchMode + */ +void cbUsePatchMode(IVariable &var) +{ + // if patch mode not set, set all fs in patching mode to accept clients now + if (!UsePatchMode.get()) + { + nlinfo("UsePatchMode disabled, switch all patching servers to actual frontends"); + + list::iterator it; + + for (it=FESList.begin(); it!=FESList.end(); ++it) + { + if ((*it).State == PatchOnly) + { + (*it).setToAcceptClients(); + } + } + } +} + + +// Callback Array for message from LS +TUnifiedCallbackItem LSCallbackArray[] = +{ + { "CS", cbLSChooseShard }, + { "DC", cbLSDisconnectClient }, + { "FAILED", cbFailed }, +}; + +class CWelcomeService : public IService +{ + +public: + + /// Init the service, load the universal time. + void init () + { + string FrontendServiceName = ConfigFile.getVar ("FrontendServiceName").asString(); + + try { FrontEndAddress = ConfigFile.getVar ("FrontEndAddress").asString(); } catch(Exception &) { } + + nlinfo ("Waiting frontend services named '%s'", FrontendServiceName.c_str()); + + CUnifiedNetwork::getInstance()->setServiceUpCallback(FrontendServiceName, cbFESConnection, NULL); + CUnifiedNetwork::getInstance()->setServiceDownCallback(FrontendServiceName, cbFESDisconnection, NULL); + CUnifiedNetwork::getInstance()->setServiceUpCallback("*", cbServiceUp, NULL); + CUnifiedNetwork::getInstance()->setServiceDownCallback("*", cbServiceDown, NULL); + + // add a connection to the LS + string LSAddr; + if (haveArg('T')) + { + // use the command line param if set + LSAddr = getArg('T'); + } + else if (ConfigFile.exists ("LSHost")) + { + // use the config file param if set + LSAddr = ConfigFile.getVar("LSHost").asString(); + } + + if (haveArg('S')) + { + // use the command line param if set + uint shardId = atoi(IService::getInstance()->getArg('S').c_str()); + + nlinfo("Using shard id %u from command line '%s'", shardId, IService::getInstance()->getArg('S').c_str()); + anticipateShardId(shardId); + } + else if (ConfigFile.exists ("ShardId")) + { + // use the config file param if set + uint shardId = IService::getInstance()->ConfigFile.getVar ("ShardId").asInt(); + + nlinfo("Using shard id %u from config file '%s'", shardId, IService::getInstance()->ConfigFile.getVar ("ShardId").asString().c_str()); + anticipateShardId(shardId); + } + + // the config file must have a valid address where the login service is + nlassert(!LSAddr.empty()); + + // add default port if not set by the config file + if (LSAddr.find (":") == string::npos) + LSAddr += ":49999"; + + AllowDispatchMsgToLS = true; + + if (ConfigFile.getVarPtr("DontUseLSService") == NULL + || !ConfigFile.getVar("DontUseLSService").asBool()) + { + // We are using NeL Login Service + CUnifiedNetwork::getInstance()->addCallbackArray(LSCallbackArray, sizeof(LSCallbackArray)/sizeof(LSCallbackArray[0])); + if (!DontUseLS) + { + CUnifiedNetwork::getInstance()->setServiceUpCallback("LS", cbLSConnection, NULL); + CUnifiedNetwork::getInstance()->addService("LS", LSAddr); + } + } + // List of expected service instances + ConfigFile.setCallback( "ExpectedServices", cbUpdateExpectedServices ); + cbUpdateExpectedServices( ConfigFile.getVar( "ExpectedServices" ) ); + + + /* + * read config variable ShardOpenStateFile to update + * + */ + cbShardOpenStateFile(ShardOpenStateFile); + +// // create a welcome service module (for SU comm) +// IModuleManager::getInstance().createModule("WelcomeService", "ws", ""); +// // plug the module in the default gateway +// NLMISC::CCommandRegistry::getInstance().execute("ws.plug wg", InfoLog()); + } + + bool update () + { + // update the service status + + removeStatusTag("DEV_ONLY"); + removeStatusTag("RESTRICTED"); + removeStatusTag("Open"); + + if (ShardOpen == 0) + addStatusTag("DEV_ONLY"); + else if (ShardOpen == 1) + addStatusTag("RESTRICTED"); + else if (ShardOpen == 2) + addStatusTag("Open"); + + return true; + } + +}; + + +static const char* getCompleteServiceName(const IService* theService) +{ + static std::string s; + s= "welcome_service"; + + if (theService->haveLongArg("wsname")) + { + s+= "_"+theService->getLongArg("wsname"); + } + + if (theService->haveLongArg("fullwsname")) + { + s= theService->getLongArg("fullwsname"); + } + + return s.c_str(); +} + +static const char* getShortServiceName(const IService* theService) +{ + static std::string s; + s= "WS"; + + if (theService->haveLongArg("shortwsname")) + { + s= theService->getLongArg("shortwsname"); + } + + return s.c_str(); +} + +// Service instantiation +NLNET_SERVICE_MAIN( CWelcomeService, getShortServiceName(scn), getCompleteServiceName(scn), 0, FESCallbackArray, "", ""); + + +// welcome service module +//class CWelcomeServiceMod : +// public CEmptyModuleCommBehav > >, +// public WS::CWelcomeServiceSkel +//{ +// void onProcessModuleMessage(IModuleProxy *sender, const CMessage &message) +// { +// if (CWelcomeServiceSkel::onDispatchMessage(sender, message)) +// return; +// +// nlwarning("Unknown message '%s' received by '%s'", +// message.getName().c_str(), +// getModuleName().c_str()); +// } +// +// +// ////// CWelcomeServiceSkel implementation +// +// // ask the welcome service to welcome a user +// virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 userId, const std::string &userName, const CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) +// { +// string ret = lsChooseShard(userName, +// cookie, +// priviledge, +// exPriviledge, +// mode, +// instanceId); +// +// if (!ret.empty()) +// { +// // TODO : correct this +// string fsAddr; +// CWelcomeServiceClientProxy wsc(sender); +// wsc.welcomeUserResult(this, userId, ret.empty(), fsAddr); +// } +// } +// +// // ask the welcome service to disconnect a user +// virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId) +// { +// nlstop; +// } +// +//}; + +namespace WS +{ + + void CWelcomeServiceMod::onModuleUp(IModuleProxy *proxy) + { + if (proxy->getModuleClassName() == "RingSessionManager") + { + if (_RingSessionManager != NULL) + { + nlwarning("WelcomeServiceMod::onModuleUp : receiving module up for RingSessionManager '%s', but already have it as '%s', replacing it", + proxy->getModuleName().c_str(), + _RingSessionManager->getModuleName().c_str()); + } + // store this module as the ring session manager + _RingSessionManager = proxy; + + // say hello to our new friend (transmit fixed session id if set in config file) + nlinfo("Registering welcome service module into session manager '%s'", proxy->getModuleName().c_str()); + uint32 sessionId = 0; + CConfigFile::CVar *varFixedSessionId = IService::getInstance()->ConfigFile.getVarPtr( "FixedSessionId" ); + if ( varFixedSessionId ) + sessionId = varFixedSessionId->asInt(); + CWelcomeServiceClientProxy wscp(proxy); + wscp.registerWS(this, IService::getInstance()->getShardId(), sessionId, OnlineServices.getOnlineStatus()); + + // Send counts + uint32 totalNbOnlineUsers = 0, totalNbPendingUsers = 0; + for (list::iterator it=FESList.begin(); it!=FESList.end(); ++it) + { + totalNbOnlineUsers += (*it).NbUser; + totalNbPendingUsers += (*it).NbPendingUsers; + } + CWelcomeServiceMod::getInstance()->updateConnectedPlayerCount(totalNbOnlineUsers, totalNbPendingUsers); + } + else if (proxy->getModuleClassName() == "LoginService") + { + _LoginService = proxy; + } + } + + void CWelcomeServiceMod::onModuleDown(IModuleProxy *proxy) + { + if (_RingSessionManager == proxy) + { + // remove this module as the ring session manager + _RingSessionManager = NULL; + } + else if (_LoginService == proxy) + _LoginService = NULL; + } + + + void CWelcomeServiceMod::welcomeUser(NLNET::IModuleProxy *sender, uint32 charId, const std::string &userName, const CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) + { + nldebug( "ERLOG: welcomeUser(%u,%s,%s,%s,%s,%u,%u)", charId, userName.c_str(), cookie.toString().c_str(), priviledge.c_str(), exPriviledge.c_str(), (uint)mode.getValue(), instanceId ); + string ret = lsChooseShard(userName, + cookie, + priviledge, + exPriviledge, + mode, + instanceId, + charId & 0xF); + + uint32 userId = charId >> 4; + if (!ret.empty()) + { + nldebug( "ERLOG: lsChooseShard returned an error => welcomeUserResult"); + // TODO : correct this + string fsAddr; + CWelcomeServiceClientProxy wsc(sender); + wsc.welcomeUserResult(this, userId, false, fsAddr, ret); + } + else + { + nldebug( "ERLOG: lsChooseShard OK => adding to pending"); + TPendingFEResponseInfo pfri; + pfri.WSMod = this; + pfri.UserId = userId; + pfri.WaiterModule = sender; + PendingFeResponse.insert(make_pair(cookie, pfri)); + } + } + + void CWelcomeServiceMod::pendingUserLost(const NLNET::CLoginCookie &cookie) + { + if (!_LoginService) + return; + + CLoginServiceProxy ls(_LoginService); + + ls.pendingUserLost(this, cookie); + } + + + // register the module + NLNET_REGISTER_MODULE_FACTORY(CWelcomeServiceMod, "WelcomeService"); + +} // namespace WS + + +// +// Variables +// + +NLMISC_DYNVARIABLE(uint32, OnlineUsersNumber, "number of connected users on this shard") +{ + // we can only read the value + if (get) + { + uint32 nbusers = 0; + for (list::iterator it = FESList.begin(); it != FESList.end (); it++) + { + nbusers += (*it).NbUser; + } + *pointer = nbusers; + } +} + + +// +// Commands +// + + +NLMISC_COMMAND (frontends, "displays the list of all registered front ends", "") +{ + if(args.size() != 0) return false; + + log.displayNL ("Display the %d registered front end :", FESList.size()); + for (list::iterator it = FESList.begin(); it != FESList.end (); it++) + { +// log.displayNL ("> FE %u: nb estimated users: %u nb users: %u, nb pending users : %u", + log.displayNL ("> FE %u: nb users: %u, nb pending users : %u", + it->SId.get(), + it->NbUser, + it->NbPendingUsers); + } + log.displayNL ("End ot the list"); + + return true; +} + +NLMISC_COMMAND (users, "displays the list of all registered users", "") +{ + if(args.size() != 0) return false; + + log.displayNL ("Display the %d registered users :", UserIdSockAssociations.size()); + for (map::iterator it = UserIdSockAssociations.begin(); it != UserIdSockAssociations.end (); it++) + { + log.displayNL ("> %u SId=%u", (*it).first, (*it).second.get()); + } + log.displayNL ("End ot the list"); + + return true; +} + +NLMISC_COMMAND( displayOnlineServices, "Display the online service instances", "" ) +{ + OnlineServices.display( log ); + return true; +} + +NLMISC_VARIABLE( bool, OnlineStatus, "Main online status of the shard" ); diff --git a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.h b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.h new file mode 100644 index 000000000..92d1a5986 --- /dev/null +++ b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.h @@ -0,0 +1,112 @@ +// NeLNS - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/misc/types_nl.h" +#include "nel/misc/singleton.h" + +#include "nel/net/module_manager.h" +#include "nel/net/module_builder_parts.h" + +#include "game_share/welcome_service_itf.h" + +std::string lsChooseShard (const std::string &userName, + const NLNET::CLoginCookie &cookie, + const std::string &userPriv, + const std::string &userExtended, + WS::TUserRole userRole, + uint32 instanceId, + uint32 charSlot); + + +bool disconnectClient(uint32 userId); + + +namespace WS +{ + // welcome service module + class CWelcomeServiceMod : + public NLNET::CEmptyModuleCommBehav > >, + public WS::CWelcomeServiceSkel, + public NLMISC::CManualSingleton + { + /// the ring session manager module (if any) + NLNET::TModuleProxyPtr _RingSessionManager; + /// the login service module (if any) + NLNET::TModuleProxyPtr _LoginService; + + void onModuleUp(NLNET::IModuleProxy *proxy); + void onModuleDown(NLNET::IModuleProxy *proxy); + + + ////// CWelcomeServiceSkel implementation + + // ask the welcome service to welcome a user + virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 userId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId); + + // ask the welcome service to disconnect a user + virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId) + { + disconnectClient(userId); + } + + public: + CWelcomeServiceMod() + { + CWelcomeServiceSkel::init(this); + } + + void reportWSOpenState(bool shardOpen) + { + if (_RingSessionManager == NULL) // skip if the RSM is offline + return; + + CWelcomeServiceClientProxy wscp(_RingSessionManager); + wscp.reportWSOpenState(this, shardOpen); + } + + // forward response from the front end for a player slot to play in + // to the client of this welcome service (usually the Ring Session Manager) + void frontendResponse(NLNET::IModuleProxy *waiterModule, uint32 userId, const std::string &reason, const NLNET::CLoginCookie &cookie, const std::string &fsAddr) + { + CWelcomeServiceClientProxy wscp(waiterModule); + wscp.welcomeUserResult(this, userId, reason.empty(), fsAddr, reason); + } + + // send the current number of players on this shard to the Ring Session Manager + void updateConnectedPlayerCount(uint32 nbOnlinePlayers, uint32 nbPendingPlayers) + { + if (_RingSessionManager == NULL) // skip if the RSM is offline + return; + + CWelcomeServiceClientProxy wscp(_RingSessionManager); + wscp.updateConnectedPlayerCount(this, nbOnlinePlayers, nbPendingPlayers); + } + + // inform the LS that a pending client is lost + void pendingUserLost(const NLNET::CLoginCookie &cookie); + }; + + struct TPendingFEResponseInfo + { + CWelcomeServiceMod *WSMod; + NLNET::TModuleProxyPtr WaiterModule; + uint32 UserId; + }; + typedef std::map TPendingFeReponses; + // the list of cookie string that are pending an + TPendingFeReponses PendingFeResponse; + +} // namespace WS diff --git a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.vcproj b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.vcproj index b83039254..c223fb76a 100644 --- a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.vcproj +++ b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.vcproj @@ -94,82 +94,6 @@ Name="VCPostBuildEventTool" /> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/server/src/shard_unifier_service/login_service.cpp b/code/ryzom/server/src/shard_unifier_service/login_service.cpp index b8d04e5aa..ad0ff1f5f 100644 --- a/code/ryzom/server/src/shard_unifier_service/login_service.cpp +++ b/code/ryzom/server/src/shard_unifier_service/login_service.cpp @@ -5,7 +5,7 @@ #include "nel/net/module_builder_parts.h" #include "nel/net/login_cookie.h" -#include "../../nelns/welcome_service/welcome_service_itf.h" +#include "game_share/welcome_service_itf.h" #include "game_share/utils.h" #include "server_share/mysql_wrapper.h" @@ -23,8 +23,6 @@ using namespace MSW; using namespace RSMGR; using namespace ENTITYLOC; -#include "../../../../nelns/welcome_service/welcome_service_itf.cpp" - namespace LS { diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 7dc259524..0d2aa8882 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -4,7 +4,7 @@ #include "nel/net/module_builder_parts.h" #include "nel/net/callback_server.h" -#include "../../nelns/welcome_service/welcome_service_itf.h" +#include "game_share/welcome_service_itf.h" #include "game_share/r2_types.h" diff --git a/code/ryzom/tools/all.sln b/code/ryzom/tools/all.sln index fe055cc0a..7bf63041f 100644 --- a/code/ryzom/tools/all.sln +++ b/code/ryzom/tools/all.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3d", "..\..\nel\src\3d.vcproj", "{2B48BE83-108B-4E8E-8A55-6627CF09AC5A}" ProjectSection(ProjectDependencies) = postProject {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} @@ -163,7 +163,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csv_transform", "leveldesig {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "land_export_lib", "leveldesign\world_editor\land_export_lib\land_export_lib.vcproj", "{4B934267-7476-40FF-8701-817DFC63A7F9}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "variable_parser", "leveldesign\variable_parser\variable_parser.vcproj", "{294FC08E-91F1-4838-AA4D-13A457E227E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp_generator", "leveldesign\mp_generator\mp_generator.vcproj", "{DA23C491-DE13-4DD0-84CD-132E2905DFD6}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icon_search", "leveldesign\icon_search\icon_search.vcproj", "{D9678C2E-5137-4A48-BA0D-51B652A08624}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alias_synchronizer", "leveldesign\alias_synchronizer\alias_synchronizer.vcproj", "{3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "land_export", "leveldesign\world_editor\land_export\land_export.vcproj", "{FECBB892-F33C-4195-AB69-9B708BFBCDEA}" ProjectSection(ProjectDependencies) = postProject @@ -174,6 +186,34 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "land_export", "leveldesign\ {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C} = {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "land_export_lib", "leveldesign\world_editor\land_export_lib\land_export_lib.vcproj", "{4B934267-7476-40FF-8701-817DFC63A7F9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "primitive_id_assignator", "leveldesign\primitive_id_assignator\primitive_id_assignator.vcproj", "{78902223-BDC9-4CAC-9EE4-B5074ACA5055}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "prim_export", "leveldesign\prim_export\prim_export.vcproj", "{96975416-BE2B-4458-8DF4-91870D25C46B}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + {9D284C6B-BE12-4549-87E5-2337D64F31BE} = {9D284C6B-BE12-4549-87E5-2337D64F31BE} + {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} = {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} + {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C} = {1DDC11C7-AF79-40F3-A6D4-F84BA8644B5C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "named_items_2_csv", "leveldesign\named_items_2_csv\named_items_2_csv.vcproj", "{B253223D-5E94-41B7-92A1-4E27461C91F8}" + ProjectSection(ProjectDependencies) = postProject + {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} = {44B21233-EFCC-4825-B5E5-3A3BD6CC5516} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "master", "leveldesign\master\master.vcproj", "{D53B297E-01B6-4E9A-9753-BBF18A6EB332}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "georges_plugin_test", "leveldesign\georges_plugin_test\georges_plugin_test.vcproj", "{36DE80C1-0519-4177-847C-17A8D846D365}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "georges_convert", "leveldesign\georges_convert\georges_convert.vcproj", "{3539CE53-2596-4BC4-A177-045BBAFF4A82}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "export", "leveldesign\export\export.vcproj", "{577230FF-399C-4C9D-9495-CEC106326441}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -414,18 +454,102 @@ Global {FA681701-91A3-44D7-878B-92E3B3BCBE43}.Release|Win32.Build.0 = Release|Win32 {FA681701-91A3-44D7-878B-92E3B3BCBE43}.Release|x64.ActiveCfg = Release|x64 {FA681701-91A3-44D7-878B-92E3B3BCBE43}.Release|x64.Build.0 = Release|x64 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|Win32.Build.0 = Debug|Win32 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|x64.ActiveCfg = Debug|Win32 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|Win32.ActiveCfg = Release|Win32 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|Win32.Build.0 = Release|Win32 - {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|x64.ActiveCfg = Release|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Debug|Win32.ActiveCfg = Debug|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Debug|Win32.Build.0 = Debug|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Debug|x64.ActiveCfg = Debug|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Release|Win32.ActiveCfg = Release|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Release|Win32.Build.0 = Release|Win32 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Release|x64.ActiveCfg = Release|x64 + {294FC08E-91F1-4838-AA4D-13A457E227E9}.Release|x64.Build.0 = Release|x64 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Debug|Win32.Build.0 = Debug|Win32 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Debug|x64.ActiveCfg = Debug|Win32 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Release|Win32.ActiveCfg = Release|Win32 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Release|Win32.Build.0 = Release|Win32 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Release|x64.ActiveCfg = Release|x64 + {DA23C491-DE13-4DD0-84CD-132E2905DFD6}.Release|x64.Build.0 = Release|x64 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Debug|Win32.ActiveCfg = Debug|Win32 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Debug|Win32.Build.0 = Debug|Win32 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Debug|x64.ActiveCfg = Debug|Win32 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Release|Win32.ActiveCfg = Release|Win32 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Release|Win32.Build.0 = Release|Win32 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Release|x64.ActiveCfg = Release|x64 + {D9678C2E-5137-4A48-BA0D-51B652A08624}.Release|x64.Build.0 = Release|x64 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Debug|Win32.ActiveCfg = Debug|Win32 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Debug|Win32.Build.0 = Debug|Win32 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Debug|x64.ActiveCfg = Debug|x64 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Debug|x64.Build.0 = Debug|x64 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Release|Win32.ActiveCfg = Release|Win32 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Release|Win32.Build.0 = Release|Win32 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Release|x64.ActiveCfg = Release|x64 + {3ECD7F32-6603-45D2-91AB-5FBC278F6DC8}.Release|x64.Build.0 = Release|x64 {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Debug|Win32.ActiveCfg = Debug|Win32 {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Debug|Win32.Build.0 = Debug|Win32 {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Debug|x64.ActiveCfg = Debug|Win32 {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Release|Win32.ActiveCfg = Release|Win32 {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Release|Win32.Build.0 = Release|Win32 - {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Release|x64.ActiveCfg = Release|Win32 + {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Release|x64.ActiveCfg = Release|x64 + {FECBB892-F33C-4195-AB69-9B708BFBCDEA}.Release|x64.Build.0 = Release|x64 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|Win32.Build.0 = Debug|Win32 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Debug|x64.ActiveCfg = Debug|Win32 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|Win32.ActiveCfg = Release|Win32 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|Win32.Build.0 = Release|Win32 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|x64.ActiveCfg = Release|x64 + {4B934267-7476-40FF-8701-817DFC63A7F9}.Release|x64.Build.0 = Release|x64 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Debug|Win32.ActiveCfg = Debug|Win32 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Debug|Win32.Build.0 = Debug|Win32 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Debug|x64.ActiveCfg = Debug|x64 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Debug|x64.Build.0 = Debug|x64 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Release|Win32.ActiveCfg = Release|Win32 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Release|Win32.Build.0 = Release|Win32 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Release|x64.ActiveCfg = Release|x64 + {78902223-BDC9-4CAC-9EE4-B5074ACA5055}.Release|x64.Build.0 = Release|x64 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Debug|Win32.ActiveCfg = Debug|Win32 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Debug|Win32.Build.0 = Debug|Win32 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Debug|x64.ActiveCfg = Debug|Win32 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Release|Win32.ActiveCfg = Release|Win32 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Release|Win32.Build.0 = Release|Win32 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Release|x64.ActiveCfg = Release|x64 + {96975416-BE2B-4458-8DF4-91870D25C46B}.Release|x64.Build.0 = Release|x64 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Debug|Win32.Build.0 = Debug|Win32 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Debug|x64.ActiveCfg = Debug|Win32 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Release|Win32.ActiveCfg = Release|Win32 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Release|Win32.Build.0 = Release|Win32 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Release|x64.ActiveCfg = Release|x64 + {B253223D-5E94-41B7-92A1-4E27461C91F8}.Release|x64.Build.0 = Release|x64 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Debug|Win32.ActiveCfg = Debug|Win32 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Debug|Win32.Build.0 = Debug|Win32 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Debug|x64.ActiveCfg = Debug|x64 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Debug|x64.Build.0 = Debug|x64 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Release|Win32.ActiveCfg = Release|Win32 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Release|Win32.Build.0 = Release|Win32 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Release|x64.ActiveCfg = Release|x64 + {D53B297E-01B6-4E9A-9753-BBF18A6EB332}.Release|x64.Build.0 = Release|x64 + {36DE80C1-0519-4177-847C-17A8D846D365}.Debug|Win32.ActiveCfg = Debug|Win32 + {36DE80C1-0519-4177-847C-17A8D846D365}.Debug|Win32.Build.0 = Debug|Win32 + {36DE80C1-0519-4177-847C-17A8D846D365}.Debug|x64.ActiveCfg = Debug|x64 + {36DE80C1-0519-4177-847C-17A8D846D365}.Debug|x64.Build.0 = Debug|x64 + {36DE80C1-0519-4177-847C-17A8D846D365}.Release|Win32.ActiveCfg = Release|Win32 + {36DE80C1-0519-4177-847C-17A8D846D365}.Release|Win32.Build.0 = Release|Win32 + {36DE80C1-0519-4177-847C-17A8D846D365}.Release|x64.ActiveCfg = Release|x64 + {36DE80C1-0519-4177-847C-17A8D846D365}.Release|x64.Build.0 = Release|x64 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Debug|Win32.ActiveCfg = Debug|Win32 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Debug|Win32.Build.0 = Debug|Win32 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Debug|x64.ActiveCfg = Debug|Win32 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Release|Win32.ActiveCfg = Release|Win32 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Release|Win32.Build.0 = Release|Win32 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Release|x64.ActiveCfg = Release|x64 + {3539CE53-2596-4BC4-A177-045BBAFF4A82}.Release|x64.Build.0 = Release|x64 + {577230FF-399C-4C9D-9495-CEC106326441}.Debug|Win32.ActiveCfg = Debug|Win32 + {577230FF-399C-4C9D-9495-CEC106326441}.Debug|Win32.Build.0 = Debug|Win32 + {577230FF-399C-4C9D-9495-CEC106326441}.Debug|x64.ActiveCfg = Debug|x64 + {577230FF-399C-4C9D-9495-CEC106326441}.Debug|x64.Build.0 = Debug|x64 + {577230FF-399C-4C9D-9495-CEC106326441}.Release|Win32.ActiveCfg = Release|Win32 + {577230FF-399C-4C9D-9495-CEC106326441}.Release|Win32.Build.0 = Release|Win32 + {577230FF-399C-4C9D-9495-CEC106326441}.Release|x64.ActiveCfg = Release|x64 + {577230FF-399C-4C9D-9495-CEC106326441}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/code/ryzom/tools/build_gamedata/work_in_progress b/code/ryzom/tools/build_gamedata/work_in_progress new file mode 100644 index 000000000..e69de29bb diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py new file mode 100644 index 000000000..d38db7e46 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -0,0 +1,113 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-05-24 06:34GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + + +# *** ECOSYSTEM AND CONTINENT NAMES *** +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName +ContinentName = "newbieland" +ContinentPath = "continents/" + ContinentName + + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = "landscape/zones/" + EcosystemName + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = ContinentPath + "/zone" +WaterMapSourceDirectories = [ ] + +# Smallbank directories +SmallbankExportDirectory = EcosystemPath + "/smallbank" + +# Tiles directories +DisplaceExportDirectory = EcosystemPath + "/diplace" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Ligo directories +LigoZoneBuildDirectory = ContinentPath + "/ligo_zones" +LigoIgLandBuildDirectory = ContinentPath + "/ligo_ig_land" +LigoIgOtherBuildDirectory = ContinentPath + "/ligo_ig_other" + +# Zone directories +ZoneWeldBuildDirectory = ContinentPath + "/zone_weld" +ZoneLightWaterShapesLightedExportDirectory = ContinentPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = ContinentPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = ContinentPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = ContinentPath + "/zone_lighted_ig_land" #fixme + +# Farbank directories +FarbankBuildDirectory = EcosystemPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgVillageBuildDirectory = "_invalid" + +# Rbank directories +RbankBboxBuildDirectory = ContinentPath + "/rbank_bbox" +RbankTessellationBuildDirectory = ContinentPath + "/rbank_tessellation" +RbankSmoothBuildDirectory = ContinentPath + "/rbank_smooth" +RbankRawBuildDirectory = ContinentPath + "/rbank_raw" +RbankPreprocBuildDirectory = ContinentPath + "/rbank_preproc" +RbankMeshBuildDirectory = ContinentPath + "/rbank_cmb" +RbankRetrieversBuildDirectory = ContinentPath + "/rbank_retrievers" +RbankOutputBuildDirectory = ContinentPath + "/rbank_output" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Ig directory +IgClientDirectory = ContinentName + "_ig" + +# Zone directory +ZoneClientDirectory = ContinentName + "_zones" +WaterMapsClientDirectory = ContinentName + "_zones" + +# PACS directory +PacsClientDirectory = ContinentName + "_pacs" + +# PS directory +IgClientDirectory = ContinentName + "_ig" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py new file mode 100644 index 000000000..d8237176e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -0,0 +1,105 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-05-24 06:30GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files +ProcessToComplete += [ "zone" ] +#ProcessToComplete += [ "ig" ] # not implemented +ProcessToComplete += [ "zone_light" ] +ProcessToComplete += [ "rbank" ] +#ProcessToComplete += [ "ig_light" ] +#ProcessToComplete += [ "ps" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** +EcosystemName = "jungle" +ContinentName = "newbieland" + + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** CONTINENT FILE *** +ContinentFile = ContinentName + "/" + ContinentName + ".continent" + + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + + +# *** LIGO OPTIONS *** +LigoExportLand = ContinentName + ".land" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_" + ContinentName + ".png" +LigoExportHeightmap1 = "big_" + ContinentName + ".png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_" + ContinentName + ".png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/" + EcosystemName + "/" + EcosystemName + ".bank" + +# *** ZONE REGIONS ( up-left, down-right ) *** +ZoneRegion = [ "65_bz", "77_cs" ] + +# *** RBANK OPTIONS *** + +# Options +RBankVerbose = 0 +RBankConsistencyCheck = 0 +RbankReduceSurfaces = 1 +RbankSmoothBorders = 1 +RbankComputeElevation = 0 +RbankComputeLevels = 1 +RbankLinkElements = 1 +RbankCutEdges = 1 +RbankUseZoneSquare = 0 + +# Region to compute ( ALPHA UPPER CASE! ) +RbankZoneUl = "65_BZ" +RbankZoneDr = "77_CS" + +# Output names +RbankRbankName = LandscapeName + +# Import ig pathes +RbankIgPaths = [ ] # ExportBuildDirectory/... +RbankIgPaths += [ "continents/" + ContinentName + "/ig_other" ] +RbankIgPaths += [ "continents/" + ContinentName + "/ig_land" ] + +# Import shape pathes +RbankShapePaths = [ ] # ExportBuildDirectory/... +RbankShapePaths += [ "continents/" + ContinentName + "/shape" ] +RbankShapePaths += [ "continents/" + ContinentName + "/shape_with_coarse_mesh_builded" ] +RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape" ] +RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" ] +RbankShapePaths += [ "common/sfx/ps" ] +# RbankShapePaths += [ "l:/leveldesign/world_edit_files" ] + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg new file mode 100644 index 000000000..4b886d584 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg @@ -0,0 +1,52 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/%SmallbankExportDirectory%/%EcosystemName%.smallbank"; +bankfar_name = "%ExportBuildDirectory%/%FarbankBuildDirectory%/%EcosystemName%.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/continents/newbieland/ig_land", // Instance group directory + "%ExportBuildDirectory%/continents/newbieland/ig_other", // Instance group directory + "%ExportBuildDirectory%/continents/newbieland/shape", // Shape directory + "%ExportBuildDirectory%/continents/newbieland/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/common/sfx/processes/ps/ps", // Sfx directory + "%ExportBuildDirectory%/ecosystems/jungle/shape", // Shape directory + "%ExportBuildDirectory%/ecosystems/jungle/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/ecosystems/jungle/map/tga", // Map directory + "%ExportBuildDirectory%/continents/newbieland/zone_light/water_shapes_lighted", // Water shape lighted directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/%RbankOutputBuildDirectory%/%RbankRbankName%.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/%RbankOutputBuildDirectory%/%RbankRbankName%.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg new file mode 100644 index 000000000..ccb91159d --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; // FIXME: should be 1, but missing .depend files + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py new file mode 100644 index 000000000..aa3ad4c47 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -0,0 +1,245 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-05-24 06:34GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + + +# *** ECOSYSTEM NAME *** +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/" + EcosystemName + "/decors/_textures/Vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] + +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-junglegoo" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-sciurejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-terrejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/9-falaisejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/Transitions" ] + +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-junglegoo" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-sciurejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-terrejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/9-falaisejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/Transitions" ] + +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-junglegoo" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-sciurejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-terrejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/9-falaisejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/Transitions" ] + +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-junglemousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-junglefeuilles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-jungleherbesseche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-jungleherbevieille" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-jungleterreaux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-junglegoo" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-sciurejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-terrejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/9-falaisejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/Transitions" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directoriy +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "/displace" ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = "landscape/zones/" + EcosystemName + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = "ecosystems/" + EcosystemName + "/shape_tag" +ShapeExportDirectory = "ecosystems/" + EcosystemName + "/shape" +ShapeWithCoarseMeshExportDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = "ecosystems/" + EcosystemName + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = "ecosystems/" + EcosystemName + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" + +# Tiles directories +TilesExportDirectory = "ecosystems/" + EcosystemName + "/tiles" + +# Tiles directories +DisplaceExportDirectory = "ecosystems/" + EcosystemName + "/diplace" + +# Veget directories +VegetExportDirectory = "ecosystems/" + EcosystemName + "/veget" +VegetTagExportDirectory = "ecosystems/" + EcosystemName + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = "ecosystems/" + EcosystemName + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = "ecosystems/" + EcosystemName + "/map" +MapPanoplyBuildDirectory = "ecosystems/" + EcosystemName + "/map_panoply" + +# Shape directories +ShapeWithCoarseMeshBuildDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" + +# Farbank directories +FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgVillageBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Client directories +ClientSetupDirectories = [ ] +ClientSetupDirectories += [ "jungle_shapes" ] +ClientSetupDirectories += [ "jungle_maps" ] +ClientSetupDirectories += [ "jungle_tiles" ] +ClientSetupDirectories += [ "jungle_displaces" ] +ClientSetupDirectories += [ "jungle_bank" ] +ClientSetupDirectories += [ "jungle_vegetables" ] +ClientSetupDirectories += [ "jungle_vegetable_sets" ] +ClientSetupDirectories += [ "jungle_pacs_prim" ] +ClientSetupDirectories += [ "jungle_lightmaps" ] + +# Shape directory +MapClientDirectory = "jungle_maps" + +# Shape directory +ShapeClientDirectory = "jungle_shapes" + +# Map directory +BitmapClientDirectory = "jungle_maps" + +# Lightmap directory +LightmapClientDirectory = "jungle_lightmaps" + +# Tile directory +TilesClientDirectory = "jungle_tiles" + +# Displace directory +DisplaceClientDirectory = "jungle_displaces" + +# Bank directory +BankClientDirectory = "jungle_bank" + +# Vegetable set directory +VegetSetClientDirectory = "jungle_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = "jungle_vegetables" + +# PACS primitives directories +PacsPrimitiveClientDirectory = "jungle_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py new file mode 100644 index 000000000..b5e288d15 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-05-24 06:30GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process +ProcessToComplete += [ "map" ] # not fully implemented, but works for this process +ProcessToComplete += [ "smallbank" ] # OK +ProcessToComplete += [ "farbank" ] # OK +ProcessToComplete += [ "tiles" ] # OK +ProcessToComplete += [ "displace" ] # OK +ProcessToComplete += [ "veget" ] # OK +ProcessToComplete += [ "vegetset" ] # OK +ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process, but does not export max files +#ProcessToComplete += [ "pacs_prim" ] + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "false" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = "jungle" + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py new file mode 100644 index 000000000..035f43900 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +# +# \file projects.py +# \brief Projects configuration +# \date 2010-05-24-09-19-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Projects configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +ProjectsToProcess = [ ] +ProjectsToProcess += [ "ecosystems/jungle" ] +ProjectsToProcess += [ "continents/newbieland" ] + + +# end of file diff --git a/code/ryzom/tools/leveldesign/georges_convert/georges_convert.vcproj b/code/ryzom/tools/leveldesign/georges_convert/georges_convert.vcproj index 3c520eb65..b6ecee78b 100644 --- a/code/ryzom/tools/leveldesign/georges_convert/georges_convert.vcproj +++ b/code/ryzom/tools/leveldesign/georges_convert/georges_convert.vcproj @@ -11,14 +11,17 @@ + + + + + + + + + + + + + + + + + + + + @@ -306,624 +403,96 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.vcproj b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.vcproj index 90d487aae..790fb3d0d 100644 --- a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.vcproj +++ b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.vcproj @@ -10,6 +10,9 @@ + @@ -195,6 +198,189 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -202,24 +388,6 @@ - - - - - - diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export/land_export.vcproj b/code/ryzom/tools/leveldesign/world_editor/land_export/land_export.vcproj index ec324ee20..b9c583400 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export/land_export.vcproj +++ b/code/ryzom/tools/leveldesign/world_editor/land_export/land_export.vcproj @@ -1,7 +1,7 @@ + @@ -72,7 +75,7 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,25 +387,6 @@ - - - - - - diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/land_export_lib.vcproj b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/land_export_lib.vcproj index c2d5199a6..a4f0f761b 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/land_export_lib.vcproj +++ b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/land_export_lib.vcproj @@ -1,20 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - + + - - - - - - - - - + +