[Server] Craig's Server

User avatar
Esteban
Member
Posts: 873
Joined: Sun Sep 08, 2013 13:26
In-game: Esteban
Contact:

Re: [0.4.10-dev] Craig's Server

by Esteban » Post

Hey Craigy! I think this would be useful to you. Many users just connect and are inactive, taking valuable space for player that are actually going to play. The following code kicks players if they stay inactive for too long:
kaeza on Disconnect player if inactive thread wrote:Hello and welcome.

Something like this should work:

Code: Select all

    -- Interval between movement checks (in seconds).
    local INTERVAL = 5

    -- Minimum distance to move to register as not AFK (in blocks).
    local MINDIST = 0.2

    -- If player does not move within this time, kick player (in seconds).
    local TIMEOUT = 300 -- 5 minutes

    local time_afk = { }
    local last_pos = { }

    local function check_moved()
       for _, p in ipairs(minetest.get_connected_players()) do
          local plname = p:get_player_name()
          local pos = p:getpos()
          local kicked
          if last_pos[plname] then
             local d = vector.distance(last_pos[plname], pos)
             print("Player: "..plname..", Dist: "..d)
             if d < MINDIST then
                time_afk[plname] = (time_afk[plname] or 0) + INTERVAL
                if time_afk[plname] >= TIMEOUT then
                   minetest.kick_player(plname,
                         "Inactive for "..TIMEOUT.." seconds.")
                   kicked = true
                end
             else
                time_afk[plname] = 0
             end
          end
          if not kicked then
             last_pos[plname] = pos
          end
       end
       minetest.after(INTERVAL, check_moved)
    end
    minetest.after(INTERVAL, check_moved)

    minetest.register_on_leaveplayer(function(player)
       local plname = player:get_player_name()
       time_afk[plname] = nil
       last_pos[plname] = nil
    end)
Last edited by Esteban on Thu Oct 16, 2014 12:10, edited 1 time in total.
Scan avatar or click here to read a Message of Hope (PDF)

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

Re: [0.4.10-dev] Craig's Server

by CraigyDavi » Post

Landrover110 wrote:Hey guys its landrover i have been in the bush for many months so haven't been able to play i was doing antipoaching and stuff so i am going to becoming back online to continue building Landrovers cheap shop (LCS) haven't been on the server for months so it must of changed alot see you all soon

best regards

Landrover
Welcome back :)
RHR wrote:@Craig: Could you please update the overview map? :)
Yep I'll do that the next time I make a backup!
Esteban wrote:Hey Craigy! I think this would be useful to you. Many users just connect and are inactive, taking valuable space for player that are actually going to play. The following code kicks players if they stay inactive for too long:
kaeza on Disconnect player if inactive thread wrote:Hello and welcome.

Something like this should work:

Code: Select all

-- Interval between movement checks (in seconds).
local INTERVAL = 5

-- Minimum distance to move to register as not AFK (in blocks).
local MINDIST = 0.2

-- If player does not move within this time, kick player (in seconds).
local TIMEOUT = 300 -- 5 minutes

local time_afk = { }
local last_pos = { }

local function check_moved()
	for _, p in ipairs(minetest.get_connected_players()) do
		local plname = p:get_player_name()
		local pos = p:getpos()
		local kicked
		if last_pos[plname] then
			local d = vector.distance(last_pos[plname], pos)
			print("Player: "..plname..", Dist: "..d)
			if d < MINDIST then
				time_afk[plname] = (time_afk[plname] or 0) + INTERVAL
				if time_afk[plname] >= TIMEOUT then
					minetest.kick_player(plname,
							"Inactive for "..TIMEOUT.." seconds.")
					kicked = true
				end
			end
		end
		if not kicked then
			last_pos[plname] = pos
		end
	end
	minetest.after(INTERVAL, check_moved)
end
minetest.after(INTERVAL, check_moved)

minetest.register_on_leaveplayer(function(player)
	local plname = player:get_player_name()
	time_afk[plname] = nil
	last_pos[plname] = nil
end)
Looks useful, I might add this.

User avatar
lisacvuk
Member
Posts: 274
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk
Location: Serbia, Užice

Re: [0.4.10-dev] Craig's Server

by lisacvuk » Post

Hey Craig,
I noticed server is down. Will you switch to VPS soon?
lisacvuk
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)

jwpwns
Member
Posts: 62
Joined: Sat Feb 08, 2014 22:22

Re: [0.4.10-dev] Craig's Server

by jwpwns » Post

Server down? you should switch to a vps tho there cheap the server always does good until it lags or turns off for a while.

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

Re: [0.4.10-dev] Craig's Server

by CraigyDavi » Post

lisacvuk wrote:Hey Craig,
I noticed server is down. Will you switch to VPS soon?
lisacvuk
jwpwns wrote:Server down? you should switch to a vps tho there cheap the server always does good until it lags or turns off for a while.
Hi guys, sorry about the downtime - I did a complete backup of my computer and it took a few days. The server in up currently and should be up 24/7 from sometime this week.

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.10-dev] Craig's Server

by gabo.xandre » Post

Today I took a tour in the railway build by Mese Rails Inc.
Image

Great job Lisac and Raven!

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [0.4.11-dev] Craig's Server

by the_raven_262 » Post

The part of the railway that you got the screenshot on was built by hijenavuk. :)

