|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Wed Aug 11, 2010 12:17 am
[322aB] Unexpected behavior of COM string list transmission by CMUD |
In the past I have been able to send a string list across a COM connection by treating it as a string. It would arrived as "|"-separated string. Now, however, that scheme doesn't work. The far end receives a "0" as the value. However, when I send the string list as a JSON string, it arrives successfully. This is fine as far as it goes, but it does entail submission of the string to the JSON decoder which is much slower than just splitting the string into an array. As a related note, I also have had problems sending simple strings if they are declared as auto-type. These types of strings will also arrive as a "0". Changing the type to "string (expanded)" fixes the problem. It could be the case that this is the problem with the string lists, however, I strongly type them before using them so they are declared explicitly as lists.
EDIT: Instead of (manually) changing the variable type I am using %string( @var), and that seems to be working OK. Still, it seems to me I shouldn't have to do this. After all, the variable is already a string. |
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Aug 11, 2010 4:14 pm |
Show me the exact COM command you are trying to use with your list so I can try to reproduce this. As always, I need the specific code that isn't working to help.
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Aug 12, 2010 1:57 am |
Here is the code for the script:
Code: |
<alias name="invsub" id="1965">
<value>#STATE invtrig1 0
;;
#T- invtrig1
;;
#IF (@invflag = 1) {#EXIT}
;;
#CALL @comdsk.loadInventory(%json( @invlist), %string( @Username))</value>
</alias>
|
Here are the variables:
Code: |
<var name="Username" usedef="true" id="109">
<value>Anaristos</value>
<notes>Current user logged on to this mud.</notes>
</var>
|
Code: |
<var name="invlist" type="StringList" id="1494">
<value>394171942,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0|394171941,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0|394171940,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0</value>
<json>["394171942,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0","394171941,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0","394171940,HMG,@RD@wo@Wc@Dt@wr@Wi@Dn@we @Wo@Df @wD@Di@wv@Wi@Dn@we @WR@Di@wg@Wh@Rt@w,60,8,1,-1,-1,0"]</json>
</var>
|
|
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Aug 12, 2010 4:37 pm |
But is that the version that works or the version that doesn't work? I thought you said using %json worked. So please make sure you show the version that isn't working.
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Fri Aug 13, 2010 1:09 am |
That was the version that works. The only difference between that one and the one that doesn't work (this one), is the function calls withing the parameter list.
Code: |
<alias name="invsub" id="1965">
<value>#STATE invtrig1 0
;;
#T- invtrig1
;;
#IF (@invflag = 1) {#EXIT}
;;
#CALL @comdsk.loadInventory(@invlist, @Username)</value>
</alias>
|
With this alias, the far end receives "0" for each parameter. |
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 13, 2010 4:07 pm |
OK, that's what I was looking for. I'll take a look at it, but it might be a couple of weeks before I get to this one. Still haven't started on the next version yet.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Aug 18, 2010 8:10 pm |
I could not reproduce any problem with passing normal auto-type strings, but I found the problem when using string lists and have it fixed for the next version.
|
|
|
|
|
|
|
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
|
|