table_init.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package db
  2. // 玩家相关表初始化
  3. func initMapPlayerTables(playerID int64) {
  4. initMapPlayerStorageTable(playerID)
  5. initMapPlayerReportTable(playerID)
  6. }
  7. func initMapPlayerStorageTable(playerID int64) {
  8. mapPlayerStorageTable := newMapPlayerStorageTable(playerID)
  9. mapPlayerStorageTableCache.Put(playerID, mapPlayerStorageTable)
  10. mapPlayerStorageTable.Save2Queue()
  11. }
  12. func initMapPlayerReportTable(playerID int64) {
  13. mapPlayerReportTable := newMapPlayerReportTable(playerID)
  14. mapPlayerReportTableCache.Put(playerID, mapPlayerReportTable)
  15. mapPlayerReportTable.Save2Queue()
  16. }
  17. // 联盟相关表初始化
  18. func InitMapLeagueTables(leagueID int64) {
  19. initMapLeagueMemberTable(leagueID) // 联盟成员列表
  20. initMapLeagueStorageTable(leagueID) // 联盟仓库
  21. initMapLeagueMailTable(leagueID) // 联盟邮件表
  22. initMapLeagueLogTable(leagueID) // 联盟日志表
  23. initMapLeagueReportTable(leagueID) // 联盟战报表
  24. }
  25. func initMapLeagueMemberTable(leagueID int64) {
  26. mapLeagueMemberTable := NewMapLeagueMemberTable(leagueID)
  27. mapLeagueMemberTableCache.Put(leagueID, mapLeagueMemberTable)
  28. mapLeagueMemberTable.Save2Queue()
  29. }
  30. func initMapLeagueStorageTable(leagueID int64) {
  31. mapLeagueStorageTable := NewMapLeagueStorageTable(leagueID)
  32. mapLeagueStorageTableCache.Put(leagueID, mapLeagueStorageTable)
  33. mapLeagueStorageTable.Save2Queue()
  34. }
  35. func initMapLeagueMailTable(leagueID int64) {
  36. mapLeagueMailTable := NewMapLeagueMailTable(leagueID)
  37. mapLeagueMailTableCache.Put(leagueID, mapLeagueMailTable)
  38. mapLeagueMailTable.Save2Queue()
  39. }
  40. func initMapLeagueLogTable(leagueID int64) {
  41. mapLeagueLogTable := NewMapLeagueLogTable(leagueID)
  42. mapLeagueLogTableCache.Put(leagueID, mapLeagueLogTable)
  43. mapLeagueLogTable.Save2Queue()
  44. }
  45. func initMapLeagueReportTable(leagueID int64) {
  46. mapLeagueReportTable := NewMapLeagueReportTable(leagueID)
  47. mapLeagueReportTableCache.Put(leagueID, mapLeagueReportTable)
  48. mapLeagueReportTable.Save2Queue()
  49. }