User avatar
lisacvuk
Member
Posts: 274
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk
Location: Serbia, Užice

Re: [0.4.11-dev] Craig's Server

by lisacvuk » Post

Well he is in Mese Rails XD
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.11-dev] Craig's Server

by gabo.xandre » Post

lisacvuk wrote:Well he is in Mese Rails XD
Indeed, all the way from Spawn Station. So contratulations to everyone involved in Mese Rails Inc.

BTW, Happy New Year everyone!!!

nanepiwo
Member
Posts: 23
Joined: Mon Jan 05, 2015 20:13
GitHub: nanepiwo
IRC: nanepiwo or nane
In-game: nanepiwo

Re: [0.4.11-dev] Craig's Server

by nanepiwo » Post

Skin to Add
Skin to Add
Chop_by_Ferdi_Napoli.png (1.94 KiB) Viewed 639 times
Could I have my skin changed to this please? My in-game username is nanepiwo.

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.11-dev] Craig's Server

by gabo.xandre » Post

And could you add my skin, too?

name:King Sam
Image
author: Gabo
license:CC BY-NC-SA 3.0
view in 3d! on skin Database
Download

nanepiwo
Member
Posts: 23
Joined: Mon Jan 05, 2015 20:13
GitHub: nanepiwo
IRC: nanepiwo or nane
In-game: nanepiwo

Re: [0.4.11-dev] Craig's Server

by nanepiwo » Post

Ooh, nice skin!

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

Re: [0.4.11-dev] Craig's Server

by CraigyDavi » Post

Added both skins.

ZionMoulder
New member
Posts: 5
Joined: Mon Jan 26, 2015 00:19
In-game: ZionMoulde+ZMoulder+ZMoulder98
Location: The Great Corn Republic (Indiana, USA)

Re: [0.4.11-dev] Craig's Server

by ZionMoulder » Post

I really enjoy your server. Yesterday I built my first building, a small shack. I'm going to move soon, however, because someone keeps trying to build over my shack. It's small anyway, and I'm getting really good at mining.

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.11-dev] Craig's Server

by gabo.xandre » Post

Wow, Craig's server was #1 on the server's list !!!

Image

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [0.4.11-dev] Craig's Server

by ABJ » Post

The server is not shpwing on the public list in my minetest. It hasn't been on the list since a few days. What's happened?

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.11-dev] Craig's Server

by gabo.xandre » Post

ABJ wrote:The server is not shpwing on the public list in my minetest. It hasn't been on the list since a few days. What's happened?
The server is temporarily down.
In the meantime...

Image
Last edited by gabo.xandre on Wed Apr 01, 2015 22:18, edited 1 time in total.

jwpwns
Member
Posts: 62
Joined: Sat Feb 08, 2014 22:22

Re: [0.4.11-dev] Craig's Server

by jwpwns » Post

Is the server done?
Last edited by jwpwns on Tue Mar 31, 2015 19:09, edited 1 time in total.

User avatar
gabo.xandre
Member
Posts: 70
Joined: Sat Mar 15, 2014 12:54
GitHub: GaboXandre
IRC: GaboXandre
In-game: Gabo
Location: Argentina
Contact:

Re: [0.4.11-dev] Craig's Server

by gabo.xandre » Post

jwpwns wrote:Is the server done? if it is il be making my own shortly
The server has been down a few days, but it will be back soon. Nothing to worry about.

jwpwns
Member
Posts: 62
Joined: Sat Feb 08, 2014 22:22

Re: [0.4.11-dev] Craig's Server

by jwpwns » Post

mk

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [0.4.11-dev] Craig's Server

by ABJ » Post

gabo.xandre wrote:
jwpwns wrote:Is the server done? if it is il be making my own shortly
The server has been down a few days, but it will be back soon. Nothing to worry about.
How many?

User avatar
MarisD
Member
Posts: 16
Joined: Wed Apr 01, 2015 19:13
IRC: Clouds-Disabled
In-game: disableclouds enableclouds
Location: UK USA

Re: [0.4.11-dev] Craig's Server

by MarisD » Post

Hes probably, got to get money.
I'm disableclouds im mostly, best at C++ e.g. irc, im #2 owner in rnd's lab hopefully soon I'll have a server.

jwpwns
Member
Posts: 62
Joined: Sat Feb 08, 2014 22:22

Re: [0.4.11-dev] Craig's Server

by jwpwns » Post

MarisD wrote:Hes probably, got to get money.
for what? last i new it was hosted on his pc and he hasn't been on the forums since

Sat Feb 14, 2015 12:04 pm

User avatar
MarisD
Member
Posts: 16
Joined: Wed Apr 01, 2015 19:13
IRC: Clouds-Disabled
In-game: disableclouds enableclouds
Location: UK USA

Re: [0.4.11-dev] Craig's Server

by MarisD » Post

jwpwns wrote:
MarisD wrote:Hes probably, got to get money.
for what? last i new it was hosted on his pc and he hasn't been on the forums since

Sat Feb 14, 2015 12:04 pm[/qu. Getting money for hosting maybe.
I'm disableclouds im mostly, best at C++ e.g. irc, im #2 owner in rnd's lab hopefully soon I'll have a server.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: [0.4.11-dev] Craig's Server

by ABJ » Post

By the way Gabo is your server up as well? I'm missing my C-D friends so muchhhhhhhhhhhh. Last time I checked (it was way after C-D went down) it was down

Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests