protected virtual void OnDesyncDetected(DesyncEventArgs e) { PrepareEvent(e); #if DEBUG _chat.AddMessage("Desync detected, fixing..."); #endif logger.Info("Desync detected, fixing..."); foreach (var chunkPos in e.ChunksToSynchronize) { _chunks.ResyncChunk(chunkPos, true); } foreach (var entityId in e.EntitiesToSynchronize) { _server.ServerConnection.Send(new GetEntityMessage { DynamicEntityId = entityId }); } var handler = DesyncDetected; if (handler != null) { handler(this, e); } }
/// <inheritdoc /> public void AddMessage(ChatObject message, MessageType type) { if (type == MessageType.Raw || type == MessageType.Chat || type == MessageType.Whisper || type == MessageType.Announcement || type == MessageType.System) { Chat?.AddMessage(message, type); } else { _tipPopupComponent?.AddMessage(message, type); } }
void EntityMessageTranslatorEntityLockFailed(object sender, EventArgs e) { _chatComponent.AddMessage(" -- Can't use the entity, it is busy!"); _lockedEntity = null; }