Ejemplo n.º 1
0
    public void SavePlayer(ServerPlayer a_player, bool a_justUpdateParty = false)
    {
        if (a_player == null)
        {
            return;
        }
        object threadLock = this.m_threadLock;

        lock (threadLock)
        {
            List <DatabasePlayer> list = (!a_justUpdateParty) ? this.m_playersToWrite : this.m_partyPlayersToWrite;
            list.Add(new DatabasePlayer(a_player.m_accountId, this.saveStr(a_player.m_name), a_player.m_pid, a_player.GetPosition().x, a_player.GetPosition().z, (int)(a_player.GetHealth() + 0.5f), (int)(a_player.GetEnergy() + 0.5f), (int)a_player.GetKarma(), a_player.GetXp(), a_player.GetConditions(), a_player.m_gold, a_player.m_partyId, a_player.m_partyRank));
        }
    }
Ejemplo n.º 2
0
 public void SavePlayer(ServerPlayer a_player, bool a_justUpdateParty = false)
 {
     if (a_player != null)
     {
         lock (m_threadLock)
         {
             List <DatabasePlayer> list = (!a_justUpdateParty) ? m_playersToWrite : m_partyPlayersToWrite;
             ulong   accountId          = a_player.m_accountId;
             string  a_name             = saveStr(a_player.m_name);
             int     pid       = a_player.m_pid;
             Vector3 position  = a_player.GetPosition();
             float   x         = position.x;
             Vector3 position2 = a_player.GetPosition();
             list.Add(new DatabasePlayer(accountId, a_name, pid, x, position2.z, (int)(a_player.GetHealth() + 0.5f), (int)(a_player.GetEnergy() + 0.5f), (int)a_player.GetKarma(), a_player.GetXp(), a_player.GetConditions(), a_player.m_gold, a_player.m_partyId, a_player.m_partyRank));
         }
     }
 }