From 0a3ba11688259ff8e9d6312c79c13cdf685c50c0 Mon Sep 17 00:00:00 2001 From: teascade Date: Sat, 8 Aug 2020 10:08:10 +0300 Subject: [PATCH] Make Hit send source, and add splashes --- .gitignore | 1 + Assets/Graphics/Splashes/NeonTea.png | Bin 0 -> 26050 bytes Assets/Graphics/Splashes/NeonTea.png.meta | 118 ++++++++++++++++++ Assets/Scripts/Networking/Instances/Client.cs | 15 +-- .../Networking/Instances/NetInstance.cs | 2 + Assets/Scripts/Networking/Instances/Server.cs | 10 +- Assets/Scripts/Networking/Packets/HitPckt.cs | 8 +- Assets/Scripts/Players/LocalPlayer.cs | 5 - Assets/Scripts/Players/Player.cs | 10 +- 9 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 Assets/Graphics/Splashes/NeonTea.png create mode 100644 Assets/Graphics/Splashes/NeonTea.png.meta diff --git a/.gitignore b/.gitignore index 29f9459..2cfce91 100644 --- a/.gitignore +++ b/.gitignore @@ -102,4 +102,5 @@ InitTestScene*.unity LightingData.asset* # Sprites +!/[Aa]ssets/[Gg]raphics/[Ss]plashes/**/* !/[Aa]ssets/[Gg]raphics/[Ss]prites/**/* diff --git a/Assets/Graphics/Splashes/NeonTea.png b/Assets/Graphics/Splashes/NeonTea.png new file mode 100644 index 0000000000000000000000000000000000000000..4651f54fc2413bd3b45c8d59f19439a828ea8b82 GIT binary patch literal 26050 zcmZsCWl$VV*EWm0LvZ)t!QENh-8HZTcMTfcCAco`?oM!b7IzO2G)Q>4pYQKiQ(Lpu z-8JX*bT5JT+#AUG6c5F_t(FE7$V)hqTh!f zwVvKyrt_{QMm_gC{R32|k9}v^jmI!d zVh-5C*#6#0)~jO}(2;ZXy}l=UWlfa+<#4;afk4nzD4LZF<>;><1~x4HBpNY zohJF-Qud2Oy7%4z2c~`x$3s&erUsm$Iq>GvT$Fv$H}pY z9?hWov#&oO=(zHiPj7!x@Oq4ZPj`nm;PEiPfB*Z-eJ9N3PXx-R2cyzrs9v~ZPF()C zsZvB>+c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FU>3YO(2;-W=Y@MCsfqIr* z<^Usd-XUqi@))gDY2Vau2MGBvW05$~hxJW_gsbfI_sTKTQ9E@}EX;w`n{B$gvNA#H zmD1*b1TgM(9mmd+;=+R;u_*Jq*sOS9vcf}K8y@a;nO_7Pov1-7WRM@sfJeTLnpwWPSvEJ9dgv*EA`ITSuNr29e z7^|lfH9O?MBWhh$I-VXT`#A|x_H!ZwUy#%@h;;`GPRn*SfL0sXapK+w$}H+HL{32^ zu7)$eECKu_qHR%$n_tu$OUx5bgO*jLeG5|cW>oCB zyoEB1n+MhV?Y8sO8)$d_$#7xzywpP38Su_6Z(-5J_b-j_ceyI$-3eb*TaD(pxB@eE z{A)>!{)|cKF{OPCnwIUDCL5Up>RaI9bQT_PbaAgMEy^U61Ss2n`8M_77)^qFKkzcL z7sv|H@evTIDM3kilYd6acr%JomVa5dA)%=^ Players = new Dictionary(); - private NetPlayer LocalPlayer; private bool SelfIdentified = false; public float Ping { get; private set; } private float LastPingReceived; private byte LastPingIdent; + public Client() { + Net = GameObject.FindGameObjectWithTag("Net").GetComponent(); + + LocalPlayer = new NetPlayer(ulong.MaxValue - 1); + LocalPlayer.Controlled = GameObject.FindGameObjectWithTag("Player").GetComponent(); + } + public override void Start(string address, int port, PeerMessageListener listener) { if (Peer.Running) { return; @@ -31,11 +37,6 @@ namespace NeonTea.Quakeball.Networking.Instances { Peer.Start(0); byte ident = Peer.RegisterProtocol(new GameProtocol(this)); Peer.Connect(address, port, ident); - - Net = GameObject.FindGameObjectWithTag("Net").GetComponent(); - - LocalPlayer = new NetPlayer(ulong.MaxValue - 1); - LocalPlayer.Controlled = GameObject.FindGameObjectWithTag("Player").GetComponent(); } public override void OnStop() { @@ -130,7 +131,7 @@ namespace NeonTea.Quakeball.Networking.Instances { } else if (packet is HitPckt) { HitPckt hit = (HitPckt)packet; if (Players[hit.Target].Controlled != null) { - Players[hit.Target].Controlled.Hit(); + Players[hit.Target].Controlled.Hit(hit.Source); } } } diff --git a/Assets/Scripts/Networking/Instances/NetInstance.cs b/Assets/Scripts/Networking/Instances/NetInstance.cs index 790bea0..01ec7e7 100644 --- a/Assets/Scripts/Networking/Instances/NetInstance.cs +++ b/Assets/Scripts/Networking/Instances/NetInstance.cs @@ -13,6 +13,8 @@ namespace NeonTea.Quakeball.Networking.Instances { public Peer Peer; public List Connections = new List(); + public NetPlayer LocalPlayer; + public NetInstance() { Peer = new Peer(Fingerprint); } diff --git a/Assets/Scripts/Networking/Instances/Server.cs b/Assets/Scripts/Networking/Instances/Server.cs index 8c183a3..fa9742f 100644 --- a/Assets/Scripts/Networking/Instances/Server.cs +++ b/Assets/Scripts/Networking/Instances/Server.cs @@ -16,12 +16,14 @@ namespace NeonTea.Quakeball.Networking.Instances { public List PlayerList { get; private set; } = new List(); private ulong PlayerIdCounter; - private NetPlayer LocalPlayer = new NetPlayer(ulong.MaxValue); - private byte LastPingIdent; private float LastSentPing; public static float PingInterval = 1; + public Server() { + LocalPlayer = new NetPlayer(ulong.MaxValue); + } + public override void Start(string address, int port, PeerMessageListener listener) { if (Peer.Running) { return; @@ -201,8 +203,8 @@ namespace NeonTea.Quakeball.Networking.Instances { SendUnreliableToAll(pckt); } - public void SendHit(ulong id) { - HitPckt hit = new HitPckt(id); + public void SendHit(ulong source, ulong target) { + HitPckt hit = new HitPckt(source, target); SendReliableToAll(hit); } diff --git a/Assets/Scripts/Networking/Packets/HitPckt.cs b/Assets/Scripts/Networking/Packets/HitPckt.cs index 997587a..617cd02 100644 --- a/Assets/Scripts/Networking/Packets/HitPckt.cs +++ b/Assets/Scripts/Networking/Packets/HitPckt.cs @@ -4,16 +4,22 @@ using NeonTea.Quakeball.TeaNet.Packets; namespace NeonTea.Quakeball.Networking.Packets { public class HitPckt : Packet { + public ulong Source; public ulong Target; public HitPckt() { } - public HitPckt(ulong id) { Target = id; } + public HitPckt(ulong source, ulong target) { + Source = source; + Target = target; + } public override void Read(ByteBuffer buffer) { + Source = buffer.ReadULong(); Target = buffer.ReadULong(); } public override void Write(ByteBuffer buffer) { + buffer.Write(Source); buffer.Write(Target); } } diff --git a/Assets/Scripts/Players/LocalPlayer.cs b/Assets/Scripts/Players/LocalPlayer.cs index 2cf1ee9..0546947 100644 --- a/Assets/Scripts/Players/LocalPlayer.cs +++ b/Assets/Scripts/Players/LocalPlayer.cs @@ -60,11 +60,6 @@ namespace NeonTea.Quakeball.Players { transform.position = new Vector3(float.Parse(args[0]), float.Parse(args[1]), float.Parse(args[2])); return true; }, "tp x y z - Teleports the local player to the specified coordinates."); - - Terminal.Singleton.RegisterCommand("hit", args => { - Player.Hit(); - return true; - }); } private void Update() { diff --git a/Assets/Scripts/Players/Player.cs b/Assets/Scripts/Players/Player.cs index 12c4bc3..6e2b4b1 100644 --- a/Assets/Scripts/Players/Player.cs +++ b/Assets/Scripts/Players/Player.cs @@ -179,8 +179,8 @@ namespace NeonTea.Quakeball.Players { } if (Player != null) { if (Net.Singleton.Instance is Server) { - ((Server)Net.Singleton.Instance).SendHit(Player.NetId); - Player.Hit(); + ((Server)Net.Singleton.Instance).SendHit(NetId, Player.NetId); + Player.Hit(NetId); } } break; @@ -194,10 +194,14 @@ namespace NeonTea.Quakeball.Players { AudioSource.PlayOneShot(RaygunAudio); } - public void Hit() { + public void Hit(ulong sourceUid) { if (Net.Singleton.Instance is Server) { ((Server)Net.Singleton.Instance).HandlePlayerDeath(NetId); } + bool IsLocal = true; + if (Net.Singleton.Instance != null) { + IsLocal = Net.Singleton.Instance.LocalPlayer.Id == sourceUid; + } Debug.Log("I was hit! Aaagh!"); Splatter.Play(); }