Beispiel #1
0
        async void HandleAuthentication(Session session, AuthenticationPacket packet)
        {
            var option = await conn.GetUser(packet.Uuid);

            option.MatchSome(user =>
            {
                session.UserID = user.ID;
                log.Info($"authentication: uuid={packet.Uuid} user_id={session.UserID}");
                var result = new AuthenticationResultPacket(0);
                session.SendLazy(result);
            });
            option.MatchNone(() =>
            {
                log.Info($"authentication: uuid={packet.Uuid} not found");
                var notFound = new AuthenticationResultPacket(-1);
                session.SendLazy(notFound);
            });
        }