NetworkTask First Result
This commit is contained in:
parent
4fd28308f2
commit
ef5483a917
2 changed files with 21 additions and 2 deletions
|
@ -18,7 +18,6 @@ namespace DangerousD.GameCore.Network
|
||||||
public Vector2 velocity { get; set; }
|
public Vector2 velocity { get; set; }
|
||||||
public Type type { get; set; }
|
public Type type { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Нанести урон сущности
|
/// Нанести урон сущности
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -83,5 +82,25 @@ namespace DangerousD.GameCore.Network
|
||||||
name = StateName;
|
name = StateName;
|
||||||
velocity = EntityVelocity;
|
velocity = EntityVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Подключается к хосту и передаёт своё имя
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PlayerName"></param>
|
||||||
|
public NetworkTask(string PlayerName)
|
||||||
|
{
|
||||||
|
operation = NetworkTaskOperationEnum.ConnectToHost;
|
||||||
|
name = PlayerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получает id игрока на клиенте от хоста
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PlayerId"></param>
|
||||||
|
public NetworkTask(int PlayerId)
|
||||||
|
{
|
||||||
|
operation = NetworkTaskOperationEnum.GetClientPlayerId;
|
||||||
|
objId = PlayerId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,6 @@ namespace DangerousD.GameCore.Network
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public enum NetworkTaskOperationEnum
|
public enum NetworkTaskOperationEnum
|
||||||
{
|
{
|
||||||
TakeDamage, SendSound, CreateEntity, SendPosition, ChangeState
|
TakeDamage, SendSound, CreateEntity, SendPosition, ChangeState, ConnectToHost, GetClientPlayerId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue