Merge branch 'DevelopmentX' of github.com:progtime-net/ZoFo into DevelopmentX
This commit is contained in:
commit
ffff0fb299
5 changed files with 8 additions and 8 deletions
|
@ -252,12 +252,12 @@ namespace ZoFo.GameCore
|
|||
else if (update is UpdateGameEnded)
|
||||
{
|
||||
GameEnd();
|
||||
}
|
||||
else if (update is UpdatePlayerParametrs && update.IdEntity == myPlayer.Id) //aaa
|
||||
}
|
||||
else if (update is UpdatePlayerParametrs && myPlayer !=null && update.IdEntity == myPlayer.Id) //aaa
|
||||
{
|
||||
UpdatePlayerHealth(update as UpdatePlayerParametrs);
|
||||
}
|
||||
else if (update is UpdateLoot && update.IdEntity == myPlayer.Id)//aaa
|
||||
else if (update is UpdateLoot && myPlayer != null && update.IdEntity == myPlayer.Id)//aaa
|
||||
{
|
||||
if ((update as UpdateLoot).quantity == 0)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
{
|
||||
public class ClientNetworkManager
|
||||
{
|
||||
public int PlayerId;
|
||||
public int PlayerId = 0;
|
||||
private IPEndPoint endPoint;
|
||||
private IPEndPoint sendingEP;
|
||||
private Socket socket;
|
||||
|
|
|
@ -136,8 +136,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
|
||||
if (sendedData.Count != 0)
|
||||
{
|
||||
|
||||
|
||||
for (int i = 0; i < clientsEP.Count; i++)
|
||||
{
|
||||
foreach (Datagramm Dgramm in sendedData.Where(x => x.PlayerId == i+1))
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
|||
public class UpdateCreatePlayer : UpdateData
|
||||
{
|
||||
public int PlayerId { get; set; }
|
||||
public SerializableVector2 position { get; set; }
|
||||
public UpdateCreatePlayer()
|
||||
{
|
||||
isImportant = true;
|
||||
|
|
|
@ -71,7 +71,10 @@ namespace ZoFo.GameCore
|
|||
if (players.Count > 0)
|
||||
{
|
||||
UpdateInput data = updateData as UpdateInput;
|
||||
players[data.PlayerId - 1].HandleNewInput(data);
|
||||
if (data.PlayerId > 0)
|
||||
{
|
||||
players[data.PlayerId - 1].HandleNewInput(data);
|
||||
}
|
||||
}
|
||||
//TODO id instead of 0
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue