This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

View File

@ -0,0 +1,70 @@
//=========== (C) Copyright Valve, L.L.C. All rights reserved. ===========
#include "cbase.h"
#include "ui_nugget.h"
class CUiNuggetSessions : public CUiNuggetBase
{
DECLARE_NUGGET_FN_MAP( CUiNuggetSessions, CUiNuggetBase );
NUGGET_FN( CloseSession )
{
g_pMatchFramework->CloseSession();
return NULL;
}
NUGGET_FN( CreateSession )
{
args->SetName( "settings" );
g_pMatchFramework->CreateSession( args );
return NULL;
}
NUGGET_FN( MatchSession )
{
args->SetName( "settings" );
g_pMatchFramework->MatchSession( args );
return NULL;
}
NUGGET_FN( SessionSystemData )
{
if ( IMatchSession *p = g_pMatchFramework->GetMatchSession() )
{
KeyValues *kv = p->GetSessionSystemData();
return kv ? kv->MakeCopy() : NULL;
}
return NULL;
}
NUGGET_FN( SessionSettings )
{
if ( IMatchSession *p = g_pMatchFramework->GetMatchSession() )
{
KeyValues *kv = p->GetSessionSettings();
return kv ? kv->MakeCopy() : NULL;
}
return NULL;
}
NUGGET_FN( SessionUpdateSettings )
{
if ( IMatchSession *p = g_pMatchFramework->GetMatchSession() )
{
args->SetName( "settings" );
p->UpdateSessionSettings( args );
}
return NULL;
}
NUGGET_FN( SessionCommand )
{
if ( IMatchSession *p = g_pMatchFramework->GetMatchSession() )
{
p->Command( args->GetFirstSubKey() );
}
return NULL;
}
};
UI_NUGGET_FACTORY_SINGLETON( CUiNuggetSessions, "sessions" );