Example #1
0
        private void ProcessSessionJoinRequest(SessionJoinRequestPacket obj)
        {
            if (!ServiceContainer.Users.ContainsKey(obj.Sender))
            {
                return;
            }

            // Try and add the user
            var user    = ServiceContainer.Users[obj.Sender];
            var session = (from x in Sessions where x.SessionID == obj.SessionID select x);
            var result  = AddToSession(user, session.FirstOrDefault());

            if (result)
            {
                var packet = new SessionJoinResultPacket(SessionJoinResultPacket.SessionJoinResult.Succesful);
                ClientNetworkManager.Instance.SendPacket(packet, obj.Sender);
            }

            else
            {
                var packet = new SessionJoinResultPacket(SessionJoinResultPacket.SessionJoinResult.Failed);
                ClientNetworkManager.Instance.SendPacket(packet, obj.Sender);
            }

            Thread.Sleep(1500);


            CheckCompletion(session.FirstOrDefault());
        }
Example #2
0
 private void ProcessJoinResult(SessionJoinResultPacket obj)
 {
     if (obj.Result == SessionJoinResultPacket.SessionJoinResult.Succesful)
     {
         // Change the view
         FlowController.WebControl.DocumentReady -= WebControlOnDocumentReady;
         FlowController.ChangeView(new InRoomView());
     }
 }
Example #3
0
        private void ProcessJoinResult(SessionJoinResultPacket obj)
        {
            var result = obj.Result;

            if (result == SessionJoinResultPacket.SessionJoinResult.Succesful)
            {
                UpdateSessionView();
            }

            else
            {
                MessageBox.Show("Failed to join the game; possibly already in a session or this room is full.");
            }
        }