#pragma once

#include <SDL3/SDL_stdinc.h>

#include "crNet.h"

class crApp;

// dev-only net probe: registers console commands (httpget/wssend/nettest_*) and prints the crNet
// event queue to the console each frame. pure scaffolding — remove once a real game consumes the queue.
class crDevNet
{
private:
    crApp*  _app  = nullptr;
    int32_t _wsId = crNet::INVALID_ID;   // current test socket — set by wsopen / nettest_ws, used by send / close

public:
    void Init( crApp* app );   // registers the console commands
    void Cleanup();            // unregisters them
    void Drain();              // per-frame: prints queued net events

private:
    static void CmdHttpGet( void* context, int32_t argc, const char** argv );
    static void CmdHttpPost( void* context, int32_t argc, const char** argv );
    static void CmdWsOpen( void* context, int32_t argc, const char** argv );
    static void CmdWsSend( void* context, int32_t argc, const char** argv );
    static void CmdWsClose( void* context, int32_t argc, const char** argv );
    static void CmdNettestGet( void* context, int32_t argc, const char** argv );
    static void CmdNettestPost( void* context, int32_t argc, const char** argv );
    static void CmdNettestWs( void* context, int32_t argc, const char** argv );
};
