Update MQTTManager.cs #8
Reference in New Issue
Block a user
Delete Branch "lh/20250429"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raktbeej Code Review:
Summary:
▷ 위반 항목
리뷰 결과, 변경된 부분에서 C# 코드 컨벤션을 위반한 사항은 발견되지 않았습니다.
리팩토링 제안
이번 변경 사항에서는 하드코딩된 문자열
"simulation/435faabb-6183-4690-a81f-027dd96d5827/#"을 사용하는 부분이 있습니다. 만약 이 토픽이 여러 곳에서 반복적으로 사용된다면, 해당 문자열을 상수 또는 설정 파일로 빼내어 관리하는 것이 유지보수에 유리할 것입니다. 예를 들어const string또는 설정 파일을 활용할 수 있습니다.또는 설정 파일에서 읽어들이는 방식도 고려해 볼 수 있습니다.
Raktbeej Code Review:
Summary:
The provided code represents a diff from a pull request introducing various new files and modifications in an existing C# Unity project. Here's a summary of the main changes:
WebConfig.json:
Assets/StreamingAssets. It contains a config with a host, port, and access token.BaseSimulationMessage.cs:
BaseSimulationMessageadded underAssets/WorkSpace/LH.SimulationTypeis defined for different event types.MQTTManager.cs:
MQTTManagerclass with integration ofBaseSimulationMessage.topicproperty with custom getter and setter.UnsubscribeTopicmethod allowing the client to unsubscribe from MQTT topics.BaseSimulationMessageobjects usingJsonConvert.DeserializeObject.SubscriptionTopictoSubscribeTopic).WebConfig.cs:
WebConfigListandWebConfig.WebConfig.json.These changes enhance network configuration handling and message processing within the Unity project. It leverages JSON for configurations and introduces new capabilities in the MQTTManager related to handling message topics and unsubscribing from them. The use of JSON deserialization allows easy manipulation of simulation messages.
Pull request closed