Fix syncing when hashes are not required
This commit is contained in:
parent
59fb38ff1b
commit
7b7e1552ea
@ -133,8 +133,6 @@ namespace Cyber.Networking.Serverside {
|
||||
|
||||
Spawner = GetComponent<Spawner>();
|
||||
|
||||
Spawner.SyncDB.SetStaticObjectsIDs();
|
||||
|
||||
ConnectionConfig Config = new ConnectionConfig();
|
||||
NetworkChannelID.ReliableSequenced = Config.AddChannel(QosType.ReliableSequenced);
|
||||
NetworkChannelID.UnreliableSequenced = Config.AddChannel(QosType.UnreliableSequenced);
|
||||
@ -143,6 +141,8 @@ namespace Cyber.Networking.Serverside {
|
||||
|
||||
NetworkServer.Listen(port);
|
||||
|
||||
Spawner.SyncDB.SetStaticObjectsIDs();
|
||||
|
||||
NetworkServer.RegisterHandler(PktType.TextMessage, HandlePacket);
|
||||
NetworkServer.RegisterHandler(PktType.MoveCreature, HandlePacket);
|
||||
NetworkServer.RegisterHandler(PktType.Interact, HandlePacket);
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
using Cyber.Console;
|
||||
using Cyber.Entities;
|
||||
using Cyber.Entities.SyncBases;
|
||||
using Cyber.Networking.Messages;
|
||||
@ -55,7 +56,8 @@ namespace Cyber.Networking.Serverside {
|
||||
SyncHandletype Handletype = Database.GetSyncHandletypes()[type];
|
||||
if (TickCounter % Handletype.TickInterval == 0) {
|
||||
foreach (int SyncBaseID in Categorized[type]) {
|
||||
if (DirtySyncBases.Contains(SyncBaseID)) {
|
||||
bool Contains = DirtySyncBases.Contains(SyncBaseID);
|
||||
if (Contains == Handletype.RequireHash || Contains) {
|
||||
QueueSyncBase(SyncBaseID);
|
||||
}
|
||||
}
|
||||
@ -71,12 +73,6 @@ namespace Cyber.Networking.Serverside {
|
||||
DirtySyncBases.Clear();
|
||||
}
|
||||
|
||||
if (Categorized.ContainsKey(typeof(Character))) {
|
||||
foreach (int i in Categorized[typeof(Character)]) {
|
||||
DirtSyncBase(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (TickCounter < int.MaxValue) {
|
||||
TickCounter++;
|
||||
|
Loading…
Reference in New Issue
Block a user