资源简介

cocos creator js 棋牌游戏十三水前后端源码

资源截图

代码片段和文件信息

#include “jsb_socketio.hpp“

#include “cocos/scripting/js-bindings/jswrapper/SeApi.h“
#include “cocos/scripting/js-bindings/manual/jsb_conversions.hpp“
#include “cocos/scripting/js-bindings/manual/jsb_global.h“

#include “cocos/network/SocketIO.h“
#include “base/ccUTF8.h“
#include “base/CCDirector.h“

using namespace cocos2d;
using namespace cocos2d::network;

se::Class* __jsb_SocketIO_class = nullptr;

class JSB_SocketIODelegate : public Ref public SocketIO::SIODelegate
{
public:
    //c++11 map to callbacks
    typedef std::unordered_map JSB_SIOCallbackRegistry;

    JSB_SocketIODelegate()
    {
    }

    virtual ~JSB_SocketIODelegate()
    {
        CCLOGINFO(“In the destructor of JSB_SocketIODelegate(%p)“ this);
    }

    virtual void onConnect(SIOClient* client) override
    {
    }

    virtual void onMessage(SIOClient* client const std::string& data) override
    {
    }

    virtual void onClose(SIOClient* client) override
    {
        CCLOG(“JSB SocketIO::SIODelegate->onClose method called from native“);
        this->fireEventToscript(client “disconnect“ ““);
        if (getReferenceCount() == 1)
        {
            autorelease();
        }
        else
        {
            release();
        }
    }

    virtual void onerror(SIOClient* client const std::string& data) override
    {
        CCLOG(“JSB SocketIO::SIODelegate->onerror method called from native with data: %s“ data.c_str());
        this->fireEventToscript(client “error“ data);
    }

    virtual void fireEventToscript(SIOClient* client const std::string& eventName const std::string& data) override
    {
        CCLOG(“JSB SocketIO::SIODelegate->fireEventToscript method called from native with name ‘%s‘ data: %s“ eventName.c_str() data.c_str());

        se::scriptEngine::getInstance()->clearException();
        se::AutoHandleScope hs;

        if (cocos2d::Director::getInstance() == nullptr || cocos2d::scriptEngineManager::getInstance() == nullptr)
            return;

        auto iter = se::NativePtrToobjectMap::find(client); //FIXME: client probably be a new value with the same address as the old one it may cause undefined result.
        if (iter == se::NativePtrToobjectMap::end())
            return;

        se::Value dataVal;
        if (data.empty())
        {
            dataVal.setNull();
        }
        else
        {
            dataVal.setString(data);
        }

        JSB_SIOCallbackRegistry::iterator it = _eventRegistry.find(eventName);

        if (it != _eventRegistry.end())
        {
            const se::ValueArray& cbStruct = it->second;
            assert(cbStruct.size() == 2);
            const se::Value& callback = cbStruct[0];
            const se::Value& target = cbStruct[1];
            if (callback.isobject() && callback.toobject()->isFunction() && target.isobject())
            {
                se::ValueArray args;
                args.push_back(dat

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    8388608  2018-08-27 15:08  qidiangame_13shui\client\.vscode\chrome\BrowserMetrics\BrowserMetrics-5B85EAC8-1750.pma

     文件      13067  2018-08-26 12:58  qidiangame_13shui\client\.vscode\chrome\CertificateRevocation\4659\crl-set

     文件         66  2018-08-27 15:13  qidiangame_13shui\client\.vscode\chrome\CertificateRevocation\4659\manifest.fingerprint

     文件         94  2018-08-26 12:58  qidiangame_13shui\client\.vscode\chrome\CertificateRevocation\4659\manifest.json

     文件       1408  2018-08-26 12:58  qidiangame_13shui\client\.vscode\chrome\CertificateRevocation\4659\_metadata\verified_contents.json

     文件         66  2018-08-27 15:13  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\manifest.fingerprint

     文件         67  1980-01-01 00:00  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\manifest.json

     文件       8829  1980-01-01 00:00  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_metadata\verified_contents.json

     文件        244  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b.sth

     文件        235  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a.sth

     文件        238  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f.sth

     文件        235  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02.sth

     文件        240  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478.sth

     文件        237  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef.sth

     文件        238  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263.sth

     文件        236  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8.sth

     文件        239  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c.sth

     文件        238  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd.sth

     文件        236  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca.sth

     文件        238  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558.sth

     文件        243  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d.sth

     文件        243  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4.sth

     文件        243  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913.sth

     文件        239  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668.sth

     文件        237  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3.sth

     文件        239  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56.sth

     文件        239  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f.sth

     文件        240  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25.sth

     文件        240  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10.sth

     文件        484  2018-08-26 03:11  qidiangame_13shui\client\.vscode\chrome\CertificateTransparency\857\_platform_specific\all\sths\a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638.sth

............此处省略6592个文件信息

评论

共有 条评论