SHARE
TWEET

Untitled

a guest May 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. __int64 CBaseServer::SetReservationCookie(CBaseServer *this, __int64 a2, const char *a3, ...)
  2. {
  3.   __int64 v3; // r14
  4.   CBaseServer *v4; // r13
  5.   const char *v5; // rbx
  6.   __int64 v6; // r12
  7.   __int64 v7; // r14
  8.   signed __int64 v8; // r15
  9.   signed __int64 v9; // rdi
  10.   __int64 v10; // r14
  11.   signed __int64 v11; // r12
  12.   signed __int64 v12; // rdi
  13.   const char *v13; // rdi
  14.   const char *v14; // rbx
  15.   char *v15; // rbx
  16.   int v16; // eax
  17.   __int64 v17; // rdx
  18.   int v18; // eax
  19.   int v19; // er12
  20.   __int64 v20; // rcx
  21.   int v21; // ecx
  22.   __int64 v22; // rax
  23.   int v23; // ecx
  24.   signed __int64 v24; // rcx
  25.   __int64 v25; // rax
  26.   __int64 v26; // rax
  27.   const char *v27; // rdi
  28.   char *v28; // rbx
  29.   int i; // er12
  30.   __int64 v30; // rax
  31.   int v31; // eax
  32.   __int64 v32; // r14
  33.   signed __int64 v33; // r15
  34.   signed __int64 v34; // rdi
  35.   __int64 result; // rax
  36.   __int64 *v36; // [rsp+18h] [rbp-578h]
  37.   unsigned int v37; // [rsp+D4h] [rbp-4BCh]
  38.   __int64 v38; // [rsp+D8h] [rbp-4B8h]
  39.   __int64 v39; // [rsp+E0h] [rbp-4B0h]
  40.   __int64 v40; // [rsp+E8h] [rbp-4A8h]
  41.   __int64 v41; // [rsp+F0h] [rbp-4A0h]
  42.   __int64 v42; // [rsp+F8h] [rbp-498h]
  43.   int v43; // [rsp+100h] [rbp-490h]
  44.   int v44; // [rsp+104h] [rbp-48Ch]
  45.   int v45; // [rsp+108h] [rbp-488h]
  46.   char v46; // [rsp+110h] [rbp-480h]
  47.   char v47; // [rsp+119h] [rbp-477h]
  48.   char v48; // [rsp+220h] [rbp-370h]
  49.   char v49; // [rsp+229h] [rbp-367h]
  50.   char v50; // [rsp+330h] [rbp-260h]
  51.   char v51; // [rsp+339h] [rbp-257h]
  52.   __va_list_tag va[1]; // [rsp+440h] [rbp-150h]
  53.   char v53[16]; // [rsp+460h] [rbp-130h]
  54.   __int128 v54; // [rsp+470h] [rbp-120h]
  55.   __int128 v55; // [rsp+480h] [rbp-110h]
  56.   __int128 v56; // [rsp+490h] [rbp-100h]
  57.   __int128 v57; // [rsp+4A0h] [rbp-F0h]
  58.   __int128 v58; // [rsp+4B0h] [rbp-E0h]
  59.   __int128 v59; // [rsp+4C0h] [rbp-D0h]
  60.   __int128 v60; // [rsp+4D0h] [rbp-C0h]
  61.   __int128 v61; // [rsp+4E0h] [rbp-B0h]
  62.   __int128 v62; // [rsp+4F0h] [rbp-A0h]
  63.   __int128 v63; // [rsp+500h] [rbp-90h]
  64.   __int128 v64; // [rsp+510h] [rbp-80h]
  65.   __int128 v65; // [rsp+520h] [rbp-70h]
  66.   __int128 v66; // [rsp+530h] [rbp-60h]
  67.   __int128 v67; // [rsp+540h] [rbp-50h]
  68.   __int128 v68; // [rsp+550h] [rbp-40h]
  69.   __int64 v69; // [rsp+560h] [rbp-30h]
  70.  
  71.   v3 = a2;
  72.   v4 = this;
  73.   if ( *((_QWORD *)this + 108) == a2 )
  74.     goto LABEL_58;
  75.   v68 = 0LL;
  76.   v67 = 0LL;
  77.   v66 = 0LL;
  78.   v65 = 0LL;
  79.   v64 = 0LL;
  80.   v63 = 0LL;
  81.   v62 = 0LL;
  82.   v61 = 0LL;
  83.   v60 = 0LL;
  84.   v59 = 0LL;
  85.   v58 = 0LL;
  86.   v57 = 0LL;
  87.   v56 = 0LL;
  88.   v55 = 0LL;
  89.   v54 = 0LL;
  90.   *(_OWORD *)v53 = 0LL;
  91.   va_start(va, a3);
  92.   V_vsnprintf(v53, 256, a3, va);
  93.   v45 = -65281;
  94.   ConColorMsg(&v45, "-> Reservation cookie %llx:  reason %s\n", a2, v53);
  95.   if ( !a2 )
  96.   {
  97.     v6 = 0LL;
  98.     ConVar::SetValue((ConVar *)&sv_mmqueue_reservation, "");
  99.     v7 = *((signed int *)this + 212);
  100.     if ( v7 > 0 )
  101.     {
  102.       v8 = 44 * v7 - 40;
  103.       do
  104.       {
  105.         v9 = *((_QWORD *)v4 + 104) + v8;
  106.         *(_DWORD *)(v9 + 28) = 0;
  107.         netadr_s::Clear((netadr_s *)v9);
  108.         *(_QWORD *)(v9 + 20) = 0LL;
  109.         *(_QWORD *)(v9 + 12) = 0LL;
  110.         LODWORD(v7) = v7 - 1;
  111.         v8 -= 44LL;
  112.       }
  113.       while ( (signed int)v7 > 0 );
  114.     }
  115.     *((_DWORD *)v4 + 212) = 0;
  116. LABEL_57:
  117.     v3 = v6;
  118.     goto LABEL_58;
  119.   }
  120.   if ( byte_A44079 & 0x10 )
  121.   {
  122.     v5 = "FCVAR_NEVER_AS_STRING";
  123.   }
  124.   else
  125.   {
  126.     v5 = "";
  127.     if ( *(_QWORD *)(qword_A44088 + 72) )
  128.       v5 = *(const char **)(qword_A44088 + 72);
  129.   }
  130.   CFmtStrN<256,false>::CFmtStrN(&v50, "Q%llx,", a2);
  131.   if ( !StringAfterPrefix(v5, &v51) )
  132.   {
  133.     if ( byte_A44079 & 0x10 )
  134.     {
  135.       v14 = "FCVAR_NEVER_AS_STRING";
  136.     }
  137.     else
  138.     {
  139.       v14 = "";
  140.       if ( *(_QWORD *)(qword_A44088 + 72) )
  141.         v14 = *(const char **)(qword_A44088 + 72);
  142.     }
  143.     CFmtStrN<256,false>::CFmtStrN(&v48, "G%llx,", a2);
  144.     if ( !StringAfterPrefix(v14, &v49) )
  145.       goto LABEL_59;
  146.     v6 = a2;
  147.     v32 = *((signed int *)this + 212);
  148.     if ( v32 > 0 )
  149.     {
  150.       v33 = 44 * v32 - 40;
  151.       do
  152.       {
  153.         v34 = *((_QWORD *)v4 + 104) + v33;
  154.         *(_DWORD *)(v34 + 28) = 0;
  155.         netadr_s::Clear((netadr_s *)v34);
  156.         *(_QWORD *)(v34 + 20) = 0LL;
  157.         *(_QWORD *)(v34 + 12) = 0LL;
  158.         LODWORD(v32) = v32 - 1;
  159.         v33 -= 44LL;
  160.       }
  161.       while ( (signed int)v32 > 0 );
  162.     }
  163.     *((_DWORD *)v4 + 212) = 0;
  164.     *((_DWORD *)v4 + 222) = 0;
  165.     goto LABEL_57;
  166.   }
  167.   v36 = (__int64 *)((char *)this + 832);
  168.   v10 = *((signed int *)this + 212);
  169.   if ( v10 > 0 )
  170.   {
  171.     v11 = 44 * v10 - 40;
  172.     do
  173.     {
  174.       v12 = *v36 + v11;
  175.       *(_DWORD *)(v12 + 28) = 0;
  176.       netadr_s::Clear((netadr_s *)v12);
  177.       *(_QWORD *)(v12 + 20) = 0LL;
  178.       *(_QWORD *)(v12 + 12) = 0LL;
  179.       LODWORD(v10) = v10 - 1;
  180.       v11 -= 44LL;
  181.     }
  182.     while ( (signed int)v10 > 0 );
  183.   }
  184.   *((_DWORD *)v4 + 212) = 0;
  185.   if ( byte_A44079 & 0x10 )
  186.   {
  187.     v13 = "FCVAR_NEVER_AS_STRING";
  188.   }
  189.   else
  190.   {
  191.     v13 = "";
  192.     if ( *(_QWORD *)(qword_A44088 + 72) )
  193.       v13 = *(const char **)(qword_A44088 + 72);
  194.   }
  195.   v15 = strchr(v13, 91);
  196.   v16 = 0;
  197.   if ( v15 )
  198.   {
  199.     do
  200.     {
  201.       v44 = 0;
  202.       sscanf(v15, "[%x]", &v44);
  203.       if ( v44 )
  204.       {
  205.         netadr_s::SetIP((netadr_s *)((char *)&v38 + 4), 0);
  206.         netadr_s::SetPort((netadr_s *)((char *)&v38 + 4), 0);
  207.         netadr_s::SetType((char *)&v38 + 4, 3LL);
  208.         v42 = 0LL;
  209.         v41 = 0LL;
  210.         v40 = 0LL;
  211.         LODWORD(v38) = v44;
  212.         v43 = 0;
  213.         v18 = *((_DWORD *)v4 + 210);
  214.         v19 = *((_DWORD *)v4 + 212);
  215.         v20 = *((unsigned int *)v4 + 212);
  216.         if ( v19 >= v18 )
  217.         {
  218.           CUtlMemory<CBaseServer::QueueMatchPlayer_t,int>::Grow(v36, (unsigned int)(v19 + 1 - v18), v17, v20);
  219.           LODWORD(v20) = *((_DWORD *)v4 + 212);
  220.         }
  221.         v21 = v20 + 1;
  222.         *((_DWORD *)v4 + 212) = v21;
  223.         v22 = *((_QWORD *)v4 + 104);
  224.         *((_QWORD *)v4 + 107) = v22;
  225.         v23 = v21 - v19 - 1;
  226.         if ( v23 > 0 )
  227.         {
  228.           _V_memmove((void *)(v22 + 44LL * (v19 + 1)), (const void *)(v22 + 44LL * v19), 44 * v23);
  229.           v22 = *v36;
  230.         }
  231.         v24 = v22 + 44LL * v19;
  232.         if ( v24 )
  233.         {
  234.           *(_DWORD *)(v24 + 40) = v43;
  235.           *(_QWORD *)(v24 + 32) = v42;
  236.           *(_QWORD *)(v24 + 24) = v41;
  237.           *(_QWORD *)(v24 + 16) = v40;
  238.           v25 = v38;
  239.           *(_QWORD *)(v24 + 8) = v39;
  240.           *(_QWORD *)v24 = v25;
  241.         }
  242.         LODWORD(v42) = 0;
  243.         netadr_s::Clear((netadr_s *)((char *)&v38 + 4));
  244.       }
  245.       v15 = strchr(v15 + 1, 91);
  246.     }
  247.     while ( v15 );
  248.     v16 = *((_DWORD *)v4 + 212);
  249.   }
  250.   *((_DWORD *)v4 + 222) = v16;
  251.   v3 = a2;
  252.   if ( !`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer
  253.     && (unsigned int)__cxa_guard_acquire(&`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer) )
  254.   {
  255.     v26 = CommandLine(
  256.             &`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer,
  257.             91LL);
  258.     CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer = (*(__int64 (__fastcall **)(__int64, const char *, _QWORD))(*(_QWORD *)v26 + 56LL))(
  259.                                                                                                      v26,
  260.                                                                                                      "-tournament",
  261.                                                                                                      0LL);
  262.     __cxa_guard_release(&`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer);
  263.   }
  264.   if ( CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_pchTournamentServer )
  265.   {
  266.     if ( byte_A44079 & 0x10 )
  267.     {
  268.       v27 = "FCVAR_NEVER_AS_STRING";
  269.     }
  270.     else
  271.     {
  272.       v27 = "";
  273.       if ( *(_QWORD *)(qword_A44088 + 72) )
  274.         v27 = *(const char **)(qword_A44088 + 72);
  275.     }
  276.     v28 = strchr(v27, 123);
  277.     for ( i = 0; v28; v28 = strchr(v28 + 1, 123) )
  278.     {
  279.       v37 = 0;
  280.       sscanf(v28, "{%x}", &v37);
  281.       i -= (v37 < 1) - 1;
  282.     }
  283.     v3 = a2;
  284.     if ( !`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots
  285.       && (unsigned int)__cxa_guard_acquire(&`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots) )
  286.     {
  287.       v30 = CommandLine(
  288.               &`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots,
  289.               123LL);
  290.       CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots = (*(__int64 (__fastcall **)(__int64, const char *, signed __int64))(*(_QWORD *)v30 + 64LL))(v30, "-tournament_extra_casters_slots", 2LL);
  291.       __cxa_guard_release(&`guard variable for'CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots);
  292.     }
  293.     if ( CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots <= i )
  294.       i = CBaseServer::SetReservationCookie(unsigned long long,char const*,...)::s_nTournamentExtraCastersSlots;
  295.     v31 = 0;
  296.     if ( i >= 0 )
  297.       v31 = i;
  298.     *((_DWORD *)v4 + 222) += v31;
  299.   }
  300. LABEL_58:
  301.   while ( 1 )
  302.   {
  303.     *((_QWORD *)v4 + 108) = v3;
  304.     CBaseServer::UpdateGameData(v4);
  305.     ConVar::SetValue((ConVar *)&sv_hosting_lobby, *((_QWORD *)v4 + 108) != 0LL);
  306.     result = __stack_chk_guard;
  307.     if ( __stack_chk_guard == v69 )
  308.       break;
  309. LABEL_59:
  310.     CFmtStrN<256,false>::CFmtStrN(&v46, "0x%llx", v3);
  311.     ConVar::SetValue((ConVar *)&sv_mmqueue_reservation, &v47);
  312.   }
  313.   return result;
  314. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top