Пример #1
0
        protected override PeerBase CreatePeer(InitRequest request)
        {
            _log.Info($"Accepted new connection at {request.RemoteIP}:{request.RemotePort}");

            /* Create CommPeer and CommActor instance. */
            var peer  = new CommPeer(request);
            var actor = new CommActor(peer);

            /* Find available lobby and make the actor join that lobby. */
            var lobby = Lobbies.FindAvailable();

            actor.Join(lobby);

            return(actor.Peer);
        }
Пример #2
0
 public CommActor(CommPeer peer)
 {
     _peer = peer ?? throw new ArgumentNullException(nameof(peer));
 }