quakeball/Assets/Scripts/Net/TestProtocol.cs
2020-08-05 04:21:04 +03:00

28 lines
928 B
C#

using System.Collections.Generic;
using System;
using UnityEngine;
using NeonTea.Quakeball.Net.Peers;
using NeonTea.Quakeball.Net;
using NeonTea.Quakeball.Net.Packets;
namespace NeonTea.Quakeball.Net {
public class TestProtocol : Protocol {
public override byte Identifier => 0x7A;
public override string Version => "0.0.1";
public override void ConnectionStatusChanged(ConnectionStatus oldStatus, ConnectionStatus newStatus, Connection conn) {
Peer.MessageListener.Message($"Connection Status Changed into {newStatus.ToString()} for {conn.Endpoint}");
}
public override void Receive(Connection conn, Packet packet) {
Peer.MessageListener.Message($"Received packet from {conn.Endpoint}");
}
public override void Timeout(Connection conn) {
Peer.MessageListener.Message($"Closed {conn.Endpoint} for Timeout");
}
}
}