Rename Net namespace to Networking and add MultiplePlayerUpdatePckt
This commit is contained in:
parent
b34edcab2d
commit
d9ac54bd3d
@ -2,10 +2,10 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using System;
|
||||
|
||||
namespace NeonTea.Quakeball.Net {
|
||||
namespace NeonTea.Quakeball.Networking {
|
||||
public class CanvasInput : MonoBehaviour, PeerMessageListener {
|
||||
public Button Host;
|
||||
public Button Join;
|
@ -3,10 +3,10 @@ using System;
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Net.Instances;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using NeonTea.Quakeball.Networking.Instances;
|
||||
|
||||
namespace NeonTea.Quakeball.Net {
|
||||
namespace NeonTea.Quakeball.Networking {
|
||||
|
||||
public class GameProtocol : Protocol {
|
||||
public override byte Identifier => 0x7A;
|
@ -2,12 +2,12 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Player;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using NeonTea.Quakeball.Interface;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Instances {
|
||||
namespace NeonTea.Quakeball.Networking.Instances {
|
||||
public class Client : NetInstance {
|
||||
|
||||
private NetChaperone Net;
|
@ -1,11 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Instances {
|
||||
namespace NeonTea.Quakeball.Networking.Instances {
|
||||
public abstract class NetInstance {
|
||||
|
||||
protected static byte[] Fingerprint = new byte[] { 0xFF, 0xF7 };
|
@ -1,13 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using NeonTea.Quakeball.Player;
|
||||
using NeonTea.Quakeball.Interface;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Instances {
|
||||
namespace NeonTea.Quakeball.Networking.Instances {
|
||||
public class Server : NetInstance {
|
||||
|
||||
private NetChaperone Net;
|
@ -1,9 +1,9 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Net.Instances;
|
||||
using NeonTea.Quakeball.Networking.Instances;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NeonTea.Quakeball.Net {
|
||||
namespace NeonTea.Quakeball.Networking {
|
||||
|
||||
public class Net {
|
||||
public static Net Singleton = new Net();
|
@ -2,10 +2,10 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Interface;
|
||||
using NeonTea.Quakeball.Net;
|
||||
using NeonTea.Quakeball.Networking;
|
||||
using NeonTea.Quakeball.TeaNet.Peers;
|
||||
|
||||
namespace NeonTea.Quakeball.Net {
|
||||
namespace NeonTea.Quakeball.Networking {
|
||||
public class NetChaperone : MonoBehaviour, PeerMessageListener {
|
||||
|
||||
public GameObject SpawnedRemotePlayer;
|
@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Player;
|
||||
|
||||
namespace NeonTea.Quakeball.Net {
|
||||
namespace NeonTea.Quakeball.Networking {
|
||||
public class NetPlayer {
|
||||
public ulong Id;
|
||||
public GameObject Controlled;
|
@ -1,7 +1,7 @@
|
||||
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Packets {
|
||||
namespace NeonTea.Quakeball.Networking.Packets {
|
||||
public class HelloPckt : Packet {
|
||||
|
||||
public string Text;
|
@ -1,7 +1,26 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Packets {
|
||||
using System.Collections.Generic;
|
||||
using NeonTea.Quakeball.Networking;
|
||||
|
||||
namespace NeonTea.Quakeball.Networking.Packets {
|
||||
public class MultiplePlayerUpdatesPckt : Packet {
|
||||
|
||||
public List<PlayerUpdatePckt> Updates = new List<PlayerUpdatePckt>();
|
||||
|
||||
public MultiplePlayerUpdatesPckt() { }
|
||||
|
||||
public MultiplePlayerUpdatesPckt(List<NetPlayer> players) {
|
||||
}
|
||||
|
||||
public override void Read(ByteBuffer buffer) {
|
||||
}
|
||||
|
||||
public override void Write(ByteBuffer buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerUpdatePckt : Packet {
|
||||
|
||||
public ulong PlayerId;
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.TeaNet.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Net.Packets {
|
||||
namespace NeonTea.Quakeball.Networking.Packets {
|
||||
public class SpawnPckt : Packet {
|
||||
|
||||
public ulong PlayerId;
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using NeonTea.Quakeball.Net;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Player {
|
||||
/// <summary>A controller class for a local player. Handles input and updates the relevant components.</summary>
|
||||
@ -82,8 +82,8 @@ namespace NeonTea.Quakeball.Player {
|
||||
PreviousPlayerUpdate = Time.time;
|
||||
WantsToJump = false;
|
||||
|
||||
if (Net.Net.Singleton.Instance != null) {
|
||||
Net.Net.Singleton.Instance.UpdateLocalPlayer(Player.CreatePacket());
|
||||
if (Networking.Net.Singleton.Instance != null) {
|
||||
Networking.Net.Singleton.Instance.UpdateLocalPlayer(Player.CreatePacket());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
|
||||
namespace NeonTea.Quakeball.Player {
|
||||
/// <summary>The central glue class for players (both local and remote).</summary>
|
||||
|
@ -1,5 +1,5 @@
|
||||
using UnityEngine;
|
||||
using NeonTea.Quakeball.Net.Packets;
|
||||
using NeonTea.Quakeball.Networking.Packets;
|
||||
using NeonTea.Quakeball.Interface;
|
||||
|
||||
namespace NeonTea.Quakeball.Player {
|
||||
|
Loading…
Reference in New Issue
Block a user