Esempio n. 1
0
 public Album()
 {
     _doc = Application.DocumentManager.MdiActiveDocument;
     _db = _doc.Database;
     Date = DateTime.Now;
     StartOptions = new StartOption();
     StartOptions.LoadDefault();
 }
Esempio n. 2
0
        protected override void BeforeStart(out StartOption param)
        {
            base.BeforeStart(out param);


            // 업데이트 콜백 이벤트 시간을 설정합니다
            param.m_UpdateTimeMs = 50;


            // 주기적으로 업데이트할 필요가 있는 내용들...
            m_Core.update_event_handler = () =>
            {
            };
        }
Esempio n. 3
0
        /// <summary>
        /// C# is holding several important memory area for native side to write to.
        /// </summary>
        private static void AllocateIfNotYet(StartOption startOption)
        {
            if (!allocated)
            {
                ntdRingBuffer      = new NativeTouchData[startOption.ringBufferSize];
                ntdFullRingBuffer  = new NativeTouchDataFull[startOption.ringBufferSize];
                dekker             = new int[3];
                finalCursorStorage = new int[1];

                ntdRingBufferHandle     = GCHandle.Alloc(ntdRingBuffer, GCHandleType.Pinned);
                ntdFullRingBufferHandle = GCHandle.Alloc(ntdFullRingBuffer, GCHandleType.Pinned);
                finalCursorHandle       = GCHandle.Alloc(finalCursorStorage, GCHandleType.Pinned);
                dekkerHandle            = GCHandle.Alloc(dekker, GCHandleType.Pinned);

                nativeTouchDataQueue = new NativeTouchRingBuffer();
                activeRingBufferSize = startOption.ringBufferSize;

                allocated = true;
            }
        }
Esempio n. 4
0
        protected override void BeforeStart(out StartOption param)
        {
            param = new StartOption();

            param.m_IpAddressListen    = Properties.Settings.Default.MasterIp;
            param.m_PortListen         = Properties.Settings.Default.MasterPort;
            param.m_MaxConnectionCount = 5000;

            m_Core.SetKeepAliveOption(60);


            // 마스터 서버에서만 발생되는 이벤트 처리 : 마스터 클라이언트 서버 입장 시점
            m_Core.master_server_join_handler = (ZNet.RemoteID remote, string description, int type, ZNet.NetAddress addr) =>
            {
                form.printf("마스터 Client Join remoteID({0}) {1} type({2})", remote, description, type);
            };

            // 마스터 서버에서의 접속해제 이벤트 -> 마스터 클라이언트의 퇴장
            m_Core.client_disconnect_handler = (ZNet.RemoteID remote) =>
            {
                form.printf("마스터 Client Leave remoteID({0})", remote);
            };
        }
 public FormStartOptions(StartOption startOptions)
 {
     StartOptions = startOptions;
      InitializeComponent();
      propertyGrid1.SelectedObject = StartOptions;
 }
Esempio n. 6
0
 /// <summary>
 ///   Initializes a new instance of the NvimProcessStartInfo class that
 ///   specifies the path, arguments, and start options to use for starting
 ///   the Nvim process.
 /// </summary>
 /// <param name="nvimPath">
 ///   The path to the nvim executable. If null, the PATH will be searched.
 /// </param>
 /// <param name="arguments">The arguments to pass to Nvim.</param>
 /// <param name="startOptions">The options for starting Nvim.</param>
 public NvimProcessStartInfo(string nvimPath, string arguments,
                             StartOption startOptions = StartOption.None) : this(
         GetProcessStartInfo(nvimPath, arguments, startOptions))
 {
 }
Esempio n. 7
0
 /// <summary>
 ///   Initializes a new instance of the NvimProcessStartInfo class with
 ///   the specified start options.
 /// </summary>
 /// <param name="startOptions">The options for starting Nvim.</param>
 public NvimProcessStartInfo(StartOption startOptions) : this(null, null,
                                                              startOptions)
 {
 }
Esempio n. 8
0
        protected override void BeforeStart(out StartOption param)
        {
            param = new StartOption();


            param.m_IpAddressListen = ListenAddr.m_ip;
            param.m_PortListen      = ListenAddr.m_port;


            // 접속을 받을 최대 동접 숫자 :
            // 작게 잡을 경우 동적으로 동접 한계치에 가까워지면 최대 동접 숫자가 늘어납니다
            // 동적 접속자 증가를 비활성화 할 수도 있습니다 m_bExpandMaxConnect옵션을 false로 지정하면 됩니다
            param.m_MaxConnectionCount = 20000;


            // 주기적으로 서버에서 처리할 콜백 함수 시간을 설정합니다
            param.m_RefreshServerTickMs = 10000;


            // 서버와 클라이언트간의 프로토콜 버전 내용입니다, 서로 다른 경우 경고 메세지 이벤트가 발생됩니다
            param.m_ProtocolVersion = UnityCommon.Join.protocol_ver;


            // 내부 스레드 사용을 중단
            param.m_LogicThreadCount = 0;


            // 클라이언트의 반응이 없을경우 내부적으로 접속을 해제시킬 시간을 설정합니다(초단위)
            m_Core.SetKeepAliveOption(30);


            // 클라이언트의 서버 이동 요청을 처리해줍니다
            stub.server_move = (ZNet.RemoteID remote, ZNet.CPackOption pkOption, int server_type) =>
            {
                // 유효한 유저인지 확인
                CUser rc;
                if (RemoteClients.TryGetValue(remote, out rc) == false)
                {
                    return(true);
                }
                if (rc.joined == false)
                {
                    return(true);                       // 인증여부 확인
                }
                // 클라이언트가 보내온 이동할 서버타입의 서버에 대한 정보를 확인합니다
                ZNet.MasterInfo[] svr_array;
                m_Core.GetServerList(server_type, out svr_array);

                if (svr_array == null)
                {
                    return(true);
                }

                // 해당 서버 타입의 서버가 여러개 존재할 수도 있으므로...
                foreach (var obj in svr_array)
                {
                    // 서버이동시 필요한 파라미터 정보입니다
                    // -> 특정 서버의 특정한 방에 들어간다든지 할때 활용 가능하지만 현재는 사용하지 않습니다
                    ZNet.ArrByte param_buffer = new ZNet.ArrByte();


                    // 요청한 유저에 대한 서버 이동 처리를 시작합니다
                    m_Core.ServerMoveStart(

                        // 서버이동할 유저
                        remote,

                        // 이동할 서버 주소
                        obj.m_Addr,


                        // 현재 간단한 서버이동만을 다루므로 아래 2개 파라미터에 대한 설명은 생략합니다
                        // - 서버 이동 관련 파라미터 정보와 특정한 방의 식별자로 활용 가능한 옵션 기능입니다

                        new ZNet.ArrByte(),
                        new Guid()
                        );

                    form.printf("서버이동 Start : move to {0}", (UnityCommon.Server)server_type);
                    return(true);
                }
                return(true);
            };


            // 클라이언트의 연결이 이루어지는 경우 발생되는 이벤트를 처리합니다
            m_Core.client_join_handler = (ZNet.RemoteID remote, ZNet.NetAddress addr, ZNet.ArrByte move_server, ZNet.ArrByte move_param) =>
            {
                // 서버이동으로 입장한 경우
                if (move_server.Count > 0)
                {
                    CUser rc;
                    UserData.UserDataMove_Complete(move_server, out rc);

                    form.printf("move server complete  {0} {1} {2} {3}", rc.data.userID, rc.data.money_cash, rc.data.money_game, rc.data.temp);
                    RemoteClients.Add(remote, rc);
                }
                else
                {
                    if (this.Type == UnityCommon.Server.Login)
                    {
                        // 로그인 서버에서만 일반입장을 허용
                        CUser rc = new CUser();
                        rc.data.userID = Guid.Empty;
                        rc.data.temp   = "최초입장_인증받기전";
                        RemoteClients.Add(remote, rc);
                    }
                    else
                    {
                        form.printf("로그인 서버외의 서버에서 일반 입장은 허용하지 않습니다");
                    }
                }

                form.printf("Client {0} is Join {1}:{2}. Current={3}\n", remote, addr.m_ip, addr.m_port, RemoteClients.Count);
            };

            // 클라이언트의 연결이 종료되는 경우 발생되는 이벤트 처리입니다
            m_Core.client_leave_handler = (ZNet.RemoteID remote, bool bMoveServer) =>
            {
                // 서버 이동중이 아닌상태에서 퇴장하는 경우 로그아웃에 대한 처리를 해줍니다
                if (bMoveServer == false)
                {
                    CUser rc;
                    if (RemoteClients.TryGetValue(remote, out rc))
                    {
                        form.printf("[DB로그아웃] 처리, user {0}\n", rc.data.userName);
                        if (Var.Use_DB)
                        {
                            Task.Run(() =>
                            {
                                try
                                {
                                    Simple.Data.Database.Open().UserInfo.UpdateByUserUUID(UserUUID: rc.data.userID, StateOnline: false);
                                }
                                catch (Exception e)
                                {
                                    form.printf("[DB로그아웃] 예외발생 {0}\n", e.ToString());
                                }
                            });
                        }
                    }
                }

                RemoteClients.Remove(remote);
                form.printf("Client {0} Leave\n", remote);
            };


            // 서버이동 도중에 이전 서버에 퇴장은 되었으나 새로운 서버로 입장을 실패하는 경우(회선문제 등으로)
            // ---> 이때 확실하게 로그아웃 처리를 마무리 해줄 필요가 있음
            m_Core.move_server_failed_handler = (ZNet.ArrByte move_server) =>
            {
                CUser rc;
                UserData.UserDataMove_Complete(move_server, out rc);

                form.printf("[DB로그아웃] 서버이동을 실패한 경우에 대한 마무리 처리, user {0}\n", rc.data.userName);
                if (Var.Use_DB)
                {
                    Task.Run(() =>
                    {
                        try
                        {
                            Simple.Data.Database.Open().UserInfo.UpdateByUserUUID(UserUUID: rc.data.userID, StateOnline: false);
                        }
                        catch (Exception e)
                        {
                            form.printf("[DB로그아웃] 예외발생 {0}\n", e.ToString());
                        }
                    });
                }
            };


            // 어떤 유저가 서버 이동을 시작한 경우 발생하는 이벤트입니다
            m_Core.move_server_start_handler = (ZNet.RemoteID remote, out ZNet.ArrByte buffer) =>
            {
                // 해당 유저의 유효성 체크
                CUser rc;
                if (RemoteClients.TryGetValue(remote, out rc) == false)
                {
                    buffer = null;
                    return;
                }

                // 인증여부 확인
                if (rc.joined == false)
                {
                    buffer = null;
                    return;
                }

                // 데이터 이동 완료시 목표 서버에서 정상적인 데이터인지 확인을 위한 임시 데이터 구성
                rc.data.temp = this.Name;

                // 동기화 할 유저 데이터를 구성하여 buffer에 넣어둔다 -> 이동 목표 서버에서 해당 데이터를 그대로 받게된다
                UserData.UserDataMove_Start(rc, out buffer);

                form.printf("move server start  {0} {1} {2} {3}", rc.data.userID, rc.data.money_cash, rc.data.money_game, rc.data.temp);
            };


            // 마스터 서버에 입장 성공한 이벤트
            m_Core.server_master_join_handler = (ZNet.RemoteID remote, ZNet.RemoteID myRemoteID) =>
            {
                form.printf(string.Format("마스터서버에 입장성공 remoteID {0}", myRemoteID));
            };

            // 마스터 서버에 퇴장된 이벤트
            m_Core.server_master_leave_handler = () =>
            {
                form.printf(string.Format("마스터서버와 연결종료!!!"));
                form.Close();    // 마스터 서버를 종료하면 모든 서버 프로그램이 자동 종료처리 되게 하는 내용...
            };

            // 마스터 서버에 연결된 모든 서버들로부터 주기적으로 자동 받게되는 정보
            m_Core.server_refresh_handler = (ZNet.MasterInfo master_info) =>
            {
                //form.printf(string.Format("서버P2P remote:{0} type:{1}[{2}] current:{3} addr:{4}:{5}",

                //    // 정보를 보낸 서버의 remoteID
                //    master_info.m_remote,

                //    // 정보를 보낸 서버의 종류 : 정보를 보낸 서버가 MasterConnect시 입력한 4번째 파라미터를 의미합니다
                //    (UnityCommon.Server)master_info.m_ServerType,

                //    // 정보를 보낸 서버의 설명 : 정보를 보낸 서버가 MasterConnect시 입력한 3번째 파라미터를 의미합니다
                //    master_info.m_Description,

                //    // 정보를 보낸 서버의 현재 동접 숫자 : 이것을 근거로 나중에 서버이동시 로드벨런싱에 사용할것입니다
                //    master_info.m_Clients,

                //    // 정보를 보낸 서버의 주소
                //    master_info.m_Addr.m_ip,
                //    master_info.m_Addr.m_port
                //    ));
            };
        }
Esempio n. 9
0
 /// <summary>
 ///   Starts a new Nvim process.
 /// </summary>
 /// <param name="nvimPath">
 ///   The path to the nvim executable. If null, the PATH will be searched.
 /// </param>
 /// <param name="arguments">Arguments to pass to the process.</param>
 /// <param name="startOptions">
 ///   Options for starting the process.
 /// </param>
 /// <returns></returns>
 public static Process Start(
     string nvimPath, string arguments,
     StartOption startOptions = StartOption.None) => Start(
     new NvimProcessStartInfo(nvimPath, arguments, startOptions));
Esempio n. 10
0
        /// <summary>
        /// After starting it will call the static callback method you have registered with timing explained in the [Callback Details](http://exceed7.com/native-touch/callback-details) page. It won't allow you to start without registering any callbacks, unless you have <see cref="StartOption.noCallback"> in the <paramref name="startOption">.
        ///
        /// [Editor] This method is a stub that does nothing.
        /// </summary>
        /// <param name="startOption">See the <see cref="StartOption"> class's member for definition of each options.</param>
        /// <exception cref="InvalidOperationException">Thrown when you start while already in <see cref="Started"> state, start without any callback while not in <see cref="StartOption.noCallback"> mode, or start in an unsupported platform.</exception>
        public static void Start(StartOption startOption = default(StartOption))
        {
            if (Application.isEditor)
            {
                return;
            }

            if (started)
            {
                throw new InvalidOperationException("You cannot start again (with or without different start option) while you are still in Started state. Call NativeTouch.Stop() first then you can start again with new options if you want.");
            }

            UnsupportedCheck();

            if (startOption == null)
            {
                startOption = new StartOption();
            }

            if (startOption.noCallback == false && NativeTouchInterface.AreSomeCallbacksNull(startOption.fullMode))
            {
                throw new InvalidOperationException(string.Format("Native Touch Start() aborted because you start while not registered any callback of the mode : {0}. Native Touch does not use null-check on event invoke for performance reason, and when the native side call you will get a null reference exception if Native Touch allows you to start like this. If you are intended to use ring buffer iteration based API, use `noCallback` in your `StartOption` to bypass this check.",
                                                                  startOption.fullMode ? "Full" : "Minimal")
                                                    );
            }

            AllocateIfNotYet(startOption);


#if UNITY_IOS
            //On iOS everything goes to statically linked C
            NativeTouchInterface._StartNativeTouch(
                fullMode: startOption.fullMode ? 1 : 0,
                disableUnityTouch: startOption.disableUnityTouch ? 1 : 0,
                noCallback: startOption.noCallback ? 1 : 0,
                fullDelegate: NativeTouchInterface.NativeTouchFullCallbackRingBuffer,
                minimalDelegate: NativeTouchInterface.NativeTouchMinimalCallbackRingBuffer,
                fullRingBuffer: ntdFullRingBufferHandle.AddrOfPinnedObject(),
                minimalRingBuffer: ntdRingBufferHandle.AddrOfPinnedObject(),
                finalCursorHandle: finalCursorHandle.AddrOfPinnedObject(),
                dekkerHandle: dekkerHandle.AddrOfPinnedObject(),
                ringBufferSize: startOption.ringBufferSize
                );
#elif UNITY_ANDROID
            //This goes to Java
            NativeTouchInterface.androidClassBridge.CallStatic(NativeTouchInterface.AndroidStart, new object[] { startOption.fullMode, startOption.disableUnityTouch, startOption.noCallback });

            //This goes to C directly, but dynamically linked.
            //(If UT allow statically linked lib on Android callback performance could be much better since IL2CPP could touch it.)
            NativeTouchInterface.registerCallbacksCheckRingBuffer(
                fullDelegate:  NativeTouchInterface.NativeTouchFullCallbackRingBuffer,
                minimalDelegate:  NativeTouchInterface.NativeTouchMinimalCallbackRingBuffer,
                fullRingBuffer:  ntdFullRingBufferHandle.AddrOfPinnedObject(),
                minimalRingBuffer:  ntdRingBufferHandle.AddrOfPinnedObject(),
                finalCursorHandle:  finalCursorHandle.AddrOfPinnedObject(),
                dekkerHandle:  dekkerHandle.AddrOfPinnedObject(),
                ringBufferSize:  startOption.ringBufferSize
                );
#endif
            started    = true;
            isFullMode = startOption.fullMode;
        }
