Skip to content

MrJetChen/cqsocketapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CQSocketAPI

CoolQ Socket API written in VC++.

Installation

  1. Place org.dazzyd.cqsocketapi.cpk into CoolQ app folder.
  2. Enable CQSocketAPI in CoolQ APP management window.
  3. Restart CoolQ.

QQBot

You can write your owned bot based on my cqbot in Python 3.

Protocol

Communication

The communication between server and clients is sending UDP frame to each other.

The server listens on port 11235.

Clients should send ClientHello frame to inform server of client port. ClientHello frame must be sent on startup and every (at most) 5 minutes.

A UDP frame contains one Prefix and multiple Fields. Prefix and Fields are joined by one space.

Server Sent Frame

Frame = Prefix (max 256) + Payload (max 32768)

Prefix = 'PrivateMessage'
Payload = QQ + EncodedText

Prefix = 'GroupMessage'
Payload = GroupID + QQ + EncodedText

Prefix = 'DiscussMessage'
Payload = DiscussID + QQ + EncodedText

Prefix = 'GroupMemberDecrease'
Payload = GroupID + QQ + OperatedQQ

Prefix = 'GroupMemberIncrease'
Payload = GroupID + QQ + OperatedQQ

EncodedText = base64_encode( GBK_encode( text ) )

Client Sent Frame

Frame = Prefix (max 256) + Payload (max 32768)

Prefix = 'ClientHello'
Payload = Port

Prefix = 'PrivateMessage'
Payload = QQ + EncodedText

Prefix = 'GroupMessage'
Payload = GroupID + EncodedText

Prefix = 'DiscussMessage'
Payload = DiscussID + EncodedText

EncodedText = base64_encode( GBK_encode( text ) )

Example Frame

GroupMessage 123456 10000 dGVzdCCy4srU

About

CoolQ Socket API written in VC++.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 71.6%
  • C 28.4%