Esempio n. 1
0
 /// <summary>
 /// 开始事务
 /// </summary>
 /// <param name="ss"></param>
 public void BeginSession(IFSSession ss)
 {
     if (ss==null)
     {
         JW.Common.Log.LogE("IFS Service BeginSession nil Session");
         return;
     }
     //
     for (int i = _sessionProcessors.Count - 1; i >= 0; --i)
     {
         if (_sessionProcessors[i].Name.Equals(ss.Name))
         {
             JW.Common.Log.LogE("Repeat Session:" + ss.Name);
             return;
         }
     }
     //
     IFSSessionProcessor pp = IFSSessionProcessor.Create(ss);
     if (pp != null)
     {
         pp.gameObject.transform.parent = this.transform;
         _sessionProcessors.Add(pp);
         pp.BeginSession();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// To Lua
        /// </summary>
        /// <param name="sessionName"></param>
        /// <param name="firstZipName"></param>
        /// <param name="fileListFileName"></param>
        /// <param name="firstZipUrl"></param>
        /// <param name="fileListFileUrl"></param>
        /// <param name="netFileRootUrl"></param>
        /// <param name="handler"></param>
        public void BeginSessionLua(string sessionName, string firstZipName, string fileListFileName, string firstZipUrl, string fileListFileUrl, string netFileRootUrl, IFSSessionDelegate handler)
        {
            if (string.IsNullOrEmpty(sessionName))
            {
                JW.Common.Log.LogE("IFS Service BeginSessionLua Error SessionName");
                return;
            }
            IFSSession ss = new IFSSession();
            ss.Name = sessionName;
            ss.FirstZipName = firstZipName;
            ss.FileListFileName = fileListFileName;
            ss.SessionHandler = handler;
            //
            ss.FirstZipURL = firstZipUrl;
            ss.FileListFileUrl = fileListFileUrl;
            ss.NetFileRootUrl = netFileRootUrl;
            //
            for (int i = _sessionProcessors.Count - 1; i >= 0; --i)
            {
                if (_sessionProcessors[i].Name.Equals(sessionName))
                {
                    JW.Common.Log.LogE("Repeat Session:" + sessionName);
                    return;
                }
            }

            IFSSessionProcessor pp = IFSSessionProcessor.Create(ss);
            if (pp != null)
            {
                pp.gameObject.transform.parent = this.transform;
                _sessionProcessors.Add(pp);
                pp.BeginSession();
            }
        }