Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ak Announcer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minetest
Ak Announcer
Commits
89ae7ecd
Commit
89ae7ecd
authored
Oct 23, 2021
by
Peter Nerlich
Committed by
Peter Nerlich
Oct 23, 2021
Browse files
Options
Downloads
Patches
Plain Diff
introduce settings: ak_announcer.api_endpoint and ak_announcer.fetch_interval
parent
d78e7a3e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ak_stuff.lua
+2
-2
2 additions, 2 deletions
ak_stuff.lua
init.lua
+9
-4
9 additions, 4 deletions
init.lua
with
11 additions
and
6 deletions
ak_stuff.lua
+
2
−
2
View file @
89ae7ecd
-- TODO:
-- only print messages if players on server
-- print messages privately to player on join
local
FETCH_INTERVAL
=
4
*
60
-- 4 minutes
--local FETCH_INTERVAL = 30
local
FETCH_INTERVAL
=
tonumber
(
minetest
.
settings
:
get
(
"ak_announcer.fetch_interval"
))
or
4
*
60
local
aka
=
ak_announcer
aka
.
my_offset
=
0
...
...
This diff is collapsed.
Click to expand it.
init.lua
+
9
−
4
View file @
89ae7ecd
local
API
=
minetest
.
settings
:
get
(
"ak_announcer.api_endpoint"
)
or
"http://ak.kif.rocks/kif490/api/"
local
FETCH_INTERVAL
=
tonumber
(
minetest
.
settings
:
get
(
"ak_announcer.fetch_interval"
))
or
4
*
60
if
API
:
sub
(
-
1
)
~=
"/"
then
API
=
API
..
"/"
end
ak_announcer
=
{}
local
aka
=
ak_announcer
...
...
@@ -6,16 +13,14 @@ local MP = minetest.get_modpath("ak_announcer")
local
http
=
QoS
and
QoS
(
minetest
.
request_http_api
(),
2
)
or
minetest
.
request_http_api
()
if
http
then
--ak_url = "http://ak.kif.rocks/kif485/api/"
ak_url
=
"http://ak.kif.rocks/kif490/api/"
minetest
.
log
(
"warning"
,
"[AK-Announcer] starting with endpoint: "
..
ak_url
)
minetest
.
log
(
"warning"
,
"[AK-Announcer] starting with endpoint: "
..
API
)
dofile
(
MP
..
"/util.lua"
)
dofile
(
MP
..
"/ak_stuff.lua"
)
dofile
(
MP
..
"/chat_commands.lua"
)
aka
.
init
(
http
,
ak_url
)
aka
.
init
(
http
,
API
)
else
minetest
.
log
(
"error"
,
"[AK-Announcer] Using HTTP was denied."
)
end
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