Page 1 of 1

SendLuaUIMsg Question

Posted: 08 Dec 2008, 18:30
by very_bad_soldier
When I send the following string (9 bytes) via SendLuaUIMsg I end up getting 10 bytes back in the recvFunction. Is it a bug or am I doing anything wrong?
I tried to figure out why AllyCursors-Widgets isnt working anymore (I think since 0.77b5) and noticed this (IMO strange) behavior.

Code: Select all

local msg = "123456789"
Spring.Echo( "Sending: " .. msg:len() )
SendLuaUIMsg( msg,"allies")
Output:

Code: Select all

Sending: 9

Code: Select all

function widget:RecvLuaMsg(msg, playerID)
	Spring.Echo( "Receiving: " .. msg:len() )
end
Output:

Code: Select all

 
Receiving: 10

Re: SendLuaUIMsg Question

Posted: 08 Dec 2008, 18:43
by lurker
1. Check the changelog or mantis, then start getting really annoying in your calls for 0.78
2. What if you print each character? string.byte to help?

Re: SendLuaUIMsg Question

Posted: 08 Dec 2008, 18:55
by Peet
Probably a null-character or a newline.

Re: SendLuaUIMsg Question

Posted: 08 Dec 2008, 19:17
by jK
yup, it is a bug and it the reason why AllyCursors isn't working and why the corfus in CA still shows the sphere.
Just wait for the next release of spring.