Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateLobby function returns None #19

Open
P0stf1x opened this issue Oct 13, 2019 · 11 comments
Open

CreateLobby function returns None #19

P0stf1x opened this issue Oct 13, 2019 · 11 comments
Labels
callbacks Stuff related to Steam callbacks networking Stuff related to networking, matchmaking, and P2P

Comments

@P0stf1x
Copy link

P0stf1x commented Oct 13, 2019

I'm using CreateLobby(0, 2) to create private invite-only lobby for 2 player co-op game, but it doesn't return me anything, just None. I'm testing with 480 appid. The code is

from steamworks import *

Steam.Init()
print(SteamMatchmaking.CreateLobby(0, 2))
@Gramps Gramps added callbacks Stuff related to Steam callbacks networking Stuff related to networking, matchmaking, and P2P labels Oct 13, 2019
@Gramps
Copy link
Collaborator

Gramps commented Oct 13, 2019

Hey there! CreateLobby shouldn't return anything as it is a void function in Steamworks. It should, however, send a callback when the lobby is created with the lobby Steam ID. It should also make the user join the lobby they just created.

@Gramps
Copy link
Collaborator

Gramps commented Oct 13, 2019

That being said, I don't know there are any callbacks set up for it just yet. Gonna make some commits today to address that and a bunch of other things!

@P0stf1x
Copy link
Author

P0stf1x commented Oct 14, 2019

Oh, probably misunderstood Russian steamworks translation. By the way, could you please show me example of how to do this? I kinda understand it in C++ but not in Python

@Gramps
Copy link
Collaborator

Gramps commented Oct 14, 2019

I don't know the callback exists for it yet, so I'll need to update that code first. Which, hopefully, I should have up by next week.

That being said, you need to in your main loop something like:
Steam.RunCallbacks()
This will look for callbacks from Steam and should be running constantly in the background. When it finds the callback for _lobby_Created() that will return the Steam lobby ID. It will also send back a _lobby_Joined() callback which effectively moves the player into the lobby in Steam.

I'll write more code once I get the callbacks added to the experimental branch.

@P0stf1x P0stf1x closed this as completed Oct 14, 2019
@Gramps
Copy link
Collaborator

Gramps commented Oct 14, 2019

You can leave the issue open and I'll add code to it.

@Gramps Gramps reopened this Oct 14, 2019
@labanau
Copy link

labanau commented Dec 19, 2019

Just to add to the issue, RunCallBacks need to always run whenever you do calls. Example in Unity would be every time an object gets updated callbacks would need to be called. In standalone C# you would run RunCallBacks() in a separate thread for them to get trigger properly. I think in python it would be somewhat similar to C# standalone, I think Gramps will post a proper code snippet for the python version

@Gramps
Copy link
Collaborator

Gramps commented Dec 20, 2019

Yeah, the callbacks stuff is tricky. It should be in whatever main loop you have going on unless you don't have anything that requires a callback. Considering the variety of set-ups I've seen in Python, it's tricky to show folks.

I do plan on getting some tutorials up much like the ones I did for my GodotSteam library.

@Gramps
Copy link
Collaborator

Gramps commented Dec 20, 2019

And yeah, still trying to streamline the callbacks for Python. Once I get them down the rest of this will be easy-peasy.

@FreezeDriedMangos
Copy link

Once I get connected to a lobby, what can I do with it? I don't see any methods like SetLobbyData implemented

@labanau
Copy link

labanau commented Nov 22, 2021

Once I get connected to a lobby, what can I do with it? I don't see any methods like SetLobbyData implemented

Well, I haven't been following versioning and what is implemented on the wrapper. However, it opens a lot of possibilities. For example setting the data as you mentioned, or receiving players steamids on server etc.

@ghost
Copy link

ghost commented Nov 22, 2021

Thanks! How do I access SetLobbyData and functions like it? The steamworks object doesn’t have an attribute named SetLobbyData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callbacks Stuff related to Steam callbacks networking Stuff related to networking, matchmaking, and P2P
Projects
None yet
Development

No branches or pull requests

4 participants