Merge branch 'master' of github.com:Saltosion/Cyber

This commit is contained in:
excitedneon 2017-05-12 01:25:22 +03:00
commit 127d7b1565
2 changed files with 5 additions and 9 deletions

View File

@ -133,8 +133,6 @@ namespace Cyber.Networking.Serverside {
Spawner = GetComponent<Spawner>(); Spawner = GetComponent<Spawner>();
Spawner.SyncDB.SetStaticObjectsIDs();
ConnectionConfig Config = new ConnectionConfig(); ConnectionConfig Config = new ConnectionConfig();
NetworkChannelID.ReliableSequenced = Config.AddChannel(QosType.ReliableSequenced); NetworkChannelID.ReliableSequenced = Config.AddChannel(QosType.ReliableSequenced);
NetworkChannelID.UnreliableSequenced = Config.AddChannel(QosType.UnreliableSequenced); NetworkChannelID.UnreliableSequenced = Config.AddChannel(QosType.UnreliableSequenced);
@ -143,6 +141,8 @@ namespace Cyber.Networking.Serverside {
NetworkServer.Listen(port); NetworkServer.Listen(port);
Spawner.SyncDB.SetStaticObjectsIDs();
NetworkServer.RegisterHandler(PktType.TextMessage, HandlePacket); NetworkServer.RegisterHandler(PktType.TextMessage, HandlePacket);
NetworkServer.RegisterHandler(PktType.MoveCreature, HandlePacket); NetworkServer.RegisterHandler(PktType.MoveCreature, HandlePacket);
NetworkServer.RegisterHandler(PktType.Interact, HandlePacket); NetworkServer.RegisterHandler(PktType.Interact, HandlePacket);

View File

@ -1,4 +1,5 @@
 
using Cyber.Console;
using Cyber.Entities; using Cyber.Entities;
using Cyber.Entities.SyncBases; using Cyber.Entities.SyncBases;
using Cyber.Networking.Messages; using Cyber.Networking.Messages;
@ -55,7 +56,8 @@ namespace Cyber.Networking.Serverside {
SyncHandletype Handletype = Database.GetSyncHandletypes()[type]; SyncHandletype Handletype = Database.GetSyncHandletypes()[type];
if (TickCounter % Handletype.TickInterval == 0) { if (TickCounter % Handletype.TickInterval == 0) {
foreach (int SyncBaseID in Categorized[type]) { foreach (int SyncBaseID in Categorized[type]) {
if (DirtySyncBases.Contains(SyncBaseID)) { bool Contains = DirtySyncBases.Contains(SyncBaseID);
if (Contains == Handletype.RequireHash || Contains) {
QueueSyncBase(SyncBaseID); QueueSyncBase(SyncBaseID);
} }
} }
@ -71,12 +73,6 @@ namespace Cyber.Networking.Serverside {
DirtySyncBases.Clear(); DirtySyncBases.Clear();
} }
if (Categorized.ContainsKey(typeof(Character))) {
foreach (int i in Categorized[typeof(Character)]) {
DirtSyncBase(i);
}
}
if (TickCounter < int.MaxValue) { if (TickCounter < int.MaxValue) {
TickCounter++; TickCounter++;