[Mod] Node ownership [node_ownership]

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

jachoo wrote:I'm still working on upgrading my "clans" fork to 0.4. It has new block borderstone, by which you can own a 16x16x16 terrain block. IMO much better than any gui or chat commands.

Check this thread in a few weeks.
Glad to know your still workin on this:D borderstones are genius.
Keep calm and code python^_^

User avatar
Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

Hi Death Dealer,

Can you explain how to make a work this mod because i have really need.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

randomproof wrote:
robin wrote:Great idea, but i personally would like to see that with a cornerstone-block and a sign instead of the commands.
I don't like the idea of an actual cornerstone-block. You need to points to define a 3d area so you would need two blocks and one would be floating in the air. I wanted a 3d area because you would want to protect area just above and below an area without having to protect any caves deep underneath. Also, it is just easier to code.

I also had the idea of making a mod that would use this mod and automatically assign a new player a plot when they first joined a server.
Hey that's seriously a great idea. Auto assigning plots to players new to your server, ya awesome
Keep calm and code python^_^

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

Utilisatrice wrote:Hi Death Dealer,

Can you explain how to make a work this mod because i have really need.
Ya know I didn't understand at first either. But ya know what I did? I went to the page I downloaded it from and read it again. It explains everything on his post. Find it
Keep calm and code python^_^

User avatar
Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

No, when I download the file init.lua and I start the game, and bah its not working.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Gatharoth wrote:
randomproof wrote:Yes, the client software assumes that the dig happens when it sends the request to the server and there is no way for my mod to tell the server to tell the client that this action didn't complete. The functionality is in the server (it is used when you try to dig something too far from the player) but the server is not checking to see if a mod aborted the function.

Question, do you think forcing a node_update would "fix" this problem?

Edit: Never mind. Tried it, and it didn't work.
The server does something like this when you try to dig something too far away from you. You just need to see how it does that and replicat it. I'd look myself now but I'm away from my computer with minetest on it.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Utilisatrice wrote:No, when I download the file init.lua and I start the game, and bah its not working.
There should be a diff for the buildin.lua file but I seem to have lost it off the first post. I will see if I can find it or remake it.

EDIT: Here it is.
Last edited by randomproof on Thu Mar 01, 2012 16:04, edited 1 time in total.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

OK, I updated the extra diffs to the first post.

User avatar
Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

Just to be clear, does this mod work without the patches to builtin.lua and server.cpp?
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Temperest wrote:Just to be clear, does this mod work without the patches to builtin.lua and server.cpp?
The patch to builtin.lua is necessary, but the one to server.cpp is not exactly so.

The patch for builtin.lua allows the mod to override the server calling 'minetest.node_dig' and 'minetest.item_place'. Mainly this is needed for dugging so that it can check permission on the node before a player removed it from the map. Without this the only thing the mod could do if to put the node back after an unauthorized player removed it. This would cause the node to lose all of its metadata, such as sign text.

EDIT: That said I haven't figured out exactly how to prevent someone from changing a sign's text.

Without the server.cpp patch players will see nodes disappear when they dig them, but on the server they will not be removed if they don't have permission. The patch resends the mapblock to the client so they see it there again. In other words the client assumes that the dig function succeeds and therefore removes the node from its memory immediately so the server must tell the client to put it back, and that is what that patch does.
Last edited by randomproof on Fri Mar 02, 2012 23:21, edited 1 time in total.

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Post

Why does the server.cpp patch modify the punch action (0) and not the dig action (2)? It makes no sense to me.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

kahrl wrote:Why does the server.cpp patch modify the punch action (0) and not the dig action (2)? It makes no sense to me.
Your are right. I made the patch origianally and then lost it and had to recreate it and I put it in the wrong place. I have updated the patch.
Last edited by randomproof on Fri Mar 09, 2012 16:36, edited 1 time in total.

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

by RAPHAEL » Post

Could someone update this mod for latest dev?
"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
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

The only thing that should need updating is the two diffs. Shouldn't take too long...Done
Last edited by randomproof on Wed Mar 21, 2012 21:58, edited 1 time in total.

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

by RAPHAEL » Post

