Coder Social home page Coder Social logo

fizzysteamworks's People

Contributors

chykary avatar eriknielsen avatar gableroux avatar homeless-field avatar jamesmcghee avatar jasonsurratt avatar joshberc avatar kanefreeman avatar lodendarkstar avatar lukeseers avatar raystorms avatar timpickup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fizzysteamworks's Issues

Have you guys found "Use Next Gen Steam Networking" makes connection extremly unstable?

Although valve are saying they will remove the old solution soon, using next gen steam networking has a high chance disconnecting players from fragile steam p2p connection, while untick the toggle makes the connection a lot more stable.

For example it will through "Connection was closed by peer, Timed out attempting to connect" frequently.

Recently another problem tirggered me mad, that in the Steam lobby meta data, I am using a string called "password" to store the password of player's lobbies, an issue occurred for a week that the password function is not working anymore, after hours of debugging I found that Valve auto changed 'p' to uppercase 'P' in the background, which is pretty ridiculous, shouldn't they fix this bug which has been added randomly? I guess they are on vacation now.

Personally I plan to stick to the old networking solution until Valve abandon them. Hope this help those who are getting bothered by related problems.

type or namespace name 'TransportError' could not be found

Trying to install for the first time ever can't seem to figure out
-Assets\Mirror\Runtime\Transports\FizzySteamworks\LegacyServer.cs(14,35): error CS0246: The type or namespace name 'TransportError'
-Assets\Mirror\Runtime\Transports\FizzySteamworks\NextServer.cs(14,35): error CS0246: The type or namespace name 'TransportError' could not be found

Fizzy: 5.1
Unity: 2021.3.11
Steamworks foundation: 2.20.8
Mirror: 2022.10.0

Tried also with just SteamworksNET: 20.1.0 instead of foundation and the same errors appear

Error when trying to connect to a host

While connecting throws this error, hosting still works without a problem.

IndexOutOfRangeException: Index was outside the bounds of the array. Seems to be something to do with the byte array in line 74 of Common. Any ideas? :)

IndexOutOfRangeException: Index was outside the bounds of the array. Mirror.FizzySteam.Common.Send (Steamworks.CSteamID host, System.Byte[] msgBuffer, System.Int32 channel) (at Assets/FizzySteamyMirror/Common.cs:74) Mirror.FizzySteam.Common.SendInternal (Steamworks.CSteamID target, Mirror.FizzySteam.Common+InternalMessages type) (at Assets/FizzySteamyMirror/Common.cs:73) Mirror.FizzySteam.Client+<Connect>d__22.MoveNext () (at Assets/FizzySteamyMirror/Client.cs:61) UnityEngine.Debug:LogException(Exception) Mirror.NetworkClient:OnError(Exception) (at Assets/Mirror/Runtime/NetworkClient.cs:152) UnityEngine.Events.UnityEvent1:Invoke(Exception)
Mirror.FizzySteam.<>c__DisplayClass21_0:b__3(Exception) (at Assets/FizzySteamyMirror/Client.cs:35)
Mirror.FizzySteam.d__22:MoveNext() (at Assets/FizzySteamyMirror/Client.cs:79)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(d__22&)
Mirror.FizzySteam.Client:Connect(String)
Mirror.FizzySteam.Client:CreateClient(FizzySteamyMirror, String) (at Assets/FizzySteamyMirror/Client.cs:39)
Mirror.FizzySteam.FizzySteamyMirror:ClientConnect(String) (at Assets/FizzySteamyMirror/FizzySteamyMirror.cs:81)
Mirror.NetworkClient:Connect(String) (at Assets/Mirror/Runtime/NetworkClient.cs:86)
Mirror.NetworkManager:StartClient() (at Assets/Mirror/Runtime/NetworkManager.cs:390)
d__20:MoveNext() (at Assets/Scripts/Networking/MyNetworkManager.cs:152)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
MainMenu:ButtonJoin() (at Assets/Scripts/Menus/MainMenu.cs:149)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.3.0f5/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
`

Here is a screenshot of the console messages
https://i.imgur.com/oHWL5To.png

Assets\Mirror\Runtime\Transport\FizzySteamworks\NextCommon.cs(36,38): error CS1501: No overload for method 'Release' takes 1 arguments

This error shows up in my console after importing FizzySteamworks.
it leads to this code
`#if !DISABLESTEAMWORKS
using Steamworks;
using System;
using System.Runtime.InteropServices;
using UnityEngine;

namespace Mirror.FizzySteam
{
public abstract class NextCommon
{
protected const int MAX_MESSAGES = 256;

