private async void ResponseMakeRoom(Req0008 req, Res0008 res)
 {
     await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         Packet0008Received?.Invoke(this, new Packet0008ReceivedEventArgs(req, res));
     });
 }
Example #2
0
        public Res0008 RequestMakeRoom(Req0008 req)
        {
            Res0008 res = null;

            Int32 available_room_no = Singleton <DatabaseService> .Instance.GetRoomNumbers(out Boolean ex).Max();

            available_room_no++;
            String UserName = Singleton <DatabaseService> .Instance.GetUserName(req.UserID);

            Boolean is_private = String.IsNullOrEmpty(req.AccessPassword);
            Boolean Result     = Singleton <DatabaseService> .Instance.InsertRoomInfo(available_room_no, req.RoomTitle, is_private, req.AccessPassword, UserName, req.MaxJoinCount, out ex);

            if (ex)
            {
                res = new Res0008()
                {
                    Request = req, Message = "DB조회에 오류가 있습니다"
                };
            }
            else
            {
                res = new Res0008()
                {
                    Request = req, Message = "방 만들기 성공", IsCreated = Result, CreatedRoom = new RoomInfo()
                    {
                        RoomNumber = available_room_no, RoomTitle = req.RoomTitle, IsPrivateAccess = is_private, AccessPassword = req.AccessPassword, RoomMaster = UserName, MaxJoinCount = req.MaxJoinCount, CurrentJoinCount = req.CurrentJoinCount, IsPlaying = req.IsPlaying
                    }
                };
                Clients.OthersInGroup(CurrentLocation.WaitingRoom.ToString()).ResponseMakeRoom(req, res);
            }
            return(res);
        }
        public async void RequestMakeRoom(String id, String room_title, String access_pw, Double max_join_cnt)
        {
            Req0008 req = new Req0008()
            {
                UserID = id, Room = new RoomInfo()
                {
                    RoomTitle = room_title, AccessPassword = access_pw, MaxJoinCount = System.Convert.ToInt32(max_join_cnt)
                }
            };
            Res0008 res = await GGTHubProxy.Invoke <Res0008>("RequestMakeRoom", req);

            Packet0008Received?.Invoke(this, new Packet0008ReceivedEventArgs(req, res));
        }