StatisticsProc.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace loyalsoft;
  8. /**
  9. * Description of StatisticsProc
  10. *
  11. * @author cyzhao
  12. */
  13. class StatisticsProc {
  14. /**
  15. * 已经完成新手引导的玩家记录
  16. * @param type $uid
  17. * @param type $index
  18. */
  19. static function NewbieGuideRecord($uid,$index) {
  20. if($index == 2){//现在游戏新手引导就2步
  21. $key = "NewbieGuideRecord-".req()->zoneid;
  22. gMem()->lpush($key, $uid);
  23. }
  24. }
  25. /**
  26. * 玩家自己任务完成统计-----每日任务进度变化--主线,学院,日程,悬赏的任务全记录在这
  27. * @param type $id
  28. */
  29. static function SelfTaskDataCollect($taskId) {
  30. $task = $taskId."-".time();
  31. $arr = array();
  32. $arr[] = $task;
  33. $num = gMem()->rpush("SelfTaskDataCollect-".req()->uid."-". req()->zoneid, $arr);
  34. }
  35. /**
  36. * 全区:记录uid-主线任务id,玩家做任务更新id,以获取最高任务--------主线,学院,日程,悬赏的任务全记录在这
  37. * @param type $taskId
  38. */
  39. static function TaskDataCollect($taskId) {
  40. $taskMo = GameConfig::item_taskcard_getItem($taskId);
  41. // if($taskMo->type != 1){
  42. // return;
  43. // }
  44. $key = "TaskDataCollect-".req()->zoneid;
  45. gMem()->hset($key, req()->uid, $taskId);
  46. }
  47. /**
  48. * 全区--玩家解锁课程进度:uid-courseId
  49. * @param type $courseId
  50. */
  51. static function UserCourseIngRecord($courseId){
  52. $key = "UserCourseIngRecord-".req()->zoneid;
  53. gMem()->hset($key, req()->uid, $courseId);
  54. }
  55. /*
  56. * 统计全区------玩家最新解锁建筑
  57. */
  58. static function unlockBuild($buildId) {
  59. $key = "unlockBuild-".req()->zoneid;
  60. gMem()->hset($key, req()->uid, $buildId);
  61. }
  62. /**
  63. * 统计全区------玩家最新解锁关卡
  64. * @param type $gateId
  65. */
  66. static function unlockGate($gateId) {
  67. $key = "unlockGate-".req()->zoneid;
  68. gMem()->hset($key, req()->uid, $gateId);
  69. }
  70. static function AAA($gateId) {
  71. }
  72. }