Esempio n. 11
0
 public string GetTaggedText(string text) => StartOption.Text() + text + EndOption.Text();
        public override void HandleInput(InputState input)
        {
            //This needs to be check for values in whichOne and allowContinue because for some reason the menutemplate is not what it's suppossed to be.
            //The menu template should have a blocked out continue and the menu should not allow for continue selection if there was nothing loaded

            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.DPadDown) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.DPadDown) == true ||
                input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.LeftThumbstickDown) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.LeftThumbstickDown) == true)
            {
                if (whichOne == 0)
                {
                    menuOption++;
                    menuSelectPosition += new Vector2(0, 180);

                    if (menuOption > MenuOption.Credits)
                    {
                        menuOption = 0;
                        menuSelectPosition = new Vector2(100.0f);
                    }
                }
                else
                {
                    if (allowContinue)
                    {
                        startOption++;
                        menuSelectPosition += new Vector2(0, 180);

                        if (startOption > StartOption.Continue)
                        {
                            startOption = 0;
                            menuSelectPosition = new Vector2(100.0f);
                        }
                    }
                }
            }
            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.DPadUp) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.DPadUp) == true ||
                input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.LeftThumbstickUp) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.LeftThumbstickUp) == true)
            {
                if (whichOne == 0)
                {
                    menuOption--;
                    menuSelectPosition -= new Vector2(0, 180);

                    if (menuOption < 0)
                    {
                        menuOption = MenuOption.Credits;
                        menuSelectPosition = new Vector2(0, 540);
                    }
                }
                else
                {
                    if (allowContinue)
                    {
                        startOption--;
                        menuSelectPosition -= new Vector2(0, 180);

                        if (startOption < 0)
                        {
                            startOption = StartOption.Continue;
                            menuSelectPosition = new Vector2(0, 540);
                        }
                    }
                }

            }
            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.A) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.A) == true)
            {
                if (whichOne == 0)
                {
                    if (menuOption == MenuOption.Start)
                    {

                        //LoadingScreen.Load(ScreenManager, false, ControllingPlayer, new DifferentMenuScreen());
                        //reset the position of the rectangle
                        menuSelectPosition = new Vector2(100.0f);

                        //which menuTemplate to use
                        whichOne++;
                        if (allowContinue)
                        {
                            whichOne++;
                        }
                        return;
                    }

                    else if (menuOption == MenuOption.Gallery)
                    {

                        //TODO:
                    }
                    else if (menuOption == MenuOption.Credits)
                    {
                        //TODO:
                    }
                }
                if (whichOne == 1)
                {
                    if (startOption == StartOption.NewGame)
                    {
                        GamePlayScreen.storageDevice = storageDevice;

                        LoadingScreen.Load(ScreenManager, true, gamerOne.PlayerIndex, new LevelOne(gamerOne));
                        //load up a new game

                    }

                    if (startOption == StartOption.Continue)
                    {
                        if (gamerOne != null)
                        {
                            gameLoadRequested = true;
                            resultCheck = StorageDevice.BeginShowSelector(gamerOne.PlayerIndex, null, null);
                        }

                    }
                }

            }
        }
