Share (contract) to receive all the map sent over the package, this is the GS thread-driven { for (;;) { //... if(!itmap.second->RecvData (Pkt)) Break; if(Pkt.cmd = =Ms2gs_ turn Client_cmd) {onturntoclient (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Pkt.cmd = =Ms2gs_json) {Onjson (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2gs_db_buff_info = =pkt.cmd) {onleavemap (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2gs_obj_leave = = pkt.cmd)//Player Switch Map{onenternewmap (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2gs_guild_opt = =pkt.cmd) {m_spguildopt-onguildopt (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2gs_prop_mgr = =pkt.cmd) {M_sppropmanager-onpropmgropt (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2ms_cmd = =pkt.cmd) {onturntomap (Pkt.mapid, Pkt.data, Pkt.len); } Else if(Ms2gs_mall_opt = =pkt.cmd) {m_spmallopt-onmallopt (Pkt.channelid, Pkt.data, Pkt.len); } Else if(Ms2gs_auction_opt = =pkt.cmd) {m_spauctionopt-onauctionopt (Pkt.channelid, Pkt.data, Pkt.len); } //...}} has its own module is a cross-map props, gangs, mall, team, because some operations is not with which map relationship is not big, so it made cross-map mode initacrossmapopt ();//cross-map operationsInitacrossmanager ();//Cross map ManagerThese operations or managers are sent from the map of the package, so or from the loop to pick up the package, according to the internal Protocol, to the corresponding cross-map module or in the share layer of processing, and so on after the corresponding processing of the cross-module after processing, the cross-map module itself is not to send messages, He's going to send it through share: events.sendaucopt2ms.= [ This](intNchannelid,void* PData,intNlen) {Sendcmd2msbychannelid (Nchannelid, Gs2ms_auction, PData, Nlen);};voidShare::sendcmd2msbychannelid (intNchannelid,intNcmd,void* PData,intNlen) {Gamechannel* PGC =M_vecchannel[nchannelid]; if(!PGC)return; PGC->m_pmap->gs2msdata (Ncmd, Nchannelid, PData, Nlen);//send via map to playerThe same is true for sending to the client, after all, all player channels and map information are on the share side so the packet is picked up in share, sent or sent from share
Share (Contract terms)