Class: RuneRb::Database::PlayerStatus

Inherits:
Object
  • Object
show all
Defined in:
app/database/models/player/status.rb

Overview

Status information related to a player

Models a row within the <player_status> table.

Since:

  • 0.9.3

Instance Method Summary collapse

Instance Method Details

#banObject

Update the status with a ban.

Since:

  • 0.9.3


7
8
9
# File 'app/database/models/player/status.rb', line 7

def ban
  update(banned: true)
end

#muteObject

Update the status with a mute.

Since:

  • 0.9.3


12
13
14
# File 'app/database/models/player/status.rb', line 12

def mute
  update(muted: true)
end

#post_session(session) ⇒ Object

Updates the last session column with information from the passed session object.

Parameters:

Since:

  • 0.9.3


18
19
20
21
22
23
24
# File 'app/database/models/player/status.rb', line 18

def post_session(session)
  info = {}
  info[:ip] = session.ip
  info[:duration] = session.up_time
  info[:date] = session.start[:stamp]
  update(last_session: Oj.dump(info))
end