summaryrefslogtreecommitdiff
path: root/NetClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'NetClient.cs')
-rw-r--r--NetClient.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/NetClient.cs b/NetClient.cs
index 5146a0a..ce70d91 100644
--- a/NetClient.cs
+++ b/NetClient.cs
@@ -24,7 +24,9 @@ class Client
public Client(string ServerAddress, int port, string ServerPassword)
{
- if (ServerAddress == "") throw new Exception("Server Address invalid!");
+ if (string.IsNullOrEmpty(ServerAddress)) throw new Exception("Server Address invalid!");
+ if (string.IsNullOrEmpty(UserName)) throw new Exception("Invalid Username!!");
+ if (UserName.Length > 40) throw new Exception("Username too long!");
Listener = new();
NetClient = new(Listener);
@@ -100,8 +102,7 @@ class Client
if (reader.AvailableBytes > 500) return;
- NetDataReader newReader = new(reader.GetRemainingBytes());
- PacketRecived?.Invoke(newReader, from, info.Type);
+ PacketRecived?.Invoke(reader, from, info.Type);
};
}