コード例 #1
0
ファイル: Program.cs プロジェクト: GamesDesignArt/GGTalk
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                ESPlus.GlobalUtil.SetMaxLengthOfUserID(byte.Parse(ConfigurationManager.AppSettings["MaxLengthOfUserID"]));
                ESPlus.GlobalUtil.SetAuthorizedUser("FreeUser", "");

                DynamicGroupManager dynamicGroupManager = new DynamicGroupManager();//视频会议房间管理、即动态组管理
                Program.RapidServerEngine.HeartbeatTimeoutInSecs = int.Parse(ConfigurationManager.AppSettings["HeartbeatTimeoutInSecs"]);
                Program.RapidServerEngine.UseAsP2PServer = true;
                Program.RapidServerEngine.GroupManager = dynamicGroupManager;

                Program.RapidServerEngine.SecurityLogEnabled = false;
                CustomizeInfoHandler customizeInfoHandler = new CustomizeInfoHandler();

                DynamicGroupHandler groupHandler = new DynamicGroupHandler();

                ComplexCustomizeHandler complexHandler = new ComplexCustomizeHandler(customizeInfoHandler, groupHandler);
                Program.RapidServerEngine.Initialize(int.Parse(ConfigurationManager.AppSettings["Port"]), complexHandler);
                Program.RapidServerEngine.GroupController.GroupNotifyEnabled = true;
                Program.RapidServerEngine.UserManager.RelogonMode = ESFramework.Server.UserManagement.RelogonMode.IgnoreNew;
                groupHandler.Initialize(Program.RapidServerEngine.UserManager, Program.RapidServerEngine.CustomizeController, dynamicGroupManager);

                #region OMCS 服务器设置
                OMCS.GlobalUtil.SetMaxLengthOfUserID(byte.Parse(ConfigurationManager.AppSettings["MaxLengthOfUserID"]));
                OMCS.OMCSConfiguration config = new OMCS.OMCSConfiguration(
                    int.Parse(ConfigurationManager.AppSettings["CameraFramerate"]),
                    int.Parse(ConfigurationManager.AppSettings["DesktopFramerate"]));

                //用于验证登录用户的帐密
                OMCS.Server.DefaultUserVerifier userVerifier = new OMCS.Server.DefaultUserVerifier();
                Program.MultimediaServer = OMCS.Server.MultimediaServerFactory.CreateMultimediaServer(int.Parse(ConfigurationManager.AppSettings["OMCS_Port"]), userVerifier, config, bool.Parse(ConfigurationManager.AppSettings["SecurityLogEnabled"]));

                #endregion

                OMCS.Server.ServerForm form = new OMCS.Server.ServerForm(Program.MultimediaServer);
                form.Text = "GGMeeting视频会议系统2015-服务器";
                Application.Run(form);
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }