[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Mapper DLL

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Mapper DLL
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Kairuni   (8 posts)  [Biography] bio
Date Fri 24 Sep 2010 10:46 PM (UTC)  quote  ]
Message
This is acceptable.
[Go to top] top

Posted by Fiendish   USA  (848 posts)  [Biography] bio   Global Moderator
Date Fri 24 Sep 2010 10:14 PM (UTC)  quote  ]

Amended on Fri 24 Sep 2010 10:15 PM (UTC) by Fiendish

Message
Kairuni said:
The source itself is released under the 'IDGAFWYDWI' License (Read: I Don't Give A F What You Do With It)


Do you mean the WTFPL?
http://sam.zoy.org/wtfpl/

http://aardwolfclientpackage.googlecode.com/
[Go to top] top

Posted by Kairuni   (8 posts)  [Biography] bio
Date Fri 24 Sep 2010 09:06 PM (UTC)  quote  ]

Amended on Fri 24 Sep 2010 09:09 PM (UTC) by Kairuni

Message
http://www.kairuni.com/mapper.zip
http://www.kairuni.com/mapper_source.zip

All SDL related licenses are in the mapper_source.zip
Source also has a lot of unused stuff!
maputil.cpp is ancient source code for a mapper dll that interfaced with a Game Maker program that I made several years ago, and unrelated.

The source itself is released under the 'IDGAFWYDWI' License (Read: I Don't Give A F What You Do With It)

Only works with ATCP MUDs, but should support non-ATCP things if someone writes a plugin to interface with the dll.

Off to do fun Navy things.

Instructions are included in the mapper.zip file. Please use an extractor that keeps folder structure intact.

Also, a number of things are -not- optimized, and could use it. Didn't have enough time to take care of this, myself.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Thu 09 Sep 2010 06:30 PM (UTC)  quote  ]
Message
GetWorldID().

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Kairuni   (8 posts)  [Biography] bio
Date Thu 09 Sep 2010 11:26 AM (UTC)  quote  ]

Amended on Thu 09 Sep 2010 11:47 AM (UTC) by Kairuni

Message
Twisol said:

In my experience you also need to trust the world that the plugin will run in.


Aye, apparently need to trust the world, too.

Almost time for me to leave, ATCP mapper's rather functional, but I didn't make a non-ATCP plugin due to a lack of time. Will be releasing the plugin + source code later today (Though it's not terribly impressive, I don't think! Could use a few optimizations as well.)

Is there an easy way to get the world's unique ID? I just have it set to trust all worlds at the moment.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sat 07 Aug 2010 06:46 AM (UTC)  quote  ]
Message
In my experience you also need to trust the world that the plugin will run in.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 07 Aug 2010 06:34 AM (UTC)  quote  ]

Amended on Sat 07 Aug 2010 06:37 AM (UTC) by Nick Gammon

Message
Quote:

Function 'package.loadlib' disabled in Lua sandbox - see MUSHclient global preferences

...

I checked 'Allow DLLs to be loaded', and restarted MUSH a few times.


There are a couple of issues here. Many people will recall that Microsoft have come in for quite a bit of sledging because their operating systems are perceived as having security flaws. Unfortunately, good security and ease-of-use are quite often opposing design goals.

Earlier versions of Windows tried to make things easy for the end-user, but in the process arguably introduced potential security problems. More recently things have been tightened up, but you now have the counter problem that if people get used to hundreds of security warnings (and clicking on "OK - get on with it") then the usefulness of the warnings tends to go away too.

In the case of MUSHclient, I didn't want to get into the minefield of releasing software that could be easily used to compromise the end-user's PC, so in the case of Lua (over which I had some control), there were two levels of security introduced:


  • The "sandbox" in its default configuration disabled various functions (such as os.remove) which could potentially cause a lot of havoc. This sandbox was designed so that individual plugins (and world files) could be "trusted" so that, if necessary, they could do things like open and write files.

  • The second problem was loading DLLs. A DLL (dynamic link library) by its very nature can execute anything at all (like, scanning all your directories, finding interesting files, and uploading them to some server). Thus the checkbox "Allow DLLs to be loaded" was introduced, so that if unchecked, no DLLs could be loaded. However if checked, then you still have the fallback of needing to trust the plugin.


The function package.loadlib (which loads DLLs) was one of the things sandboxed for an untrusted world or plugin.

So basically to load DLLs you need to do two things - allow DLLs to be loaded (the checkbox) and also to either trust that specific plugin, or all plugins (assuming the loading is done by a plugin).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Thu 05 Aug 2010 09:10 PM (UTC)  quote  ]
Message
The sandbox starts out with those three lines false, anyways. You'll want to either change the first two to true, or manually add the world and plugin IDs to the lists lower down.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Kairuni   (8 posts)  [Biography] bio
Date Thu 05 Aug 2010 09:01 PM (UTC)  quote  ]
Message
Nick Gammon said:

That message is not caused by the "allow DLLs to be loaded" checkbox. It is generated in the sandbox itself:


function MakeSandbox ()

  local function ReportDisabled (pkg, func)
     return function ()
       error (string.format (
        "Function '%s.%s' disabled in Lua sandbox - see MUSHclient global preferences",
        pkg, func), 2)
       end -- function
  end -- ReportDisabled 
...


Maybe you changed the first few lines to not trust worlds?


trust_all_worlds = false    -- change to true to trust all the worlds
trust_all_plugins = false   -- change to true to trust all the plugins
warn_if_not_trusted = false -- change to true to show warnings


Maybe you ran from a different directory, got the default global prefs, and that caused this? Check the Lua sandbox.


