User Control Panel
Advertisements

HELP US, HELP YOU!

Net::MSN
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Bot Depot Forum Index -> MSN Protocol modules
View unanswered posts
Author Message
Rhombz
Newbie
Newbie


Joined: 21 Feb 2005
Posts: 14

Reputation: 15

PostPosted: Tue Feb 22, 2005 2:03 am    Post subject: Reply with quote

Thanks for that.. this is what i have defined in ClientID.pm

Code:
<br />  # Binary Values<br />  use constant BV_WINDOWS_MOBILE  => 0x01;       # Windows Mobile Device<br />  use constant BV_RESETTING       => 0x02;       # Unsure (some say resetting)<br />  use constant BV_VIEW_INK        => 0x04;       # Can View Ink msgs<br />  use constant BV_CREATE_INK      => 0x08;       # Can Create Ink msgs<br />  use constant BV_HAVE_WEBCAM     => 0x10;       # Have a webcam<br />  use constant BV_MULTI_PKT_MSG   => 0x20;       # Multi-Packet Messages<br />  use constant BV_MSN_MOBILE      => 0x40;       # MSN Mobile Device<br />  use constant BV_MSN_DIRECT      => 0x80;       # MSN Direct Device<br />  use constant BV_MSN_WEB         => 0x100;      # Web-Based MSN<br />  use constant BV_DIRECT_IM       => 0x4000;     # Can send direct (no SB)<br />  use constant BV_CAN_WINK        => 0x8000;     # Can send/recieve winks<br />  use constant BV_MSNC1           => 0x10000000; # MSN 6.0<br />  use constant BV_MSNC2           => 0x20000000; # MSN 6.1<br />  use constant BV_MSNC3           => 0x30000000; # MSN 6.2<br />  use constant BV_MSNC4           => 0x40000000; # MSN 7.0 (BETA)<br />


if you say MSNC5 is 0x40000000 (1073741824) - what is MSNC4 ? or isnt there one?


Anyway my game plan is as follows:
  • Convert code to MSNP10
  • Implement Net::MSN::MSNObj (to create msn objects)
  • Implement sending of MsnObj in CHG
  • Add support for P2P (which to test is best with the fore mentioned items implemented)
  • Add file sending/receiving support
  • Add multi-packet messaging (checking their clientid - and falling back to breaking the message up or some such)
is UUX direct ip to ip talk? or something else? (That would be cool to avoid the MSN SwitchBoard logs).

Rhombz
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Tue Feb 22, 2005 2:12 am    Post subject: Reply with quote

Oh my bad didn't even notice. Razz

That all seems like a good idea but theres one small problem with the multi-packet messaging. That is in order to check they're client ID they need to be on your list which has a limit of 250 people I'm not sure how your going to code it if your going to make the protocol add people to the bots list or just make it add it to its RL (reverse list). So making it check for the client ID by having them on the bots list is a bad idea because of the contact-list limit.

UUX is just personal messages beside your name.
(exampe: Jerome - this is UUX) - You need the latest build of MSN messenger 7.0.0604 Theres mirrors on mess.be for it. Oh yeah and also in the new MSN it has a msn search built in it.
Code:
MSG <TrID> N <Length>\*lazy*\n<br />MIME-Version: 1.0\*lazy*\n<br />Content-Type: text/search-query\*lazy*\n\*lazy*\n<br />Your search

Oh and also, about the Client IDs what if you wan't (Ink-sending+Ink-receiving+MSNC4) put together? and the client (user) who is using Net::MSN doesn't know how to add them together to get one ClientID (or will you make a document on that?)

Oh oh one more thing. Razz
If your going to convert the code to MSNP10 not 11 then theres no point for the ClientID _MSNC4 because MSNC4s client ID requires msnp11 to work. lmao I talk to much eh? Razz
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Feb 22, 2005 3:55 am    Post subject: Reply with quote

Hey and welcome to bot-depot. Ive done alot of the p2p work on the msn.pm. My website with my current beta is http://msndev.com, you can also add me to your msn: \[EMAIL=matt@msndev.com\]matt@msndev.com\[/EMAIL\]. I hope we can all work well togrther.


(and yes an offical release with full file transfer is soon, sorry to take so long guys)

_________________
[ matt ]
Back to top
Rhombz
Newbie
Newbie


Joined: 21 Feb 2005
Posts: 14

Reputation: 15

PostPosted: Tue Feb 22, 2005 3:59 am    Post subject: Reply with quote

Quote:
That all seems like a good idea but theres one small problem with the multi-packet messaging. That is in order to check they're client ID they need to be on your list which has a limit of 250 people I'm not sure how your going to code it if your going to make the protocol add people to the bots list or just make it add it to its RL (reverse list). So making it check for the client ID by having them on the bots list is a bad idea because of the contact-list limit.


