Пример #1
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="userId"></param>
 public void InitCache(int userId)
 {
     if(!userDeployments.ContainsKey(userId))
     {
         Deployment d = new Deployment();
         d = d.GetModel(userId);
         if(d==null)
         {
             //玩家第一次登陆,获得的出事数据
             d = new Deployment();
             d.user_id = userId;
             d.grid1 = new DeploymentGridModel();
             d.grid2 = new DeploymentGridModel();
             d.grid3 = new DeploymentGridModel();
             d.grid4 = new DeploymentGridModel();
             d.grid5 = new DeploymentGridModel();
             d.Add();
         }
         userDeployments.Add(userId, d);
     }
 }