【问题标题】:Using Facepunch Steamworks Wrapper P2P connection "NoRightsToApp" error使用 Facepunch Steamworks Wrapper P2P 连接“NoRightsToApp”错误
【发布时间】:2020-06-24 22:20:34
【问题描述】:

我目前正在尝试使用 facepunch 的 steamworks 库的 p2p 库,但它给了我这个错误:

这是我的 P2P 连接代码:

using System.Collections;
using System.Text;
using System.Collections.Generic;
using UnityEngine;
using Steamworks;

public class FacePunchSteamPeerToPeer : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        SteamNetworking.OnP2PSessionRequest = (steamid) =>
        {
            print("Accepting User");
            // If we want to let this steamid talk to us
            SteamNetworking.AcceptP2PSessionWithUser(steamid);
        };
        SteamNetworking.OnP2PConnectionFailed = (SteamId, P2PSessionError) =>
        {
            print(P2PSessionError);
        };
    }

// Update is called once per frame
void Update()
{
    if (Input.GetKey(KeyCode.R))
    {
        byte[] mydata = Encoding.ASCII.GetBytes("Hello");
        SteamId TargetSteamId = (SteamId)76561198017227431;
        var sent = SteamNetworking.SendP2PPacket(TargetSteamId, mydata);
    }

    while (SteamNetworking.IsP2PPacketAvailable())
    {
        var packet = SteamNetworking.ReadP2PPacket();
        if (packet.HasValue)
        {
            HandleMessageFrom(packet.Value.SteamId, packet.Value.Data);
        }
    }
}

void HandleMessageFrom(SteamId steamid, byte[] data)
{
    print("Data Received");
}

}

我不知道我做错了什么或那个错误意味着什么

【问题讨论】:

    标签: c# unity3d steamworks-api


    【解决方案1】:

    我发现我在其中一台计算机上使用了错误的应用程序 ID

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-06
      • 1970-01-01
      • 1970-01-01
      • 2011-07-05
      • 2015-02-20
      • 1970-01-01
      • 1970-01-01
      • 2021-05-04
      相关资源
      最近更新 更多