MCPcopy Create free account
hub / github.com/cocos/cocos-engine / fireEvent

Method fireEvent

native/cocos/network/SocketIO.cpp:956–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956void SIOClient::fireEvent(const ccstd::string &eventName, const ccstd::string &data) {
957 CC_LOG_INFO("SIOClient::fireEvent called with event name: %s and data: %s", eventName.c_str(), data.c_str());
958
959 _delegate->fireEventToScript(this, eventName, data);
960
961 if (_eventRegistry[eventName]) {
962 SIOEvent e = _eventRegistry[eventName];
963
964 e(this, data);
965
966 return;
967 }
968
969 CC_LOG_INFO("SIOClient::fireEvent no native event with name %s found", eventName.c_str());
970}
971
972void SIOClient::setTag(const char *tag) {
973 _tag = tag;

Callers 1

onMessageMethod · 0.80

Calls 2

eFunction · 0.50
fireEventToScriptMethod · 0.45

Tested by

no test coverage detected