Update, Added GetAuthTicket, to be able to do the Auth Workflow on a server from an home made API

This commit is contained in:
François Cugy 2023-07-17 19:53:12 +02:00
parent 4463739be5
commit 19953587a7
29 changed files with 50 additions and 151 deletions

View File

@ -32,7 +32,7 @@ public static void AssemblyInit( TestContext context )
//
// Init Client
//
Steamworks.SteamClient.Init( 252490 );
Steamworks.SteamClient.Init( 1442910 );
//
// Init Server
@ -44,7 +44,7 @@ public static void AssemblyInit( TestContext context )
QueryPort = 28016
};
Steamworks.SteamServer.Init( 252490, serverInit );
Steamworks.SteamServer.Init( 1442910, serverInit );
//
// Needs to happen before LogOnAnonymous

View File

@ -1,74 +0,0 @@
"In Game Actions"
{
"actions"
{
"InGameControls"
{
"title" "#Set_Ingame"
"StickPadGyro"
{
"Move"
{
"title" "#Action_Move"
"input_mode" "joystick_move"
}
"Camera"
{
"title" "#Action_Camera"
"input_mode" "absolute_mouse"
}
}
"AnalogTrigger"
{
"Throttle" "#Action_Throttle"
}
"Button"
{
"fire" "#Action_Fire"
"Jump" "#Action_Jump"
"pause_menu" "#Action_Menu"
}
}
"MenuControls"
{
"title" "#Set_Menu"
"StickPadGyro"
{
}
"AnalogTrigger"
{
}
"Button"
{
"menu_up" "#Menu_Up"
"menu_down" "#Menu_Down"
"menu_left" "#Menu_Left"
"menu_right" "#Menu_Right"
"menu_select" "#Menu_Select"
"menu_cancel" "#Menu_Cancel"
"pause_menu" "#Action_ReturnToGame"
}
}
}
"localization"
{
"english"
{
"Set_Ingame" "In-Game Controls"
"Set_Menu" "Menu Controls"
"Action_Move" "Movement"
"Action_Camera" "Camera"
"Action_Throttle" "Throttle"
"Action_Fire" "Fire Weapon"
"Action_Jump" "Jump"
"Action_Menu" "Pause Menu"
"Action_ReturnToGame" "Return To Game"
"Menu_Up" "Up"
"Menu_Down" "Down"
"Menu_Left" "Left"
"Menu_Right" "Right"
"Menu_Select" "Select"
"Menu_Cancel" "Cancel"
}
}
}

View File

@ -1,74 +0,0 @@
"In Game Actions"
{
"actions"
{
"InGameControls"
{
"title" "#Set_Ingame"
"StickPadGyro"
{
"Move"
{
"title" "#Action_Move"
"input_mode" "joystick_move"
}
"Camera"
{
"title" "#Action_Camera"
"input_mode" "absolute_mouse"
}
}
"AnalogTrigger"
{
"Throttle" "#Action_Throttle"
}
"Button"
{
"fire" "#Action_Fire"
"Jump" "#Action_Jump"
"pause_menu" "#Action_Menu"
}
}
"MenuControls"
{
"title" "#Set_Menu"
"StickPadGyro"
{
}
"AnalogTrigger"
{
}
"Button"
{
"menu_up" "#Menu_Up"
"menu_down" "#Menu_Down"
"menu_left" "#Menu_Left"
"menu_right" "#Menu_Right"
"menu_select" "#Menu_Select"
"menu_cancel" "#Menu_Cancel"
"pause_menu" "#Action_ReturnToGame"
}
}
}
"localization"
{
"english"
{
"Set_Ingame" "In-Game Controls"
"Set_Menu" "Menu Controls"
"Action_Move" "Movement"
"Action_Camera" "Camera"
"Action_Throttle" "Throttle"
"Action_Fire" "Fire Weapon"
"Action_Jump" "Jump"
"Action_Menu" "Pause Menu"
"Action_ReturnToGame" "Return To Game"
"Menu_Up" "Up"
"Menu_Down" "Down"
"Menu_Left" "Left"
"Menu_Right" "Right"
"Menu_Select" "Select"
"Menu_Cancel" "Cancel"
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -88,6 +88,17 @@ public SteamId SteamId
return InternalGetSteamID( ref id );
}
}
/// <summary>
/// Convert to a SteamId
/// </summary>
/// <param name="value"></param>
public static implicit operator NetIdentity( string value )
{
NetIdentity id = default;
InternalSetGenericString( ref id, value );
return id;
}
/// <summary>
/// Returns NULL if we're not a NetAddress
@ -103,6 +114,21 @@ public NetAddress Address
return addrptr.ToType<NetAddress>();
}
}
/// <summary>
/// Returns NULL if we're not a NetAddress
/// </summary>
public string GenericString
{
get
{
if ( type != IdentityType.GenericString ) return default;
var id = this;
var addrptr = InternalGetGenericString( ref id );
return addrptr;
}
}
/// <summary>
/// We override tostring to provide a sensible representation
@ -123,4 +149,4 @@ internal enum IdentityType
SteamID = 16
}
}
}
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
@ -462,5 +463,25 @@ public static UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamid,
{
return Internal.UserHasLicenseForApp( steamid, appid );
}
public static unsafe AuthTicket GetAuthSessionTicket( NetIdentity identity )
{
var data = Helpers.TakeBuffer( 1024 );
fixed ( byte* b = data )
{
uint ticketLength = 0;
uint ticket = Internal.GetAuthSessionTicket( (IntPtr)b, data.Length, ref ticketLength, ref identity );
if ( ticket == 0 )
return null;
return new AuthTicket()
{
Data = data.Take( (int)ticketLength ).ToArray(),
Handle = ticket
};
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.