    protected EResult SendSocket(HSteamNetConnection conn, byte[] data, int channelId)
    {
        Array.Resize(ref data, data.Length + 1);
        data[data.Length - 1] = (byte)channelId;

        GCHandle pinnedArray = GCHandle.Alloc(data, GCHandleType.Pinned);
        IntPtr pData = pinnedArray.AddrOfPinnedObject();
        int sendFlag = channelId == Channels.Unreliable ? Constants.k_nSteamNetworkingSend_Unreliable : Constants.k_nSteamNetworkingSend_Reliable;
        EResult res = SteamNetworkingSockets.SendMessageToConnection(conn, pData, (uint)data.Length, sendFlag, out long _);
        if (res != EResult.k_EResultOK)
        {
            Debug.LogWarning($"Send issue: {res}");
        }

        pinnedArray.Free();
        return res;
    }

    protected (byte[], int) ProcessMessage(IntPtr ptrs)
    {
        SteamNetworkingMessage_t data = Marshal.PtrToStructure<SteamNetworkingMessage_t>(ptrs);
        byte[] managedArray = new byte[data.m_cbSize];
        Marshal.Copy(data.m_pData, managedArray, 0, data.m_cbSize);
        SteamNetworkingMessage_t.Release(ptrs);

        int channel = managedArray[managedArray.Length - 1];
        Array.Resize(ref managedArray, managedArray.Length - 1);
        return (managedArray, channel);
    }
}

}
#endif // !DISABLESTEAMWORKS`

trying to just delete the "ptrs" from the argument causes a new error
Assets\Mirror\Runtime\Transport\FizzySteamworks\NextCommon.cs(36,13): error CS0120: An object reference is required for the non-static field, method, or property 'SteamNetworkingMessage_t.Release()'

If I replace SteamNetworkingMessage_t.Release() with data.Release() no errors occur

Recieving 3 Unity Console Errors on Importation

Hi, I just recently installed the unitypackage and after its imported it seems to be getting 3 errors in the Unity Console. The errors I recieve are as follows:
Error 1 :
Assets\Mirror\Runtime\Transport\FizzySteamworks\FizzySteamworks.cs(105,30): error CS0508: 'FizzySteamworks.ClientSend(int, ArraySegment<byte>)': return type must be 'bool' to match overridden member 'Transport.ClientSend(int, ArraySegment<byte>)'

Error 2:
Assets\Mirror\Runtime\Transport\FizzySteamworks\FizzySteamworks.cs(163,30): error CS0115: 'FizzySteamworks.ServerSend(int, int, ArraySegment<byte>)': no suitable method found to override

Error 3:
Assets\Mirror\Runtime\Transport\FizzySteamworks\FizzySteamworks.cs(11,18): error CS0534: 'FizzySteamworks' does not implement inherited abstract member 'Transport.ServerSend(List<int>, int, ArraySegment<byte>)'

I have tried using both versions 2.6 and 2.6.1 but I receive the same error for both. Any help would be appreciated! Thank you!

Release out of date

Your release package is out of date from the current state of the code on master.

Also happy to help get this project set to use package manager if you would like, this would remove the need to package a release unitypackage up saving you a step and insuring people are on the latest by simply running the in Unity package manager

New Mirror ClientSend and ServerSend

Hi just wanted to let you know that in the new Mirror version, the return type of the ServerSend and ClientSend is now void, hence breaking the Transport FizzySteamWorks override. Also ServerSend now return only 1 connection id instead of the list

CS7036 Errors after import

Hi,

I have just imported mirror into my project and imported the Fizzy Steam works file however I get the below errors (I have not changed anything)

Assets\Mirror\Runtime\Transport\FizzySteamworks\LegacyServer.cs(27,71): error CS7036: There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action<int, TransportError, string>.Invoke(int, TransportError, string)'

Assets\Mirror\Runtime\Transport\FizzySteamworks\NextServer.cs(42,71): error CS7036: There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action<int, TransportError, string>.Invoke(int, TransportError, string)'

Any idea why these error are coming up?

Steam App ID not working

Apparently I recently discovered that when I build my game, the steam API cannot be initialized, future research has lead me to the fact that I need a steam App ID in the game directory and that it must be launched through steam, I was able to do that, however it still does not connect to the steam API. Is this an issue, or is there something I don't know about this forked Repo of the original maintained fizzysteamworks repo. I discovered in that one that the Steam manager script has a App ID in it.

Channels except reliable don't seem to work

Ive only tested this with RPCs but setting any of the channels to unreliable and then using it with an RPC call doesnt seem to fire the RPC at the other end. However, changing the channel type back to reliable works. So for example if i set an rpc to use channel 2, if channel to is reliable it works, if its unreliable it doesnt.

Latest Release Missing files?

