Merge branch 'main' of http://gitlab.passervr.com/passer/csharp/controlcore
This commit is contained in:
commit
dd2cbf1646
@ -75,6 +75,12 @@ namespace Passer.Control.Core {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static byte Serialized(byte[] buffer, byte networkId) {
|
||||
byte ix = 0;
|
||||
buffer[ix++] = ClientMsg.Id;
|
||||
buffer[ix++] = networkId;
|
||||
return ix;
|
||||
}
|
||||
public static bool SendTo(Participant participant, byte networkId) {
|
||||
if (participant == null)
|
||||
return false;
|
||||
|
@ -61,6 +61,7 @@ namespace Passer.Control.Core
|
||||
|
||||
public virtual void Update(float currentTime) {
|
||||
if (currentTime > this.nextPublishMe) {
|
||||
this.PublishBuffer(ClientMsg.Serialized(this.buffer, this.networkId));
|
||||
ClientMsg.Publish(this, this.networkId);
|
||||
this.nextPublishMe = currentTime + Participant.publishInterval;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user