Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Fri Apr 09, 2010 11:59 am   

[3.16b] Problems with MXP send #LAUNCH
 
EDIT: adding this to 1st post, as the initial problem wasnt the problem...

In another NEW cmudpro install... at connection window...

at command line...

#MXP %ansi( cyan)Lines in File%char( 32) %ansi( cyan): %ansi( white)%filesize(1) <send '#LAUNCH notepad.exe %concat("c:\cmudpro\aardwolf\info\area\",%zonenum(),"_info.txt")'>Edit</send> (aedit)

shows: Lines in File : Edit (aedit)

clicking "Edit" does nothing for me... so this thread should be "Problems with MXP send #LAUNCH" as that is the problem

all this doesnt really apply anymore...
Code:

the alias... aedit

#ALIAS aedit {notepad c:\cmudpro\aardwolf\info\area\%zonenum()_info.txt}

the alias... ainfo

[code]
#FILE 1 aardwolf/info/area/%zonenum()_info.txt
#FILE 2 aardwolf/info/aq/%zonenum()_aq.txt
#IF (%filesize(2) > 0) {aq_info_exists = "YES"} {aq_info_exists = "NO"}
#SHOW {}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#SHOW {%ansi( cyan)Area Name%char( 32)%char( 32)%char( 32)%char( 32)%char( 32) %ansi( cyan): %ansi( white)%replace( %replace( %zonename( %zonenum( )), "ZZ", "Z"), "Z: ", "") ~(%zonenum( )~)}
#MXP %ansi( cyan)Lines in File%char( 32) %ansi( cyan): %ansi( white)%filesize(1) <send "aedit">Edit File</send>%char( 32)~(aedit~)
#SHOW {%ansi( cyan)AQ Info Exists %ansi( cyan): %ansi( white)@aq_info_exists ~(aqinfo~)}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#IF (%filesize( 1) >= "1") {#LOOP %filesize(1) {#SHOW %read( 1, %i)}} {#SHOW No info in c:\cmudpro\aardwolf\info\area\%zonenum()_info.txt}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#SHOW {}
#CLOSE 2
#CLOSE 1
[/code]

alias from xml...

