Exemplo n.º 1
0
 public static List<WorldChunk> GetLocalChunks(WorldChunk CurrentChunk)
 {
     Vector2 Location = new Vector2(CurrentChunk.BoundingBox.X,
         CurrentChunk.BoundingBox.Y);
     List<WorldChunk> RetVal = new List<WorldChunk>();
     RetVal.Add(CurrentChunk);
     RetVal.Add(GetChunkViaLocation(Location + North));
     RetVal.Add(GetChunkViaLocation(Location + NorthEast));
     RetVal.Add(GetChunkViaLocation(Location + East));
     RetVal.Add(GetChunkViaLocation(Location + SouthEast));
     RetVal.Add(GetChunkViaLocation(Location + South));
     RetVal.Add(GetChunkViaLocation(Location + SouthWest));
     RetVal.Add(GetChunkViaLocation(Location + West));
     RetVal.Add(GetChunkViaLocation(Location + NorthWest));
     return RetVal;
 }
Exemplo n.º 2
0
        private void PostMovement(NetConnection netConnection)
        {
            PlayerClient Character = CharacterManager.GetByConnection(netConnection);
            if (LastUpdateChunk == null)
                LastUpdateChunk = ChunkManager.GetChunk(Character.Location);

            WorldChunk CurrentChunk = ChunkManager.GetChunk(Character.Location);
            if (LastUpdateChunk != CurrentChunk) {
                WorldDataSync Sync = new WorldDataSync(netConnection);
                GameServer.TaskScheduler.AddTask(Sync.RunUpdate());
                LastUpdateChunk = CurrentChunk;
            }
        }