void LoadDataPlayer_Player(GameObject player) { TablePlayer tablePlayer = FindWithQuery <TablePlayer>("SELECT * FROM " + nameof(TablePlayer) + " WHERE playername=? AND deleted=0", player.name); player.GetComponent <PlayerComponent>().tablePlayer = tablePlayer; player.transform.position = new Vector3(tablePlayer.x, tablePlayer.y, tablePlayer.z); }
// ------------------------------------------------------------------------------- // GetPlayerOnline // // ------------------------------------------------------------------------------- public bool GetPlayerOnline(string playerName) { TablePlayer tablePlayer = FindWithQuery <TablePlayer>("SELECT * FROM " + nameof(TablePlayer) + " WHERE playername=? AND banned=0 AND deleted=0", playerName); if (tablePlayer == null) { return(false); } else { DateTime dateTime = tablePlayer.lastonline.AddSeconds(saveInterval * 2.0f); return(DateTime.Compare(DateTime.UtcNow, dateTime) <= 0); } }