예제 #1
0
        public void Send(ExtendedPlayerAgent player)
        {
            if (NET.IsMaster)
            {
                if (player == null || player.WrappedObj == null)
                {
                    Debug.LogError("Tried to send progression data to a null player.");
                    return;
                }

                pProgressionData data = Replicator.Owner.ProgressionData.ToPacket();
                data.to.Set(player.WrappedObj);

                byte[] bytes = NET.GetBytesFromPacket(data, Replicator.Key, ID);
                NET.Send(bytes, SNetwork.SNet_ChannelType.GameReceiveCritical, player.Owner);
            }
            else
            {
                Debug.LogError("Attempting to send progression data when not the master.");
            }
        }