|
|
Member
Total posts: 21
Joined: Oct 25, 2011
|
Hi!
I try to modify charscript.
For example:
- random() function behavior
- buffers size related to MAX_JUMP_OFFSET definition (BTW why is it =6083?)
- маке other kind of session (like http-bind in xmpp)
I use VS2010Express (not free 2005 because __VA_ARGS__ not supported)
I have some questions to developers. Please answer if it possible.
1) Why dont you use STL? Mainly for string handling
2) I found XMPPmain defined in mainSystem.cpp, but no sources. Does it exists?
3) What is the best way to implement long-polling session (lile http-bind in xmpp)
4) What does it mean “Bad UTF-8 in…” in ReadALine(...) of textUtilites.cpp?
I have got it just compiled without modifications and run locally on the same machine client and server. I have Window7.
Thank you.
|
|
|
|
|
Posted: Oct 25, 2011 |
[ # 1 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
MAX_JUMP_OFFSET is tied to how the system internally stores and uses jump offsets.
A topic is a collection of rules. Each rule is preceeded by a jump offset to allow one to jump past that rule to the next one (an optimization over having to scan to get past the rule). The system uses 2 bytes to hold that offset, but the 2 bytes must be legal characters and decode is kept simple. So that gives that limit. And since in general I think a rule that goes significantly above that is getting complicated, I have been happy with it. What issues do you have with it?
Why not use STL? I like to maintain complete control over all memory allocation.
XMPPmain is not supported for a release to the world. I sometimes use the system in conjunction with XMPP, hence the ability to add sources to do so.
BAD-UTF-8— currently ChatScript only supports plain ascii. The system detects characters outside of it, warns you, and revises the code.
I don’t know what “long-polling session” really implies so I can’t currently comment.
|
|
|
|
|
Posted: Oct 25, 2011 |
[ # 2 ]
|
|
Member
Total posts: 21
Joined: Oct 25, 2011
|
My trouble with MAX_JUMP_OFFSET is text response count limitation on given rule…
So if applicattion support only ascii it means app doesn’t work on Linux (on my used utf-8), am I right?
What is minimal changes I need to do to get it work on Linux?
“Long pooling session” - maybe I am use not well correct.
My API will be like XMP(JSON)-RPC. No long live session.
Only requests from time to time. Each request open and close socket connection.
|
|
|
|
|
Posted: Oct 25, 2011 |
[ # 3 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
Currently the system works on Linux as is. But it does not support foreign words particularly. And as a server on linux is already has no long-lived session. It opens and closes a socket for each input from a user. It DOES maintain a file to track each specific user’s state which it loads, uses, then writes with each volley.
As for text response. You are saying that you want to output more than 6000 characters in an answer to a user?
I could make sure it was easy to change this limit.
|
|
|
|
|
Posted: Oct 28, 2011 |
[ # 4 ]
|
|
Member
Total posts: 21
Joined: Oct 25, 2011
|
I make fix in csocket.cpp, it was mistake with strcpy into inputFeed buffer
static void* MainChatbotServer()
{
...
while (1)
{
ServerGetChatLock();
// chatlock mutex controls whether server is processing data or client can hand server data.
// That we now have it means a client has data for us.
// we own the chatLock again from here on so no new client can try to pass in data.
// CLIENT has passed server in globals: clientBuffer (ip,user,bot,message)
// We will send back his answer in clientBuffer, overwriting it.
char ip[MAX_WORD_SIZE];
char user[MAX_WORD_SIZE];
char bot[MAX_WORD_SIZE];
char* p = clientBuffer; strcpy(ip, p);
p = p + strlen(p) + 1; strcpy(user, p);
p = p + strlen(p) + 1; strcpy(bot, p);
p = p + strlen(p) + 1; strcpy(inputFeed, p);
...
|
|
|
|
|
Posted: Oct 28, 2011 |
[ # 5 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
Right, thanks. That was already found and fixed in the recent 1.26 release.
|
|
|
|
|
Posted: Dec 23, 2011 |
[ # 6 ]
|
|
Member
Total posts: 20
Joined: Oct 28, 2011
|
Is there any way to change size limitation of responses on a given rule? I need to provide a wide variety of answers for one question. I get errors by exceeding of the size, the last one was “In topic ~unknown-topic missing colon for responder t - look at prior responder for bug”.
btw when I exceed size for one symbol - system freezes.
|
|
|
|
|
Posted: Dec 23, 2011 |
[ # 7 ]
|
|
Member
Total posts: 21
Joined: Oct 25, 2011
|
really I don’t understand formula of 6083
As I understand Bruce want readable form of offset. That is why he use / 75, % 75 in Encode(), Decode() function,
but why 75?..
Bruce, can you explain your method?
I need increase number variants of responses too.
If we needn’t debug script compiledecompile functionality we can use more simple form of storage offsets? For example in 4 bytes (printable) or in binary.
|
|
|
|
|
Posted: Dec 23, 2011 |
[ # 8 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
Actually, it could probably go to 77, but that wont help you. The limitation is on available printable simple ascii characters that don’t conflict with other uses by the system.
I can modify the engine to use a 3-byte jump offset instead of a 2-byte one. And I could make that compile switchable. So I will do that. Probably this weekend.
Can you give me an example of a responder you want which is larger than it can handle?
As for :“In topic ~unknown-topic missing colon for responder t - look at prior responder for bug”.
This says you have a script bug. that in the responder before you failed to make it correctly, probably leaving out a colon.
|
|
|
|
|
Posted: Dec 23, 2011 |
[ # 9 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
Bruce, this weekend is Christmas. I’m sure everyone here would understand if you put it off for a few days.
Enjoy your holiday.
|
|
|
|
|
Posted: Dec 24, 2011 |
[ # 10 ]
|
|
Senior member
Total posts: 974
Joined: Oct 21, 2009
|
Dave Morton - Dec 23, 2011: Bruce, this weekend is Christmas. I’m sure everyone here would understand if you put it off for a few days.
Enjoy your holiday.
Oh no no no no no…. you work right threw xmas and new years… 24 hours a day until it is fixed Bruce…
kidding…. no, listen to Dave… it is enough you have provided a lot of free software for everyone.. time to relax
|
|
|
|
|
Posted: Dec 26, 2011 |
[ # 11 ]
|
|
Member
Total posts: 20
Joined: Oct 28, 2011
|
Look, I have a set of responses for some rule, for example
u: ( test )
[ This is first answer. ]
[ This is second answer. ]
[ This is third answer. ]
[ This is fourth answ ]
And it works fine. When I add single character into one of answers, for example
u: ( test )
[ This is first answer. ]
[ This is second answer. ]
[ This is third answer. ]
[ This is fourth answe ]
- system freezes.
When I add one more character (or couple, it does not matter) into any response:
u: ( test )
[ This is first answer. ]
[ This is second answer. ]
[ This is third answer. ]
[ This is fourth answer. ]
- I have the above error. (“missing colon for responder”)
I can’t understand, why error occurs only when having some length.
|
|
|
|
|
Posted: Dec 26, 2011 |
[ # 12 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
I presume the example you give is not a literal one, since it is nowhere near size limits.
To debug your situation, I would need actual data, INCLUDING seeing the responder before this one.
Could you email me the file involved? gowilcox at gmail
|
|
|
|
|
Posted: Dec 27, 2011 |
[ # 13 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
I will be expanding the size of responders, but you and victor should also read the new topic on Multiple Personality Syndrome for some coding suggestions.
|
|
|
|
|
Posted: Dec 29, 2011 |
[ # 14 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
new version up, extends the size range of a responder
|
|
|
|
|
Posted: Dec 30, 2011 |
[ # 15 ]
|
|
Member
Total posts: 20
Joined: Oct 28, 2011
|
Thanks very much, but I’ve noticed that legal topic size remains the same. Is it possible to change it? Sometimes it is inconvenient to split topics.
|
|
|
|