Installing 4.55 over the 4.54 install seems to have fixed the issue, though a friend of mine's still having it while testing this with me. I'll pester him to check if he has MUSH installed anywhere else?
Didn't edit the sandbox at all, though.
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Thu 05 Aug 2010 08:28 PM (UTC)  quote  ]
Message
Tsunami said:
Could you clarify?
Yes.

What do you mean by not every room? Do some rooms not send coordinate information?
Correct.

If not, for which rooms and why not?
The rooms where there is no MAP command output. The coordinates are used to draw the MAP; AFAIK there is no other use for them, and Achaean areas don't need to be Euclidian, as I can attest as I used to draw my own maps in Notepad.

Also, when you say Achaea mappers, I assume you mean the builders, not the players?
Yes.

Does this mean coordinates are not guaranteed to be unique, but are likely assigned automatically? Also, do coordinates operate on a per area basis?
They're assigned manually unless I'm quite mistaken; I've pointed out some issues in the distances between rooms in a few areas which were fixed promptly. Coordinates are pretty reliably unique per area however.

Answers in bold.

Tsunami said:
I'm not sure what you mean by some areas looking bad? In the pictures above, there are no unintended overlaps or edge crossings that I see. Things are a bit crowded, but thats an artifact of drawing, rather than the layout. Also, these is an extremely good initial layout for passing into the layout program I wrote a while ago (I think you saw the link from that thread on the Achaean forums?)

Whichever Immortal does the mapmaking seems to be unable to fit everything onto one "plane", so they move sections out of the way. It usually keeps things small, but it's also annoyingly ugly from a birds-eye view. The MAP has a fixed radius, so it's okay for that, but for birds-eye maps like the ones I made and for automappers, it's just not good.

It's definitely a good place to start, though.

Tsunami said:
For a game I haven't played in years now, Achaea still presents me some interesting programming problems, heh.

Hahah, I know what you mean :D

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Thu 05 Aug 2010 07:46 PM (UTC)  quote  ]

Amended on Thu 05 Aug 2010 07:51 PM (UTC) by Tsunami

Message
Kairuni said:

Not for every room. They're what the Achaea mappers set for the rooms, so some of them look really bad when the areas are set to what they actually are (See: Cyrene, Shallam, Hashan, Ashtan, the various forests, savannah, etc)


Could you clarify? What do you mean by not every room? Do some rooms not send coordinate information? If not, for which rooms and why not? Also, when you say Achaea mappers, I assume you mean the builders, not the players? Does this mean coordinates are not guaranteed to be unique, but are likely assigned automatically? Also, do coordinates operate on a per area basis?

I'm not sure what you mean by some areas looking bad? In the pictures above, there are no unintended overlaps or edge crossings that I see. Things are a bit crowded, but thats an artifact of drawing, rather than the layout. Also, these is an extremely good initial layout for passing into the layout program I wrote a while ago (I think you saw the link from that thread on the Achaean forums?)

For a game I haven't played in years now, Achaea still presents me some interesting programming problems, heh.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 05 Aug 2010 03:53 AM (UTC)  quote  ]
Message
That message is not caused by the "allow DLLs to be loaded" checkbox. It is generated in the sandbox itself:


function MakeSandbox ()

  local function ReportDisabled (pkg, func)
     return function ()
       error (string.format (
        "Function '%s.%s' disabled in Lua sandbox - see MUSHclient global preferences",
        pkg, func), 2)
       end -- function
  end -- ReportDisabled 
...


Maybe you changed the first few lines to not trust worlds?


trust_all_worlds = false    -- change to true to trust all the worlds
trust_all_plugins = false   -- change to true to trust all the plugins
warn_if_not_trusted = false -- change to true to show warnings


Maybe you ran from a different directory, got the default global prefs, and that caused this? Check the Lua sandbox.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kairuni   (8 posts)  [Biography] bio
Date Thu 05 Aug 2010 12:16 AM (UTC)  quote  ]

Amended on Thu 05 Aug 2010 03:43 AM (UTC) by Nick Gammon

Message
Not for every room. They're what the Achaea mappers set for the rooms, so some of them look really bad when the areas are set to what they actually are (See: Cyrene, Shallam, Hashan, Ashtan, the various forests, savannah, etc)

Twisol, however, is correct :) It's one of bits of ATCP information that's sent.


Having a perhaps minor issue, however! Loading the plugin works fine in MUSHClient 4.54, however when I try in 4.55:


Run-time error
Plugin: Achaea_ATCP_Mapper (called from world: rwr)
Immediate execution
[string "Plugin"]:152: Function 'package.loadlib' disabled in Lua sandbox - see MUSHclient global preferences
stack traceback:
        [C]: in function 'error'
        [string "Sandbox"]:39: in function 'loadlib'
        [string "Plugin"]:152: in main chunk
Error context in script:
 152*: assert (package.loadlib ("mapper.dll", "mapper_open")) ()

[WARNING] D:\MUSHClientT\worlds\plugins\Keegan_DLL\ach_atcp_mapper_.xml
Line   64: Error parsing script (Cannot load)


I checked 'Allow DLLs to be loaded', and restarted MUSH a few times. :(

Does work if I comment out the lines that disable loadlib, but.. D:
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Wed 04 Aug 2010 08:57 PM (UTC)  quote  ]
Message
Tsunami said:
Does achaea now give you their own coordinates for every room? That would also eliminate the problem of identifying similar rooms.


Yep. However, Achaea also provides the Room.Num message which gives you Achaea's own internal room ID number, so you don't really need workarounds.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Wed 04 Aug 2010 08:34 PM (UTC)  quote  ]
Message
Nice, I'll want to take a look at that. Does achaea now give you their own coordinates for every room? That would also eliminate the problem of identifying similar rooms.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


5,708 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]