This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from proepkes/develop
Develop
- Loading branch information
Showing
69 changed files
with
1,286 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
...ssets/Scripts/Commands/NavigateCommand.cs → Engine/Client/Commands/NavigateCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...y/Assets/Scripts/Commands/SpawnCommand.cs → Engine/Client/Commands/SpawnCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Lockstep.Core.Interfaces; | ||
|
||
namespace Lockstep.Core.DefaultServices | ||
{ | ||
class DefaultHashService : IHashService | ||
public class DefaultHashService : IHashService | ||
{ | ||
public long CalculateHashCode(IEnumerable<GameEntity> entities) | ||
public long CalculateHashCode(IEnumerable<GameEntity> hashableEntities, GameStateContext context, ILogService logger) | ||
{ | ||
long hashCode = 0; | ||
foreach (var entity in entities) | ||
foreach (var entity in hashableEntities.OrderBy(entity => entity.localId.value)) | ||
{ | ||
hashCode ^= entity.position.value.X.RawValue; | ||
hashCode ^= entity.position.value.Y.RawValue; | ||
hashCode ^= CalculateHashCode(entity); | ||
if (context.tick.value > 170 && context.tick.value < 175 && entity.actorId.value == 2 && entity.id.value == 89) | ||
//if (context.tick.value == 38) | ||
{ | ||
logger.Warn(entity.actorId.value + "/" + entity.id.value + ": (" + entity.position.value + ")"); | ||
} | ||
} | ||
return hashCode; | ||
} | ||
|
||
public long CalculateHashCode(GameEntity entity) | ||
{ | ||
long hashCode = 0; | ||
hashCode ^= entity.position.value.X.RawValue; | ||
hashCode ^= entity.position.value.Y.RawValue; | ||
return hashCode; | ||
} | ||
} | ||
} |
Oops, something went wrong.