Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
50621ffe
Commit
50621ffe
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Fix mod paths
parent
db4911f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/server.cpp
+7
-15
7 additions, 15 deletions
src/server.cpp
src/subgame.cpp
+7
-5
7 additions, 5 deletions
src/subgame.cpp
src/subgame.h
+3
-3
3 additions, 3 deletions
src/subgame.h
with
17 additions
and
23 deletions
src/server.cpp
+
7
−
15
View file @
50621ffe
...
...
@@ -885,25 +885,13 @@ Server::Server(
infostream
<<
"- world: "
<<
m_path_world
<<
std
::
endl
;
infostream
<<
"- config: "
<<
m_path_config
<<
std
::
endl
;
infostream
<<
"- game: "
<<
m_gamespec
.
path
<<
std
::
endl
;
for
(
std
::
set
<
std
::
string
>::
const_iterator
i
=
m_gamespec
.
addon_paths
.
begin
();
i
!=
m_gamespec
.
addon_paths
.
end
();
i
++
)
infostream
<<
"- addons: "
<<
(
*
i
)
<<
std
::
endl
;
// Path to builtin.lua
std
::
string
builtinpath
=
porting
::
path_share
+
DIR_DELIM
+
"builtin"
+
DIR_DELIM
+
"builtin.lua"
;
// Add default global mod search path
m_modspaths
.
push_front
(
m_gamespec
.
path
+
DIR_DELIM
"mods"
);
// Add world mod search path
m_modspaths
.
push_front
(
m_path_world
+
DIR_DELIM
+
"worldmods"
);
// Add addon mod search path
for
(
std
::
set
<
std
::
string
>::
const_iterator
i
=
m_gamespec
.
addon_paths
.
begin
();
i
!=
m_gamespec
.
addon_paths
.
end
();
i
++
)
m_modspaths
.
push_front
((
*
i
)
+
DIR_DELIM
+
"mods"
);
// Add simple user mod search path
m_modspaths
.
push_front
(
porting
::
path_user
+
DIR_DELIM
+
"mods"
+
DIR_DELIM
+
m_gamespec
.
id
);
for
(
std
::
set
<
std
::
string
>::
const_iterator
i
=
m_gamespec
.
mods_paths
.
begin
();
i
!=
m_gamespec
.
mods_paths
.
end
();
i
++
)
m_modspaths
.
push_front
((
*
i
));
// Print out mod search paths
for
(
core
::
list
<
std
::
string
>::
Iterator
i
=
m_modspaths
.
begin
();
...
...
@@ -912,6 +900,10 @@ Server::Server(
infostream
<<
"- mods: "
<<
modspath
<<
std
::
endl
;
}
// Path to builtin.lua
std
::
string
builtinpath
=
porting
::
path_share
+
DIR_DELIM
+
"builtin"
+
DIR_DELIM
+
"builtin.lua"
;
// Create world if it doesn't exist
if
(
!
initializeWorld
(
m_path_world
,
m_gamespec
.
id
))
throw
ServerError
(
"Failed to initialize world"
);
...
...
This diff is collapsed.
Click to expand it.
src/subgame.cpp
+
7
−
5
View file @
50621ffe
...
...
@@ -38,14 +38,16 @@ SubgameSpec findSubgame(const std::string &id)
}
if
(
!
fs
::
PathExists
(
game_path
))
return
SubgameSpec
();
// Find addon directories
std
::
set
<
std
::
string
>
addon_paths
;
// Find mod directories
std
::
set
<
std
::
string
>
mods_paths
;
mods_paths
.
insert
(
game_path
+
DIR_DELIM
+
"mods"
);
if
(
!
user_game
)
addon_paths
.
insert
(
share
+
DIR_DELIM
+
"addons"
+
DIR_DELIM
+
id
);
addon_paths
.
insert
(
user
+
DIR_DELIM
+
"addons"
+
DIR_DELIM
+
id
);
mods_paths
.
insert
(
share
+
DIR_DELIM
+
"mods"
+
DIR_DELIM
+
id
);
if
(
user
!=
share
||
user_game
)
mods_paths
.
insert
(
user
+
DIR_DELIM
+
"mods"
+
DIR_DELIM
+
id
);
// TODO: Read proper name from game_path/game.conf
std
::
string
game_name
=
id
;
return
SubgameSpec
(
id
,
game_path
,
addon
_paths
,
game_name
);
return
SubgameSpec
(
id
,
game_path
,
mods
_paths
,
game_name
);
}
std
::
set
<
std
::
string
>
getAvailableGameIds
()
...
...
This diff is collapsed.
Click to expand it.
src/subgame.h
+
3
−
3
View file @
50621ffe
...
...
@@ -28,16 +28,16 @@ struct SubgameSpec
{
std
::
string
id
;
// "" = game does not exist
std
::
string
path
;
std
::
set
<
std
::
string
>
addon
_paths
;
std
::
set
<
std
::
string
>
mods
_paths
;
std
::
string
name
;
SubgameSpec
(
const
std
::
string
&
id_
=
""
,
const
std
::
string
&
path_
=
""
,
const
std
::
set
<
std
::
string
>
&
addon
_paths_
=
std
::
set
<
std
::
string
>
(),
const
std
::
set
<
std
::
string
>
&
mods
_paths_
=
std
::
set
<
std
::
string
>
(),
const
std
::
string
&
name_
=
""
)
:
id
(
id_
),
path
(
path_
),
addon
_paths
(
addon
_paths_
),
mods
_paths
(
mods
_paths_
),
name
(
name_
)
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment