Esempio n. 1
0
        async Task <JoinRoomResponse> OnRoomJoin(JoinRoom msg, IOperationContext context)
        {
            var room = await _rooms.GetActor(new ActorKey(msg.RoomName));

            var callbackRef      = _callbacksNode.ExposeAsCallbackChannel(this);
            var joinRoomOnServer = new JoinRoomS2S()
            {
                CallbackChannelRef = callbackRef,
                RoomName           = msg.RoomName,
                UserName           = msg.UserName
            };
            var reply = await room.SendAsync <JoinRoomResponse>(joinRoomOnServer, context);

            if (reply.RetCode == JoinRoomRetCode.Ok)
            {
                _room     = room;
                _userName = msg.UserName;
            }

            return(reply);
        }
Esempio n. 2
0
        async Task <OperationResult> Process(UseActor msg, IOperationContext context)
        {
            _actor = await _actorSystem.GetActor(new ActorKey(msg.ActorName));

            return(OperationResult.Success);
        }