summaryrefslogtreecommitdiff
path: root/NetClient.cs
diff options
context:
space:
mode:
authorSarah B <git@sarahduck.ca>2023-12-24 21:45:26 -0800
committerSarah B <git@sarahduck.ca>2023-12-24 21:45:26 -0800
commita4874e186e24ce1736bfbda1deb0227597d2d690 (patch)
tree9bf11b6521237547c860cbc775110a49ef938b30 /NetClient.cs
parent0206e04e0a3542b8f0fc97996f1d885f7604a6fa (diff)
Added seperate nekoname
Diffstat (limited to 'NetClient.cs')
-rw-r--r--NetClient.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/NetClient.cs b/NetClient.cs
index da287df..492c459 100644
--- a/NetClient.cs
+++ b/NetClient.cs
@@ -6,7 +6,7 @@ namespace OnekoOnline.Net;
class Client
{
- public static readonly string UserName = OnekoOnline.Config.GetValue("UserName", "Oneko");
+ public static readonly string UserName = OnekoOnline.Config.GetValue("UserName", "User");
public int Id {get; private set;} = -1;
public bool Connected => NetClient?.ConnectedPeersCount > 0 && Id != -1;
@@ -38,6 +38,7 @@ class Client
writer.Put(new PacketInfo(PacketType.UserInfo, Id));
writer.Put(UserName);
+ writer.Put(OnekoLocal.Instance!.Name);
writer.PutBytesWithLength(OnekoLocal.Instance!.SpriteSheet.Serialize());
peer.Send(writer, DeliveryMethod.ReliableUnordered);
};
@@ -73,6 +74,7 @@ class Client
else if (info.Type == PacketType.UserInfo) {
from.Username = reader.GetString();
+ from.Nekoname = reader.GetString();
from.SpriteSheet = reader.GetBytesWithLength();
Console.WriteLine($"User {from.Username} joined!");
from.Initialized = true;