Skip to content

How to send a message to client

kytooooo edited this page Jun 30, 2019 · 5 revisions

In terms of GameServer, we send messages to the ProxyServer then ProxyServer helps us transfer our messages to the client.



class NFIGameServerNet_ServerModule
    : public NFIModule
{
public:

	virtual void SendMsgPBToGate(const uint16_t nMsgID, google::protobuf::Message& xMsg, const NFGUID& self) = 0;
	virtual void SendGroupMsgPBToGate(const uint16_t nMsgID, google::protobuf::Message& xMsg, const int nSceneID, const int nGroupID) = 0;
	virtual void SendGroupMsgPBToGate(const uint16_t nMsgID, google::protobuf::Message& xMsg, const int nSceneID, const int nGroupID, const NFGUID exceptID) = 0;

	virtual void SendMsgToGate(const uint16_t nMsgID, const std::string& strMsg, const NFGUID& self) = 0;
	virtual void SendGroupMsgPBToGate(const uint16_t nMsgID, const std::string& strMsg, const int nSceneID, const int nGroupID) = 0;
	virtual void SendGroupMsgPBToGate(const uint16_t nMsgID, const std::string& strMsg, const int nSceneID, const int nGroupID, const NFGUID exceptID) = 0;

};


In terms of WorldServer, you would follow your heart.