BoltEngine / Bolt-Tracker

New issue tracker for Photon Bolt
10 stars 2 forks source link

UdpSessionError #171

Closed yessGlory17 closed 4 years ago

yessGlory17 commented 4 years ago

There is a pointless type mismatch problem here. public override void SessionListUpdated(Map<Guid, UdpSession> sessionList) { foreach(var session in sessionList) {

        UdpSession photonSession = session.Value as UdpSession;

        if(photonSession.Source == UdpSessionSource.Photon)
        {
            BoltNetwork.Connect(photonSession);
        }
    }
}

When I try to fix the type mismatch, it does not establish the correct connection while working this time.

public override void SessionListUpdated(Map<Guid, UdpSession> sessionList) { foreach(var session in sessionList) {

        UdpSession photonSession = session.Value as UdpSession;

        if(photonSession.Source == UdpSessionSource.Photon)
        {
            BoltNetwork.Connect(Convert.ToUInt16(photonSession));
        }
    }
}

phproblem phproblem2

ramonmelo commented 4 years ago

Hello @yessGlory17 ,

Please follow the Getting Started documentation on our site: https://doc.photonengine.com/en-us/bolt/current/demos-and-tutorials/bolt-basics/bolt-102-getting-started. It shows the basics of how to start using Bolt.

In order to join a session, you need to use the BoltMatchmaking API, more specifically the BoltMatchmaking.JoinSession(photonSession) method.

Have a nice day.

yessGlory17 commented 4 years ago

Sir, this is not work! phproblem3 phproblem4

ramonmelo commented 4 years ago

Hello @yessGlory17 ,

Please, follow the Getting Started tutorial: https://doc.photonengine.com/en-us/bolt/current/demos-and-tutorials/bolt-basics/bolt-102-getting-started

Also, the method can receive a UdpSession directly (BoltMatchmaking.JoinSession(photonSession);). The param you are passing (photonSession.Id) is a Unique GUID created randomly for each session, and it does not represent the Session Name.