private unsafe void OnLobbyChatMessageRecievedAPI(LobbyChatMsg_t callback, bool error) { //from Client.Networking if (error || callback.SteamIDLobby != CurrentLobby) { return; } byte[] ReceiveBuffer = new byte[1024]; SteamNative.CSteamID steamid = 1; ChatEntryType chatEntryType; //not used int readData = 0; fixed(byte *p = ReceiveBuffer) { readData = client.native.matchmaking.GetLobbyChatEntry(CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, ReceiveBuffer.Length, out chatEntryType); while (ReceiveBuffer.Length < readData) { ReceiveBuffer = new byte[readData + 1024]; readData = client.native.matchmaking.GetLobbyChatEntry(CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, ReceiveBuffer.Length, out chatEntryType); } } if (OnChatMessageRecieved != null) { OnChatMessageRecieved(steamid, ReceiveBuffer, readData); } }
private unsafe void OnLobbyChatMessageRecievedAPI(LobbyChatMsg_t callback, bool error) { //from Client.Networking if (error || callback.SteamIDLobby != CurrentLobby) { return; } SteamNative.CSteamID steamid = 1; ChatEntryType chatEntryType; // "If set then this will just always return k_EChatEntryTypeChatMsg. This can usually just be set to NULL." int readData = 0; fixed(byte *p = chatMessageData) { readData = client.native.matchmaking.GetLobbyChatEntry(CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, chatMessageData.Length, out chatEntryType); } OnChatMessageRecieved?.Invoke(steamid, chatMessageData, readData); OnChatStringRecieved?.Invoke(steamid, Encoding.UTF8.GetString(chatMessageData)); }
// bool public bool InviteUserToLobby(CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDInvitee /*class CSteamID*/) { return(platform.ISteamMatchmaking_InviteUserToLobby(steamIDLobby.Value, steamIDInvitee.Value)); }
// bool public bool CloseP2PSessionWithUser(CSteamID steamIDRemote /*class CSteamID*/) { return(platform.ISteamNetworking_CloseP2PSessionWithUser(steamIDRemote.Value)); }
// bool public bool SendP2PPacket(CSteamID steamIDRemote /*class CSteamID*/, IntPtr pubData /*const void **/, uint cubData /*uint32*/, P2PSend eP2PSendType /*EP2PSend*/, int nChannel /*int*/) { return(platform.ISteamNetworking_SendP2PPacket(steamIDRemote.Value, (IntPtr)pubData, cubData, eP2PSendType, nChannel)); }
// bool public bool GetSocketInfo(SNetSocket_t hSocket /*SNetSocket_t*/, out CSteamID pSteamIDRemote /*class CSteamID **/, IntPtr peSocketStatus /*int **/, out uint punIPRemote /*uint32 **/, out ushort punPortRemote /*uint16 **/) { return(platform.ISteamNetworking_GetSocketInfo(hSocket.Value, out pSteamIDRemote.Value, (IntPtr)peSocketStatus, out punIPRemote, out punPortRemote)); }
// BeginAuthSessionResult public BeginAuthSessionResult BeginAuthSession(IntPtr pAuthTicket /*const void **/, int cbAuthTicket /*int*/, CSteamID steamID /*class CSteamID*/) { return(platform.ISteamUser_BeginAuthSession((IntPtr)pAuthTicket, cbAuthTicket, steamID.Value)); }
// UserHasLicenseForAppResult public UserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID /*class CSteamID*/, AppId_t appID /*AppId_t*/) { return(platform.ISteamUser_UserHasLicenseForApp(steamID.Value, appID.Value)); }
// bool public bool SetLobbyJoinable(CSteamID steamIDLobby /*class CSteamID*/, bool bLobbyJoinable /*bool*/) { return(platform.ISteamMatchmaking_SetLobbyJoinable(steamIDLobby.Value, bLobbyJoinable)); }
// void public void SetLobbyGameServer(CSteamID steamIDLobby /*class CSteamID*/, uint unGameServerIP /*uint32*/, ushort unGameServerPort /*uint16*/, CSteamID steamIDGameServer /*class CSteamID*/) { platform.ISteamMatchmaking_SetLobbyGameServer(steamIDLobby.Value, unGameServerIP, unGameServerPort, steamIDGameServer.Value); }
// bool public bool SetLobbyData(CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/, string pchValue /*const char **/) { return(platform.ISteamMatchmaking_SetLobbyData(steamIDLobby.Value, pchKey, pchValue)); }
// bool public bool SetLinkedLobby(CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDLobbyDependent /*class CSteamID*/) { return(platform.ISteamMatchmaking_SetLinkedLobby(steamIDLobby.Value, steamIDLobbyDependent.Value)); }
// bool public bool SendLobbyChatMsg(CSteamID steamIDLobby /*class CSteamID*/, IntPtr pvMsgBody /*const void **/, int cubMsgBody /*int*/) { return(platform.ISteamMatchmaking_SendLobbyChatMsg(steamIDLobby.Value, (IntPtr)pvMsgBody, cubMsgBody)); }
// bool public bool RequestLobbyData(CSteamID steamIDLobby /*class CSteamID*/) { return(platform.ISteamMatchmaking_RequestLobbyData(steamIDLobby.Value)); }
// void public void LeaveLobby(CSteamID steamIDLobby /*class CSteamID*/) { platform.ISteamMatchmaking_LeaveLobby(steamIDLobby.Value); }
// void public void EndAuthSession(CSteamID steamID /*class CSteamID*/) { platform.ISteamUser_EndAuthSession(steamID.Value); }
// int public int InitiateGameConnection(IntPtr pAuthBlob /*void **/, int cbMaxAuthBlob /*int*/, CSteamID steamIDGameServer /*class CSteamID*/, uint unIPServer /*uint32*/, ushort usPortServer /*uint16*/, bool bSecure /*bool*/) { return(platform.ISteamUser_InitiateGameConnection((IntPtr)pAuthBlob, cbMaxAuthBlob, steamIDGameServer.Value, unIPServer, usPortServer, bSecure)); }
// void public void SetLobbyMemberData(CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/, string pchValue /*const char **/) { platform.ISteamMatchmaking_SetLobbyMemberData(steamIDLobby.Value, pchKey, pchValue); }
// void public void AdvertiseGame(CSteamID steamIDGameServer /*class CSteamID*/, uint unIPServer /*uint32*/, ushort usPortServer /*uint16*/) { platform.ISteamUser_AdvertiseGame(steamIDGameServer.Value, unIPServer, usPortServer); }
// bool public bool SetLobbyMemberLimit(CSteamID steamIDLobby /*class CSteamID*/, int cMaxMembers /*int*/) { return(platform.ISteamMatchmaking_SetLobbyMemberLimit(steamIDLobby.Value, cMaxMembers)); }
// bool public bool GetP2PSessionState(CSteamID steamIDRemote /*class CSteamID*/, ref P2PSessionState_t pConnectionState /*struct P2PSessionState_t **/) { return(platform.ISteamNetworking_GetP2PSessionState(steamIDRemote.Value, ref pConnectionState)); }
// bool public bool SetLobbyOwner(CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDNewOwner /*class CSteamID*/) { return(platform.ISteamMatchmaking_SetLobbyOwner(steamIDLobby.Value, steamIDNewOwner.Value)); }
// bool public bool ReadP2PPacket(IntPtr pubDest /*void **/, uint cubDest /*uint32*/, out uint pcubMsgSize /*uint32 **/, out CSteamID psteamIDRemote /*class CSteamID **/, int nChannel /*int*/) { return(platform.ISteamNetworking_ReadP2PPacket((IntPtr)pubDest, cubDest, out pcubMsgSize, out psteamIDRemote.Value, nChannel)); }
// bool public bool SetLobbyType(CSteamID steamIDLobby /*class CSteamID*/, LobbyType eLobbyType /*ELobbyType*/) { return(platform.ISteamMatchmaking_SetLobbyType(steamIDLobby.Value, eLobbyType)); }
// bool public bool CloseP2PChannelWithUser(CSteamID steamIDRemote /*class CSteamID*/, int nChannel /*int*/) { return(platform.ISteamNetworking_CloseP2PChannelWithUser(steamIDRemote.Value, nChannel)); }
// void public void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby /*class CSteamID*/) { platform.ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(steamIDLobby.Value); }
// SNetSocket_t public SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget /*class CSteamID*/, int nVirtualPort /*int*/, int nTimeoutSec /*int*/, bool bAllowUseOfPacketRelay /*bool*/) { return(platform.ISteamNetworking_CreateP2PConnectionSocket(steamIDTarget.Value, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay)); }
// bool public bool TradeItems(ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, CSteamID steamIDTradePartner /*class CSteamID*/, SteamItemInstanceID_t[] pArrayGive /*const SteamItemInstanceID_t **/, uint[] pArrayGiveQuantity /*const uint32 **/, uint nArrayGiveLength /*uint32*/, SteamItemInstanceID_t[] pArrayGet /*const SteamItemInstanceID_t **/, uint[] pArrayGetQuantity /*const uint32 **/, uint nArrayGetLength /*uint32*/) { return(platform.ISteamInventory_TradeItems(ref pResultHandle.Value, steamIDTradePartner.Value, pArrayGive.Select(x => x.Value).ToArray(), pArrayGiveQuantity, nArrayGiveLength, pArrayGet.Select(x => x.Value).ToArray(), pArrayGetQuantity, nArrayGetLength)); }
// bool public bool CheckResultSteamID(SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/, CSteamID steamIDExpected /*class CSteamID*/) { return(platform.ISteamInventory_CheckResultSteamID(resultHandle.Value, steamIDExpected.Value)); }
// int public int GetNumLobbyMembers(CSteamID steamIDLobby /*class CSteamID*/) { return(platform.ISteamMatchmaking_GetNumLobbyMembers(steamIDLobby.Value)); }