源战役
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 line
1.9 KiB

  1. %% ---------------------------------------------------------------------------
  2. %% @doc role.hrl
  3. %% @author hjh
  4. %% @since 2016-12-06
  5. %% @deprecated 角色信息
  6. %% ---------------------------------------------------------------------------
  7. %% -define(ETS_ROLE_MAJOR, ets_role_major).
  8. -define(ETS_ROLE_SHOW, ets_role_show).
  9. %% 角色信息(操作只能在进程,数据重要,保证唯一性)
  10. %% -record(ets_role_major, {id}).
  11. %% 角色信息展示(数据不重要,不能过于频繁)
  12. -record(ets_role_show, {
  13. id = 0
  14. , accid = 0
  15. , accname = <<>>
  16. , figure = undefined %%
  17. , online_flag = 0 %% 在线标识
  18. , last_login_time = 0 %% 上次登陆时间
  19. , last_logout_time = 0 %% 上次登出时间
  20. , combat_power = 0 %% 玩家当前战力
  21. , h_combat_power = 0 %% 玩家历史最高战力
  22. , left_activity_num_list = [] %% 剩余活动次数列表 [{{Module, SubModule, Type}, Count} |...]
  23. %% 本字段登录时才初始化加载,离线的玩家不加载
  24. , mate_title = [] %% 羁绊称号
  25. , offline_hosting = 0 %% 是否设置了离线托管
  26. }).
  27. %% 获取玩家展示的信息
  28. -define(sql_role_show_other_info, <<"
  29. select
  30. pl.accid, pl.accname, pl.online_flag, pl.last_login_time, pl.last_logout_time, ps.last_combat_power, ph.hightest_combat_power
  31. from player_login as pl left join player_high as ph on pl.id = ph.id left join player_state as ps on pl.id = ps.id WHERE pl.id = ~p">>).
  32. %% 获取最后退出游戏时候玩家战力
  33. -define(sql_role_last_logout_power, <<"select last_combat_power from player_state where id = ~p">>).
  34. %% ------------------------------------------------
  35. %% @doc 查看角色信息
  36. %% ------------------------------------------------