コード例 #1
0
        /// <summary>
        /// <para>Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.</para>
        /// <a href="https://partner.steamgames.com/doc/api/ISteamGameServer#GetAuthSessionTicket">https://partner.steamgames.com/doc/api/ISteamGameServer#GetAuthSessionTicket</a>
        /// </summary>
        /// <returns></returns>
        public static Ticket ServerGetAuthSessionTicket()
        {
            RegisterCallbacks();

            uint m_pcbTicket;
            var  ticket = new Ticket();

            ticket.isClientTicket = false;
            ticket.Data           = new byte[1024];
            ticket.Handle         = SteamGameServer.GetAuthSessionTicket(ticket.Data, 1024, out m_pcbTicket);
            ticket.CreatedOn      = SteamUtils.GetServerRealTime();
            Array.Resize(ref ticket.Data, (int)m_pcbTicket);

            if (ActiveTickets == null)
            {
                ActiveTickets = new List <Ticket>();
            }

            ActiveTickets.Add(ticket);

            return(ticket);
        }