/// <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(int spawnId, MstProperties finalizationData, SuccessCallback callback, IClientSocket connection) { if (!connection.IsConnected) { callback.Invoke(false, "Not connected"); return; } var packet = new SpawnFinalizationPacket() { SpawnTaskId = spawnId, FinalizationData = finalizationData }; connection.SendMessage((short)MstMessageCodes.CompleteSpawnProcess, packet, (status, response) => { if (status != ResponseStatus.Success) { callback.Invoke(false, response.AsString("Unknown Error")); return; } callback.Invoke(true, null); }); }
/// <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; } }