[Mod] Raspberry PI MC API for Python code [raspberryjammod]

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Tue Oct 30, 2018 02:37

have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.
 

User avatar
rubenwardy
Moderator
 
Posts: 5670
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by rubenwardy » Tue Oct 30, 2018 02:41

GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Tue Oct 30, 2018 20:45

rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled


My mistake...so specifying this as "true" worked on one machine (oddly)... on another machine it only works with security disabled... which is a BAD idea for sure... but with security enabled I get a "require() is disabled" message. any ideas how to get around that?

This is on the latest 5.0.0dev on linux.
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Wed Oct 31, 2018 02:06

cvincross wrote:
rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled


My mistake...so specifying this as "true" worked on one machine (oddly)... on another machine it only works with security disabled... which is a BAD idea for sure... but with security enabled I get a "require() is disabled" message. any ideas how to get around that?

This is on the latest 5.0.0dev on linux.


Again...my mistake... I just confirmed I can't get either machine to work with security turned on... so both return the error about require() being disabled by security. Any help would be appreciated. Does turning off security pose a serious security risk if it is being used as a self hosted single player session - ie without the server enabled?
 

User avatar
rubenwardy
Moderator
 
Posts: 5670
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by rubenwardy » Wed Oct 31, 2018 02:46

You need to change `require` this:

Code: Select all
local old_require = require
require = ie.require

local socket = require("socket")
-- any other sockets

require = old_require
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Wed Oct 31, 2018 04:03

rubenwardy wrote:You need to change `require` this:

Code: Select all
local old_require = require
require = ie.require

local socket = require("socket")
-- any other sockets

require = old_require


Ok, I am probably doing this wrong... but I made the above change to the init.lua of the mod and I'm not getting it to work. Am I wrapping just the socket "requires" with this redefinition or all of them? - there are three others that are not "sockets" sprinkled throughout the script. I'm not really clear on what this is accomplishing though...since the calls are already ie.require before I redefine require to be ie.require. please excuse my ignorance. Anyway... when I do this I end up with an error about attempting to index a nil value for "ie" - the same error I get if I don't include the mod in secure.trusted_mods
 

hyan
New member
 
Posts: 3
Joined: Sat Dec 15, 2018 13:31

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by hyan » Sat Dec 15, 2018 13:55

[Can't connect to server--SOLVED]
Hi, I am trying to apply this great mod to python programming education, and I think I would be fun with multi-player.
I have tested this mod on linux Ubuntu 18.04 with single-player and multi-player on the same machine.
But I have some problem with multi-player on different machines. I have a PC and a laptop both running Ubuntu 18.04 and both can run this mod in single-player mode.
Now I have PC as server and laptop as client, laptop can connect to server and play the game, but cannot use the mcpi api to connect to server.
If I enter the following in the laptop python ternimal:
Code: Select all
mc = Minecraft(connection=Connection("192.168.1.90",30000))    # try connecting to server

I get an error:
Code: Select all
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "connection.py", line 37, in __init__
    self.socket.connect((address, port))
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused


Is there anything I have done wrong? Dose anyone successfully tried this mod on different machines playing multi-player?

Oh, forgot to mention, I using Minetest 0.4.16, lua5.1


----------------
[edit]:
now I have solved the above problem:
Code: Select all
mc = Minecraft(connection=Connection("192.168.1.90",30000))
# this is wrong way to connect to the api server, which is on a defferent port(default to 4711) than the minetest server

the right way is to set
Code: Select all
restrict_to_local_connections = false
in the settings.conf file(already set to false by default)
and do this on the client terminal:
Code: Select all
export MINECRAFT_API_HOST='your server address'
export MINECRAFT_PLAYER_NAME='your player name'

notice:
there are some differences between the links below, I don't know which is newer. my test is done with git cloning the 2nd link, and extracted the raspberryjammod folder. exporting MINECRAFT_PLAYER_NAME in ternimal might not be working with the source code in the 1st link.
https://github.com/arpruss/raspberryjam ... t/releases
https://github.com/arpruss/raspberryjammod-minetest

now It is fully functional even in multi-player mode on linux(ubuntu)! thanks again to the author!
 

zargulthewizard
Member
 
Posts: 220
Joined: Wed Jul 26, 2017 18:10
In-game: zargul

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by zargulthewizard » Sun Dec 16, 2018 03:23

rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled



Still getting the le nil value error. Using 0.4.17
May God be with you, always.
 

hyan
New member
 
Posts: 3
Joined: Sat Dec 15, 2018 13:31

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by hyan » Sun Dec 16, 2018 03:51

zargulthewizard wrote:
rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled



Still getting the le nil value error. Using 0.4.17

doesn't work for me either, so I just set security to false
 

zargulthewizard
Member
 
Posts: 220
Joined: Wed Jul 26, 2017 18:10
In-game: zargul
 

hyan
New member
 
Posts: 3
Joined: Sat Dec 15, 2018 13:31
 

zargulthewizard
Member
 
Posts: 220
Joined: Wed Jul 26, 2017 18:10
In-game: zargul

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by zargulthewizard » Mon Dec 17, 2018 03:34

Well...
rubenwardy wrote:Don't touch this setting! Mod security should never be disabled

I don't really play online...
rubenwardy wrote:Mod security should never be disabled

Or use any really risky mods...
rubenwardy wrote:never be disabled
May God be with you, always.
 

zargulthewizard
Member
 
Posts: 220
Joined: Wed Jul 26, 2017 18:10
In-game: zargul

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by zargulthewizard » Sat Dec 22, 2018 04:10

I disabled it. The good news is the ie nil value error is gone. The bad news is during server creation Minetest crashed completely with no error report or anything.
May God be with you, always.
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 8 guests