randomproof wrote:The only thing that should need updating is the two diffs. Shouldn't take too long...Done
I have never used patch or diff files but did the following (based on googling) and it failed.

patch builtin.lua diff.diff
patching file builtin.lua
Hunk #1 succeeded at 359 with fuzz 1.
Hunk #2 FAILED at 385.
Hunk #3 FAILED at 436.
Hunk #4 FAILED at 454.
3 out of 4 hunks FAILED -- saving rejects to file builtin.lua.rej
"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
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Hmmm... not sure why that would happen. I edited a stock builtin.lua file. I'll add a download for the edited files, it is just that it can be a pain to keep them up-to-date.

User avatar
sfan5
Moderator
Posts: 3889
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

RAPHAEL wrote:
randomproof wrote:The only thing that should need updating is the two diffs. Shouldn't take too long...Done
I have never used patch or diff files but did the following (based on googling) and it failed.

patch builtin.lua diff.diff
patching file builtin.lua
Hunk #1 succeeded at 359 with fuzz 1.
Hunk #2 FAILED at 385.
Hunk #3 FAILED at 436.
Hunk #4 FAILED at 454.
3 out of 4 hunks FAILED -- saving rejects to file builtin.lua.rej
The Patch is outdated
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

I applied the patch by hand, I found all the correct lines, but it didn't function properly afterwards. The game loaded I type in the set_owner command, then list_area's it listed the area then said list_area invalid command and other players could still remove blocks and place them and everything.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

I'll take a closer look when I get some time.

Edit: Everything seems to be working on my sample server. I did fix a bug with the /list_areas command. I left out the 'return true' that told the server that my mod handled the command so it gave the error with that, but it still worked. It should be noted that players will still see nodes disappear, but, if you installed the server.cpp patch correctly, they should see the node reappear and they should see a chat message that they are not allowed to dig there.
Last edited by randomproof on Sun Mar 25, 2012 01:02, edited 1 time in total.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

Ok, glad to hear it. Do I patch server.cpp before or after compilation?

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

I am experiencing difficulty understanding this... players can only own a straight or diagonal line between two point? A single block line straight up would be 0,0,0 0,100,0 that would be one chat command then, 1,0,0 1,100,0, a single block line straight up next to the previous. I would have to keep doing this over and over again 64 times to own a square area 16x16 that was 100 blocks high. For just the height I would have to issue a command for each block of the wall? That would be very tedious especially considering you would have to have the debug version to get coordinates anyway.
EDIT: I think I understand, if your coordinates are kitty-corner. you would then own the a square, 0,0,0 to 16,16,16 would give 16 blocks left to right front to back ground to roof, but would you own 1,16,1? I got another question would if give you every possible combination 0-16, 0-16, 0-16, or would if you the shortest distance between the two points?
Would the ownership look like this. Does it work like checkers the game or mouse drag selection box?
____ or this ___
/ \ | |
/ \ | |
Last edited by bgsmithjr on Sun Mar 25, 2012 14:57, edited 1 time in total.

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Your right about owning the cube between the two points. The math is some much easier if the spaces are aligned along the grid of the map.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

Why didn't you just copy the init lua section for what happens when a player without build privileges tries to remove a node. I don't think you need to patch the server.cpp

User avatar
randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

bgsmithjr wrote:Why didn't you just copy the init lua section for what happens when a player without build privileges tries to remove a node. I don't think you need to patch the server.cpp
Because there is no such section unless something had changed in the last few days. I'm in the process of moving and my computers are not set up do I can't check right now. By the way the server.cpp patch was copied from the part that handles players without build privs.

User avatar
Menche
Member
Posts: 997
Joined: Sat Jul 02, 2011 00:43
IRC: Menche
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

I tried this on my server. Players can only define areas for themselves, setting for other players doesn't work. The .diff files don't seem to patch properly on the latest version.
EDIT: Mistake, it works fine, and without the patches, seems the other player has to be online. Can it be fixed so you can assign property to players while they're offline?
Last edited by Menche on Thu Jun 28, 2012 05:03, edited 1 time in total.
An innocent kitten dies every time you top-post.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest