GodotTicTacToe/scripts/Peer.cs
2017-11-21 19:33:48 +02:00

22 lines
559 B
C#

using Godot;
public abstract class Peer : Object {
private PacketPeerUDP PacketPeer;
private int LastConnectionSended = -1;
public Peer(PacketPeerUDP packetPeer) {
PacketPeer = packetPeer;
}
public abstract void Initialize(string address, int port);
public abstract void Update(float delta);
public void SendBuffer(byte[] buffer, Connection to) {
GD.print("Putting stuff to " + to.Address + ":" + to.Port);
PacketPeer.SetDestAddress(to.Address, to.Port);
PacketPeer.PutPacket(buffer);
}
}