Open nvh2001 opened 3 months ago
Chill I'll respond you again at 1h or less.
More issue: If list of struct is length = 0 (not null), will error when deserialize
Idol idol = new Idol();
idol.name = "Karina";
idol.birthdayYear = 2000;
idol.group = new Group
{
name = "aespa",
birthdayYear = 2019,
songs = new List<Song>()
{
//new Song{name = "Supernova", birthdayYear = 2024},
//new Song{name = "Armageddon", birthdayYear = 2024}
}
};
Idol[] list = new Idol[1];
list[0] = (idol);
Primitive send = new Primitive();
send.Add.Array<Idol>(list);
Primitive recive = new Primitive(send.GetBytes());
var reIdol = recive.Get.Array<Idol>();
Debug.Log(reIdol[0].name);
Debug.Log(reIdol[0].birthdayYear);
Debug.Log(reIdol[0].group.name);
Debug.Log(reIdol[0].group.birthdayYear);
//foreach (var song in reIdol[0].group.songs)
//{
// Debug.Log(song.name + " | " + song.birthdayYear);
//}
More issue: If list of struct is length = 0 (not null), will error when deserialize
true, Primitive don't allow write null information
To avoid error On Byter, my funny way, huhu i crying
public async Task<PlayerSessionModel> OnGetUserInfo(string accessToken)
{
PlayerSessionModel pModel = new PlayerSessionModel();
var url = ServerURL.GetUrlByTypeGetRequest(TypeGetRequest.UserInfo);
var result = await ServerAPI.GetAPI<WebUserInfo>(url, accessToken);
if (result.Item2)
{
var webUserInfo = result.Item1;
if (webUserInfo.id != null)
{
pModel = new PlayerSessionModel
{
statePlayer = TypeStatePlayer.Idle,
id = webUserInfo.id,
name = webUserInfo.username,
point = webUserInfo.balance,
webUserInfo = new WebUserInfo
{
_id = webUserInfo._id ?? "null",
phone = webUserInfo.phone ?? "null",
name = webUserInfo.name ?? "null",
email = webUserInfo.email ?? "null",
username = webUserInfo.username ?? "null",
telegram_id = webUserInfo.telegram_id ?? "null",
avatar = new Avatar
{
_id = webUserInfo.avatar._id ?? "null",
name = webUserInfo.avatar.name ?? "null",
key = webUserInfo.avatar.key ?? "null",
full_url = webUserInfo.avatar.full_url ?? "null",
id = webUserInfo.avatar.id ?? "null",
},
banner = webUserInfo.banner ?? "null",
is_active = webUserInfo.is_active,
invite_code = webUserInfo.invite_code ?? "null",
balance = webUserInfo.balance,
titles = webUserInfo.titles ?? "null",
wallets = webUserInfo.wallets ?? "null",
is_online = webUserInfo.is_online,
is_email_verified = webUserInfo.is_email_verified,
is_phone_verified = webUserInfo.is_phone_verified,
is_telegram_verified = webUserInfo.is_telegram_verified,
is_wallet_connect = webUserInfo.is_wallet_connect,
tickets = webUserInfo.tickets,
usdt_balance = webUserInfo.usdt_balance,
last_online_at = webUserInfo.last_online_at,
about = webUserInfo.about ?? "null",
is_use_password = webUserInfo.is_use_password,
id = webUserInfo.id ?? "null",
telegram_ref = webUserInfo.telegram_ref ?? "null"
}
};
}
}
return pModel;
}
To avoid error On Byter, my funny way, huhu i crying
Do you fixed?
More issue: If list of struct is length = 0 (not null), will error when deserialize
true, Primitive don't allow write null information
To avoid error On Byter, my funny way, huhu i crying
Do you fixed?
no, it's just set for default custom for null but still error
Ok, Tell me what result do you expect
what is TypeStatePlayer object, can send me?
Ok, Tell me what result do you expect
Can byter send null value?
what is TypeStatePlayer object, can send me?
It's Enum
public enum TypeStatePlayer
{
None,
Idle,
Ready,
Play,
}
https://github.com/alec1o/Byter/issues/28#issuecomment-2210260632 WebUserInfo->wallet, WebUserInfo->banner, is a object! I told you before Primitive not support object will make error đ¤Ŗ
Can byter send null value?
Do you mean I implement a way to serialize and deserialize null objects??? đ¤¯đ¨
Can byter send null value?
Do you mean I implement a way to serialize and deserialize null objects??? đ¤¯đ¨
yep, because my struct request from api web so it have somany null field, and sometime i create struct and just use only a few internal variables to achieve the goal
yep, because my struct request from api web so it have somany null field, and sometime i create struct and just use only a few internal variables to achieve the goal
yep, because my struct request from api web so it have somany null field, and sometime i create struct and just use only a few internal variables to achieve the goal
đ đ đ đ đ đ đ đ đ đ đ đ đ
If it's difficult then skip it, but lists and arrays should be able to fix it
I'll implement it, To allow any null data. But have a big problem about the way.
Have a idea smart boys? (Nguyen Van Hao: @nvh2001 @vanhaodev), (Alecio Furanze: @alec1o)
I'll implement it, To allow any null data. But have a big problem about the way.
How Skip null value in Primitive.Add?
- Use null suffix/prefix, (Bug when object value contain same value then prefix/suffix). â (Conflict)
- Update overhead of Primitive from 1 byte to bytes. â (Force incress data)
- â
Have a idea smart boys? (Nguyen Van Hao: @nvh2001 @vanhaodev), (Alecio Furanze: @alec1o)
Do you have a ideia about?
Bro can you test if null object is skipped by primitive. (Use current updated sources) from main branch
It's working?
It's working?
sorry i have some problem in my life, in today, i'll check this
I'm waiting for you feedback
Hi @nvh2001 @vanhaodev
Can you give me a review? âšī¸đ
đ bro!!! Talk something, are you okay? @nvh2001 @vanhaodev
â Hello! @nvh2001 @vanhaodev
â Hello! @nvh2001 @vanhaodev
sorry, I have some issue in my life. Now im here to continue my project.
Good! I was worried about you a lot. Welcome.
Hey @nvh2001 @vanhaodev Did you test it? I'm waiting for you feedback update it to v4
Test: Unity .NET Standartd 2.1 & .NET 8 Console
The structs
SEND
RECEIVE
My deadline is killing me haha