コード例 #1
0
 /// <summary>
 /// <para> Releases a previously created communications pipe</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe));
 }
コード例 #2
0
 public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamApps_GetInstalledDepots(CSteamGameServerAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots));
 }
コード例 #3
0
 public static bool BIsAppInstalled(AppId_t appID)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamApps_BIsAppInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID));
 }
コード例 #4
0
 /// <summary>
 /// <para> AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback</para>
 /// <para> P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet</para>
 /// <para> if you don't want to talk to the user, just ignore the request</para>
 /// <para> if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically</para>
 /// <para> this may be called multiple times for a single user</para>
 /// <para> (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)</para>
 /// </summary>
 public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote));
 }
コード例 #5
0
		public static void Shutdown() {
			InteropHelp.TestIfPlatformSupported();
			NativeMethods.SteamGameServer_Shutdown();
			CSteamGameServerAPIContext.Clear();
			CallbackDispatcher.Shutdown();
		}
コード例 #6
0
 /// <summary>
 /// <para> max packet size, in bytes</para>
 /// </summary>
 public static int GetMaxPacketSize(SNetSocket_t hSocket)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket));
 }
コード例 #7
0
 /// <summary>
 /// <para> returns true if any data is available for read, and the amount of data that will need to be read</para>
 /// </summary>
 public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel));
 }
コード例 #8
0
 /// <summary>
 /// <para> Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection</para>
 /// <para> or NAT-traversal cannot be established. Only applies to connections created after setting this value,</para>
 /// <para> or to existing connections that need to automatically reconnect after this value is set.</para>
 /// <para> P2P packet relay is allowed by default</para>
 /// <para> NOTE: This function is deprecated and may be removed in a future version of the SDK.  For</para>
 /// <para> security purposes, we may decide to relay the traffic to certain peers, even if you pass false</para>
 /// <para> to this function, to prevent revealing the client's IP address top another peer.</para>
 /// </summary>
 public static bool AllowP2PPacketRelay(bool bAllow)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow));
 }
コード例 #9
0
 /// <summary>
 /// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
 /// <para> LISTEN / CONNECT connection-oriented interface functions</para>
 /// <para> These functions are more like a client-server TCP API.  One side is the "server"</para>
 /// <para> and "listens" for incoming connections, which then must be "accepted."  The "client"</para>
 /// <para> initiates a connection by "connecting."  Sending and receiving is done through a</para>
 /// <para> connection handle.</para>
 /// <para> For a more UDP-style interface, where you do not track connection handles but</para>
 /// <para> simply send messages to a SteamID, use the UDP-style functions above.</para>
 /// <para> Both methods can send both reliable and unreliable methods.</para>
 /// <para> These APIs are deprecated, and may be removed in a future version of the Steamworks</para>
 /// <para> SDK.  See ISteamNetworkingSockets.</para>
 /// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
 /// <para> creates a socket and listens others to connect</para>
 /// <para> will trigger a SocketStatusCallback_t callback on another client connecting</para>
 /// <para> nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports</para>
 /// <para>		this can usually just be 0 unless you want multiple sets of connections</para>
 /// <para> unIP is the local IP address to bind to</para>
 /// <para>		pass in 0 if you just want the default local IP</para>
 /// <para> unPort is the port to use</para>
 /// <para>		pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only</para>
 /// </summary>
 public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, SteamIPAddress_t nIP, ushort nPort, bool bAllowUseOfPacketRelay)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay));
 }
コード例 #10
0
 /// <summary>
 /// <para> set the local IP and Port to bind to</para>
 /// <para> this must be set before CreateLocalUser()</para>
 /// </summary>
 public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort)
 {
     InteropHelp.TestIfAvailableGameServer();
     NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort);
 }
コード例 #11
0
 /// <summary>
 /// <para> fills out P2PSessionState_t structure with details about the underlying connection to the user</para>
 /// <para> should only needed for debugging purposes</para>
 /// <para> returns false if no connection exists to the specified user</para>
 /// </summary>
 public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState));
 }
コード例 #12
0
 /// <summary>
 /// <para> removes an allocated user</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser)
 {
     InteropHelp.TestIfAvailableGameServer();
     NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser);
 }
コード例 #13
0
 /// <summary>
 /// <para> used by game servers, create a steam user that won't be shared with anyone else</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType));
 }
コード例 #14
0
 /// <summary>
 /// <para> connects to an existing global user, failing if none exists</para>
 /// <para> used by the game to coordinate with the steamUI</para>
 /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
 /// </summary>
 public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe));
 }
コード例 #15
0
 /// <summary>
 /// <para> returns which local port the listen socket is bound to</para>
 /// <para> *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only</para>
 /// </summary>
 public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out SteamIPAddress_t pnIP, out ushort pnPort)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort));
 }
コード例 #16
0
 /// <summary>
 /// <para> creates a socket and begin connection to a remote destination</para>
 /// <para> can connect via a known steamID (client or game server), or directly to an IP</para>
 /// <para> on success will trigger a SocketStatusCallback_t callback</para>
 /// <para> on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState</para>
 /// </summary>
 public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay));
 }
コード例 #17
0
 /// <summary>
 /// <para> returns true to describe how the socket ended up connecting</para>
 /// </summary>
 public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket));
 }
コード例 #18
0
 public static SNetSocket_t CreateConnectionSocket(SteamIPAddress_t nIP, ushort nPort, int nTimeoutSec)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec));
 }
コード例 #19
0
 /// <summary>
 /// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
 /// <para> UDP-style (connectionless) networking interface.  These functions send messages using</para>
 /// <para> an API organized around the destination.  Reliable and unreliable messages are supported.</para>
 /// <para> For a more TCP-style interface (meaning you have a connection handle), see the functions below.</para>
 /// <para> Both interface styles can send both reliable and unreliable messages.</para>
 /// <para> Automatically establishes NAT-traversing or Relay server connections</para>
 /// <para> These APIs are deprecated, and may be removed in a future version of the Steamworks</para>
 /// <para> SDK.  See ISteamNetworkingMessages.</para>
 /// <para> Sends a P2P packet to the specified user</para>
 /// <para> UDP-like, unreliable and a max packet size of 1200 bytes</para>
 /// <para> the first packet send may be delayed as the NAT-traversal code runs</para>
 /// <para> if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t</para>
 /// <para> see EP2PSend enum above for the descriptions of the different ways of sending packets</para>
 /// <para> nChannel is a routing number you can use to help route message to different systems  - you'll have to call ReadP2PPacket()</para>
 /// <para> with the same channel number in order to retrieve the data on the other end</para>
 /// <para> using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources</para>
 /// </summary>
 public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel));
 }
コード例 #20
0
 /// <summary>
 /// <para> destroying a listen socket will automatically kill all the regular sockets generated from it</para>
 /// </summary>
 public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd));
 }
コード例 #21
0
 /// <summary>
 /// <para> reads in a packet that has been sent from another user via SendP2PPacket()</para>
 /// <para> returns the size of the message and the steamID of the user who sent it in the last two parameters</para>
 /// <para> if the buffer passed in is too small, the message will be truncated</para>
 /// <para> this call is not blocking, and will return false if no data is available</para>
 /// </summary>
 public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel));
 }
コード例 #22
0
 /// <summary>
 /// <para> sending data</para>
 /// <para> must be a handle to a connected socket</para>
 /// <para> data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets</para>
 /// <para> use the reliable flag with caution; although the resend rate is pretty aggressive,</para>
 /// <para> it can still cause stalls in receiving data (like TCP)</para>
 /// </summary>
 public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable));
 }
コード例 #23
0
 /// <summary>
 /// <para> call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels</para>
 /// <para> open channels to a user have been closed, the open session to the user will be closed and new data from this</para>
 /// <para> user will trigger a P2PSessionRequest_t callback</para>
 /// </summary>
 public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel));
 }
コード例 #24
0
 /// <summary>
 /// <para> checks for data from any socket that has been connected off this listen socket</para>
 /// <para> returns false if there is no data remaining</para>
 /// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para>
 /// <para> fills out *phSocket with the socket that data is available on</para>
 /// </summary>
 public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket));
 }
コード例 #25
0
 public static bool MarkContentCorrupt(bool bMissingFilesOnly)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamApps_MarkContentCorrupt(CSteamGameServerAPIContext.GetSteamApps(), bMissingFilesOnly));
 }
コード例 #26
0
 /// <summary>
 /// <para> retrieves data from any socket that has been connected off this listen socket</para>
 /// <para> fills in pubDest with the contents of the message</para>
 /// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para>
 /// <para> if *pcubMsgSize &lt; cubDest, only partial data is written</para>
 /// <para> returns false if no data is available</para>
 /// <para> fills out *phSocket with the socket that data is available on</para>
 /// </summary>
 public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket));
 }
コード例 #27
0
 public static bool BIsLowViolence()
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamApps_BIsLowViolence(CSteamGameServerAPIContext.GetSteamApps()));
 }
コード例 #28
0
 /// <summary>
 /// <para> returns information about the specified socket, filling out the contents of the pointers</para>
 /// </summary>
 public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out SteamIPAddress_t punIPRemote, out ushort punPortRemote)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote));
 }
コード例 #29
0
 public static CSteamID GetAppOwner()
 {
     InteropHelp.TestIfAvailableGameServer();
     return((CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamGameServerAPIContext.GetSteamApps()));
 }
コード例 #30
0
 /// <summary>
 /// <para> Trigger global shutdown for the DLL</para>
 /// </summary>
 public static bool BShutdownIfAllPipesClosed()
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()));
 }