24 lines
561 B
C#
24 lines
561 B
C#
|
using Godot;
|
|||
|
|
|||
|
public class Client : Peer {
|
|||
|
|
|||
|
private PacketPeerUDP PacketPeer;
|
|||
|
|
|||
|
private Connection ServerConn;
|
|||
|
|
|||
|
private byte[] TempBuffer = {1};
|
|||
|
|
|||
|
public Client(PacketPeerUDP packetPeer) : base(packetPeer) {
|
|||
|
PacketPeer = packetPeer;
|
|||
|
}
|
|||
|
|
|||
|
public override void Initialize(string address, int port) {
|
|||
|
GD.print("Start client.");
|
|||
|
ServerConn = new Connection(address, port);
|
|||
|
}
|
|||
|
|
|||
|
public override void Update(float delta) {
|
|||
|
GD.print("Update client.");
|
|||
|
SendBuffer(TempBuffer, ServerConn);
|
|||
|
}
|
|||
|
}
|