系统架构层面流量控制功能完善

This commit is contained in:
flswld
2023-02-05 07:18:43 +08:00
parent cfb001c18a
commit 94c8db402a
51 changed files with 1049 additions and 2408 deletions

View File

@@ -54,9 +54,18 @@ func (c *CommandManager) GMAddUserAvatar(userId, avatarId uint32) {
// GMAddUserAllItem 给予玩家所有物品
func (c *CommandManager) GMAddUserAllItem(userId, itemCount uint32) {
// 猜猜这样做为啥不行?
// for itemId := range GAME_MANAGER.GetAllItemDataConfig() {
// c.GMAddUserItem(userId, uint32(itemId), itemCount)
// }
itemList := make([]*UserItem, 0)
for itemId := range GAME_MANAGER.GetAllItemDataConfig() {
c.GMAddUserItem(userId, uint32(itemId), itemCount)
itemList = append(itemList, &UserItem{
ItemId: uint32(itemId),
ChangeCount: itemCount,
})
}
GAME_MANAGER.AddUserItem(userId, itemList, false, 0)
}
// GMAddUserAllWeapon 给予玩家所有武器