Implement LobbyServer
This commit is contained in:
31
LobbyServer/Message.cs
Normal file
31
LobbyServer/Message.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
namespace LobbyServer
|
||||
{
|
||||
class Message
|
||||
{
|
||||
public string SendDate { get; }
|
||||
public string Sender { get; }
|
||||
public string Content { get; }
|
||||
|
||||
public Message(string sendDate, string sender, string content)
|
||||
{
|
||||
SendDate = sendDate;
|
||||
Sender = sender;
|
||||
Content = content;
|
||||
}
|
||||
|
||||
public Message(string serialized)
|
||||
{
|
||||
var split = serialized.Split(';');
|
||||
SendDate = split[0];
|
||||
Sender = split[1];
|
||||
Content = string.Join(';', split.Skip(2));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{SendDate};{Sender};{Content}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user