1. Structure of the message:
2. Message Delivery
A: Message definition: protocl/directory/common Some common messages,/proto_cs client server communication messages,/PROTO_SVR server communication messages, the respective directory should be the CMD definition and message definition belong to the corresponding file
B: Message encapsulation and sending: see the source code is good, there are similar cgamesvrpacketsendutil such as the delivery interface
3. Receipt of messages:
A: Receive message registration generally first in similar cbattlesvrapp->initprocessor register each need to process the message module, such as cloginprocessor, processing the login message, the processing module registered, with the cmd parameter
B: Message receiving process: Distance enet, enter Cpacketdisp::P rocessenetpacket, enter m_conneventhandlerimp.onconnectionmessage according to type
According to Cmd to find the corresponding processor, on the a step registered, into the Pprocessor->processclientpacket execution message processing
Messaging Processing Flow