Hi there! I was just following a YT tut on getting this setup, I downloaded the last Unity Package shown in releases (v5.1) and after importing it to unity it only imported a few scripts. The tutorial I was using is a few years old now, and was using version 2.5.2. I downloaded the older release and sure enough it contained all the files I needed. Just pointing this out as I'm not sure if this is expected behaviour or not. It should be noted that Steamworks.NET stuff were the majority of the missing and causing the package from not working properly!

Crash when connects, I went back to a working commit and the same error still occurs.

Hello, I am trying to make a multiplayer game with steam, so I'm currently using Mirror and FizzySteamworks. After following the DapperDino tutorial, everything worked. I went a little further, and nothing worked, so I came back few commits backward to when it was still working an I still have the same mistakes which is blowing my mind, here's the error I'm getting Server and Client side : https://cdn.discordapp.com/attachments/775305953922252810/908774217904971816/unknown.png
https://cdn.discordapp.com/attachments/775305953922252810/908774366387535942/unknown.png

k_EResultAccessDenied

When running SteamMatchmaking.CreateLobby(ELobbyType.k_ELobbyTypePrivate, manager.maxConnections);
My callback from steam says k_EResultAccessDenied instead of k_EResultOK
My steam app id is 480 (Spacewar)

Why does Steam deny my create lobby request?

Unity: 2021.3.12f1
Mirror: 2022.9.15
FizzySteamworks: 5.1

Only suitable for client use not Steam Game Server

Your transport uses a lot of client only interface calls so wont work on a steam game server
We have created a variant that wraps these with

#if UNITY_SERVER
// server variant
#else
// client variant
#endif

That said its based on our framework not Steamworks.NET so wouldn't work in your case but wanted to raise this to you. but you are welcome to it https://www.dropbox.com/s/topkpniiqshroo7/SteamMirrorTransport.cs?dl=0

Follows is a list of the modifications we made

  1. Our own wrap up of Steamworks.NET we dont use SteamManager so everywhere you see SteamManager.Initalized gets changed to SteamSettings.Initalized.
  2. Our own kit handles initalization and is smart enough to know when it should initalize SteamAPI vs GameServer so we dont let things like a transport do a lot of what yours does ... thus we gutted it :)
  3. Our kit supports MLAPI and a few others so the naming is a good bit different we have also made your transport self contained e.g. IClient and all that are now a child of SteamMirrorTransport
  4. SteamNetworking is a client interface thus its wrapped such that on a server build it will use SteamGameServerNetworking and on a client it will use SteamNetwokring
  5. Similarly SteamNetworkingUtils is a client interface, wrapped to use SteamGameServerNetworkingUtils when appropreate
  6. Similarlly again SteamNetworkingSockets == client we have wrapped it to use SteamGameServerNetworkingSockets when appropreate
  7. We assume you are using a modified Steamworks.NET in that NativeMethods is private and shouldn't be called directly. We haven't tested it yet but are using data.Release() which should do the same thing

Note we are aware of either a bug or at least bit of confusion around GameServer.Init with the Steamworks.NET wrapper causing issues on port bindings. So if you go to test this you may run into that you can see more on that here rlabrecque/Steamworks.NET#407

Steam friends server browser guidance?

First of all, I'm sorry for asking it here as an issue!

I want to create a Steam friends server browser, which, as it says, it displays the client-hosted servers created by my friends. This is my second day of just research in this matter and I am not able to connect any dots. I have looked through:

  • FizzySteamworks README
  • Steamworks.NET Docs and examples (Steamworks.NET Example/Steamworks.NET Test). Yes, I went through the code.
  • Steamworks Official Docs
  • FizzySteamworks code
  • Any possible tutorial there is..

I managed to make the Mirror's NetworkManager work using FizzySteamworks as the transport. Managed to Host/Join using User Steam ID (using the default HUD Mirror provides in the Unity package). Managed to make players sync movement and rotation.
I saw that in the Steamworks.NET Test project, I can create and join a lobby.

What I would like to know:

  1. Looking at the default NetworkManagerHUD, does the Host button create a Server(SteamMatchmakingServers) or a Lobby(SteamMatchmaking)?
  2. Assuming it creates a server, how do I get a list of servers my friends host?
  3. How do I give that server a name and a password?

I have more questions, but they all depend on whether or not the button creates a server or a lobby.

Should not run code when Transport is disabled

Hi,
I was testing the Transport, but wanted to disabled it for some builds etc.
However, by disabling the component it was still running some code that requires Steam to be running.
I had to add the following code in the Awake function:

if(!enabled) { return; }

I think this should be a feature in this transport anyway.

Thanks for you work!

When loading a new scene with a NetworkManager transport shuts down.

