diff --git a/Facepunch.Steamworks.Test/AppTest.cs b/Facepunch.Steamworks.Test/AppTest.cs index 693abe2..95833dc 100644 --- a/Facepunch.Steamworks.Test/AppTest.cs +++ b/Facepunch.Steamworks.Test/AppTest.cs @@ -32,7 +32,7 @@ namespace Steamworks // // Init Client // - Steamworks.SteamClient.Init( 252490 ); + Steamworks.SteamClient.Init( 1442910 ); // // Init Server @@ -44,7 +44,7 @@ namespace Steamworks QueryPort = 28016 }; - Steamworks.SteamServer.Init( 252490, serverInit ); + Steamworks.SteamServer.Init( 1442910, serverInit ); // // Needs to happen before LogOnAnonymous diff --git a/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf b/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf deleted file mode 100644 index b0672eb..0000000 --- a/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf +++ /dev/null @@ -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" - } - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll b/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll deleted file mode 100644 index 216cf68..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll b/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll deleted file mode 100644 index 9d78727..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll b/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll deleted file mode 100644 index e4a2392..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll b/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll deleted file mode 100644 index 155dad4..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll deleted file mode 100644 index 8ad7e87..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll deleted file mode 100644 index 394e8a2..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf b/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf deleted file mode 100644 index b0672eb..0000000 --- a/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf +++ /dev/null @@ -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" - } - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/bin/Release/steamclient.dll b/Facepunch.Steamworks.Test/bin/Release/steamclient.dll deleted file mode 100644 index 216cf68..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/steamclient.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll b/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll deleted file mode 100644 index 9d78727..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll b/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll deleted file mode 100644 index e4a2392..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll b/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll deleted file mode 100644 index 155dad4..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll deleted file mode 100644 index 8ad7e87..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll deleted file mode 100644 index 394e8a2..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/linux32/libsteam_api.so b/Facepunch.Steamworks.Test/linux32/libsteam_api.so new file mode 100644 index 0000000..687503b Binary files /dev/null and b/Facepunch.Steamworks.Test/linux32/libsteam_api.so differ diff --git a/Facepunch.Steamworks.Test/linux64/libsteam_api.so b/Facepunch.Steamworks.Test/linux64/libsteam_api.so new file mode 100644 index 0000000..4217a2e Binary files /dev/null and b/Facepunch.Steamworks.Test/linux64/libsteam_api.so differ diff --git a/Facepunch.Steamworks.Test/osx/libsteam_api.dylib b/Facepunch.Steamworks.Test/osx/libsteam_api.dylib new file mode 100644 index 0000000..5237be0 Binary files /dev/null and b/Facepunch.Steamworks.Test/osx/libsteam_api.dylib differ diff --git a/Facepunch.Steamworks.Test/steam_api.lib b/Facepunch.Steamworks.Test/steam_api.lib new file mode 100644 index 0000000..0cc7011 Binary files /dev/null and b/Facepunch.Steamworks.Test/steam_api.lib differ diff --git a/Facepunch.Steamworks.Test/win64/steam_api64.dll b/Facepunch.Steamworks.Test/win64/steam_api64.dll new file mode 100644 index 0000000..2b42812 Binary files /dev/null and b/Facepunch.Steamworks.Test/win64/steam_api64.dll differ diff --git a/Facepunch.Steamworks.Test/win64/steam_api64.lib b/Facepunch.Steamworks.Test/win64/steam_api64.lib new file mode 100644 index 0000000..fb014ec Binary files /dev/null and b/Facepunch.Steamworks.Test/win64/steam_api64.lib differ diff --git a/Facepunch.Steamworks/Networking/NetIdentity.cs b/Facepunch.Steamworks/Networking/NetIdentity.cs index 270bf5a..127cd40 100644 --- a/Facepunch.Steamworks/Networking/NetIdentity.cs +++ b/Facepunch.Steamworks/Networking/NetIdentity.cs @@ -88,6 +88,17 @@ namespace Steamworks.Data return InternalGetSteamID( ref id ); } } + + /// + /// Convert to a SteamId + /// + /// + public static implicit operator NetIdentity( string value ) + { + NetIdentity id = default; + InternalSetGenericString( ref id, value ); + return id; + } /// /// Returns NULL if we're not a NetAddress @@ -103,6 +114,21 @@ namespace Steamworks.Data return addrptr.ToType(); } } + + /// + /// Returns NULL if we're not a NetAddress + /// + public string GenericString + { + get + { + if ( type != IdentityType.GenericString ) return default; + var id = this; + + var addrptr = InternalGetGenericString( ref id ); + return addrptr; + } + } /// /// We override tostring to provide a sensible representation @@ -123,4 +149,4 @@ namespace Steamworks.Data SteamID = 16 } } -} \ No newline at end of file +} diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index 68431bb..7435cb8 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -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 @@ namespace Steamworks { 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 + }; + } + } } } diff --git a/Facepunch.Steamworks/linux32/libsteam_api.so b/Facepunch.Steamworks/linux32/libsteam_api.so new file mode 100644 index 0000000..687503b Binary files /dev/null and b/Facepunch.Steamworks/linux32/libsteam_api.so differ diff --git a/Facepunch.Steamworks/linux64/libsteam_api.so b/Facepunch.Steamworks/linux64/libsteam_api.so new file mode 100644 index 0000000..4217a2e Binary files /dev/null and b/Facepunch.Steamworks/linux64/libsteam_api.so differ diff --git a/Facepunch.Steamworks/osx/libsteam_api.dylib b/Facepunch.Steamworks/osx/libsteam_api.dylib new file mode 100644 index 0000000..5237be0 Binary files /dev/null and b/Facepunch.Steamworks/osx/libsteam_api.dylib differ diff --git a/Facepunch.Steamworks/steam_api.lib b/Facepunch.Steamworks/steam_api.lib new file mode 100644 index 0000000..0cc7011 Binary files /dev/null and b/Facepunch.Steamworks/steam_api.lib differ diff --git a/Facepunch.Steamworks/win64/steam_api64.dll b/Facepunch.Steamworks/win64/steam_api64.dll new file mode 100644 index 0000000..2b42812 Binary files /dev/null and b/Facepunch.Steamworks/win64/steam_api64.dll differ diff --git a/Facepunch.Steamworks/win64/steam_api64.lib b/Facepunch.Steamworks/win64/steam_api64.lib new file mode 100644 index 0000000..fb014ec Binary files /dev/null and b/Facepunch.Steamworks/win64/steam_api64.lib differ