Random Thought: displaying stats on a website?

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

Random Thought: displaying stats on a website?

by RAPHAEL » Mon Feb 27, 2012 22:55

Well a random thought just came to me. I've noticed with a lot of multiplayer games they have stats of the server listed on a website.

Examples would be how many players online, how many player total, server loads, generated map overviews and such. Would be interesting for Minetest to support such eventually or someone with enough skill come along and make it work and show others how to do it.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Mon Feb 27, 2012 23:22

+1
 

XCalibur54
Member
 
Posts: 51
Joined: Mon Oct 24, 2011 01:29

by XCalibur54 » Tue Feb 28, 2012 03:05

+1

It would be really cool to show live stats like how many people are currently logged in, but that would require a central server which is a bad idea.
Moderator of redcrab's 0.4 server: http://c55.me/minetest/forum/viewtopic.php?id=606
 

Roflo
Member
 
Posts: 51
Joined: Sun Nov 06, 2011 16:31

by Roflo » Tue Feb 28, 2012 03:34

Maybe not..

For example, your server could generate a small image in which it "writes down" the number of active users.

Any webpage can just link to that dynamic image.
Unless otherwise specified: I use linux and run (and compile) the latest dev.
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Tue Feb 28, 2012 04:04

Roflo wrote:Maybe not..

For example, your server could generate a small image in which it "writes down" the number of active users.

Any webpage can just link to that dynamic image.

+1 except needs to show active players, total players and maybe explored world size?
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

tinoesroho
Member
 
Posts: 570
Joined: Fri Feb 17, 2012 21:55

by tinoesroho » Tue Feb 28, 2012 16:22

Hmm...k...

I was think of writing a mod that utilizes Python and Twitter's API to have a live feed of notable events ("Johann destroyed 100 blocks in the past 120 seconds!") ("Ralph clobbered 5 players in 10 seconds!") for those who either can't log in (too many players) or just want t o have an overview of the action.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Tue Feb 28, 2012 17:24

tinoesroho wrote:Hmm...k...

I was think of writing a mod that utilizes Python and Twitter's API to have a live feed of notable events ("Johann destroyed 100 blocks in the past 120 seconds!") ("Ralph clobbered 5 players in 10 seconds!") for those who either can't log in (too many players) or just want t o have an overview of the action.


yes please!

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Tue Feb 28, 2012 22:54

I could be possible to have a mod catch some of these types of info and write it to a file and you could up PHP of parse the file and output it on a webserver. It is also possible for a mod to run an external command which could post to Twitter(https://launchpad.net/twitter-cmdline/)

If you post a list of the kind of stats you want I can help write some of the mod code and some of the PHP code, if you need.

For example, here is a function that will output a sorted list of the currently connected players to a file every 60 seconds:
(Only flaw I see here is that dead players will not show up.)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
timer = 0
filename = "connected_players.txt"
minetest.register_globalstep(function(dtime)
    timer = timer + dtime
    if timer >= 60 then
        timer = 0
    else
        return
    end
   
    all_connected_players = {}
   
    for k, v in pairs(minetest.object_refs) do
        if v:get_player_name() ~= nil then
            table.insert(all_connected_players, v:get_player_name())
        end
    end
   
    table.sort(all_connected_players)
   
    file,err = io.open( filename, "w" )
    if err then return end
   
    for k, v in pairs(all_connected_players) do
        file:write(v .. "\n")
    end
   
    file:close()
end)
Last edited by randomproof on Tue Feb 28, 2012 23:08, edited 1 time in total.
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: Random Thought: displaying stats on a website?

by Milan* » Sat Oct 01, 2016 15:10

Lets necrobump this thread because i found this on the web and others may this too.
I am using a munin script based on this.
An example is here.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Random Thought: displaying stats on a website?

by rubenwardy » Sat Oct 01, 2016 15:20

already possible using external tools - such as appending player numbers to a file, minetestmapper
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 13 guests

cron