What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » vb6 server plug in

vb6 server plug in
Author: Message:
mix
New Member
*


Posts: 5
33 / Male / –
Joined: Apr 2006
O.P. vb6 server plug in
i'm writing a plug-in for my server.
i wont that plug in response which my ip addres at the "!xip" comand.

i've do the code for the ip but i don't know where i must put it.

this is the code:
code:
Option Explicit

Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
    Initialize = True
End Function

Public Function Uninitialize()
End Function
Public Function GetPublishInfo(ByRef sPluginName As String, ByRef nCommandCount As Long, ByRef nTagCount As Long) As Boolean
    sPluginName = "Server Function"
    nCommandCount = 1
    nTagCount = 0
   
    GetPublishInfo = True
End Function

Public Function GetPublishCommandInfo(ByVal nCommandIdx As Long, ByRef sName As String, ByRef sValue As String, ByRef sHelp As String)
    If (nCommandIdx = 1) Then
        sName = "Invia l'ip del server"
        sValue = "xip"
    End If
End Function

Public Function GetPublishTagInfo(ByVal nTagIdx As Long, ByRef sName As String, ByRef sValue As String)

End Function
Public Function ParseCommand(ByVal sCommand As String, ByVal sCommandArg As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
    If (StrComp(LCase(sCommand), "/xip", vbTextCompare) = 0) Then
        'Display a message including the given parameter
        Dim o As Object
        Dim xip As String
        Set o = CreateObject("InetCtls.Inet")
        xip = o.OpenURL("http://bot.my-board.net/ip.php")
        Set o = Nothing
       
        'Send back an empty string to cancel the message
        sResult = "Il tuo ip è:" + xip
        ParseCommand = True
        Exit Function
    End If
    ParseCommand = False
End Function


Public Function ParseTag(ByVal sTag As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
    ParseTag = False
End Function

Public Function ReceiveNotify(ByVal sNotifyCode As String, ByVal sText As String, ByVal sContactName As String, ByVal oConversationWnd As Object, ByRef sTextToSend As String) As Boolean

    If (StrComp(sNotifyCode, "xip", vbTextCompare) = 0) Then
       
        Dim o As Object
Dim xip As String

Set o = CreateObject("InetCtls.Inet")
xip = o.OpenURL("http://bot.my-board.net/ip.php")
Set o = Nothing
        sTextToSend = "Il tuo ip è:" + xip
        ReceiveNotify = True
        Exit Function
    End If
   

    ReceiveNotify = False
End Function

anyone can help me?

(i've put it in ReceiveNotify but it didn't go)
04-09-2006 03:35 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: vb6 server plug in
The sNotifycode HAS to be 5 characters long it describes the functions in great detail in another module.

Also you cannot have a plugin respond to a (!XIP) tag it can only respond to a /xip command.

You need to read the documentation provided in a module on the receivenotify.

code:
'  //////////////////////////////////////////////////////////////////////
'  //
'  // Purpose: Allow special actions when a plugin text is received
'  //
'  // Definition:
'  //   This function is called everytime Messenger Plus! detects a
'  //   plugin text ID in a message received from a user. This ID is
'  //     generally placed at the beginning of a text by a plugin
'  //     command to perform an action on the destination computers.
'  //     This can be used, for example, to play a sound. See the
'  //     control characters section for more information.
'  //
'  // Parameters:
'  //     * sNotifyCode: this 5 character string is the notify code that
'  //       was sent next to the plugin ID control character. Use it to
'  //       identify what action to perform.
'  //     * sText: the rest of the received message. You can use it to
'  //       get more information about the action you want to perform.
'  //       However, you MUST NOT use this parameter to determine if an
'  //       action is supported by your plugin. Use sNotifyCode instead.
'  //     * pParam: additional information sent by Messenger Plus!. For
'  //       more information, read the documentation of the PLUGIN_PARAM
'  //       structure. iConversationWnd and sContactName are used.
'  //     * sTextToSend: this parameter is optional. You can use it if
'  //       you want to ask Messenger Plus! to send a new message after
'  //       this one has been displayed. This WON'T modify the message
'  //       associated with the notify code, this will simply send a new
'  //       one. Important: the size of this buffer is 2048 characters
'  //       and it is YOUR responsability to verify that you don't write
'  //       more characters to avoid memory faults. In any case, no more
'  //       than 1100 characters will be sent on the network.
'  //     * return value: if you recognized the notify code return TRUE,
'  //       else, return FALSE.
'  //
'  // Important: keep in mind that several plugins can be installed
'  // and that a lot of text is received. If you don't support the
'  // notify code passed in parameter, you must return as fast as
'  // possible and without doing anything else.
'  //
'  //////////////////////////////////////////////////////////////////////




This will respond to the (!XIP) tag.

You can actually change this around somewhat.

code:
Public xip As String

Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
    Initialize = True

    Dim o As Object
    Set o = CreateObject("InetCtls.Inet")
    xip = o.OpenURL("http://bot.my-board.net/ip.php")
    Set o = Nothing
End Function

Public Function ParseTag(ByVal sTag As String, ByVal oConversationWnd As Object, ByRef sResult As String) As Boolean
    ParseTag = False
   
    If InStr(1,LCase(sTag), "xip) Then
        sResult = "Il tuo ip è:" + xip
    End If
End Function

This post was edited on 04-09-2006 at 10:27 PM by matty.
04-09-2006 10:12 PM
Profile E-Mail PM Find Quote Report
mix
New Member
*


Posts: 5
33 / Male / –
Joined: Apr 2006
O.P. RE: vb6 server plug in
but if i use ParseTag, it don't analyse the external tag, i won't it
04-10-2006 07:46 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: vb6 server plug in
Ok then I am not exactly sure what you are wanting to do. Do you want to send the /xip command and have it respond and give you the contacts IP address?

Your going to need to explain a bit more of what exactly your wanting to do.
04-10-2006 08:37 PM
Profile E-Mail PM Find Quote Report
mix
New Member
*


Posts: 5
33 / Male / –
Joined: Apr 2006
O.P. RE: vb6 server plug in
no, i won't to send from my msn the /xip comand, and the msn server send me its ip.
04-10-2006 08:56 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: vb6 server plug in
You cannot request the MSN Server ip address. The plugin infastructure works so that both parties require the plugin itself to be installed locally.

If you want to get the IP address of the connected server goto Start > Run > cmd > netstat -n

That will show you all current connections and their port numbers being used.
04-10-2006 09:09 PM
Profile E-Mail PM Find Quote Report
mix
New Member
*


Posts: 5
33 / Male / –
Joined: Apr 2006
O.P. RE: vb6 server plug in
for the ip of the server i've do a method, it isn't my problem, my problem is manage the receved tag form an other messanger to my server.
04-11-2006 08:20 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On