Skip to content

Commit

Permalink
RequestCreateEntity now passes the ownerId so that screens can place …
Browse files Browse the repository at this point in the history
…objects in different lists.
  • Loading branch information
vchelaru committed Mar 8, 2019
1 parent ebf75c3 commit 3699f5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion INetworkArena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface INetworkArena
/// <param name="entityId">The unique ID of the entity to create</param>
/// <param name="entityData">The initial state of the created entity</param>
/// <returns>The created INetworkEntity, which will be tracked by the NetworkManager</returns>
INetworkEntity RequestCreateEntity(object entityData);
INetworkEntity RequestCreateEntity(long ownerId, object entityData);

/// <summary>
/// Called by the network manager when a message is received to destroy an entity.
Expand Down
3 changes: 2 additions & 1 deletion NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ private void CreateEntity(long ownerId, long entityId, object payload, double ti

if(targetEntity == null)
{
targetEntity = GameArena.RequestCreateEntity(payload);
targetEntity = GameArena.RequestCreateEntity(ownerId, payload);
}
else
{
Expand Down Expand Up @@ -622,6 +622,7 @@ private void SendDataMessage(INetworkEntity entity, NetworkMessageType action, N
SendDataMessage(entity.EntityId, entity.OwnerId, payload, action, recipient);
}

// from https://stackoverflow.com/questions/6803073/get-local-ip-address
public string GetLocalIpAddress()
{
var host = Dns.GetHostEntry(Dns.GetHostName());
Expand Down

0 comments on commit 3699f5b

Please sign in to comment.