mirror of
https://github.com/AlexMacocian/MTSC.git
synced 2026-07-16 23:39:32 +00:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using MTSC.Client;
|
|
using MTSC.Client.Handlers;
|
|
using MTSC.ClientSide;
|
|
using MTSC.Common.WebSockets.ClientModules;
|
|
using MTSC.Logging;
|
|
using System;
|
|
|
|
namespace MTSC_TestClient
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Client client = new Client();
|
|
WebsocketHandler websocketHandler = new WebsocketHandler();
|
|
ChatModule chatModule = new ChatModule();
|
|
client
|
|
.SetServerAddress("127.0.0.1")
|
|
.SetPort(800)
|
|
.WithReconnectPolicy(ReconnectPolicy.Forever)
|
|
.AddHandler(websocketHandler.AddModule(chatModule))
|
|
//.AddHandler(new EncryptionHandler())
|
|
//.AddHandler(new BroadcastHandler())
|
|
.AddLogger(new ConsoleLogger())
|
|
.AddLogger(new DebugConsoleLogger())
|
|
.Connect();
|
|
while (true)
|
|
{
|
|
string message = Console.ReadLine();
|
|
chatModule.SendMessage(websocketHandler, message);
|
|
}
|
|
}
|
|
}
|
|
}
|