Esempio n. 13
0
 protected override void BeforeStart(out StartOption param)
 {
     base.BeforeStart(out param);
 }
Esempio n. 14
0
 public StartMenuItemExecutedEventArgs(ShellDrillDownMenuItem menuItem, IShellModule module, StartOption startOption)
 {
     MenuItem    = menuItem;
     Module      = module;
     StartOption = startOption;
 }
Esempio n. 15
0
        protected override void BeforeStart(out StartOption param)
        {
            base.BeforeStart(out param);


            // 클라이언트에게 받은 메세지
            stub.Chat = (ZNet.RemoteID remote, ZNet.CPackOption pkOption, string txt) =>
            {
                // 접속된 모두에게 그대로 돌려주는 단순한 처리입니다
                foreach (var obj in RemoteClients)
                {
                    proxy.Chat(obj.Key, ZNet.CPackOption.Basic, txt);
                }
                return(true);
            };


            // 클라이언트의 로그인 인증 요청을 처리합니다
            stub.request_Login = (ZNet.RemoteID remote, ZNet.CPackOption pkOption, string name, string pass) =>
            {
                // 유효한 유저인지 확인
                CUser rc;
                if (RemoteClients.TryGetValue(remote, out rc) == false)
                {
                    return(true);
                }


                Action LoginAsync = async() =>
                {
                    UserDataSync dummy = new UserDataSync();

                    var result = await Task.Run(() =>
                    {
                        form.printf("[DB로그인] 처리 시작. 결과를 기다리는 중입니다 ....\n");

                        try
                        {
                            dynamic result_db = Simple.Data.Database.Open().UserInfo.FindAllByUserName(name).FirstOrDefault();


                            if (result_db == null)
                            {
                                form.printf("[DB로그인] 해당 유저가 DB에 존재하지 않아 새로운 계정을 생성합니다\n");

                                System.Guid newID = System.Guid.NewGuid();
                                var user          = Simple.Data.Database.Open().UserInfo.Insert(UserUUID: newID, UserName: name, PassWord: pass);


                                // 생성한 계정을 로그인 상태로 변경
                                if (Simple.Data.Database.Open().UserInfo.UpdateByUserUUID(UserUUID: newID, StateOnline: true) == 1)
                                {
                                    dummy.userID     = newID;
                                    dummy.userName   = name;
                                    dummy.money_cash = 0;
                                    dummy.money_game = 500;
                                    return(1);   // 인증 성공
                                }
                            }
                            else
                            {
                                form.printf("[DB로그인] 인증진행중...\n");

                                /*if (result_db.StateOnline) // 이미 로그인한 상태 --> 중복 로그인 오류
                                 * {
                                 *  return 2;
                                 * }
                                 * else*/
                                if (result_db.PassWord == pass) // 암호 검사
                                {
                                    // 암호검사 통과 -> 해당 계정을로그인 상태로 변경
                                    if (Simple.Data.Database.Open().UserInfo.UpdateByUserUUID(UserUUID: result_db.UserUUID, StateOnline: true) == 1)
                                    {
                                        // 로딩한 DB데이터 보관
                                        dummy.userID     = result_db.UserUUID;
                                        dummy.userName   = result_db.UserName;
                                        dummy.money_cash = result_db.CashMoney;
                                        dummy.money_game = result_db.GameMoney;
                                        return(1);
                                    }
                                }
                                else
                                {
                                    return(3);   // 인증 실패 : 암호오류
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            form.printf("[DB로그인] 예외발생 {0}\n", e.ToString());
                        }

                        return(0);
                    });


                    // 상단의 DB Task가 완료되는 시점이므로 다시 유저가 유효한 상태인지 확인합니다
                    if (RemoteClients.TryGetValue(remote, out rc) == false)
                    {
                        form.printf("[DB로그인 결과받음] 결과 받은 시점에 해당유저 연결종료됨\n");
                        return;
                    }

                    // 인증 성공
                    if (result == 1)
                    {
                        form.printf("[DB로그인 결과받음] DB인증성공 : CashMoney : {0}  GameMoney : {1}  \n", rc.data.money_cash, rc.data.money_game);
                        rc.data   = dummy;
                        rc.joined = true;
                        proxy.reponse_Login(remote, ZNet.CPackOption.Basic, true);
                    }
                    else
                    {
                        if (result == 2)
                        {
                            form.printf("[DB로그인 결과받음] Login 실패 : 중복로그인  idname={0}\n", name);
                        }
                        else if (result == 3)
                        {
                            form.printf("[DB로그인 결과받음] Login 실패 : 암호오류  idname={0}\n", name);
                        }
                        else
                        {
                            form.printf("[DB로그인 결과받음] Login 실패 : ???  idname={0}\n", name);
                        }

                        // 인증 실패를 알려줌
                        proxy.reponse_Login(remote, ZNet.CPackOption.Basic, false);
                    }
                    return;
                };

                if (Var.Use_DB)
                {
                    // 로그인 DB 인증 비동기 방식으로 실행
                    LoginAsync.Invoke();
                }
                else
                {
                    form.printf("[DB로그인] DB작업없이 진행합니다 설정을 확인해주세요.\n");

                    rc.data.userID     = Guid.Empty;
                    rc.data.userName   = "******";
                    rc.data.money_cash = 0;
                    rc.data.money_game = 500;
                    rc.joined          = true;
                    proxy.reponse_Login(remote, ZNet.CPackOption.Basic, true);
                }

                return(true);
            };
        }
Esempio n. 16
0
        public void AKR_RemoveMarkPaintingFromMountingPanels()
        {
            CommandStart.Start(doc =>
            {
                Editor ed = doc.Editor;
                Database db = doc.Database;

                try
                {
                    var startOptions = new StartOption();
                    startOptions.LoadDefault();
                    if (startOptions.CheckMarkPainting)
                    {
                        MessageBox.Show("Для чертежа включена проверка марок покраски панелей. Нельзя выполнять очистку!",
                            "АКР. Очистка марок покраски в монтажных панелях.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                catch { }

                using (var t = db.TransactionManager.StartTransaction())
                {
                    // Все монтажные блоки панелей в модели
                    var ms = SymbolUtilityServices.GetBlockModelSpaceId(db).GetObject(OpenMode.ForRead) as BlockTableRecord;
                    var mountingsPanelsInMs = MountingPanel.GetPanels(ms, Point3d.Origin, Matrix3d.Identity, null, null);
                    mountingsPanelsInMs.ForEach(p => p.RemoveMarkPainting());
                    foreach (ObjectId idEnt in ms)
                    {
                        if (idEnt.ObjectClass.Name == "AcDbBlockReference")
                        {
                            var blRefMounting = t.GetObject(idEnt, OpenMode.ForRead, false, true) as BlockReference;
                            if (blRefMounting.Name.StartsWith(Settings.Default.BlockPlaneMountingPrefixName, StringComparison.CurrentCultureIgnoreCase))
                            {
                                var btr = blRefMounting.BlockTableRecord.GetObject(OpenMode.ForRead) as BlockTableRecord;
                                var mountingsPanels = MountingPanel.GetPanels(btr, blRefMounting.Position, blRefMounting.BlockTransform, null, null);
                                mountingsPanels.ForEach(p => p.RemoveMarkPainting());
                            }
                        }
                    }
                    t.Commit();
                }
                ed.Regen();
            });
        }