Author Topic: VectorNet Protocol  (Read 860 times)

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
VectorNet Protocol
« on: October 27, 2008, 07:10:35 PM »
So you want to make a client that connects to a VectorNet Server? Well, this is just how you do it.

Note: By default, the port for VectorNet is 4800.

Connection:

you have to send a password to the server. Even if authentication isn't enabled, you still have to send the password. NOTE: The server will encrypt the password for auth checks, so whoever maintains the server cannot get their password.

In VB6, for example, to send the first packet (0x01) you would do the following:

Code: [Select]
sckVectorNet.SendData Chr$(&H1) & Username & Chr$(0) & password & Chr$(0) & ClientType & Chr$(0) & pingValue
Current list of client types:

1 = VectorNet client
2 = StealthBot plugin
3 = VectorBot client
4 = VN Bot by Jd
5 = FailBot Client

[size=]Do NOT use the client types listed above in your implementation of the VectorNet client.[/size]

[size=]See the section at the end of the packet descriptions on how to obtain a ping value[/size]

Events: [size=]NOTE: The first packet the server sends you when you connect (properly) is 0x05[/size]

Format: <packet> (description) = <data bits> (this protocol description will separate data bits by (null))

Note: packets in red are currently unavailable.

S > C, C > S

0x01 (user logged on to VectorNet) = <username> (null) <password> (null) <client type> (null) <ping value> (null) <main channel called "Main">
  - This packet is sent whenever someone joins VectorNet.
  - The password is sent, not received
  - The channel name is received, not sent
  - Client type is an integer - see above for more info on the client types

S > C

0x02 (chat received) = <username> (null) <text sent>
  - This packet is sent whenever someone on the server talks.

C > S

0x02 (Send text) = <username> (null) <text to send>
 -  When you talk on vectornet, you send this.

S > C

0x03 (custom info packet) = <message> (null) <code type>
  -  This is sent to you when the server sends a custom info message.
  -  The code type can be either 0 or 1.
  • 0 - Server/Client Error
  • 1 - ServerInfo Message

S > C

0x04 (user left VectorNet) = <username>
  - This packet is sent whenever someone logs off VectorNet.

S > C

0x05 (Initial connect information) = <version of server> (null) <everyone in the main channel> (null) <Everyone on VectorNet at the time separated by commas> (null) <channel name; currently "Main" at logon>
 -  This packet is sent whenever you first connect to VectorNet by sending your name, as well as your client type.

S > C

0x06 (Server message) = <Message sent from server>
 -  If you talk via the server, the message is sent via this packet

C > S

0x07 (User information request) = <type of request> (null) <username to request>
  -  This packet allows you to retrieve specific information about a user.

  - Current requests:
 
  • Ping - Retrieves the ping value of the specified user
       
  • Product - Retrieves product of the specified user
       
  • all - Retrieves all the information in a string separated by a pipe symbol (|)

S > C

0x07 (User information response) = <type of response> (null) <username requested) (null) <information on user>
 -  This packet is received when a request is made on the information of the specified user.

  - Current types of responses:
 
  • Ping
       
  • Product
       
  • all - string with information separated by a pipe symbol (|). The data is sent back to you in order: ping|product|channel
[/color]
S > C

0x08 Defunct
 -  This packet is no longer sent/received. It may have a value in the future.

C > S

0x09 (channel refresh request) = none
 -  This packet can be sent to the server when you want to request a channel list update.

S > C

0x09 (channel refresh) = <list of users on VectorNet separated by a comma> (un-supported in client plugin)
 -  This packet is sent to you when the server requests a client userlist update (I.E. re-arranging the userlist for mods/admins [IRC ability]).

S > C

0x0A (fresh account creation) = none
 - If you log onto the server with an account that hasn't been created, this message will be sent to you.

C > S

0x0B (Keep alive packet) = none
 -  Lets the server know you are still connected, otherwise it will disconnect your socket.

S > C

0x0B (Request keep alive packet) = none
 -  Keeps the sockets fresh, and without any chance of getting disconnected. You must reply to this, or the server will disconnect you.

C > S

0x0C (Request to join channel) = <Username> (null) <Channel name>
 -  When you want to join a channel, send this packet, and the server will determine if you can join or not.

S > C

0x0C (User left channel) = <username>
 -  When a user leaves your channel, this packet is sent.

S > C

0x0D (Channel join status) = <channel name> (null) <join status>
 -  When you attempt to join the specified channel, the server will return to you
    the name of the channel, plus the status on whether or not you could enter.

Statuses:
  • restricted
  • success

C > S

0x0E (Whisper to user) = <username sending message> (null) <username receiving message> (null) <message>
 - When you whisper a user "/whisper <username> <message>" You send this packet.

S > C

0x0F (User joined channel) = <name of user>
 - If any users exist in the channel the user joined, a message will be sent to all the clients
   in that channel, saying the user joined it.

C > S

0x10 (Ignore user request) = <Username to ignore>
 - This packet is simply sent when you wish to ignore a user on VectorNet.

S > C

0x10 (Ignore user response) = <Username requested to ignore>
 - The status on whether the user was ignored or not is sent back. The results can be one of two things:
  • <Name of user> = Returned successful. You may now add the user to whatever block list you have
     
  • %NULL% = The user does not exist on VectorNet

C > S

0x11 (Statistics request) = none
 - If you want to retrieve various statistics on vectornet, send this packet.

S > C

0x11 (VectorNet statistics response) = <# channels currently occupied on VectorNet> (null) <# of users on VectorNet> (null) <Names of users separated by a comma>
 -  Returns various statistics on VectorNet.

S > C

0x12 (Online user dump) = <String of all users connected to VectorNet separated by a comma>
 -  The entire list of users is sent in this packet. I use it to test whether I whispered a user successfully or not in my client.

[size=]Determining your ping from the server[/size]

Note: the syntax here is for VB6.

This first requires an API called GetTickCount. Make a modDeclares module, and place the following code into it:

Code: [Select]
Public Declare Function GetTickCount Lib "kernel32" () As Long
Now, in your main form, upon first connecting, you need to assign GetTickCount to a variable: ex. gtc1 = GetTickCount(). First connecting means when you first hit the "connect" buttom, or whatever you do to initiate a connect.

In your <winsock object name>_Connect() routine assign GetTickCount() to another variable: ex. gtc2 = GetTickCount().
You may then do finalPing = gtc2 - gtc1, which will give you your final ping value.
« Last Edit: March 09, 2009, 05:38:27 PM by Vector »
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector