TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#chat calls too soon?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Sun May 29, 2011 6:21 am    Post subject: #chat calls too soon? Reply with quote

Here's the beginning of the (original) file which tintin (on secondary window) loads at startup:
Code:
#chat {initialize} {4051}
#chat {name} {affects}
#chat {call} {127.0.0.1}


Here's occasional result of it, appearing on (seemingly) random pattern:
Code:
<CHAT> Attempting to
call @127.0.0.1.$
...

<CHAT> Failed to
call @127.0.0.1.$,
unknown host.


By merely moving the #chat call command at the bottom in the initiating file I was able to reduce the failures into level of nonexistant, as the chat initializing gains few vital microseconds more.


Last edited by F-3000 on Mon May 30, 2011 2:15 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun May 29, 2011 9:30 pm    Post subject: Reply with quote

I'm having a hard time reproducing this, in addition:

Code:

#chat {initialize} {4051}
#chat {name} {affects}
#chat {call} {127.0.0.1}

By default tintin connects to port 4050, as you initialize port 4051 the above code would never connect.

Code:

<CHAT> Attempting to
call @127.0.0.1.$

It's weird how there's a @ at the start and .$ at the end of the hostname.
Back to top
View user's profile Send private message Send e-mail
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Mon May 30, 2011 2:04 am    Post subject: Reply with quote

I'll throw the whole script here. (I also remodify this paste back to what it was)

Code:
#chat {initialize} {4051}
#chat {name} {affects}
#chat {call} {127.0.0.1}
#run telnet telnet
#var {time} {0}

#var affs {}
#var class {}

#NOP ACTIONS
#action {^<CHAT> FL chats to you, 'aff: %1'$} {@received{%1}}
#action {^<CHAT> FL chats to you, 'class: %1'$} {#var class %1;#system clear;#showme Waiting for affects...}
#action {^<CHAT> FL chats to you, 'refresh: %1'$} {@refresh{%1}}
#action {^<CHAT> Connection made to FL.} {#system clear;#showme Waiting for class info...}
#action {^<CHAT> Closing connection to FL@127.0.0.1.$} {#end}

#NOP GAGS
#gag {^<CHAT> Connection made to FL.}
#gag {^<CHAT> FL chats to you, 'refresh: }
#gag {^telnet>}


#NOP ALIASES
#alias {%*} {#NOP}


#NOP FUNCTIONS

#function {received}
{
   #script php ./fl/php/affects_trigger.php '%0';
   #script php ./fl/php/affects_shower.php '$affs' $class;
   #var {result} {#nop};
}

#function {refresh}
{
   #script php ./fl/php/refresh_affects.php pilkotus '%0';
   #script php ./fl/php/affects_shower.php '$affs' $class;
   #var {result} {#nop};
}


Might computer speed be factor here? I got laptop with 1.6GHz CPU.


Quote:
By default tintin connects to port 4050, as you initialize port 4051 the above code would never connect.

This is the secondary window. Main window got the default 4050, thus it's already in use. Second secondary window got 4052.

Code:
#chat initialize
#chat name FL
Code:
#chat initialize 4052
#chat name comms
#chat call 127.0.0.1



Quote:
It's weird how there's a @ at the start and .$ at the end of the hostname.

Sometimes there's just "..." in place of IP, sometimes nothing. But beforementioned is most common behavior.

Adding any delay before "call" seems to prevent this from happening.

"Recalling" does not work either, I succeeded to create a flooding "failed to call" loop.

Both secondary windowses had this (occasional) misbehavior before I moved the #chat call into bottom of file.

This behavior gained huge increase in frequency when I upgraded the Ubuntu distro from 9.10 to 10.4.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon May 30, 2011 10:29 am    Post subject: Reply with quote

I'll look into it when I got time. While at it you'd probably want to go ahead and change:

#script php ./fl/php/refresh_affects.php pilkotus '%0';

to

#script {php ./fl/php/refresh_affects.php pilkotus '%0'};

As I already changed #script to behave like a 2 argument command for the next release.

You might also want to consider using netcat instead of #chat for your 2nd and 3rd window.

You'd use: nc -lp 5051 in the status window, then you'd connect a session to it using for example: #ses window1 127.0.0.1 5051

Next you'd send updates using:

#window1 {#line substitute colors #send {<128>Hello <138>Window1}}

You'd probably want to create an alias for that:

#alias {window1} {#window1 #line substitute colors #send {%0}}

window1 <128>Hello <138>Window1
Back to top
View user's profile Send private message Send e-mail
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Tue May 31, 2011 3:24 pm    Post subject: Reply with quote

Scandum wrote:
you'd probably want to go ahead and change...

I changed all #script and #system commands then. Thanks for the notify. Smile

Scandum wrote:
You might also want to consider using netcat instead of #chat for your 2nd and 3rd window.

You'd use: nc -lp 5051 in the status window, then you'd connect a session to it using for example: #ses window1 127.0.0.1 5051

Next you'd send updates using:

#window1 {#line substitute colors #send {<128>Hello <138>Window1}}

You'd probably want to create an alias for that:

#alias {window1} {#window1 #line substitute colors #send {%0}}

window1 <128>Hello <138>Window1

Interesting option... Although, you'd call netcat with "nc -l 5051".

One good point with using #chat is, that you can use scripting on the other window as well. For mere log-type of view (i.e. echoing communications) it would work, but would it work for a(n affect) list that refresh every time an action hits in?
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue May 31, 2011 10:25 pm    Post subject: Reply with quote

On Cygwin the only way I can get it to work is with nc -lp, looks like nc -l works as expected on Linux systems.

As an alternative you could use: tt++ -e "#run nc nc -l 5051" which allows for additional tintin scripting.
Back to top
View user's profile Send private message Send e-mail
F-3000



Joined: 06 Dec 2010
Posts: 66
Location: Next to polarbear

PostPosted: Sun Jun 12, 2011 10:30 am    Post subject: Reply with quote

Scandum wrote:
#alias {window1} {#window1 #line substitute colors #send {%0}}

If it is #send {%0} within alias, then content that window1 receives is wrapped with {}. With #send %0 this does not happen.

And with alias, the colours do not preserve. Confused Not even if content after #window1 is wrapped inside {}.

Funny though, that if you use this...
Quote:
#window1 {#line substitute colors #send {<128>Hello <138>Window1}}
#send content must be wrapped, or it will print out wrong.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jun 12, 2011 10:38 am    Post subject: Reply with quote

The color codes contain semi-colons once translated to ANSI.

No idea why the braces are send along for you, doesn't happen for me.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group