mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 22:55:55 +03:00
Update, Added GetAuthTicket, to be able to do the Auth Workflow on a server from an home made API
This commit is contained in:
parent
4463739be5
commit
19953587a7
@ -32,7 +32,7 @@ public static void AssemblyInit( TestContext context )
|
|||||||
//
|
//
|
||||||
// Init Client
|
// Init Client
|
||||||
//
|
//
|
||||||
Steamworks.SteamClient.Init( 252490 );
|
Steamworks.SteamClient.Init( 1442910 );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init Server
|
// Init Server
|
||||||
@ -44,7 +44,7 @@ public static void AssemblyInit( TestContext context )
|
|||||||
QueryPort = 28016
|
QueryPort = 28016
|
||||||
};
|
};
|
||||||
|
|
||||||
Steamworks.SteamServer.Init( 252490, serverInit );
|
Steamworks.SteamServer.Init( 1442910, serverInit );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Needs to happen before LogOnAnonymous
|
// Needs to happen before LogOnAnonymous
|
||||||
|
@ -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.
@ -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.
BIN
Facepunch.Steamworks.Test/linux32/libsteam_api.so
Normal file
BIN
Facepunch.Steamworks.Test/linux32/libsteam_api.so
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks.Test/linux64/libsteam_api.so
Normal file
BIN
Facepunch.Steamworks.Test/linux64/libsteam_api.so
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks.Test/osx/libsteam_api.dylib
Normal file
BIN
Facepunch.Steamworks.Test/osx/libsteam_api.dylib
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks.Test/steam_api.lib
Normal file
BIN
Facepunch.Steamworks.Test/steam_api.lib
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks.Test/win64/steam_api64.dll
Normal file
BIN
Facepunch.Steamworks.Test/win64/steam_api64.dll
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks.Test/win64/steam_api64.lib
Normal file
BIN
Facepunch.Steamworks.Test/win64/steam_api64.lib
Normal file
Binary file not shown.
@ -89,6 +89,17 @@ public SteamId SteamId
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <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>
|
/// <summary>
|
||||||
/// Returns NULL if we're not a NetAddress
|
/// Returns NULL if we're not a NetAddress
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -104,6 +115,21 @@ public NetAddress Address
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <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>
|
/// <summary>
|
||||||
/// We override tostring to provide a sensible representation
|
/// We override tostring to provide a sensible representation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -462,5 +463,25 @@ public static UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamid,
|
|||||||
{
|
{
|
||||||
return Internal.UserHasLicenseForApp( steamid, appid );
|
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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
Facepunch.Steamworks/linux32/libsteam_api.so
Normal file
BIN
Facepunch.Steamworks/linux32/libsteam_api.so
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks/linux64/libsteam_api.so
Normal file
BIN
Facepunch.Steamworks/linux64/libsteam_api.so
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks/osx/libsteam_api.dylib
Normal file
BIN
Facepunch.Steamworks/osx/libsteam_api.dylib
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks/steam_api.lib
Normal file
BIN
Facepunch.Steamworks/steam_api.lib
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks/win64/steam_api64.dll
Normal file
BIN
Facepunch.Steamworks/win64/steam_api64.dll
Normal file
Binary file not shown.
BIN
Facepunch.Steamworks/win64/steam_api64.lib
Normal file
BIN
Facepunch.Steamworks/win64/steam_api64.lib
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user