#Thread to not spam ~

1 messages · Page 1 of 1 (latest)

modest pivot
#
IEnumerator ReadyUp()
{
    if (!_isReady)
    {
        if (_selectedDeck == null)
        {
            SetStatusText("No hay ningun mazo seleccionado", 2f);
            _readyButton.interactable = false;
            _openDeckSelectButton.interactable = false;

            yield return _oneSecondWaitTime;
            yield return _oneSecondWaitTime;

            _readyButton.interactable = true;
            _openDeckSelectButton.interactable = true;
            yield return null;
        }
        else
        {
            _isReady = true;

            _readyButton.interactable = false;
            _openDeckSelectButton.interactable = false;

            yield return _oneSecondWaitTime;
            _readyButton.interactable = true;

            //If both players are ready, StartGame();
        }
    }
    else
    {
        //Set player as not ready
        Debug.Log("Player not ready anymore.");
        _isReady = false;
        _readyButton.interactable = false;
        yield return _oneSecondWaitTime;
        _readyButton.interactable = true;
        _openDeckSelectButton.interactable = true;
    }

    ChangeReadyStatusRpc(_currentSession.IsHost, _isReady);
}```
#
[Rpc(SendTo.Server)]
void ChangeReadyStatusRpc(bool isHost, bool isReady)
{
    string x = isHost ? "Host" : "Guest";
    string y = isReady ? "Ready" : "Not Ready";
    Debug.Log("This is being called");
    Debug.Log($"{x} is {y}");

    if (isHost)
        _isHostReady.Value = isReady;

    else
        _isGuestReady.Value = isReady;
}```
modest pivot
random goblet
#

When is ReadyUp() getting called? And which object is it on? Personally, I would use Player Properties for "Ready". Or a network variable with owner write permissions on the player object

modest pivot
#

with a button

#

in the same script everything else is

random goblet
#

Is that Lobby Room manager a Network Behavior?

modest pivot
#

I just realized it is a MonoBehaviour...

#

XDDDDDDDD

#

playerproperties, they can only be strings?

modest pivot
random goblet
modest pivot
#

I missed that one :v

#

I changed it to a property tho

#

more comfortable to work with

random goblet
modest pivot
#

cool xD

#

playerproperties are lit, I love how they're organized

random goblet
#

just be careful not to over use them. Lobby bandwidth is 10GB/month

modest pivot
#

I don't... I hope I don't get to 10GB per month? XD

#

but thanks for the advice

random goblet
#

you will likely never reach that limit unless you are doing something crazy. but I sometimes forget its there

modest pivot
#

hey evil

#

you ever dealt with authentication?

#

other than... Anonymous

#

I have seen you make videos, I did watch a full one

#

never really touched things I needed but I feel like they're very informative and I was wondering

#

if you're ever going to make one about it (Authentication)

random goblet
#

I swore we did. But yea, I've used Unity Player Accounts before. Its a bit tricky to get the log in with Google working

modest pivot
#

XDDDDDDDDDDDDDD

#

I want it in my game... but I just couldn't do it

#

not by my own :'v

random goblet
#

Using Username/Password is super easy to get going though

modest pivot
#

I think I will go with that

#

been thinking about it

random goblet
#

I'll see if we can bang out a quick Authentication video this week.

modest pivot
#

so far this is what I got

#

I need to handle when player quits, delete lobbies and such

#

for now, I think I want to move on with the game and come back to this later

#

since I already have player connection and stuff

modest pivot
#

now, I want to move all my players to another scene

modest pivot
#

make it a "Don't Destroy On Load"

random goblet
#

You don't have to.