3 # \file a1_worldedit_data.py
4 # \brief Install worldedit data
5 # \date 2014-09-10 14:01GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Install worldedit data
10 # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
11 # Copyright (C) 2014 by authors
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU Affero General Public License as
15 # published by the Free Software Foundation, either version 3 of the
16 # License, or (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Affero General Public License for more details.
23 # You should have received a copy of the GNU Affero General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 import time
, sys
, os
, shutil
, subprocess
, distutils
.dir_util
28 sys
.path
.append("configuration")
30 if os
.path
.isfile("log.log"):
32 log
= open("log.log", "w")
34 from buildsite_local
import *
37 sys
.path
.append(WorkspaceDirectory
)
38 from projects
import *
42 printLog(log
, "-------")
43 printLog(log
, "--- Install worldedit data")
44 printLog(log
, "-------")
45 printLog(log
, time
.strftime("%Y-%m-%d %H:%MGMT", time
.gmtime(time
.time())))
48 for ecosystem
in WorldEditEcosystems
:
49 ecosystemName
= ecosystem
[0]
50 srcZoneLigos
= ExportBuildDirectory
+ "/ecosystems/" + ecosystemName
+ "/ligo_es/zoneligos/"
51 dstZoneLigos
= WorldEditInstallDirectory
+ "/" + ecosystemName
+ "/zoneligos/"
52 mkPath(log
, srcZoneLigos
)
53 mkPath(log
, dstZoneLigos
)
54 copyFilesNoTreeIfNeeded(log
, srcZoneLigos
, dstZoneLigos
)
55 srcZoneBitmaps
= DatabaseDirectory
+ "/landscape/ligo/" + ecosystemName
+ "/zonebitmaps/"
56 dstZoneBitmaps
= WorldEditInstallDirectory
+ "/" + ecosystemName
+ "/zonebitmaps/"
57 mkPath(log
, srcZoneBitmaps
)
58 mkPath(log
, dstZoneBitmaps
)
59 copyFilesExtNoTreeIfNeeded(log
, srcZoneBitmaps
, dstZoneBitmaps
, ".tga")
60 copyFilesExtNoTreeIfNeeded(log
, srcZoneBitmaps
, dstZoneBitmaps
, ".png")
61 dstCollisionMap
= WorldEditInstallDirectory
+ "/" + ecosystemName
+ "/collisionmap/"
62 mkPath(log
, dstCollisionMap
)
63 for continentName
in ecosystem
[1]:
64 srcCollisionMap
= ExportBuildDirectory
+ "/continents/" + continentName
+ "/ai_wmap/"
65 mkPath(log
, srcCollisionMap
)
66 copyFilesExtNoTreeIfNeeded(log
, srcCollisionMap
, dstCollisionMap
, ".tga")
67 copyFilesExtNoTreeIfNeeded(log
, srcCollisionMap
, dstCollisionMap
, ".png")
71 if os
.path
.isfile("a1_worldedit_data.log"):
72 os
.remove("a1_worldedit_data.log")
73 shutil
.copy("log.log", time
.strftime("%Y-%m-%d-%H-%M-GMT", time
.gmtime(time
.time())) + "_worldedit_data.log")
74 shutil
.move("log.log", "a1_worldedit_data.log")