When you change scenes to a new scene with NetworkManager Mirror automatically destroys the duplicate NetworkManager GameObject.

The FizzySteamworks.cs on the NetworkManager GameObject then calls its OnDestory() method which calls Shutdown().
Since client and server are static the Shutdown method shuts down the connection.

UseNextGenSteamNetworking: bandwidth is lower than stated?

Hi,
I recently updated the version and ran into a problem: in the old version, I could transfer up to 1 MB of data per second. But in the new version, if I leave "UseNextGenSteamNetworking" enabled by default, I can only send 1 MBit per second.
If I overshoot this size, I get an error:

Send issue: k_EResultLimitExceeded
In:
Assets/Mirror/Runtime/Transport/FizzySteamworks/NextCommon.cs:23
Assets/Mirror/Runtime/Transport/FizzySteamworks/NextServer.cs:161
Assets/Mirror/Runtime/Transport/FizzySteamworks/FizzySteamworks.cs:209
Assets/Mirror/Runtime/NetworkConnectionToClient.cs:118
Assets/Mirror/Runtime/NetworkConnectionToClient.cs:171
Assets/Mirror/Runtime/NetworkServer.cs:1529
Assets/Mirror/Runtime/NetworkServer.cs:1559
Assets/Mirror/Runtime/NetworkLoop.cs:188)
...

However, GetMaxPacketSize returns 512 * 1024 which is half a megabyte.
Is this the expected behavior? Has the new API reduced the maximum transfer rate by 8 times? If my game uses more than one megabit, do I need to stay on legacy p2p?

Thx.

Networking NullReferenceException FizzySteamworks.ClientSend

When I have the server switch scenes for all players the console returns the following error client-side as soon as they change scenes:

"NullReferenceException: Object reference not set to an instance of an object
Mirror.FizzySteam.FizzySteamworks.ClientSend (System.ArraySegment`1[T] segment, System.Int32 channelId) (at Assets/Mirror/Runtime/Transport/FizzySteamworks/FizzySteamworks.cs:140)"

I am assuming a reference gets lost between the scenes but I don't know what. For more clarification the player objects dont destroy on load

Update to latest Heathen's Steamworks Foundaiton version

Hello.
FizzySteamworks does not support the latest version of Steamworks Foundaiton since my console is being spammed with errors saying that Steamworks could not be found even after I installed it.
Please update FizzySteamworks to work with the latest version of Steamworks Foundaiton, thanks.
Capture

Could not send: k_EResultLimitExceeded

unity 2021.3.0f1
mirror 53.0.0
steamwork.net Release 20.1.0
FizzySteamworks 5.1
I have no problem connecting with a LAN, but I have this problem with a steam connection
Is it exceeding Steam's transfer limit or something?

image

warning CS0414

Hi i get this warning

Assets\Mirror\Runtime\Logging\NetworkHeadlessLogger.cs(13,31): warning CS0414: The field 'NetworkHeadlessLogger.showExceptionStackTrace' is assigned but its value is never used

Can you give me a little tutorial?

I'm currently learning mirror and I'm almost done.
I'm trying to link a multiplayer game to Steam, and I've been looking around, but I have no idea how to do it, can you give me a simple example? If it's not convenient to give a complete one, you can just tell me some key code, like how to link a steam socket to mirror, etc.
Thanks!

Connection was closed by peer, Timed out attempting to connect.

Hi, I don't know when this problem has been with me since.
I have tried to modify FizzySteamworks.Timeout but it doesn't solve the problem.
But there is one thing, sometimes this problem does not occur, but most of the time it is not linked to the host.
I hope you can answer it directly here, there are too many people in Discover and I don't think anyone cares about my problem.
Thank you very much!

image

FizzySteam NextClient will not trigger transport's OnDisconnected

NextClient will not call its own OnDisconnected event if disconnection is run via FizzyTransport.Shutdown (which include voluntary disconnect) which does not call NextClient.InternalDisconnect, result in transport.OnClientDisconnected never called, result in NetworkClient.RemoveTransportHandlers never called.

This will become error elsewhere such as client will fire AddPlayerMessage multiple times, etc.

Just to cross post it here from Mirror github repo issue.
Full detail is in my comment in that issue.

Solution:

Add following line to your "FizzySteamworks\NextClient.cs" at location in this screen shot.

if( Connected )
    InternalDisconnect( );

image

The connection attempt was cancelled.

unity 2021.3.0f1
mirror 71.0.0
steamwork.net Release 20.1.0
FizzySteamworks 5.1
All are now the latest version
Test with the simplest project, replace KCP with FIZZY
No matter how you measure it, it can't be connected
What version can you connect to now?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.