![[C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1 [C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1](https://i.gyazo.com/eacbff773afd3bacdd9ede5d91e96a73.png)
Mesaje: 112
Membru din: 26 Noi 2024, 04:08
Status: Discord: mihaimiti
Contact:
Testat , necesită câteva ajustări pentru Martysama 5.8, dar cu atenție se implementează fără probleme!
![[C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1 [C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1](https://i.gyazo.com/eacbff773afd3bacdd9ede5d91e96a73.png)
![[C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1 [C++/Py] Switchbot Sanii 5 sloturi cu functie Save - Mesaj 11 - Imagine 1](https://i.gyazo.com/eacbff773afd3bacdd9ede5d91e96a73.png)
Salut, mersi pentru distribuire! Switchbot-ul funcționează foarte bine în momentul de față, singura problemă pe care o întâmpin este că derularea bonusurilor nu funcționează așa cum se vede în videoclip. Ai idee de la ce ar putea fi? Mersi!
Files MartySama v5.8 Ikarus v2
https://gyazo.com/d8e2b0669e582555ee4beaee7a359b92
Files MartySama v5.8 Ikarus v2
https://gyazo.com/d8e2b0669e582555ee4beaee7a359b92
MartySama v5.8 p23 Compatibility Notes
I successfully integrated this Switchbot package into MartySama v5.8 p23.
The package works, but several compatibility adjustments were required to make it fully stable on this source.
To help anyone using the same base, here are the most important points from my experience.
1. input_main.cpp
One of the most important changes was made inside input_main.cpp.
The original Switchbot() packet handling was not fully compatible with MartySama's packet structure.
During the first tests I experienced:
packet synchronization issues,
buffer_read_proceed errors,
unnecessary syserr logs.
I rewrote the packet handling to match MartySama's original packet flow, and all packet-related issues disappeared.
2. Database Synchronization
The database queries had to be adjusted to properly support the SWITCHBOT window.
Without these changes, Switchbot items could disappear from the client after:
relog,
warp,
character selection,
reconnect.
The items still existed in the database, but they were not synchronized correctly with the client.
After adjusting the database queries, this issue was completely resolved.
3. Switchbot Synchronization
This was the most time-consuming part of the integration.
At first I tried forcing synchronization by adding additional SendSwitchbotUpdate() calls.
Although this looked like a possible solution, on MartySama it introduced new problems such as:
packet synchronization issues,
unstable client updates,
connection problems,
and in some cases even channel crashes.
The most stable solution was to keep MartySama's original synchronization flow and avoid sending unnecessary update packets.
4. Start / Stop Handling
Some sys_err() messages were generated during completely normal user actions.
For example:
pressing Start on an already running slot,
pressing Stop on an inactive slot.
These are not real errors, so I removed the unnecessary sys_err() messages to keep the logs clean.
5. Locale String Parameters
Be careful with the parameter order inside locale strings.
Example:
Bonuschange of %s (Slot: %d) successfully finished.
The source sends the parameters in this order:
%s
%d
If you change the translation to use:
%d
%s
the parameter order no longer matches the source and snprintf() will crash with a SIGSEGV (Segmentation Fault).
If you want a different message format, create a new locale key or modify the source accordingly instead of changing the placeholder order.
6. Testing
The following scenarios were tested successfully:
Multiple Switchbot slots running simultaneously.
Long-term bonus switching.
Warp.
Relog.
Character selection.
Reconnect.
Switch item synchronization.
Bonus completion notifications.
Chat notifications.
PM notifications.
After these adjustments I did not experience any item loss or synchronization issues.
The system has been stable during long-term testing.
Final Notes
The package itself works well.
However, MartySama has several implementation differences, so I strongly recommend reviewing:
packet handling,
database synchronization,
item synchronization,
instead of simply copying the files.
After making these compatibility adjustments, the package has been stable on MartySama v5.8 p23.
Important
The most difficult part of this integration was item synchronization.
Even if everything appears to work correctly at first, make sure you also test:
Warp
Relog
Character selection
Reconnect
Long-term Switchbot usage
Many synchronization issues only become visible after testing these scenarios.
Do not assume the integration is fully stable until every one of these cases has been verified.
I successfully integrated this Switchbot package into MartySama v5.8 p23.
The package works, but several compatibility adjustments were required to make it fully stable on this source.
To help anyone using the same base, here are the most important points from my experience.
1. input_main.cpp
One of the most important changes was made inside input_main.cpp.
The original Switchbot() packet handling was not fully compatible with MartySama's packet structure.
During the first tests I experienced:
packet synchronization issues,
buffer_read_proceed errors,
unnecessary syserr logs.
I rewrote the packet handling to match MartySama's original packet flow, and all packet-related issues disappeared.
2. Database Synchronization
The database queries had to be adjusted to properly support the SWITCHBOT window.
Without these changes, Switchbot items could disappear from the client after:
relog,
warp,
character selection,
reconnect.
The items still existed in the database, but they were not synchronized correctly with the client.
After adjusting the database queries, this issue was completely resolved.
3. Switchbot Synchronization
This was the most time-consuming part of the integration.
At first I tried forcing synchronization by adding additional SendSwitchbotUpdate() calls.
Although this looked like a possible solution, on MartySama it introduced new problems such as:
packet synchronization issues,
unstable client updates,
connection problems,
and in some cases even channel crashes.
The most stable solution was to keep MartySama's original synchronization flow and avoid sending unnecessary update packets.
4. Start / Stop Handling
Some sys_err() messages were generated during completely normal user actions.
For example:
pressing Start on an already running slot,
pressing Stop on an inactive slot.
These are not real errors, so I removed the unnecessary sys_err() messages to keep the logs clean.
5. Locale String Parameters
Be careful with the parameter order inside locale strings.
Example:
Bonuschange of %s (Slot: %d) successfully finished.
The source sends the parameters in this order:
%s
%d
If you change the translation to use:
%d
%s
the parameter order no longer matches the source and snprintf() will crash with a SIGSEGV (Segmentation Fault).
If you want a different message format, create a new locale key or modify the source accordingly instead of changing the placeholder order.
6. Testing
The following scenarios were tested successfully:
Multiple Switchbot slots running simultaneously.
Long-term bonus switching.
Warp.
Relog.
Character selection.
Reconnect.
Switch item synchronization.
Bonus completion notifications.
Chat notifications.
PM notifications.
After these adjustments I did not experience any item loss or synchronization issues.
The system has been stable during long-term testing.
Final Notes
The package itself works well.
However, MartySama has several implementation differences, so I strongly recommend reviewing:
packet handling,
database synchronization,
item synchronization,
instead of simply copying the files.
After making these compatibility adjustments, the package has been stable on MartySama v5.8 p23.
Important
The most difficult part of this integration was item synchronization.
Even if everything appears to work correctly at first, make sure you also test:
Warp
Relog
Character selection
Reconnect
Long-term Switchbot usage
Many synchronization issues only become visible after testing these scenarios.
Do not assume the integration is fully stable until every one of these cases has been verified.
If anyone experiences issues with the Switchbot bonus selection (bonus list not displaying or updating correctly), I recommend checking the following before looking elsewhere:
packet.h (client and server)
Switchbot packet structures
Packet size consistency
Attribute information packets
Client/server structure synchronization
On MartySama, this behavior is usually caused by packet or structure incompatibilities rather than the Switchbot itself.
Making sure that the client and server structures are perfectly synchronized resolved the issue.
Hopefully this helps someone save a few hours of debugging.
packet.h (client and server)
Switchbot packet structures
Packet size consistency
Attribute information packets
Client/server structure synchronization
On MartySama, this behavior is usually caused by packet or structure incompatibilities rather than the Switchbot itself.
Making sure that the client and server structures are perfectly synchronized resolved the issue.
Hopefully this helps someone save a few hours of debugging.
Creează-ți un cont sau autentifică-te pentru a participa la discuție
Trebuie să fii membru pentru a răspunde
Creează-ți un cont
Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!
Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.
Autentifică-te
-
Subiecte similare
-
9Răspunsuri2112Vizualizăride skywhywalker
-
de 3lteror » » în Arhivă probleme12Răspunsuri1815Vizualizăride 3lteror
-
0Răspunsuri1545Vizualizăride SCOOB
-
0Răspunsuri547Vizualizăride SCOOB
-
2Răspunsuri1333Vizualizăride dany8368
-
Informații
Discord ID copiat:




