예제 #1
0
        public bool Initialize(LockStepInitializeInfo initInfo, IBufferStrategy bufferStrategy)
        {
            // just want to initialize Gcloud
            IGCloud gcloud = IGCloud.Instance;

            ADebug.Log("Initialize" + (gcloud == null));

            if (initInfo != null)
            {
                this.initInfo = initInfo;

                byte[] buffer;
                if (initInfo.Encode(out buffer) && buffer != null)
                {
                    bool ret = gcloud_lockstep_init(buffer, buffer.Length);
                    if (!ret)
                    {
                        return(false);
                    }
                }
                else
                {
                    ADebug.LogError("LockStep Initialize Encode error");
                    return(false);
                }
            }
            else
            {
                ADebug.LogError("LockStep Initialize is null");
                return(true);
            }

            if (bufferStrategy != null)
            {
                this.bufferStrategy = bufferStrategy;
            }
            else
            {
                this.bufferStrategy = new DefaultBufferStrategy();
            }

            if (this.bufferStrategy != null)
            {
                this.bufferStrategy.Steper = this;
            }

            return(true);
        }
예제 #2
0
 /// <summary>
 /// Initialize the specified initInfo.
 /// </summary>
 /// <param name="initInfo">Init info.</param>
 public abstract bool Initialize(LockStepInitializeInfo initInfo);
예제 #3
0
 public override bool Initialize(LockStepInitializeInfo initInfo)
 {
     base.Initialize(false, true);
     return(Initialize(initInfo, null));
 }