Comments (4)
@baflink
I've tested with the latest commit and something still isn't right. It seems like field change events now fire if an RPC is sent from the client. Though I can't quite tell for sure, but I'm pretty sure that's what's happening. Or maybe it's receiving any field updates from the server causing them to fire?
For example I have a uint, I set it once on the server and only once, yet when I move, it's change event seems to fire, I've done a find in all files to double check I'm not setting it anywhere else.
I'll keep investigating.
EDIT:
Yeah, I'm pretty sure it's when another field(s) is updated, it fires the event for every field, even fields that haven't been updated.
from forgenetworkingremastered.
@BrianWiz Can you try with the newest NetworkObjectTemplate.txt on develop?
from forgenetworkingremastered.
@baflink Finally got around to testing this. There is still a problem.
I've got two fields, one is "position
" (Vector2), one is "test
" (int), both have Interpolation off. I set test
once in NetworkStart(), and I set position
in Update();
The result is that the testChanged event fires every time position is changed. So it looks like if any field is changed, it thinks they all changed. I confirmed this by commenting out the line that sets the position in Update();
Here's my entire class(es) so you know I'm not doing anything weird.
using UnityEngine;
using BeardedManStudios.Forge.Networking;
using BeardedManStudios.Forge.Networking.Unity;
using BeardedManStudios.Forge.Networking.Generated;
public class Grenade : Projectile
{
protected override void NetworkStart()
{
base.NetworkStart();
if (networkObject.IsServer)
{
networkObject.test = 2;
}
else
{
networkObject.testChanged += TestChanged;
}
}
void Update()
{
if (networkObject != null)
{
if (networkObject.IsServer)
{
networkObject.position = transform.position;
}
}
}
private void TestChanged(int test, ulong timestamp)
{
Debug.Log("test");
}
}
using UnityEngine;
using BeardedManStudios.Forge.Networking;
using BeardedManStudios.Forge.Networking.Unity;
using BeardedManStudios.Forge.Networking.Generated;
public class Projectile : ProjectileBehavior
{
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public virtual void MoveProjectile(Vector3 direction)
{
// GetComponent<Rigidbody>().AddForce(direction * force, ForceMode.Impulse);
}
}
from forgenetworkingremastered.
@baflink So it looks like on the server, in SerializeDirtyFields()
, it returns dirtyFieldsData
with fields that shouldn't actually be dirty.
So it looks like if any field is dirty, it sends them all of them over in HeartBeat()
on NetworkObject.cs
. If none are dirty, it doesn't send anything as expected.
from forgenetworkingremastered.
Related Issues (20)
- Null reference exception in lobby scene HOT 2
- NAT Server not functioning properly. HOT 1
- [wiki] Basic Authentication possible fix HOT 6
- Players will not see already joined players when connecting to lobby system HOT 7
- Client loading Scene even though automaticScenes is false HOT 1
- Windows Stand Alone Player returns null reference when you instantiate in Scene 0 HOT 3
- Client in the objectCreated handler, getting a null AttachedBehavior HOT 1
- ForgeNetworkingCommon.dll not found to build StandAloneServer HOT 1
- Unity 2019.3.15 IL2CPP Build Error!
- SSL/TLS/Encryption support for TCP/UDP servers
- BeardedMath.Lerp appears incorrect for generic types
- Forge Networking Alloy networking code cannot be used without Unity due to (unused) import
- Heads up: ConcurrentQueue.TryDequeue hides member in (at least) .NET 5.0
- Consider adding relevant network object to RpcArgs HOT 2
- STEAMWORKS define symbol causes bugs HOT 1
- RPCs broken at higher pings HOT 2
- NetworkerStatistics.BandwidthInOut BREAKS at High Ping!
- No connection on iOS 14
- Wiki Documentation feedback HOT 1
- Unstable Packets (all 4 bugs which make Forge unfitting for serious projects)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forgenetworkingremastered.