646 lines
22 KiB
C#
646 lines
22 KiB
C#
using System;
|
|
using System.Linq;
|
|
using FishNet.Connection;
|
|
using FishNet.Managing;
|
|
using FishNet.Object;
|
|
using FishNet.Object.Synchronizing;
|
|
using FishNet.Serializing;
|
|
using FishNet.Serializing.Generated;
|
|
using FishNet.Transporting;
|
|
using Obvious.Soap;
|
|
using Sirenix.Utilities;
|
|
using UFS3;
|
|
using UnityEngine;
|
|
|
|
public class MultiplayerFishingSetControler : NetworkBehaviour
|
|
{
|
|
private GameObject networkObjectParent;
|
|
|
|
[SerializeField]
|
|
private ItemDatabase itemDatabase;
|
|
|
|
[SerializeField]
|
|
private LineRenderer lineRenderer;
|
|
|
|
[SerializeField]
|
|
private float lineThickness = 0.0007f;
|
|
|
|
[SerializeField]
|
|
[Range(0.5f, 30f)]
|
|
[Tooltip("Low value => more smoothing, High value => less delay")]
|
|
private float posRotLerpSpeed = 5f;
|
|
|
|
[SerializeField]
|
|
private ScriptableListGameObject distanceSourceObjects;
|
|
|
|
private FishingSetController fishingSetController;
|
|
|
|
private MultiplayerAvatarControler multiplayerAvatarControler;
|
|
|
|
private float lineLengthPrevious;
|
|
|
|
private Rod spawnedRod;
|
|
|
|
private Reel spawnedReel;
|
|
|
|
private GameObject spawnedBobber;
|
|
|
|
private Hook spawnedHook;
|
|
|
|
private GameObject spawnedLure;
|
|
|
|
private GameObject spawnedBait;
|
|
|
|
private RodIK rodIK;
|
|
|
|
public readonly SyncVar<FishingMethodType> fishingMethodType = new SyncVar<FishingMethodType>();
|
|
|
|
public readonly SyncVar<int> rodID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> reelID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> lineID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> bobberID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> hookID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> lureID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<int> baitID = new SyncVar<int>(-1);
|
|
|
|
public readonly SyncVar<Vector3> bobberPosition = new SyncVar<Vector3>();
|
|
|
|
public readonly SyncVar<Quaternion> bobberRotation = new SyncVar<Quaternion>();
|
|
|
|
public readonly SyncVar<Vector3> baitPosition = new SyncVar<Vector3>();
|
|
|
|
public readonly SyncVar<Quaternion> baitRotation = new SyncVar<Quaternion>();
|
|
|
|
public readonly SyncVar<float> ikWeight = new SyncVar<float>();
|
|
|
|
public readonly SyncVar<float> reelSpeed = new SyncVar<float>();
|
|
|
|
private bool NetworkInitialize___EarlyMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted;
|
|
|
|
private bool NetworkInitialize___LateMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted;
|
|
|
|
public Transform NetworkObjectParent
|
|
{
|
|
get
|
|
{
|
|
if (networkObjectParent == null)
|
|
{
|
|
networkObjectParent = GameObject.Find("NetworkObjectParent");
|
|
if ((object)networkObjectParent == null)
|
|
{
|
|
networkObjectParent = new GameObject("NetworkObjectParent");
|
|
}
|
|
}
|
|
return networkObjectParent.transform;
|
|
}
|
|
}
|
|
|
|
public Reel SpawnedReel => spawnedReel;
|
|
|
|
public static event Action<MultiplayerFishingSetControler> OnStartLocal;
|
|
|
|
public override void OnStartClient()
|
|
{
|
|
if (base.IsOwner)
|
|
{
|
|
base.OnStartClient();
|
|
MultiplayerFishingSetControler.OnStartLocal?.Invoke(this);
|
|
}
|
|
}
|
|
|
|
public override void OnStopClient()
|
|
{
|
|
base.OnStopClient();
|
|
CleanupRemoteEquipment();
|
|
}
|
|
|
|
public void Init(FishingSetController fishingSetController)
|
|
{
|
|
if (base.IsOwner)
|
|
{
|
|
this.fishingSetController = fishingSetController;
|
|
}
|
|
}
|
|
|
|
public void Deinit()
|
|
{
|
|
if (base.IsOwner)
|
|
{
|
|
DespawnRPC();
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (base.IsOwner)
|
|
{
|
|
UpdateLocal();
|
|
}
|
|
else
|
|
{
|
|
UpdateRemote();
|
|
}
|
|
}
|
|
|
|
private void UpdateLocal()
|
|
{
|
|
if (fishingSetController == null)
|
|
{
|
|
return;
|
|
}
|
|
FishingSetData fishingSetData = fishingSetController.FishingSetData;
|
|
if (!(fishingSetData == null))
|
|
{
|
|
UpdateEquipmentSyncVars(fishingSetData.SetType, (fishingSetData.Rod != null) ? fishingSetData.Rod.ID : (-1), (fishingSetData.Reel != null) ? fishingSetData.Reel.ID : (-1), (fishingSetData.Line != null) ? fishingSetData.Line.ID : (-1), (fishingSetData.Bobber != null) ? fishingSetData.Bobber.ID : (-1), (fishingSetData.Hook != null) ? fishingSetData.Hook.ID : (-1), (fishingSetData.Lure != null) ? fishingSetData.Lure.ID : (-1), (fishingSetData.Bait != null) ? fishingSetData.Bait.ID : (-1));
|
|
if (fishingSetData.SetType == FishingMethodType.Spinning)
|
|
{
|
|
UpdateBobberAndBaitSyncVars(Vector3.zero, Quaternion.identity, fishingSetController.AttachedLure.transform.position, fishingSetController.AttachedLure.transform.rotation);
|
|
}
|
|
else if (fishingSetData.SetType == FishingMethodType.Float)
|
|
{
|
|
UpdateBobberAndBaitSyncVars(fishingSetController.attachedBobber.transform.position, fishingSetController.attachedBobber.transform.rotation, fishingSetController.AttachedHook.transform.position, fishingSetController.AttachedHook.transform.rotation);
|
|
}
|
|
float val = fishingSetController.AttachedLine.LineLength - lineLengthPrevious;
|
|
lineLengthPrevious = fishingSetController.AttachedLine.LineLength;
|
|
val = Math.Min(val, 0f);
|
|
UpdateRodAndReelSyncVars(fishingSetController.Tension / fishingSetController.AttachedRod.RodPower, val);
|
|
}
|
|
}
|
|
|
|
private void UpdateRemote()
|
|
{
|
|
UpdateRemoteRodPosition();
|
|
UpdateRemoteEquipment();
|
|
UpdateRemoteBaitPosition();
|
|
UpdateRemoteRodBending();
|
|
UpdateRemoteReelSpeed();
|
|
UpdateRemoteFishingLine();
|
|
}
|
|
|
|
private void UpdateRemoteRodPosition()
|
|
{
|
|
if ((object)multiplayerAvatarControler == null)
|
|
{
|
|
multiplayerAvatarControler = base.Owner.Objects.FirstOrDefault((NetworkObject element) => element.GetComponent<MultiplayerAvatarControler>() != null)?.GetComponent<MultiplayerAvatarControler>();
|
|
}
|
|
if (!(multiplayerAvatarControler == null))
|
|
{
|
|
base.transform.SetPositionAndRotation(multiplayerAvatarControler.RodParent.transform.position, multiplayerAvatarControler.RodParent.transform.rotation);
|
|
}
|
|
}
|
|
|
|
private void UpdateRemoteBaitPosition()
|
|
{
|
|
if (fishingMethodType.Value == FishingMethodType.Spinning)
|
|
{
|
|
spawnedLure?.transform.SetLocalPositionAndRotation(Vector3.Lerp(spawnedLure.transform.position, baitPosition.Value, Time.deltaTime * posRotLerpSpeed), Quaternion.Lerp(spawnedLure.transform.rotation, baitRotation.Value, Time.deltaTime * posRotLerpSpeed));
|
|
}
|
|
else if (fishingMethodType.Value == FishingMethodType.Float)
|
|
{
|
|
spawnedBobber?.transform.SetPositionAndRotation(Vector3.Lerp(spawnedBobber.transform.position, bobberPosition.Value, Time.deltaTime * posRotLerpSpeed), Quaternion.Lerp(spawnedBobber.transform.rotation, bobberRotation.Value, Time.deltaTime * posRotLerpSpeed));
|
|
spawnedHook?.transform.SetPositionAndRotation(Vector3.Lerp(spawnedHook.transform.position, baitPosition.Value, Time.deltaTime * posRotLerpSpeed), Quaternion.Lerp(spawnedHook.transform.rotation, baitRotation.Value, Time.deltaTime * posRotLerpSpeed));
|
|
}
|
|
}
|
|
|
|
private void UpdateRemoteEquipment()
|
|
{
|
|
if (!(spawnedRod == null))
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
if (rodID.Value != -1 && reelID.Value != -1 && lineID.Value != -1)
|
|
{
|
|
if (fishingMethodType.Value == FishingMethodType.Spinning)
|
|
{
|
|
if (lureID.Value != -1)
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
else if (fishingMethodType.Value == FishingMethodType.Float && bobberID.Value != -1 && hookID.Value != -1 && baitID.Value != -1)
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
if (!flag)
|
|
{
|
|
return;
|
|
}
|
|
RodData rodData = itemDatabase.GetItemById(rodID.Value) as RodData;
|
|
ReelData reelData = itemDatabase.GetItemById(reelID.Value) as ReelData;
|
|
if (rodData != null && reelData != null)
|
|
{
|
|
spawnedRod = UnityEngine.Object.Instantiate(rodData.GetPrefab, base.transform).GetComponent<Rod>();
|
|
spawnedRod.Initialize(rodData);
|
|
rodIK = spawnedRod.GetComponent<RodIK>();
|
|
spawnedReel = UnityEngine.Object.Instantiate(reelData.GetPrefab, base.transform).GetComponent<Reel>();
|
|
spawnedReel.Initialize(reelData);
|
|
spawnedRod.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
|
|
spawnedRod.AttachReel(spawnedReel.transform);
|
|
if (fishingMethodType.Value == FishingMethodType.Spinning)
|
|
{
|
|
LureData lureData = itemDatabase.GetItemById(lureID.Value) as LureData;
|
|
spawnedLure = UnityEngine.Object.Instantiate(lureData.GetPrefab, NetworkObjectParent);
|
|
spawnedLure.transform.SetPositionAndRotation(baitPosition.Value, baitRotation.Value);
|
|
RemoveNonMultiplayerComponents(new GameObject[1] { spawnedLure });
|
|
}
|
|
else if (fishingMethodType.Value == FishingMethodType.Float)
|
|
{
|
|
BobberData bobberData = itemDatabase.GetItemById(bobberID.Value) as BobberData;
|
|
HookData hookData = itemDatabase.GetItemById(hookID.Value) as HookData;
|
|
BaitData baitData = itemDatabase.GetItemById(baitID.Value) as BaitData;
|
|
spawnedBobber = UnityEngine.Object.Instantiate(bobberData.GetPrefab, NetworkObjectParent);
|
|
spawnedBobber.transform.SetPositionAndRotation(bobberPosition.Value, bobberRotation.Value);
|
|
spawnedHook = UnityEngine.Object.Instantiate(hookData.GetPrefab, NetworkObjectParent).GetComponent<Hook>();
|
|
spawnedHook.transform.SetPositionAndRotation(baitPosition.Value, baitRotation.Value);
|
|
spawnedBait = UnityEngine.Object.Instantiate(baitData.GetPrefab, NetworkObjectParent);
|
|
spawnedBait.transform.SetParent(spawnedHook.baitPlace);
|
|
spawnedBait.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
|
|
RemoveNonMultiplayerComponents(new GameObject[3] { spawnedBobber, spawnedHook.gameObject, spawnedBait });
|
|
}
|
|
}
|
|
if (spawnedLure != null)
|
|
{
|
|
distanceSourceObjects.Add(spawnedLure);
|
|
}
|
|
if (spawnedHook != null)
|
|
{
|
|
distanceSourceObjects.Add(spawnedHook.gameObject);
|
|
}
|
|
static void RemoveNonMultiplayerComponents(GameObject[] gameObjects)
|
|
{
|
|
if (gameObjects != null && gameObjects.Length != 0)
|
|
{
|
|
foreach (GameObject gameObject in gameObjects)
|
|
{
|
|
if (!(gameObject == null))
|
|
{
|
|
gameObject.GetComponentsInChildren<Collider>(includeInactive: true).ForEach(delegate(Collider element)
|
|
{
|
|
UnityEngine.Object.Destroy(element);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void UpdateRemoteRodBending()
|
|
{
|
|
if (!(spawnedRod == null))
|
|
{
|
|
rodIK.SetIkWeight(ikWeight.Value);
|
|
if (fishingMethodType.Value == FishingMethodType.Spinning)
|
|
{
|
|
rodIK.SetIKTarget(spawnedLure.transform);
|
|
}
|
|
else if (fishingMethodType.Value == FishingMethodType.Float)
|
|
{
|
|
rodIK.SetIKTarget(spawnedHook.transform);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void UpdateRemoteReelSpeed()
|
|
{
|
|
if (!(spawnedRod == null))
|
|
{
|
|
spawnedReel.SpinReel(reelSpeed.Value);
|
|
}
|
|
}
|
|
|
|
private void UpdateRemoteFishingLine()
|
|
{
|
|
if (!(spawnedRod == null))
|
|
{
|
|
int num = spawnedRod.RodGuides.Guides.Count + ((fishingMethodType.Value == FishingMethodType.Spinning) ? 2 : 3);
|
|
if (lineRenderer.positionCount != num)
|
|
{
|
|
lineRenderer.positionCount = num;
|
|
lineRenderer.startWidth = lineThickness;
|
|
lineRenderer.endWidth = lineThickness;
|
|
}
|
|
if (fishingMethodType.Value == FishingMethodType.Spinning)
|
|
{
|
|
lineRenderer.SetPosition(0, spawnedLure.transform.position);
|
|
}
|
|
else if (fishingMethodType.Value == FishingMethodType.Float)
|
|
{
|
|
lineRenderer.SetPosition(0, spawnedHook.transform.position);
|
|
lineRenderer.SetPosition(1, spawnedBobber.transform.position);
|
|
}
|
|
for (int i = 0; i < spawnedRod.RodGuides.Guides.Count; i++)
|
|
{
|
|
lineRenderer.SetPosition(i + ((fishingMethodType.Value == FishingMethodType.Spinning) ? 1 : 2), spawnedRod.RodGuides.Guides[i].position);
|
|
}
|
|
lineRenderer.SetPosition(num - 1, spawnedReel.RopeAnchorOnRoller.position);
|
|
}
|
|
}
|
|
|
|
private void CleanupRemoteEquipment()
|
|
{
|
|
if (spawnedLure != null)
|
|
{
|
|
distanceSourceObjects.Remove(spawnedLure);
|
|
}
|
|
if (spawnedHook != null)
|
|
{
|
|
distanceSourceObjects.Remove(spawnedHook.gameObject);
|
|
}
|
|
if (spawnedRod != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedRod.gameObject);
|
|
spawnedRod = null;
|
|
}
|
|
if (spawnedReel != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedReel.gameObject);
|
|
spawnedReel = null;
|
|
}
|
|
if (spawnedBobber != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedBobber.gameObject);
|
|
spawnedBobber = null;
|
|
}
|
|
if (spawnedHook != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedHook.gameObject);
|
|
spawnedHook = null;
|
|
}
|
|
if (spawnedLure != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedLure.gameObject);
|
|
spawnedLure = null;
|
|
}
|
|
if (spawnedBait != null)
|
|
{
|
|
UnityEngine.Object.Destroy(spawnedBait.gameObject);
|
|
spawnedBait = null;
|
|
}
|
|
}
|
|
|
|
[ServerRpc]
|
|
public void UpdateEquipmentSyncVars(FishingMethodType fishingMethodType, int rodID, int reelID, int lineID, int bobberID, int hookID, int lureID, int baitID)
|
|
{
|
|
RpcWriter___Server_UpdateEquipmentSyncVars_4106814919(fishingMethodType, rodID, reelID, lineID, bobberID, hookID, lureID, baitID);
|
|
}
|
|
|
|
[ServerRpc]
|
|
public void UpdateBobberAndBaitSyncVars(Vector3 bobberPosition, Quaternion bobberRotation, Vector3 baitPosition, Quaternion baitRotation)
|
|
{
|
|
RpcWriter___Server_UpdateBobberAndBaitSyncVars_2669797829(bobberPosition, bobberRotation, baitPosition, baitRotation);
|
|
}
|
|
|
|
[ServerRpc]
|
|
public void UpdateRodAndReelSyncVars(float ikWeight, float reelSpeed)
|
|
{
|
|
RpcWriter___Server_UpdateRodAndReelSyncVars_1138564871(ikWeight, reelSpeed);
|
|
}
|
|
|
|
[ServerRpc]
|
|
public void DespawnRPC()
|
|
{
|
|
RpcWriter___Server_DespawnRPC_2166136261();
|
|
}
|
|
|
|
public override void NetworkInitialize___Early()
|
|
{
|
|
if (!NetworkInitialize___EarlyMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted)
|
|
{
|
|
NetworkInitialize___EarlyMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted = true;
|
|
base.NetworkInitialize___Early();
|
|
reelSpeed.InitializeEarly(this, 13u, isSyncObject: false);
|
|
ikWeight.InitializeEarly(this, 12u, isSyncObject: false);
|
|
baitRotation.InitializeEarly(this, 11u, isSyncObject: false);
|
|
baitPosition.InitializeEarly(this, 10u, isSyncObject: false);
|
|
bobberRotation.InitializeEarly(this, 9u, isSyncObject: false);
|
|
bobberPosition.InitializeEarly(this, 8u, isSyncObject: false);
|
|
baitID.InitializeEarly(this, 7u, isSyncObject: false);
|
|
lureID.InitializeEarly(this, 6u, isSyncObject: false);
|
|
hookID.InitializeEarly(this, 5u, isSyncObject: false);
|
|
bobberID.InitializeEarly(this, 4u, isSyncObject: false);
|
|
lineID.InitializeEarly(this, 3u, isSyncObject: false);
|
|
reelID.InitializeEarly(this, 2u, isSyncObject: false);
|
|
rodID.InitializeEarly(this, 1u, isSyncObject: false);
|
|
fishingMethodType.InitializeEarly(this, 0u, isSyncObject: false);
|
|
RegisterServerRpc(0u, RpcReader___Server_UpdateEquipmentSyncVars_4106814919);
|
|
RegisterServerRpc(1u, RpcReader___Server_UpdateBobberAndBaitSyncVars_2669797829);
|
|
RegisterServerRpc(2u, RpcReader___Server_UpdateRodAndReelSyncVars_1138564871);
|
|
RegisterServerRpc(3u, RpcReader___Server_DespawnRPC_2166136261);
|
|
}
|
|
}
|
|
|
|
public override void NetworkInitialize___Late()
|
|
{
|
|
if (!NetworkInitialize___LateMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted)
|
|
{
|
|
NetworkInitialize___LateMultiplayerFishingSetControlerAssembly_002DCSharp_002Edll_Excuted = true;
|
|
base.NetworkInitialize___Late();
|
|
reelSpeed.InitializeLate();
|
|
ikWeight.InitializeLate();
|
|
baitRotation.InitializeLate();
|
|
baitPosition.InitializeLate();
|
|
bobberRotation.InitializeLate();
|
|
bobberPosition.InitializeLate();
|
|
baitID.InitializeLate();
|
|
lureID.InitializeLate();
|
|
hookID.InitializeLate();
|
|
bobberID.InitializeLate();
|
|
lineID.InitializeLate();
|
|
reelID.InitializeLate();
|
|
rodID.InitializeLate();
|
|
fishingMethodType.InitializeLate();
|
|
}
|
|
}
|
|
|
|
public override void NetworkInitializeIfDisabled()
|
|
{
|
|
NetworkInitialize___Early();
|
|
NetworkInitialize___Late();
|
|
}
|
|
|
|
private void RpcWriter___Server_UpdateEquipmentSyncVars_4106814919(FishingMethodType fishingMethodType, int rodID, int reelID, int lineID, int bobberID, int hookID, int lureID, int baitID)
|
|
{
|
|
if (!base.IsClientInitialized)
|
|
{
|
|
NetworkManager networkManager = base.NetworkManager;
|
|
networkManager.LogWarning("Cannot complete action because client is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component.");
|
|
return;
|
|
}
|
|
if (!base.IsOwner)
|
|
{
|
|
NetworkManager networkManager2 = base.NetworkManager;
|
|
networkManager2.LogWarning("Cannot complete action because you are not the owner of this object. .");
|
|
return;
|
|
}
|
|
Channel channel = Channel.Reliable;
|
|
PooledWriter pooledWriter = WriterPool.Retrieve();
|
|
// GeneratedWriters___Internal.GWrite___FishingMethodTypeFishNet_002ESerializing_002EGenerated(pooledWriter, fishingMethodType);
|
|
pooledWriter.WriteInt32(rodID);
|
|
pooledWriter.WriteInt32(reelID);
|
|
pooledWriter.WriteInt32(lineID);
|
|
pooledWriter.WriteInt32(bobberID);
|
|
pooledWriter.WriteInt32(hookID);
|
|
pooledWriter.WriteInt32(lureID);
|
|
pooledWriter.WriteInt32(baitID);
|
|
SendServerRpc(0u, pooledWriter, channel, DataOrderType.Default);
|
|
pooledWriter.Store();
|
|
}
|
|
|
|
public void RpcLogic___UpdateEquipmentSyncVars_4106814919(FishingMethodType P_0, int P_1, int P_2, int P_3, int P_4, int P_5, int P_6, int P_7)
|
|
{
|
|
fishingMethodType.Value = P_0;
|
|
rodID.Value = P_1;
|
|
reelID.Value = P_2;
|
|
lineID.Value = P_3;
|
|
bobberID.Value = P_4;
|
|
hookID.Value = P_5;
|
|
lureID.Value = P_6;
|
|
baitID.Value = P_7;
|
|
}
|
|
|
|
private void RpcReader___Server_UpdateEquipmentSyncVars_4106814919(PooledReader PooledReader0, Channel channel, NetworkConnection conn)
|
|
{
|
|
// FishingMethodType fishingMethodType = GeneratedReaders___Internal.GRead___FishingMethodTypeFishNet_002ESerializing_002EGenerateds(PooledReader0);
|
|
int num = PooledReader0.ReadInt32();
|
|
int num2 = PooledReader0.ReadInt32();
|
|
int num3 = PooledReader0.ReadInt32();
|
|
int num4 = PooledReader0.ReadInt32();
|
|
int num5 = PooledReader0.ReadInt32();
|
|
int num6 = PooledReader0.ReadInt32();
|
|
int num7 = PooledReader0.ReadInt32();
|
|
if (base.IsServerInitialized && OwnerMatches(conn))
|
|
{
|
|
// RpcLogic___UpdateEquipmentSyncVars_4106814919(fishingMethodType, num, num2, num3, num4, num5, num6, num7);
|
|
}
|
|
}
|
|
|
|
private void RpcWriter___Server_UpdateBobberAndBaitSyncVars_2669797829(Vector3 bobberPosition, Quaternion bobberRotation, Vector3 baitPosition, Quaternion baitRotation)
|
|
{
|
|
if (!base.IsClientInitialized)
|
|
{
|
|
NetworkManager networkManager = base.NetworkManager;
|
|
networkManager.LogWarning("Cannot complete action because client is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component.");
|
|
return;
|
|
}
|
|
if (!base.IsOwner)
|
|
{
|
|
NetworkManager networkManager2 = base.NetworkManager;
|
|
networkManager2.LogWarning("Cannot complete action because you are not the owner of this object. .");
|
|
return;
|
|
}
|
|
Channel channel = Channel.Reliable;
|
|
PooledWriter pooledWriter = WriterPool.Retrieve();
|
|
pooledWriter.WriteVector3(bobberPosition);
|
|
pooledWriter.WriteQuaternion32(bobberRotation);
|
|
pooledWriter.WriteVector3(baitPosition);
|
|
pooledWriter.WriteQuaternion32(baitRotation);
|
|
SendServerRpc(1u, pooledWriter, channel, DataOrderType.Default);
|
|
pooledWriter.Store();
|
|
}
|
|
|
|
public void RpcLogic___UpdateBobberAndBaitSyncVars_2669797829(Vector3 P_0, Quaternion P_1, Vector3 P_2, Quaternion P_3)
|
|
{
|
|
bobberPosition.Value = P_0;
|
|
bobberRotation.Value = P_1;
|
|
baitPosition.Value = P_2;
|
|
baitRotation.Value = P_3;
|
|
}
|
|
|
|
private void RpcReader___Server_UpdateBobberAndBaitSyncVars_2669797829(PooledReader PooledReader0, Channel channel, NetworkConnection conn)
|
|
{
|
|
Vector3 vector = PooledReader0.ReadVector3();
|
|
Quaternion quaternion = PooledReader0.ReadQuaternion32();
|
|
Vector3 vector2 = PooledReader0.ReadVector3();
|
|
Quaternion quaternion2 = PooledReader0.ReadQuaternion32();
|
|
if (base.IsServerInitialized && OwnerMatches(conn))
|
|
{
|
|
RpcLogic___UpdateBobberAndBaitSyncVars_2669797829(vector, quaternion, vector2, quaternion2);
|
|
}
|
|
}
|
|
|
|
private void RpcWriter___Server_UpdateRodAndReelSyncVars_1138564871(float ikWeight, float reelSpeed)
|
|
{
|
|
if (!base.IsClientInitialized)
|
|
{
|
|
NetworkManager networkManager = base.NetworkManager;
|
|
networkManager.LogWarning("Cannot complete action because client is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component.");
|
|
return;
|
|
}
|
|
if (!base.IsOwner)
|
|
{
|
|
NetworkManager networkManager2 = base.NetworkManager;
|
|
networkManager2.LogWarning("Cannot complete action because you are not the owner of this object. .");
|
|
return;
|
|
}
|
|
Channel channel = Channel.Reliable;
|
|
PooledWriter pooledWriter = WriterPool.Retrieve();
|
|
pooledWriter.WriteSingle(ikWeight);
|
|
pooledWriter.WriteSingle(reelSpeed);
|
|
SendServerRpc(2u, pooledWriter, channel, DataOrderType.Default);
|
|
pooledWriter.Store();
|
|
}
|
|
|
|
public void RpcLogic___UpdateRodAndReelSyncVars_1138564871(float P_0, float P_1)
|
|
{
|
|
ikWeight.Value = P_0;
|
|
reelSpeed.Value = P_1;
|
|
}
|
|
|
|
private void RpcReader___Server_UpdateRodAndReelSyncVars_1138564871(PooledReader PooledReader0, Channel channel, NetworkConnection conn)
|
|
{
|
|
float num = PooledReader0.ReadSingle();
|
|
float num2 = PooledReader0.ReadSingle();
|
|
if (base.IsServerInitialized && OwnerMatches(conn))
|
|
{
|
|
RpcLogic___UpdateRodAndReelSyncVars_1138564871(num, num2);
|
|
}
|
|
}
|
|
|
|
private void RpcWriter___Server_DespawnRPC_2166136261()
|
|
{
|
|
if (!base.IsClientInitialized)
|
|
{
|
|
NetworkManager networkManager = base.NetworkManager;
|
|
networkManager.LogWarning("Cannot complete action because client is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component.");
|
|
return;
|
|
}
|
|
if (!base.IsOwner)
|
|
{
|
|
NetworkManager networkManager2 = base.NetworkManager;
|
|
networkManager2.LogWarning("Cannot complete action because you are not the owner of this object. .");
|
|
return;
|
|
}
|
|
Channel channel = Channel.Reliable;
|
|
PooledWriter pooledWriter = WriterPool.Retrieve();
|
|
SendServerRpc(3u, pooledWriter, channel, DataOrderType.Default);
|
|
pooledWriter.Store();
|
|
}
|
|
|
|
public void RpcLogic___DespawnRPC_2166136261()
|
|
{
|
|
Despawn();
|
|
}
|
|
|
|
private void RpcReader___Server_DespawnRPC_2166136261(PooledReader PooledReader0, Channel channel, NetworkConnection conn)
|
|
{
|
|
if (base.IsServerInitialized && OwnerMatches(conn))
|
|
{
|
|
RpcLogic___DespawnRPC_2166136261();
|
|
}
|
|
}
|
|
|
|
public virtual void Awake()
|
|
{
|
|
NetworkInitialize___Early();
|
|
NetworkInitialize___Late();
|
|
}
|
|
}
|