public static void Dispose(GameActive gameActive) { _combatProcessList = null; _userList = null; _teamList = null; _userTimesList = null; }
public static void Init(GameActive gameActive) { _combatProcessList = new DictionaryExtend<int, TeamCombatResult>(); _userList = new DictionaryExtend<string, int>(); _teamList = new DictionaryExtend<int, MorePlotTeam>(); _userTimesList = new DictionaryExtend<string, int>(); }
public ActionResult ExportExcel(string gridUrl, string referUrl, string pageNumber, string pageSize, string queryParams, string title, string sortName, string sortOrder, string columns) { var postData = new Dictionary <string, object>(); if (!string.IsNullOrEmpty(queryParams)) { postData = queryParams.JsonToDictionary(); } var serverUrl = string.Format("{0}://{1}", Request.Url.Scheme, Request.Headers["Host"]); var requestUrl = gridUrl; var dicList = GetDicList(serverUrl, requestUrl, referUrl, postData); DataTable dt = null; if (!string.IsNullOrEmpty(columns)) { dt = new DataTable(); var columnDic = columns.JsonToDictionaryList(); foreach (var dic in columnDic) { if (!dt.Columns.Contains(dic.GetValue("title"))) { dt.Columns.Add(dic.GetValue("title")); } } foreach (var dic in dicList) { DataRow dr = dt.NewRow(); foreach (var item in dic) { var column = columnDic.FirstOrDefault(a => a.GetValue("field") == item.Key); if (column != null) { dr[column.GetValue("title")] = item.Value; } } dt.Rows.Add(dr); } } else { dt = DictionaryExtend.ConvertDicToTable(dicList.ToList()); } var buffer = NPOIExcelHelper.Export(dt, "").GetBuffer(); buffer.CheckNotNull("导出excel出现异常"); return(File(buffer, "application/vnd.ms-excel", Url.Encode(title) + ".xls")); }
public static void Init(GameActive gameActive) { _combatProcessList = new DictionaryExtend <int, TeamCombatResult>(); _userList = new DictionaryExtend <string, int>(); _teamList = new DictionaryExtend <int, MorePlotTeam>(); _userTimesList = new DictionaryExtend <string, int>(); }
/// <summary> /// init /// </summary> /// <param name="proxyId">local name</param> /// <param name="client"></param> private RemoteService(string proxyId, RemoteClient client) { _packagePools = new DictionaryExtend <int, RemotePackage>(); _proxySessionId = Guid.NewGuid().ToString("N"); _proxyId = string.IsNullOrEmpty(proxyId) ? _proxySessionId : proxyId; _client = client; InitClient(); }
static EntitySyncManger() { _syncPools = new DictionaryExtend<string, bool>(); _sendQueue = new ConcurrentQueue<BaseEntity>(); _queueProcessThread = new Thread(ProcessQueue); _queueProcessThread.Start(); }
static EntitySyncManger() { _syncPools = new DictionaryExtend <string, bool>(); _sendQueue = new ConcurrentQueue <BaseEntity>(); Interlocked.Exchange(ref _runningQueue, 1); _queueProcessThread = new Thread(ProcessQueue); _queueProcessThread.Start(); }
static EntitySyncManger() { _syncPools = new DictionaryExtend<string, bool>(); _sendQueue = new ConcurrentQueue<BaseEntity>(); Interlocked.Exchange(ref _runningQueue, 1); _queueProcessThread = new Thread(ProcessQueue); _queueProcessThread.Start(); }
/// <summary> /// 获得参战的玩家 /// </summary> /// <param name="userId"></param> /// <returns></returns> public BossUser GetCombatUser(string userId) { DictionaryExtend <string, BossUser> userGeneralList = BossDict.UserGeneralList; if (userGeneralList.ContainsKey(userId)) { return(userGeneralList[userId]); } throw new Exception(string.Format("玩家{0}未加入公会Boss活动id:{1}", userId, _guildID)); }
/// <summary> /// /// </summary> public override void Init() { _modelCodeCache = new DictionaryExtend<string, ScriptFileInfo>(); _csharpCodeCache = new DictionaryExtend<string, ScriptFileInfo>(); _modelScriptPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.ModelScriptPath); AddWatchPath(_modelScriptPath, FileFilter); _csharpScriptPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.CSharpScriptPath); AddWatchPath(_csharpScriptPath, FileFilter); Load(); base.Init(); }
/// <summary> /// /// </summary> public override void Init() { _modelCodeCache = new DictionaryExtend <string, ScriptFileInfo>(); _csharpCodeCache = new DictionaryExtend <string, ScriptFileInfo>(); _modelScriptPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.ModelScriptPath); AddWatchPath(_modelScriptPath, FileFilter); _csharpScriptPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.CSharpScriptPath); AddWatchPath(_csharpScriptPath, FileFilter); Load(); base.Init(); }
/// <summary> /// /// </summary> public override void Init() { if (!SettupInfo.DisablePython) { _pythonCodeCache = new DictionaryExtend<string, PythonFileInfo>(); string refPath = Path.GetDirectoryName(SettupInfo.PythonReferenceLibFile); if (!string.IsNullOrEmpty(refPath) && !Directory.Exists(refPath)) { Directory.CreateDirectory(refPath); } pythonPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.PythonScriptPath); AddWatchPath(pythonPath, FileFilter); InitPython(); } base.Init(); }
/// <summary> /// /// </summary> public override void Init() { if (!SettupInfo.DisablePython) { _pythonCodeCache = new DictionaryExtend <string, PythonFileInfo>(); string refPath = Path.GetDirectoryName(SettupInfo.PythonReferenceLibFile); if (!string.IsNullOrEmpty(refPath) && !Directory.Exists(refPath)) { Directory.CreateDirectory(refPath); } pythonPath = Path.Combine(SettupInfo.RuntimePath, SettupInfo.ScriptRelativePath, SettupInfo.PythonScriptPath); AddWatchPath(pythonPath, FileFilter); InitPython(); } base.Init(); }
public JsonResult ExportExcel() { string code = QueryString("UICode"); code.CheckNotNullOrEmpty("UICode"); var listConfig = UnitOfWork.GetSingle <ListConfig>(a => a.UICode == code); listConfig.CheckNotNull("listConfig"); var colList = listConfig.GetColumnList();//列设置 #region 数据库数据 string sql = listConfig.SQL; if (!string.IsNullOrEmpty(listConfig.OrderBy)) { if (!listConfig.OrderBy.ToLower().Contains("order") && !listConfig.OrderBy.ToLower().Contains("by")) { sql += (" order by " + listConfig.OrderBy); } else { sql += (" " + listConfig.OrderBy); } } var res = UnitOfWork.DynamicListFromSql(listConfig.DBName, sql); #endregion //fieldName替换为标题 var dt = DictionaryExtend.ConvertDicToTable(res.ToList()); foreach (DataColumn dataCol in dt.Columns) { var colItem = colList.FirstOrDefault(a => a.GetValue("field") == dataCol.ColumnName); if (colItem != null) { dataCol.ColumnName = colItem.GetValue("title"); } } NPOIExcelHelper.ExportByWeb(dt, listConfig.Name, listConfig.Name); return(Json("")); }
static ProfileManager() { _summary = new ProfileSummary(); _entityObjectCollection = new DictionaryExtend <string, EntityProfileCollection>(); _sqlCollection = new DictionaryExtend <string, SqlProfileCollection>(); }
/// <summary> /// /// </summary> public static void Init() { SchemaSet = new DictionaryExtend <string, SchemaTable>(); StartCheckTableTimer(); }
static ScriptEngines() { //init object. _pythonOptions = new Dictionary <string, object>(); _watcherDict = new DictionaryExtend <string, FileWatcherInfo>(); _scriptCodeCache = new DictionaryExtend <string, ScriptFileInfo>(); _changedFiles = new HashSet <string>(); //init runtime path. _runtimePath = MathUtils.RuntimePath; _runtimeBinPath = MathUtils.RuntimeBinPath; if (string.IsNullOrEmpty(_runtimeBinPath)) { _runtimeBinPath = _runtimePath; } _relativeDirName = ConfigUtils.GetSetting("ScriptRelativePath", ""); _disablePython = ConfigUtils.GetSetting("Python_Disable", false); _scriptIsDebug = ConfigUtils.GetSetting("Script_IsDebug", false); SetPythonDebug = ConfigUtils.GetSetting("Python_IsDebug", _scriptIsDebug); CSharpDirName = ConfigUtils.GetSetting("CSharpRootPath", "Script"); ScriptMainClass = ConfigUtils.GetSetting("ScriptMainClass", Path.Combine(CSharpDirName, "MainClass.cs")); ScriptMainTypeName = ConfigUtils.GetSetting("ScriptMainTypeName", ""); //init script dir. var directorys = new[] { string.Format("{0};{1}", ModelDirName, false), string.Format("{0};{1};{2}", CSharpDirName, false, ModelDirName) }; foreach (string temp in directorys) { var arr = temp.Split(';'); string dirName = arr[0]; bool isMemory = arr.Length > 1 ? arr[1].ToBool() : false; string[] refArr = arr.Length > 2 ? arr[2].Split(',') : new string[0]; _watcherDict[dirName] = new FileWatcherInfo() { Path = Path.Combine(_runtimePath, _relativeDirName, dirName), Filter = "*.cs", CompileLevel = dirName == ModelDirName ? 9 : 3, IsInMemory = isMemory, ReferenceKeys = refArr }; } if (!_disablePython) { PythonDirName = ConfigUtils.GetSetting("PythonRootPath", "PyScript"); ReferenceLibFile = Path.Combine(_runtimePath, _relativeDirName, PythonDirName, ConfigUtils.GetSetting("ReferenceLibFile", "Lib/ReferenceLib.py")); string path = Path.GetDirectoryName(ReferenceLibFile); if (!string.IsNullOrEmpty(path) && !Directory.Exists(path)) { Directory.CreateDirectory(path); } _watcherDict[PythonDirName] = new FileWatcherInfo() { IsPython = true, CompileLevel = 0, Path = Path.Combine(_runtimePath, _relativeDirName, PythonDirName), Filter = "*.py" }; } //init Assemblies _referencedAssemblies = new HashSet <string>(new[] { Path.Combine(_runtimeBinPath, "NLog.dll"), Path.Combine(_runtimeBinPath, "Newtonsoft.Json.dll"), Path.Combine(_runtimeBinPath, "protobuf-net.dll"), Path.Combine(_runtimeBinPath, "ServiceStack.Redis.dll"), Path.Combine(_runtimeBinPath, "ZyGames.Framework.Common.dll"), Path.Combine(_runtimeBinPath, "ZyGames.Framework.dll") }); }
/// <summary> /// /// </summary> /// <param name="settupInfo"></param> public CSharpRuntimeScope(ScriptSettupInfo settupInfo) : base(settupInfo) { _modelCodeCache = new DictionaryExtend <string, ScriptFileInfo>(); _csharpCodeCache = new DictionaryExtend <string, ScriptFileInfo>(); }
/// <summary> /// /// </summary> /// <param name="settupInfo"></param> public CSharpRuntimeScope(ScriptSettupInfo settupInfo) : base(settupInfo) { _modelCodeCache = new DictionaryExtend<string, ScriptFileInfo>(); _csharpCodeCache = new DictionaryExtend<string, ScriptFileInfo>(); }
/// <summary> /// /// </summary> public static void Init() { SchemaSet = new DictionaryExtend <string, SchemaTable>(); }
/// <summary> /// init /// </summary> /// <param name="proxyId">local name</param> /// <param name="client"></param> private RemoteService(string proxyId, RemoteClient client) { _packagePools = new DictionaryExtend<int, RemotePackage>(); _proxySessionId = Guid.NewGuid().ToString("N"); _proxyId = string.IsNullOrEmpty(proxyId) ? _proxySessionId : proxyId; _client = client; InitClient(); }
static ProfileManager() { _summary = new ProfileSummary(); _entityObjectCollection = new DictionaryExtend<string, EntityProfileCollection>(); _sqlCollection = new DictionaryExtend<string, SqlProfileCollection>(); }
public BossDictionary() { UserGeneralList = new DictionaryExtend <string, BossUser>(); }
/// <summary> /// /// </summary> /// <param name="settupInfo"></param> public PythonRuntimeScope(ScriptSettupInfo settupInfo) : base(settupInfo) { _pythonCodeCache = new DictionaryExtend <string, PythonFileInfo>(); }
public BossDictionary() { UserGeneralList = new DictionaryExtend<string, BossUser>(); }
static ScriptEngines() { //init object. _pythonOptions = new Dictionary<string, object>(); _watcherDict = new DictionaryExtend<string, FileWatcherInfo>(); _scriptCodeCache = new DictionaryExtend<string, ScriptFileInfo>(); _changedFiles = new HashSet<string>(); //init runtime path. _runtimePath = MathUtils.RuntimePath; _runtimeBinPath = MathUtils.RuntimeBinPath; if (string.IsNullOrEmpty(_runtimeBinPath)) { _runtimeBinPath = _runtimePath; } _relativeDirName = ConfigUtils.GetSetting("ScriptRelativePath", ""); _disablePython = ConfigUtils.GetSetting("Python_Disable", false); _scriptIsDebug = ConfigUtils.GetSetting("Script_IsDebug", false); SetPythonDebug = ConfigUtils.GetSetting("Python_IsDebug", _scriptIsDebug); CSharpDirName = ConfigUtils.GetSetting("CSharpRootPath", "Script"); ScriptMainClass = ConfigUtils.GetSetting("ScriptMainClass", Path.Combine(CSharpDirName, "MainClass.cs")); ScriptMainTypeName = ConfigUtils.GetSetting("ScriptMainTypeName", ""); //init script dir. var directorys = new[] { string.Format("{0};{1}", ModelDirName, false), string.Format("{0};{1};{2}", CSharpDirName, false, ModelDirName) }; foreach (string temp in directorys) { var arr = temp.Split(';'); string dirName = arr[0]; bool isMemory = arr.Length > 1 ? arr[1].ToBool() : false; string[] refArr = arr.Length > 2 ? arr[2].Split(',') : new string[0]; _watcherDict[dirName] = new FileWatcherInfo() { Path = Path.Combine(_runtimePath, _relativeDirName, dirName), Filter = "*.cs", CompileLevel = dirName == ModelDirName ? 9 : 3, IsInMemory = isMemory, ReferenceKeys = refArr }; } if (!_disablePython) { PythonDirName = ConfigUtils.GetSetting("PythonRootPath", "PyScript"); ReferenceLibFile = Path.Combine(_runtimePath, _relativeDirName, PythonDirName, ConfigUtils.GetSetting("ReferenceLibFile", "Lib/ReferenceLib.py")); string path = Path.GetDirectoryName(ReferenceLibFile); if (!string.IsNullOrEmpty(path) && !Directory.Exists(path)) { Directory.CreateDirectory(path); } _watcherDict[PythonDirName] = new FileWatcherInfo() { IsPython = true, CompileLevel = 0, Path = Path.Combine(_runtimePath, _relativeDirName, PythonDirName), Filter = "*.py" }; } //init Assemblies _referencedAssemblies = new HashSet<string>(new[] { Path.Combine(_runtimeBinPath, "NLog.dll"), Path.Combine(_runtimeBinPath, "Newtonsoft.Json.dll"), Path.Combine(_runtimeBinPath, "protobuf-net.dll"), Path.Combine(_runtimeBinPath, "ServiceStack.Redis.dll"), Path.Combine(_runtimeBinPath, "ZyGames.Framework.Common.dll"), Path.Combine(_runtimeBinPath, "ZyGames.Framework.dll") }); }
/// <summary> /// /// </summary> /// <param name="settupInfo"></param> public PythonRuntimeScope(ScriptSettupInfo settupInfo) : base(settupInfo) { _pythonCodeCache = new DictionaryExtend<string, PythonFileInfo>(); }