Well, firstly Net::MSN isnt a bot - its an API to the msn protocol. Other than that I would implement the following.




  • send_multi_packet_msgs (TRUE/FALSE) - Default to sending multi-packet messages (if client supports it)


  • send_split_messages (TRUE/FALSE) - Default to splitting up messages larger than 1000/1200 bytes (not characters, 'use bytes;')


  • force_multi_packet_msgs (TRUE/FALSE) - Force sending of multi-packet messages (if there is no client id - if there is a client id and the client doesnt support them dont send mpm)




Obviously it wont be as above - probably alot cleaner, but something along the lines of that - always falling back to splitting the message perhaps.

Quote:
UUX is just personal messages beside your name.
(exampe: Jerome - this is UUX) - You need the latest build of MSN messenger 7.0.0604 Theres mirrors on mess.be for it. Oh yeah and also in the new MSN it has a msn search built in it.


Sounds cool Smile

Quote:
Oh and also, about the Client IDs what if you wan't (Ink-sending+Ink-receiving+MSNC4) put together? and the client (user) who is using Net::MSN doesn't know how to add them together to get one ClientID (or will you make a document on that?)


You didnt actually look at ClientID.pm did you? Smile

Code:
<br />  my $client_id = Net::MSN::ClientID->extract( client_id_int );<br />  if ($client_id->msnc4()) {<br />    print "Is MSN 7\n";<br />  }<br />  if ($client_id->have_webcam()) {<br />    print "Has Webcam\n";<br />  }<br />  # e.t.c ...<br /><br />  my $client_id = Net::MSN::ClientID->new(<br />     msnc3                        => TRUE,<br />     multi_packet_message => TRUE,<br />   );<br />   print "The ClientID i just made is: ". $client_id->as_int(). "\n";<br />   # prints 805306400<br /><br />   # How does all this fit in?<br />   # Clients own ClientID ... (there are defaults applied when new is called)<br />   $self->client_id( Net::MSN::ClientID->new() );<br /><br />   # then the method change_status uses it<br />   sub change_status {<br />     my ($self, $status) = @_;<br /><br />     return unless ($status);<br /><br />     my $client_id = ($self->client_id()) ?<br />       $self->client_id()->as_int() : 0;<br /><br />     $self->notification()->send('CHG', uc($status). ' '. $client_id);<br />   }<br /><br />   # contact list users ...<br />   my $user = $self->contact()->find_or_create_user($username);<br />   if ($user) {<br />     $user->friendly_name( uri_unescape($friendly_name) );<br />     $user->status_code( $status );<br />     $user->client_id( $client_id ); # Inflated with integer<br />   }<br /><br />   # elsewhere in the code... (client_id is automatically deflated into a ClientID object)<br />   if ($user->client_id()->have_webcam()) {<br />      print "You got a webcam sir!\n";<br />   }<br />


So yeah, it is VERY flexiable Smile ability to both create and parse (extract) Client ID's - the BV_ constants mentioned before are used in the 'as_int()' method to 'add up' the client id - and in the 'extract()' method to 'Bitwise AND' calculate the values for the accessors.

Quote:
Oh oh one more thing. Razz
If your going to convert the code to MSNP10 not 11 then theres no point for the ClientID _MSNC4 because MSNC4s client ID requires msnp11 to work. lmao I talk to much eh? Razz


Never hurts to have something there like that that you arent using just yet - it makes your code more future proof / documented for when you may actually need it.

Rhombz.
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Tue Feb 22, 2005 4:27 am    Post subject: Reply with quote

Ah, I see. I thought you were going to make user choose what clientID they wanted to use as a feature. Anyways in the tar file you posted doesn't have Net::MSN::ClientID so I really couldn't check it :-/
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Tue Feb 22, 2005 4:53 am    Post subject: Reply with quote

QUOTE(..::BIGmouth( )::.. @ Feb 21 2005, 06:12 PM)
Code:
MSG <TrID> N <Length>\*lazy*\n<br />MIME-Version: 1.0\*lazy*\n<br />Content-Type: text/search-query\*lazy*\n\*lazy*\n<br />Your search


Code:
sub msnSearch{<br />        my ($self,$msg,$TrID) = (shift,shift,$self->{Msn}->{Notification}->{TrID}++);<br />        my $header = "MIME-Version: 1.0\*lazy*\nContent-Type: text/search-query\*lazy*\n\*lazy*\n$msg";<br />       $self->send("MSG $TrID N " . length($header) . "\*lazy*\n" . $header);<br />}


Very Happy That should I couldn't test it because msn.pm uses p10 work like a charm (That is, if your using P11!)
Back to top
Rhombz
Newbie
Newbie


Joined: 21 Feb 2005
Posts: 14

Reputation: 15

PostPosted: Tue Feb 22, 2005 5:53 am    Post subject: Reply with quote

QUOTE(TCS @ Feb 21 2005, 08:53 PM)
QUOTE(..::BIGmouth( )::.. @ Feb 21 2005, 06:12 PM)
Code:
MSG <TrID> N <Length>\*lazy*\n<br />MIME-Version: 1.0\*lazy*\n<br />Content-Type: text/search-query\*lazy*\n\*lazy*\n<br />Your search


Code:
sub msnSearch{<br />        my ($self,$msg,$TrID) = (shift,shift,$self->{Msn}->{Notification}->{TrID}++);<br />        my $header = "MIME-Version: 1.0\*lazy*\nContent-Type: text/search-query\*lazy*\n\*lazy*\n$msg";<br />       $self->send("MSG $TrID N " . length($header) . "\*lazy*\n" . $header);<br />}


Very Happy That should I couldn't test it because msn.pm uses p10 work like a charm (That is, if your using P11!)

you mean...

Code:
<br />    $message = Net::MSN::Message->new(<br />      header => SEARCH_MSG,<br />      body     => $search_string,<br />    );<br /><br />    $client->sendmsg($message);<br />


Which, of course could be put into..

Code:
<br />   $client->send_search_msg($search_string);<br />


or something like that, on that note i really want to rename 'sendmsg' to 'send_message' since its the only command without a _ to join the words Razz

Of course none of the above is implemented, but all that would be needed to implement it would be for me to define SEARCH_MSG, currently DEFAULT_MSG is a constant (template) for a normal message Smile

Rhombz
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Tue Feb 22, 2005 12:30 pm    Post subject: Reply with quote

Razz Well if you make it a fast way of doing it Yep.
But you wouldn't use send_msg since when you send the data to that socket it sends a send_msg command already.

soo it's just:
Code:
sub send_search_msg {<br />my ($client, $search_string) = (shift, shift);<br /><br />$message = Net::MSN::Message->new(<br />     header => SEARCH_MSG,<br />     body     => $search_string,<br />   );<br /><br />$client->send($message); # Or wtv you use to send data.<br />}<br /><br />$client->send_search_msg($search_string);

Or something like that. Razz
Back to top
Rhombz
Newbie
Newbie


Joined: 21 Feb 2005
Posts: 14

Reputation: 15

PostPosted: Tue Feb 22, 2005 1:15 pm    Post subject: Reply with quote

What i mean is currently I have 'sendmsg' in (Net::)MSN.pm, which tries to send a message to the 'active' (last typed in by user) or 'most recent' (highest connection(file no)) SwitchBoard - if there is none, it places a call and puts the message in a queue to be sent once its connected fully - During this there is a 'pending_switchboard' tracking system which of course queues more messages that may have been sent while actually trying to get a switchboard ready - what that all means is I can for (1..100) { $client->sendmsg(' test 1 ') } and they will ALL go through - im quite suprised it doesnt disconnect me.. hehe

I also have 'sendmsg_private' which will try and track down a private (only the client and the user, no one else) SwitchBoard to send a message - otherwise it will call the user.

If there was a 'send_search_message' method it of course would call a method for sending a MSG to the ns server - i assume thats where it goes.

And what i meant is id like to rename 'sendmsg' to 'send_message' - as in the method in my module Smile.. and also 'sendmsg_private' to 'send_message_pvt'.. or something.

MSNP10 is now mostly implemented too Smile

Rhombz
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Tue Feb 22, 2005 1:32 pm    Post subject: Reply with quote

heh I see.
Nope the msn search is sent by the sb.
http://biggiem.com/example.PNG (Might be offline our server sucks -_-)
Back to top
Rhombz
Newbie
Newbie


Joined: 21 Feb 2005
Posts: 14

Reputation: 15

PostPosted: Sat Feb 26, 2005 1:22 pm    Post subject: Reply with quote

Well firstly - Hi all, im glad this place is back up and running. I have a question for any MSN protocol wiz's..

Does anyone know a way of ensuring that my client recieves the messages right away?

What I mean is, sometimes i'll send a message via my messenger, and it wont arrive untill i start tyoing (he then recieves TypingUser messages.. and the message arrives just before them)... Ive also made a simple bot to play scrabble with a friend of mines bot but he never sees the 'ok, the next letters are..' and keeps guessing on the old word for a while.. then they all come through.. its quite annoying. I have tried to turn autoflush on the socket on - but that didnt help.. would it be the switchboard buffering?

Cheers in advance,

Rhombz
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Sat Feb 26, 2005 1:27 pm    Post subject: Reply with quote

I think you need to buffer your data as not all data is sent at once.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> MSN Protocol modules All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group