//首先,用户ID竟然是字符串型,数据库里存的是BIGINT型吧,就算用户登陆名不是纯数字 ,那他在数据库里也有一个bigint型数据
private string userid;
public GameTable AddTable(string tableId)
        {
//桌子列表用的是字典,一个游戏(比如QQ游戏的象棋),每次添加一个桌子我要判断几K次,况且字典又费内存
//为什么不设置成自增的桌号??
            if (tableList.ContainsKey(tableId))
                return tableList[tableId];
 //每次添加桌子还要从配置文件中取一次类名,不知道这个配置是只加载一次到内存还是每次打开

            string className = ConfigurationManager.AppSettings[gameName];
            Assembly asmb = Assembly.LoadFrom(className);

            string typeName = ConfigurationManager.AppSettings[gameName + "GameTable"];
            Type t = asmb.GetType(typeName);

            GameTable table = (GameTable)Activator.CreateInstance(t, new object[] { tableId });
            tableList.Add(tableId, table);
            return table;
        }
      写的不是程序,是寂寞

相关文章:

  • 2021-06-26
  • 2021-08-16
  • 2021-07-15
  • 2021-07-04
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2022-02-19
  • 2021-11-18
  • 2021-10-20
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案