Plugin work

This commit is contained in:
Layla 2020-08-23 04:21:50 -04:00
parent 257fb07e94
commit 149555fb02
No known key found for this signature in database
GPG Key ID: A494D9357BA1BE31
2 changed files with 11 additions and 3 deletions

View File

@ -107,11 +107,17 @@ func (m *Match) MatchJoin(ctx context.Context, logger runtime.Logger, db *sql.DB
player, loadPlayerErr := entities.LoadPlayer(ctx, nk, precense)
if loadPlayerErr != nil {
logger.Error(loadPlayerErr.Error())
player.X = 16
player.Y = 16
} else {
player = entities.PlayerEntity{
X: 16,
Y: 16,
Name: "ERROR",
Presence: precense,
}
}
player.X = 16
player.Y = 16
if jsonObj, err := player.GetPosJSON(); err != nil {
logger.Error(err.Error())
} else {

View File

@ -80,6 +80,8 @@ func LoadPlayer(ctx context.Context, nk runtime.NakamaModule, presence runtime.P
}
player.Name = responseData.Name
player.Faction = gameworld.Faction(responseData.Faction)
player.X = 16.0
player.Y = 16.0
}
}
return player, nil