/// <summary> /// The Execute method will handle Steam CallResult creation and storage. /// Simply pass the configured SteamAPICall and the callback that you want to be invoked when the work is done. /// Pending results can be viewed in the console with SteamMainBase.IsDebugLogEnabled set to <c>true</c>. /// </summary> /// <param name="p_steamCall">the configured SteamAPICall.</param> /// <param name="p_onCompleted">invoked when the work is done.</param> /// <typeparam name="T">The CallResult type.</typeparam> public void Execute <T>(SteamAPICall_t p_steamCall, CallResult <T> .APIDispatchDelegate p_onCompleted) { CallResult <T> callResult = CallResult <T> .Create(p_onCompleted); callResult.Set(p_steamCall, null); m_pendingRequests.Add(callResult); }
public void OnEnable() { m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived); m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored); m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnUserAchievementStored); m_UserStatsUnloaded = Callback <UserStatsUnloaded_t> .Create(OnUserStatsUnloaded); m_UserAchievementIconFetched = Callback <UserAchievementIconFetched_t> .Create(OnUserAchievementIconFetched); UserStatsReceived = CallResult <UserStatsReceived_t> .Create(OnUserStatsReceived); LeaderboardFindResult = CallResult <LeaderboardFindResult_t> .Create(OnLeaderboardFindResult); LeaderboardScoresDownloaded = CallResult <LeaderboardScoresDownloaded_t> .Create(OnLeaderboardScoresDownloaded); LeaderboardScoreUploaded = CallResult <LeaderboardScoreUploaded_t> .Create(OnLeaderboardScoreUploaded); NumberOfCurrentPlayers = CallResult <NumberOfCurrentPlayers_t> .Create(OnNumberOfCurrentPlayers); GlobalAchievementPercentagesReady = CallResult <GlobalAchievementPercentagesReady_t> .Create(OnGlobalAchievementPercentagesReady); LeaderboardUGCSet = CallResult <LeaderboardUGCSet_t> .Create(OnLeaderboardUGCSet); GlobalStatsReceived = CallResult <GlobalStatsReceived_t> .Create(OnGlobalStatsReceived); }
public void OnEnable() { m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived); m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored); m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnUserAchievementStored); m_UserStatsUnloaded = Callback <UserStatsUnloaded_t> .Create(OnUserStatsUnloaded); m_UserAchievementIconFetched = Callback <UserAchievementIconFetched_t> .Create(OnUserAchievementIconFetched); //m_PS3TrophiesInstalled = Callback<PS3TrophiesInstalled_t>.Create(OnPS3TrophiesInstalled); // PS3 Only. OnUserStatsReceivedCallResult = CallResult <UserStatsReceived_t> .Create(OnUserStatsReceived); OnLeaderboardFindResultCallResult = CallResult <LeaderboardFindResult_t> .Create(OnLeaderboardFindResult); OnLeaderboardScoresDownloadedCallResult = CallResult <LeaderboardScoresDownloaded_t> .Create(OnLeaderboardScoresDownloaded); OnLeaderboardScoreUploadedCallResult = CallResult <LeaderboardScoreUploaded_t> .Create(OnLeaderboardScoreUploaded); OnNumberOfCurrentPlayersCallResult = CallResult <NumberOfCurrentPlayers_t> .Create(OnNumberOfCurrentPlayers); OnGlobalAchievementPercentagesReadyCallResult = CallResult <GlobalAchievementPercentagesReady_t> .Create(OnGlobalAchievementPercentagesReady); OnLeaderboardUGCSetCallResult = CallResult <LeaderboardUGCSet_t> .Create(OnLeaderboardUGCSet); OnGlobalStatsReceivedCallResult = CallResult <GlobalStatsReceived_t> .Create(OnGlobalStatsReceived); }
void OnEnable() { if (m_LobbyListPanel == null || m_LobbyPanel == null) { throw new System.Exception("Stop being a dumbo ya' big dumbo."); } m_LobbyPanel.SetActive(false); m_LobbyListPanel.SetActive(true); if (!SteamManager.Initialized) { ChangeState(EChatClientState.SteamNotInitialized); return; } m_LobbyEnterCallResult = CallResult<LobbyEnter_t>.Create(OnLobbyEnter); m_LobbyMatchListCallResult = CallResult<LobbyMatchList_t>.Create(OnLobbyMatchList); m_LobbyCreatedCallResult = CallResult<LobbyCreated_t>.Create(OnLobbyCreated); m_Lobbies = null; if (m_items != null) { for (int i = 0; i < m_items.Length; ++i) { Destroy(m_items[i]); } } m_items = null; RefreshLobbyList(); }
public void OnEnable() { m_Message = ""; m_RemoteStorageAppSyncedClient = Callback <RemoteStorageAppSyncedClient_t> .Create(OnRemoteStorageAppSyncedClient); m_RemoteStorageAppSyncedServer = Callback <RemoteStorageAppSyncedServer_t> .Create(OnRemoteStorageAppSyncedServer); m_RemoteStorageAppSyncProgress = Callback <RemoteStorageAppSyncProgress_t> .Create(OnRemoteStorageAppSyncProgress); m_RemoteStorageAppSyncStatusCheck = Callback <RemoteStorageAppSyncStatusCheck_t> .Create(OnRemoteStorageAppSyncStatusCheck); m_RemoteStoragePublishedFileSubscribed = Callback <RemoteStoragePublishedFileSubscribed_t> .Create(OnRemoteStoragePublishedFileSubscribed); m_RemoteStoragePublishedFileUnsubscribed = Callback <RemoteStoragePublishedFileUnsubscribed_t> .Create(OnRemoteStoragePublishedFileUnsubscribed); m_RemoteStoragePublishedFileDeleted = Callback <RemoteStoragePublishedFileDeleted_t> .Create(OnRemoteStoragePublishedFileDeleted); m_RemoteStoragePublishedFileUpdated = Callback <RemoteStoragePublishedFileUpdated_t> .Create(OnRemoteStoragePublishedFileUpdated); OnRemoteStorageFileShareResultCallResult = CallResult <RemoteStorageFileShareResult_t> .Create(OnRemoteStorageFileShareResult); OnRemoteStoragePublishFileResultCallResult = CallResult <RemoteStoragePublishFileResult_t> .Create(OnRemoteStoragePublishFileResult); OnRemoteStorageDeletePublishedFileResultCallResult = CallResult <RemoteStorageDeletePublishedFileResult_t> .Create(OnRemoteStorageDeletePublishedFileResult); OnRemoteStorageEnumerateUserPublishedFilesResultCallResult = CallResult <RemoteStorageEnumerateUserPublishedFilesResult_t> .Create(OnRemoteStorageEnumerateUserPublishedFilesResult); OnRemoteStorageSubscribePublishedFileResultCallResult = CallResult <RemoteStorageSubscribePublishedFileResult_t> .Create(OnRemoteStorageSubscribePublishedFileResult); OnRemoteStorageEnumerateUserSubscribedFilesResultCallResult = CallResult <RemoteStorageEnumerateUserSubscribedFilesResult_t> .Create(OnRemoteStorageEnumerateUserSubscribedFilesResult); OnRemoteStorageUnsubscribePublishedFileResultCallResult = CallResult <RemoteStorageUnsubscribePublishedFileResult_t> .Create(OnRemoteStorageUnsubscribePublishedFileResult); OnRemoteStorageUpdatePublishedFileResultCallResult = CallResult <RemoteStorageUpdatePublishedFileResult_t> .Create(OnRemoteStorageUpdatePublishedFileResult); OnRemoteStorageDownloadUGCResultCallResult = CallResult <RemoteStorageDownloadUGCResult_t> .Create(OnRemoteStorageDownloadUGCResult); OnRemoteStorageGetPublishedFileDetailsResultCallResult = CallResult <RemoteStorageGetPublishedFileDetailsResult_t> .Create(OnRemoteStorageGetPublishedFileDetailsResult); OnRemoteStorageEnumerateWorkshopFilesResultCallResult = CallResult <RemoteStorageEnumerateWorkshopFilesResult_t> .Create(OnRemoteStorageEnumerateWorkshopFilesResult); OnRemoteStorageGetPublishedItemVoteDetailsResultCallResult = CallResult <RemoteStorageGetPublishedItemVoteDetailsResult_t> .Create(OnRemoteStorageGetPublishedItemVoteDetailsResult); OnRemoteStorageUpdateUserPublishedItemVoteResultCallResult = CallResult <RemoteStorageUpdateUserPublishedItemVoteResult_t> .Create(OnRemoteStorageUpdateUserPublishedItemVoteResult); OnRemoteStorageUserVoteDetailsCallResult = CallResult <RemoteStorageUserVoteDetails_t> .Create(OnRemoteStorageUserVoteDetails); OnRemoteStorageEnumerateUserSharedWorkshopFilesResultCallResult = CallResult <RemoteStorageEnumerateUserSharedWorkshopFilesResult_t> .Create(OnRemoteStorageEnumerateUserSharedWorkshopFilesResult); OnRemoteStorageSetUserPublishedFileActionResultCallResult = CallResult <RemoteStorageSetUserPublishedFileActionResult_t> .Create(OnRemoteStorageSetUserPublishedFileActionResult); OnRemoteStorageEnumeratePublishedFilesByUserActionResultCallResult = CallResult <RemoteStorageEnumeratePublishedFilesByUserActionResult_t> .Create(OnRemoteStorageEnumeratePublishedFilesByUserActionResult); OnRemoteStoragePublishFileProgressCallResult = CallResult <RemoteStoragePublishFileProgress_t> .Create(OnRemoteStoragePublishFileProgress); OnRemoteStorageFileWriteAsyncCompleteCallResult = CallResult <RemoteStorageFileWriteAsyncComplete_t> .Create(OnRemoteStorageFileWriteAsyncComplete); OnRemoteStorageFileReadAsyncCompleteCallResult = CallResult <RemoteStorageFileReadAsyncComplete_t> .Create(OnRemoteStorageFileReadAsyncComplete); }
public static void updateWorkshopItem(ModData data, string path, Action <bool> callback) { var items = initPublishedWorkshopItems(); if (!items.ContainsKey(path)) { throw new Exception("item must be published before it is updated."); } var handle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), items[path]); SteamUGC.SetItemTitle(handle, data.title); SteamUGC.SetItemDescription(handle, data.description); SteamUGC.SetItemTags(handle, data.tags); SteamUGC.SetItemPreview(handle, data.previewImage); SteamUGC.SetItemContent(handle, path); SteamUGC.SetItemVisibility(handle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic); var call = SteamUGC.SubmitItemUpdate(handle, ""); var result = CallResult <SubmitItemUpdateResult_t> .Create(); result.Set(call, (param, error) => { callback(!error && param.m_eResult == EResult.k_EResultOK); }); }
private void OnEnable() { if (SteamManager.Initialized) { m_NumberOfCurrentPlayers = CallResult <NumberOfCurrentPlayers_t> .Create(OnNumberOfCurrentPlayers); } }
//当游戏大厅面板启用时调用,初始化信息 void OnEnable() { m_LobbyMatchListCallResult = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchList); m_LobbyMatchListCallResult.Set(SteamMatchmaking.RequestLobbyList()); currentPageNumber = 1; //初始化当前房间页 maxPageNumber = 1; //初始化最大房间页 //获取房间信息面板 RectTransform rectTransform = roomMessagePanel.GetComponent <RectTransform>(); roomPerPage = rectTransform.childCount; //获取房间信息面板的条目数 //初始化每条房间信息条目 roomMessage = new GameObject[roomPerPage]; for (int i = 0; i < roomPerPage; i++) { roomMessage[i] = rectTransform.GetChild(i).gameObject; roomMessage[i].SetActive(false); //禁用房间信息条目 } ButtonControl(); if (AutoCreateToggle.isOn) { ClickJoinOrCreateButton(); } }
public void GetPublishedMods(int app_id, Action <WorkshopItem[]> callback) { this.Call(delegate() { EUserUGCList list = EUserUGCList.k_EUserUGCList_Published; EUGCMatchingUGCType type = EUGCMatchingUGCType.k_EUGCMatchingUGCType_All; EUserUGCListSortOrder order = EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderAsc; uint page = 1; //@ToDo iterate/count up! A single page has a maximum of 50 items. is the result-count under 50, it's the last page! UGCQueryHandle_t handle = SteamUGC.CreateQueryUserUGCRequest(this.GetAccountID(), list, type, order, this.GetCreatorApp(), new AppId_t((uint)((uint)app_id & 0xFFFFFFul)), page); CallResult <SteamUGCQueryCompleted_t> .Create(delegate(SteamUGCQueryCompleted_t pCallback, bool bIOFailure) { WorkshopItem[] result = new WorkshopItem[pCallback.m_unTotalMatchingResults]; for (uint index = 0; index < pCallback.m_unTotalMatchingResults; index++) { SteamUGCDetails_t details; if (SteamUGC.GetQueryUGCResult(handle, index, out details)) { result[index] = new WorkshopItem(details); } } callback(result); SteamUGC.ReleaseQueryUGCRequest(handle); }).Set(SteamUGC.SendQueryUGCRequest(handle)); }); }
void OnGetTotalCountResult(RemoteStorageEnumerateWorkshopFilesResult_t pCallback, bool bIOFailure) { try { if (pCallback.m_eResult == EResult.k_EResultOK) { for (int i = 0; i < _getAmount; i++) { int randIdx = Random.Range(1, pCallback.m_nTotalResultCount); GetFileInfoResult.Add(CallResult <RemoteStorageEnumerateWorkshopFilesResult_t> .Create(OnGetFileInfoResult)); SteamAPICall_t handle = SteamRemoteStorage.EnumeratePublishedWorkshopFiles(EWorkshopEnumerationType.k_EWorkshopEnumerationTypeRecent, (uint)randIdx, 1, 0, _tags, null); GetFileInfoResult[i].Set(handle); } } else { Finish(_fileIDs, _publishIDs, false); } } catch (System.Exception e) { Finish(_fileIDs, _publishIDs, false); Debug.LogError(e.ToString()); } }
public void Initialize() { try { active = SteamAPI.Init(); Console.WriteLine("Steam logged on: " + SteamUser.BLoggedOn().ToString()); if (active) { Console.WriteLine("Initializing GalaxySDK"); GalaxyInstance.Init(new InitParams("48767653913349277", "58be5c2e55d7f535cf8c4b6bbc09d185de90b152c8c42703cc13502465f0d04a", ".")); encryptedAppTicketResponse = CallResult <EncryptedAppTicketResponse_t> .Create(onEncryptedAppTicketResponse); galaxyAuthListener = new GalaxyHelper.AuthListener(onGalaxyAuthSuccess, onGalaxyAuthFailure, onGalaxyAuthLost); galaxyStateChangeListener = new GalaxyHelper.OperationalStateChangeListener(onGalaxyStateChange); Console.WriteLine("Requesting Steam app ticket"); SteamAPICall_t handle = SteamUser.RequestEncryptedAppTicket(new byte[0], 0); encryptedAppTicketResponse.Set(handle); ConnectionProgress++; } } catch (Exception value) { Console.WriteLine(value); active = false; ConnectionFinished = true; } if (active) { gameOverlayActivated = Callback <GameOverlayActivated_t> .Create(onGameOverlayActivated); gamepadTextInputDismissed = Callback <GamepadTextInputDismissed_t> .Create(OnKeyboardDismissed); } }
protected override void OnEnable() { base.OnEnable(); createItemResult = CallResult <CreateItemResult_t> .Create(OnCreateItemResult); submitItemResult = CallResult <SubmitItemUpdateResult_t> .Create(OnSubmitItemUpdateResult); }
private IEnumerator InitCoroutine() { m_LobbyCreated = Callback <LobbyCreated_t> .Create(OnLobbyCreated); m_GameLobbyJoinRequested = Callback <GameLobbyJoinRequested_t> .Create(OnGameLobbyJoinRequested); m_LobbyEnter = Callback <LobbyEnter_t> .Create(OnLobbyEnter); m_LobbyChatUpdate = Callback <LobbyChatUpdate_t> .Create(OnLobbyChatUpdate); m_LobbyList = CallResult <LobbyMatchList_t> .Create(OnLobbyList); m_SteamServersDisconnected = Callback <SteamServersDisconnected_t> .Create(OnSteamServersDisconnected); m_SteamServersConnected = Callback <SteamServersConnected_t> .Create(OnSteamServersConnected); m_LobbyDataUpdate = Callback <LobbyDataUpdate_t> .Create(OnLobbyDataUpdate); m_GameOverlayActivated = Callback <GameOverlayActivated_t> .Create(OnGameOverlayActivation); m_OnSessionConnectFail = Callback <P2PSessionConnectFail_t> .Create(OnSessionConnectFail); m_OnSessionRequest = Callback <P2PSessionRequest_t> .Create(OnSessionRequest); while (!SteamManager.Initialized) { yield return(null); } }
private void sendButton_Click(object sender, RoutedEventArgs e) { if (contentTitle.Text == null || contentTitle.Text == "") { MessageBox.Show("You must put a title to your content"); return; } if (contentDesc.Text == null || contentDesc.Text == "") { MessageBox.Show("You must put a description to your content"); return; } if (!imageValid) { MessageBox.Show("You must put an image for your content"); return; } var result = SteamUGC.CreateItem(app, EWorkshopFileType.k_EWorkshopFileTypeCommunity); p_createdItem = CallResult <CreateItemResult_t> .Create(); p_createdItem.Set(result, CreatedWorkshopItem); }
private void CreatedWorkshopItem(CreateItemResult_t res, bool ioFailure) { runMT runMTCB = () => { if (res.m_bUserNeedsToAcceptWorkshopLegalAgreement) { MessageBox.Show("You must accept first the workshop legal agreement"); return; } // UGCUpdateHandle_t ugHandle = new UGCUpdateHandle_t(res.m_nPublishedFileId.m_PublishedFileId); UGCUpdateHandle_t ugHandle = SteamUGC.StartItemUpdate(app, res.m_nPublishedFileId); SteamUGC.SetItemTitle(ugHandle, contentTitle.Text); SteamUGC.SetItemDescription(ugHandle, contentDesc.Text); SteamUGC.SetItemPreview(ugHandle, (string)imagePath.Content); string runtimePath = AppDomain.CurrentDomain.BaseDirectory; if (!Directory.Exists(runtimePath + "Workshop")) { Directory.CreateDirectory(runtimePath + "Workshop"); } if (!Directory.Exists(runtimePath + "Workshop\\" + res.m_nPublishedFileId)) { Directory.CreateDirectory(runtimePath + "Workshop\\" + res.m_nPublishedFileId); } Guid localLowId = new Guid("A520A1A4-1780-4FF6-BD18-167343C5AF16"); string DataPath = GetKnownFolderPath(localLowId); DataPath += "\\Fustygame\\Hover\\Missions"; if (!Directory.Exists(System.IO.Path.GetDirectoryName(runtimePath + "Workshop\\" + res.m_nPublishedFileId + "\\" + SelectedFileName + ".xml"))) { Directory.CreateDirectory(System.IO.Path.GetDirectoryName(runtimePath + "Workshop\\" + res.m_nPublishedFileId + "\\" + SelectedFileName + ".xml")); } File.Copy(DataPath + "\\" + SelectedFileName + ".xml", runtimePath + "Workshop\\" + res.m_nPublishedFileId + "\\" + SelectedFileName + ".xml"); SteamUGC.SetItemContent(ugHandle, (runtimePath + "Workshop\\" + res.m_nPublishedFileId + "\\").Replace("\\", "/")); SteamUGC.SetItemTags(ugHandle, new List <string> { "Races" }); // Add language SteamUGC.SetItemVisibility(ugHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic); var steamCall = SteamUGC.SubmitItemUpdate(ugHandle, ""); p_workshopUpd = CallResult <SubmitItemUpdateResult_t> .Create(); p_workshopUpd.Set(steamCall, SubmitItemCallResult); MessageBox.Show("Submitting to Steam..."); _Missions.Clear(); //RefreshWorkshopList(); }; pending = runMTCB; }
public void OnEnable() { m_FavoritesListChanged = Callback <FavoritesListChanged_t> .Create(OnFavoritesListChanged); m_LobbyInvite = Callback <LobbyInvite_t> .Create(OnLobbyInvite); m_LobbyEnter = Callback <LobbyEnter_t> .Create(OnLobbyEnter); m_LobbyDataUpdate = Callback <LobbyDataUpdate_t> .Create(OnLobbyDataUpdate); m_LobbyChatUpdate = Callback <LobbyChatUpdate_t> .Create(OnLobbyChatUpdate); m_LobbyChatMsg = Callback <LobbyChatMsg_t> .Create(OnLobbyChatMsg); m_LobbyGameCreated = Callback <LobbyGameCreated_t> .Create(OnLobbyGameCreated); m_LobbyKicked = Callback <LobbyKicked_t> .Create(OnLobbyKicked); //m_PSNGameBootInviteResult = Callback<PSNGameBootInviteResult_t>.Create(OnPSNGameBootInviteResult); // PS3 Only. m_FavoritesListAccountsUpdated = Callback <FavoritesListAccountsUpdated_t> .Create(OnFavoritesListAccountsUpdated); OnLobbyEnterCallResult = CallResult <LobbyEnter_t> .Create(OnLobbyEnter); OnLobbyMatchListCallResult = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchList); OnLobbyCreatedCallResult = CallResult <LobbyCreated_t> .Create(OnLobbyCreated); }
public void OnEnable() { m_ItemInstalled = Callback <ItemInstalled_t> .Create(OnItemInstalled); m_DownloadItemResult = Callback <DownloadItemResult_t> .Create(OnDownloadItemResult); OnSteamUGCQueryCompletedCallResult = CallResult <SteamUGCQueryCompleted_t> .Create(OnSteamUGCQueryCompleted); OnSteamUGCRequestUGCDetailsResultCallResult = CallResult <SteamUGCRequestUGCDetailsResult_t> .Create(OnSteamUGCRequestUGCDetailsResult); OnCreateItemResultCallResult = CallResult <CreateItemResult_t> .Create(OnCreateItemResult); OnSubmitItemUpdateResultCallResult = CallResult <SubmitItemUpdateResult_t> .Create(OnSubmitItemUpdateResult); OnUserFavoriteItemsListChangedCallResult = CallResult <UserFavoriteItemsListChanged_t> .Create(OnUserFavoriteItemsListChanged); OnSetUserItemVoteResultCallResult = CallResult <SetUserItemVoteResult_t> .Create(OnSetUserItemVoteResult); OnGetUserItemVoteResultCallResult = CallResult <GetUserItemVoteResult_t> .Create(OnGetUserItemVoteResult); // These come from ISteamRemoteStorage but they are used here as well... OnRemoteStorageSubscribePublishedFileResultCallResult = CallResult <RemoteStorageSubscribePublishedFileResult_t> .Create(OnRemoteStorageSubscribePublishedFileResult); OnRemoteStorageUnsubscribePublishedFileResultCallResult = CallResult <RemoteStorageUnsubscribePublishedFileResult_t> .Create(OnRemoteStorageUnsubscribePublishedFileResult); }
void OnEnable() { if (!SteamManager.Initialized) { return; } // Cache the GameID for use in the Callbacks m_GameID = new CGameID(SteamUtils.GetAppID()); m_UserStatsReceived = Callback <UserStatsReceived_t> .Create(OnUserStatsReceived); m_UserStatsStored = Callback <UserStatsStored_t> .Create(OnUserStatsStored); m_UserAchievementStored = Callback <UserAchievementStored_t> .Create(OnAchievementStored); //添加的回调 m_LobbyCreated = CallResult <LobbyCreated_t> .Create(OnLobbyCreated); m_LobbyMatchList = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchedList); m_LobbyChatUpdate = Callback <LobbyChatUpdate_t> .Create(OnLobbyChatUpdated); m_LobbyEnter = CallResult <LobbyEnter_t> .Create(OnLobbyEntered); m_GameLobbyJoinRequested = Callback <GameLobbyJoinRequested_t> .Create(OnGameLobbyJoinRequested); //p2p相关回调 m_P2PSessionRequest = Callback <P2PSessionRequest_t> .Create(OnP2PRequest); // These need to be reset to get the stats upon an Assembly reload in the Editor. m_bRequestedStats = false; m_bStatsValid = false; }
/// <summary> /// 设置item的相关数据 /// </summary> /// <param name="fileId"></param> private void SetCreateItemInfo(PublishedFileId_t fileId) { //获取设置参数基类 mUpdateHandle = SteamUGC.StartItemUpdate(mAppId, fileId); //设置标题 SteamUGC.SetItemTitle(mUpdateHandle, this.mUpdateData.title); //设置介绍 SteamUGC.SetItemDescription(mUpdateHandle, this.mUpdateData.description); //设置语言 SteamUGC.SetItemUpdateLanguage(mUpdateHandle, this.mUpdateData.updateLanguage); //设置原数据 SteamUGC.SetItemMetadata(mUpdateHandle, this.mUpdateData.metadata); //设置公开 SteamUGC.SetItemVisibility(mUpdateHandle, this.mUpdateData.visibility); //设置标签 SteamUGC.SetItemTags(mUpdateHandle, this.mUpdateData.tags); //设置键值对 //SteamUGC.AddItemKeyValueTag(); //移除键值对 //SteamUGC.RemoveItemKeyValueTags(); //设置文件地址 SteamUGC.SetItemContent(mUpdateHandle, this.mUpdateData.content); //设置浏览图片 SteamUGC.SetItemPreview(mUpdateHandle, this.mUpdateData.preview); CallResult <SubmitItemUpdateResult_t> callResult = CallResult <SubmitItemUpdateResult_t> .Create(OnSubmitItemCallBack); SteamAPICall_t apiCallBack = SteamUGC.SubmitItemUpdate(mUpdateHandle, null); callResult.Set(apiCallBack); mContent.StartCoroutine(ProgressCoroutine(mUpdateHandle, fileId)); }
public static void Init() { UpdateUserInfo(); OnLobbyMatchListCallResult = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchList); OnLobbyCreatedCallResult = CallResult <LobbyCreated_t> .Create(OnLobbyCreated); callbacks = new SteamCallbacks(); _lobbyInfo = new LobbyInfo(); string[] args = System.Environment.GetCommandLineArgs(); string input = ""; for (int i = 0; i < args.Length; i++) { if (args[i] == "+connect_lobby" && args.Length > i + 1) { input = args[i + 1]; } } if (!string.IsNullOrEmpty(input)) { ulong lobbyId = Convert.ToUInt64(input); if (lobbyId > 0) { Logger.Debug($"Game was started with +connect_lobby, lets join it @ {lobbyId}"); JoinLobby(new CSteamID(lobbyId)); } } }
private static void OnItemCreated(CreateItemResult_t result, bool IOFailure) { if (IOFailure || result.m_eResult != EResult.k_EResultOK) { uploadingHook = null; Dialog_WorkshopOperationInProgress.CloseAll(); Log.Error("Workshop: OnItemCreated failure. Result: " + result.m_eResult.GetLabel()); Find.WindowStack.Add(new Dialog_MessageBox("WorkshopSubmissionFailed".Translate(GenText.SplitCamelCase(result.m_eResult.GetLabel())))); } else { uploadingHook.PublishedFileId = result.m_nPublishedFileId; if (Prefs.LogVerbose) { Log.Message("Workshop: Item created. PublishedFileId: " + uploadingHook.PublishedFileId); } curUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), uploadingHook.PublishedFileId); SetWorkshopItemDataFrom(curUpdateHandle, uploadingHook, creating: true); curStage = WorkshopInteractStage.SubmittingItem; if (Prefs.LogVerbose) { Log.Message("Workshop: Submitting item."); } SteamAPICall_t hAPICall = SteamUGC.SubmitItemUpdate(curUpdateHandle, "[Auto-generated text]: Initial upload."); submitResult = CallResult <SubmitItemUpdateResult_t> .Create(OnItemSubmitted); submitResult.Set(hAPICall); createResult = null; } }
public SteamMatchmakingTest() { m_FavoritesListChanged = Callback <FavoritesListChanged_t> .Create(OnFavoritesListChanged); m_LobbyInvite = Callback <LobbyInvite_t> .Create(OnLobbyInvite); m_LobbyEnter = Callback <LobbyEnter_t> .Create(OnLobbyEnter); m_LobbyDataUpdate = Callback <LobbyDataUpdate_t> .Create(OnLobbyDataUpdate); m_LobbyChatUpdate = Callback <LobbyChatUpdate_t> .Create(OnLobbyChatUpdate); m_LobbyChatMsg = Callback <LobbyChatMsg_t> .Create(OnLobbyChatMsg); m_LobbyGameCreated = Callback <LobbyGameCreated_t> .Create(OnLobbyGameCreated); m_LobbyKicked = Callback <LobbyKicked_t> .Create(OnLobbyKicked); m_FavoritesListAccountsUpdated = Callback <FavoritesListAccountsUpdated_t> .Create(OnFavoritesListAccountsUpdated); OnLobbyEnterCallResult = CallResult <LobbyEnter_t> .Create(OnLobbyEnter); OnLobbyMatchListCallResult = CallResult <LobbyMatchList_t> .Create(OnLobbyMatchList); OnLobbyCreatedCallResult = CallResult <LobbyCreated_t> .Create(OnLobbyCreated); }
public static bool Create(Mod mod) { // start async call var call = SteamUGC.CreateItem(RIMWORLD, 0); createResultCallback = CallResult <CreateItemResult_t> .Create(OnItemCreated); createResultCallback.Set(call); // keep checking for async call to complete var loading = new LoadingIndicator(); while (!ready.WaitOne(50)) { SteamAPI.RunCallbacks(); ClearLine(); Console.Write("Waiting for item creation to complete... " + loading); } // we have completed! if (createResult.m_eResult != EResult.k_EResultOK) { Console.WriteLine(createResult.m_eResult); } else { mod.PublishedFileId = createResult.m_nPublishedFileId; Console.WriteLine("\nNew mod created (" + mod.PublishedFileId + ")"); } return(createResult.m_eResult == EResult.k_EResultOK); }
public override void Entry(IModHelper helper) { ModHelper = helper; LoadConfig(); CoopMenuHolder.PublicCheckBox.IsChecked = Config.PublicCheckedByDefault; RefreshTexture = helper.Content.Load <Texture2D>("refresh.png"); Patch.PatchAll("Ilyaki.ServerBrowser"); callr = CallResult <LobbyMatchList_t> .Create(OnReceiveSteamServers); helper.ConsoleCommands.Add("serverbrowser_setTemporaryPassword", "Set a temporary password for the current server. Usage: serverbrowser_setTemporaryPassword <password>", (cmd, args) => { if (args.Length != 1) { Monitor.Log("Need a password to set", LogLevel.Error); } else if (!Game1.IsServer) { Monitor.Log("You need to be the server host", LogLevel.Error); } else if (CurrentCreatedLobby == null) { Monitor.Log("Can't find a connected server", LogLevel.Error); } else { ServerMetaData.SetTemporaryPassword(CurrentCreatedLobby, args[0]); Monitor.Log("Set the temporary password", LogLevel.Info); } }); helper.ConsoleCommands.Add("serverbrowser_reloadConfig", "Reload the config.json", (cmd, args) => { if (args.Length != 0) { Monitor.Log("This command required no parameters", LogLevel.Error); } else { LoadConfig(); Monitor.Log("Reloaded config", LogLevel.Info); if (Game1.IsServer && CurrentCreatedLobby != null) { ServerMetaData.InnitServer(CurrentCreatedLobby); } } }); helper.Events.GameLoop.UpdateTicked += (o, e) => { if (CurrentCreatedLobby != null && Game1.IsServer && e.IsMultipleOf(60 * 5)) { ServerMetaData.UpdateServerTick(CurrentCreatedLobby); } }; }
public void OnEnable() { m_SteamServersConnected = Callback <SteamServersConnected_t> .Create(OnSteamServersConnected); m_SteamServerConnectFailure = Callback <SteamServerConnectFailure_t> .Create(OnSteamServerConnectFailure); m_SteamServersDisconnected = Callback <SteamServersDisconnected_t> .Create(OnSteamServersDisconnected); m_ClientGameServerDeny = Callback <ClientGameServerDeny_t> .Create(OnClientGameServerDeny); m_IPCFailure = Callback <IPCFailure_t> .Create(OnIPCFailure); m_LicensesUpdated = Callback <LicensesUpdated_t> .Create(OnLicensesUpdated); m_ValidateAuthTicketResponse = Callback <ValidateAuthTicketResponse_t> .Create(OnValidateAuthTicketResponse); m_MicroTxnAuthorizationResponse = Callback <MicroTxnAuthorizationResponse_t> .Create(OnMicroTxnAuthorizationResponse); m_GetAuthSessionTicketResponse = Callback <GetAuthSessionTicketResponse_t> .Create(OnGetAuthSessionTicketResponse); m_GameWebCallback = Callback <GameWebCallback_t> .Create(OnGameWebCallback); OnEncryptedAppTicketResponseCallResult = CallResult <EncryptedAppTicketResponse_t> .Create(OnEncryptedAppTicketResponse); OnStoreAuthURLResponseCallResult = CallResult <StoreAuthURLResponse_t> .Create(OnStoreAuthURLResponse); OnMarketEligibilityResponseCallResult = CallResult <MarketEligibilityResponse_t> .Create(OnMarketEligibilityResponse); }
public void OnEnable() { m_HTML_NeedsPaint = Callback <HTML_NeedsPaint_t> .Create(OnHTML_NeedsPaint); m_HTML_StartRequest = Callback <HTML_StartRequest_t> .Create(OnHTML_StartRequest); m_HTML_CloseBrowser = Callback <HTML_CloseBrowser_t> .Create(OnHTML_CloseBrowser); m_HTML_URLChanged = Callback <HTML_URLChanged_t> .Create(OnHTML_URLChanged); m_HTML_FinishedRequest = Callback <HTML_FinishedRequest_t> .Create(OnHTML_FinishedRequest); m_HTML_OpenLinkInNewTab = Callback <HTML_OpenLinkInNewTab_t> .Create(OnHTML_OpenLinkInNewTab); m_HTML_ChangedTitle = Callback <HTML_ChangedTitle_t> .Create(OnHTML_ChangedTitle); m_HTML_SearchResults = Callback <HTML_SearchResults_t> .Create(OnHTML_SearchResults); m_HTML_CanGoBackAndForward = Callback <HTML_CanGoBackAndForward_t> .Create(OnHTML_CanGoBackAndForward); m_HTML_HorizontalScroll = Callback <HTML_HorizontalScroll_t> .Create(OnHTML_HorizontalScroll); m_HTML_VerticalScroll = Callback <HTML_VerticalScroll_t> .Create(OnHTML_VerticalScroll); m_HTML_LinkAtPosition = Callback <HTML_LinkAtPosition_t> .Create(OnHTML_LinkAtPosition); m_HTML_JSAlert = Callback <HTML_JSAlert_t> .Create(OnHTML_JSAlert); m_HTML_JSConfirm = Callback <HTML_JSConfirm_t> .Create(OnHTML_JSConfirm); m_HTML_FileOpenDialog = Callback <HTML_FileOpenDialog_t> .Create(OnHTML_FileOpenDialog); m_HTML_ComboNeedsPaint = Callback <HTML_ComboNeedsPaint_t> .Create(OnHTML_ComboNeedsPaint); m_HTML_ShowPopup = Callback <HTML_ShowPopup_t> .Create(OnHTML_ShowPopup); m_HTML_HidePopup = Callback <HTML_HidePopup_t> .Create(OnHTML_HidePopup); m_HTML_SizePopup = Callback <HTML_SizePopup_t> .Create(OnHTML_SizePopup); m_HTML_NewWindow = Callback <HTML_NewWindow_t> .Create(OnHTML_NewWindow); m_HTML_SetCursor = Callback <HTML_SetCursor_t> .Create(OnHTML_SetCursor); m_HTML_StatusText = Callback <HTML_StatusText_t> .Create(OnHTML_StatusText); m_HTML_ShowToolTip = Callback <HTML_ShowToolTip_t> .Create(OnHTML_ShowToolTip); m_HTML_UpdateToolTip = Callback <HTML_UpdateToolTip_t> .Create(OnHTML_UpdateToolTip); m_HTML_HideToolTip = Callback <HTML_HideToolTip_t> .Create(OnHTML_HideToolTip); m_HTML_BrowserReadyResult = CallResult <HTML_BrowserReady_t> .Create(OnHTML_BrowserReady); m_Init = SteamHTMLSurface.Init(); print("SteamHTMLSurface.Init() : " + m_Init); m_Texture = null; }
public void OnEnable() { m_HHTMLBrowser = HHTMLBrowser.Invalid; m_URL = "http://steamworks.github.io"; m_Texture = null; m_Find = "Steamworks"; m_CurrentlyInFind = false; m_ScaleFactor = 0f; m_BackgroundMode = false; m_Init = SteamHTMLSurface.Init(); print("SteamHTMLSurface.Init() : " + m_Init); m_HTML_NeedsPaint = Callback <HTML_NeedsPaint_t> .Create(OnHTML_NeedsPaint); m_HTML_StartRequest = Callback <HTML_StartRequest_t> .Create(OnHTML_StartRequest); m_HTML_CloseBrowser = Callback <HTML_CloseBrowser_t> .Create(OnHTML_CloseBrowser); m_HTML_URLChanged = Callback <HTML_URLChanged_t> .Create(OnHTML_URLChanged); m_HTML_FinishedRequest = Callback <HTML_FinishedRequest_t> .Create(OnHTML_FinishedRequest); m_HTML_OpenLinkInNewTab = Callback <HTML_OpenLinkInNewTab_t> .Create(OnHTML_OpenLinkInNewTab); m_HTML_ChangedTitle = Callback <HTML_ChangedTitle_t> .Create(OnHTML_ChangedTitle); m_HTML_SearchResults = Callback <HTML_SearchResults_t> .Create(OnHTML_SearchResults); m_HTML_CanGoBackAndForward = Callback <HTML_CanGoBackAndForward_t> .Create(OnHTML_CanGoBackAndForward); m_HTML_HorizontalScroll = Callback <HTML_HorizontalScroll_t> .Create(OnHTML_HorizontalScroll); m_HTML_VerticalScroll = Callback <HTML_VerticalScroll_t> .Create(OnHTML_VerticalScroll); m_HTML_LinkAtPosition = Callback <HTML_LinkAtPosition_t> .Create(OnHTML_LinkAtPosition); m_HTML_JSAlert = Callback <HTML_JSAlert_t> .Create(OnHTML_JSAlert); m_HTML_JSConfirm = Callback <HTML_JSConfirm_t> .Create(OnHTML_JSConfirm); m_HTML_FileOpenDialog = Callback <HTML_FileOpenDialog_t> .Create(OnHTML_FileOpenDialog); m_HTML_NewWindow = Callback <HTML_NewWindow_t> .Create(OnHTML_NewWindow); m_HTML_SetCursor = Callback <HTML_SetCursor_t> .Create(OnHTML_SetCursor); m_HTML_StatusText = Callback <HTML_StatusText_t> .Create(OnHTML_StatusText); m_HTML_ShowToolTip = Callback <HTML_ShowToolTip_t> .Create(OnHTML_ShowToolTip); m_HTML_UpdateToolTip = Callback <HTML_UpdateToolTip_t> .Create(OnHTML_UpdateToolTip); m_HTML_HideToolTip = Callback <HTML_HideToolTip_t> .Create(OnHTML_HideToolTip); m_HTML_BrowserRestarted = Callback <HTML_BrowserRestarted_t> .Create(OnHTML_BrowserRestarted); OnHTML_BrowserReadyCallResult = CallResult <HTML_BrowserReady_t> .Create(OnHTML_BrowserReady); }
public Lobby() { // ISSUE: method pointer this._lobbyEnter = CallResult <LobbyEnter_t> .Create(new CallResult <LobbyEnter_t> .APIDispatchDelegate((object)this, __methodptr(OnLobbyEntered))); // ISSUE: method pointer this._lobbyCreated = CallResult <LobbyCreated_t> .Create(new CallResult <LobbyCreated_t> .APIDispatchDelegate((object)this, __methodptr(OnLobbyCreated))); }
private void SendSteamDetailsQuery() { SteamAPICall_t hAPICall = SteamUGC.RequestUGCDetails(this.PublishedFileId, 999999u); this.queryResult = CallResult <SteamUGCRequestUGCDetailsResult_t> .Create(new CallResult <SteamUGCRequestUGCDetailsResult_t> .APIDispatchDelegate(this.OnDetailsQueryReturned)); this.queryResult.Set(hAPICall, null); }
private void SendSteamDetailsQuery() { SteamAPICall_t hAPICall = SteamUGC.RequestUGCDetails(PublishedFileId, 999999u); queryResult = CallResult <SteamUGCRequestUGCDetailsResult_t> .Create(OnDetailsQueryReturned); queryResult.Set(hAPICall); }