[code]
<alias name="ainfo" autoappend="true" id="492">
  <value><![CDATA[#FILE 1 aardwolf/info/area/%zonenum()_info.txt
#FILE 2 aardwolf/info/aq/%zonenum()_aq.txt
#IF (%filesize(2) > 0) {aq_info_exists = "YES"} {aq_info_exists = "NO"}
#SHOW {}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#SHOW {%ansi( cyan)Area Name%char( 32)%char( 32)%char( 32)%char( 32)%char( 32) %ansi( cyan): %ansi( white)%replace( %replace( %zonename( %zonenum( )), "ZZ", "Z"), "Z: ", "") ~(%zonenum( )~)}
#MXP %ansi( cyan)Lines in File%char( 32) %ansi( cyan): %ansi( white)%filesize(1) <send "aedit">Edit File</send>%char( 32)~(aedit~)
#SHOW {%ansi( cyan)AQ Info Exists %ansi( cyan): %ansi( white)@aq_info_exists ~(aqinfo~)}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#IF (%filesize( 1) >= "1") {#LOOP %filesize(1) {#SHOW %read( 1, %i)}} {#SHOW No info in c:\cmudpro\aardwolf\info\area\%zonenum()_info.txt}
#SHOW {%ansi( cyan)----------------------------------------------------------------------------}
#SHOW {}
#CLOSE 2
#CLOSE 1]]></value>
</alias>
[/code]

hit escape at the connection window, in a new area from a new map, with one room
>ainfo

Opened aardwolf/info/area/2_info.txt as file 1
Opened aardwolf/info/aq/2_aq.txt as file 2

----------------------------------------------------------------------------
Area Name      : test ( 2)
Lines in File  : 0 [u]Edit File[/u] (aedit)
AQ Info Exists : [u]NO[/u] (aqinfo)
----------------------------------------------------------------------------
Edit: [u]c:\cmudpro\aardwolf\info\area\2_info.txt[/u]
----------------------------------------------------------------------------

Closed C:\CMUDPro\aardwolf/info/aq/2_aq.txt on file 2
Closed C:\CMUDPro\aardwolf/info/area/2_info.txt on file 1

ran aedit alias manually... it opened in notepad, added one line with the word test...


Opened aardwolf/info/area/2_info.txt as file 1
Opened aardwolf/info/aq/2_aq.txt as file 2

----------------------------------------------------------------------------
Area Name      : test ( 2)
Lines in File  : 1 [u]Edit File[/u] (aedit)
AQ Info Exists : [u]NO[/u] (aqinfo)
----------------------------------------------------------------------------
test
----------------------------------------------------------------------------

Closed C:\CMUDPro\aardwolf/info/aq/2_aq.txt on file 2
Closed C:\CMUDPro\aardwolf/info/area/2_info.txt on file 1

these are the only 2 aliases in system, ainfo & aedit, the MXP links are showing, but clicking on them, or right clicking and choosing the option in the menu does nothing. CTRL-M formatting also messes these up as it turns  %zonenum() into %zonenum( ) which puts a space in the mxp file link

these aliases work fine in zmud, and are very important to me, it's where i keep all kinds of info, currently the text files hold well over 2MB of text in total...

is this a bug? or what?


Last edited by Private on Sat Apr 10, 2010 2:05 pm; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Apr 09, 2010 2:54 pm   
 
Do you have the preference "Allow commands in MXP menus" enabled in your MXP Preferences?

I just tried your aliases here and when I click the "Edit File" link, it displays:

notepad c:\cmudpro\aardwolf\info\area\1_info.txt

on the screen. Either when I run "aedit" manually or if I click the link. Both work here.

Also, if you are trying to actually launch notepad, then you probably need to use the #LAUNCH command, right? Or do you have another alias on your system called "notepad" that does this?

And yes, the Ctrl-M formatting adds spaces to function arguments. You are using something left over from zMUD called "implicit concat" which can cause problems. In CMUD you should be using a stricter syntax for your aedit alias like this:
Code:
#ALIAS aedit {notepad %concat("c:\cmudpro\aardwolf\info\area\",%zonenum(),"_info.txt")}

and the the space added by Ctrl-M won't have the side effect of adding a space.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Apr 10, 2010 10:47 am   
 
yes, alias for notepad...

#ALIAS notepad {#LAUNCH {notepad.exe %-1}}

changed the aedit alias to use concat

Allow commands in MXP menus = checked already

aedit manually works, clicking the Edit File link does nothing, right click edit file, choosing from memnu does not either.

clicking "NO" in AQ Info Exists : NO (aqinfo) works... wierd right?

i use mxp links ALL over the place, this is the only one so far that aint working

>mobfind A disrespectful changeling
Finding: A disrespectful changeling...

Name: A disrespectful changeling Level: 152 Align: evil
Room: A Wagon-encircled Menagerie SW: 43681 go
Area: The Gathering Horde
Notes: none

the SW: 43681 correctly displays path when clicked, the "go" correctly runs to the room when clicked

You still have to kill 1 * the halfling (Anthrox).

can click to lookup mob or runto area...

MXP links just work... this confuses me :P
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Apr 10, 2010 10:53 am   
 
ok, i went into the line below Edit File that sends aqinfo, it worked

i changed the command it sends from 'aqinfo' to 'aedit', and it broke it

made a new root class, 12345

made an alias in it, alias1

copied the contents from ainfo into alias1... it worked.. wtf?

it worked cause i had disabled the class with the original aliases in it...

as soon as i recreated new aedit (renamed to alias2) in the 12345 class which was enabled... clicking was broke again

if i delete or disable the aliases that send trys to send... the clicking works... kinda like what %eval(10+10) was doing when i had a 20 alias

with aedit alias disabled, typed ainfo... then cliked in the link to aedit...



going to try on a clean session with only those 2 aliases... ainfo & aedit...

ok, new session, created manually, AreaInfo, then area_info classes...
created ainfo alias... works, sends bad command to mud of "aedit" on click.
created aedit alias... works, sends bad command to mud of "notepad c:\cmud\aardwolf\info\area\196_info.txt"
created notpad alias... contents: #LAUNCH {notepad.exe %-1}

Clicking Edit at this point sends nothing...

altered notepad alias to: #SHOW LAUNCH {notepad.exe %-1}

Clicking edit shows: LAUNCH {notepad.exe %-1}

changing to #LAU, #LAUN, #LAUNC sends to mud... i guess this command cant be abbreviated

MXP used to be ok with #LAUNCH... is it not anymore?

cmud pro installed to c:\cmud with settings stored in c:\cmud under XP

re-imported all XML, same thing, so it wasnt a corrupted setting on my end

heh, even changed the notepad alias to Perlscript,

$sess->ProcessCommand("#LAUNCH notepad.exe " . $zvar->Param1 . "");

no go,

$sess->ProcessCommand("#SHOW LAUNCH notepad.exe " . $zvar->Param1 . "");

works

Edit:
In another NEW cmudpro install... at connection window...

at command line...

#MXP %ansi( cyan)Lines in File%char( 32) %ansi( cyan): %ansi( white)%filesize(1) <send '#LAUNCH notepad.exe %concat("c:\cmudpro\aardwolf\info\area\",%zonenum(),"_info.txt")'>Edit</send> (aedit)

shows: Lines in File : Edit (aedit)

clicking "Edit" does nothing for me... so this thread should be "Problems with MXP send #LAUNCH" as that is the problem
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Apr 12, 2010 4:54 pm   
 
Confirmed. I'll take a look at this, but I'm pretty sure the issue is that CMUD is preventing the #LAUNCH command from running via MXP because you'd NEVER want the MUD to be able to execute the LAUNCH command and allow it to execute code on your computer. It's possible this security issue was extended to *any* use of the SEND tag, even when used locally.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Apr 20, 2010 7:17 am   
 
I found a workaround past MXP security and #LAUNCH...

#MXP <send '#SHOW Editing info for %concat("c:\cmudpro\aardwolf\info\area\",%zonenum(),"_info.txt")'>Edit</send>

then make a trigger for: ^Editing info for (*)$
have this trigger do: #LAUNCH notepad.exe %1
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Apr 20, 2010 3:39 pm   
 
Clever :) See, there is always another way to do almost anything. If this was IE, I'd have to patch that as a security flaw ;)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Fri Apr 23, 2010 7:22 pm   
 
uhm... you are gonna fix this aint you? hopefully before you decide to make everyone pay again :P

having a trigger with MXP in it to send text just so another trigger can send a command seems rather shody to me.

would rather just be able to create the send sub todo what i want it todo in the 1st place... past #LAUNCH had the same issue trying todo an MXP sql_delete_mob alias... it does a "DELETE FROM mob where id=%1" ... dont work with MXP... SELECT's do... but any command that writes to the db fail... i can run sql_delete_mob X from command line or through that workaround trigger... but having 2 triggers todo one thing blows.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Apr 24, 2010 5:19 pm   
 
Quote:
uhm... you are gonna fix this aint you? hopefully before you decide to make everyone pay again :P

Yes, it's on the bug list, but probably not for the next version. And the 2.x version line is frozen, so any changes will occur in the 3.x line. This is a tricky issue to fix and I'd rather err on the safe side rather than opening up a security hole that would allow the mud to execute applications on your local machine via mxp somehow.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Oct 20, 2012 10:31 am   
 
And again, 2 years later, more money spent... new version 3.34... "Yes, it's on the bug list, but probably not for the next version." still don't work as expected :(
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net