コード例 #1
0
        /*
         * /// <summary>
         * /// This method should be called, when spawn process is finalized (finished spawning).
         * /// For example, when spawned game server fully starts
         * /// </summary>
         * /// <param name="spawnId"></param>
         * /// <param name="callback"></param>
         * public void FinalizeSpawnedProcess(string spawnId, CompleteSpawnedProcessCallback callback)
         * {
         *  FinalizeSpawnedProcess(spawnId, new Dictionary<string, string>(), callback, Connection);
         * }
         *
         * /// <summary>
         * /// This method should be called, when spawn process is finalized (finished spawning).
         * /// For example, when spawned game server fully starts
         * /// </summary>
         * public void FinalizeSpawnedProcess(string spawnId, Dictionary<string, string> finalizationData, CompleteSpawnedProcessCallback callback)
         * {
         *  FinalizeSpawnedProcess(spawnId, finalizationData, callback, Connection);
         * }
         */
        /// <summary>
        /// This method should be called, when spawn process is finalized (finished spawning).
        /// For example, when spawned game server fully starts
        /// </summary>
        public void FinalizeSpawnedProcess(string spawnId, Dictionary <string, string> finalizationData, CompleteSpawnedProcessCallback callback, IClientSocket connection)
        {
            if (!connection.IsConnected)
            {
                callback.Invoke(false, "Not connected");
                return;
            }

            var packet = new SpawnFinalizationPacket()
            {
                SpawnId          = spawnId,
                FinalizationData = finalizationData
            };

            connection.SendMessage((short)MsfOpCodes.CompleteSpawnProcess, packet, (status, response) =>
            {
                if (status != ResponseStatus.Success)
                {
                    callback.Invoke(false, response.AsString("Unknown Error"));
                    return;
                }

                callback.Invoke(true, null);
            });
        }
コード例 #2
0
 /// <summary>
 /// Call when processis finalized
 /// </summary>
 /// <param name="finalizationPacket"></param>
 public void OnFinalized(SpawnFinalizationPacket finalizationPacket)
 {
     FinalizationPacket = finalizationPacket;
     if (!IsAborted && Status < SpawnStatus.Finalized)
     {
         Status = SpawnStatus.Finalized;
     }
 }