コード例 #1
0
        /// <summary>
        /// 服务器存档
        /// </summary>
        /// <param name="session"></param>
        /// <param name="requestInfo"></param>
        public static void ServerSave()
        {
            Util.BenchmarkStart("服务器存档");
            BaseServerManager.SaveData();
            //全局数据存储

            Util.BenchmarkEnd();
        }
コード例 #2
0
        /// <summary>
        /// 服务器存档
        /// </summary>
        /// <param name="session"></param>
        /// <param name="requestInfo"></param>
        public static void ServerSave(bool saveplayer = true)
        {
            Util.BenchmarkStart("服务器存档");

            BaseServerManager.SaveData();

            Util.BenchmarkEnd();

            if (saveplayer)
            {
                Util.BenchmarkStart($"所有玩家存档 {PlayerManager.DictPlayerOnline.Count}");
                foreach (var p in PlayerManager.DictPlayerOnline.Values)
                {
                    p.Save();
                }
                Util.BenchmarkEnd();
            }
        }