Kaynağa Gözat

add:逻辑修改

LAPTOP-PC6VHEF0\XIONGHUY 1 yıl önce
ebeveyn
işleme
3b35c9b9d0

+ 1 - 0
RO_Server_Trunk-branch_0.1.39/roserver/config/csv/DesignationCfg.csv

@@ -30,6 +30,7 @@ int,string,int,list,list,list,int,int,int
 318,绝世小恶魔Ⅳ,3,21:24,91:40,,,,
 319,绝世小恶魔Ⅴ,3,21:28,91:50,,,,
 323,永恒传说,3,21:30,82:100,,,,
+324,王者归来,3,21:10,82:1,20002:1,,,
 401,金甲战士,4,21:22,86:4:24,,,,
 402,天神下凡,4,21:32,86:5:24,,,,
 403,精装上阵,4,21:22,83:12:1,,,,

+ 12 - 10
RO_Server_Trunk-branch_0.1.39/roserver/game/model/def.go

@@ -10,7 +10,7 @@ const (
 	Pro_Type_MAX      = 6
 )
 
-//装备部件
+// 装备部件
 const (
 	Equip_Type_None   = iota
 	Equip_Type_Head   = 1 //头部
@@ -22,12 +22,12 @@ const (
 	Equip_Type_Max    = 7 //MAX
 )
 const (
-	Skill_Equip_Type_None = iota
+	Skill_Equip_Type_None  = iota
 	Skill_Equip_Type_First = 1
-	Skill_Equip_Type_Max = 2
+	Skill_Equip_Type_Max   = 2
 )
 
-//坑位索引对应的部件
+// 坑位索引对应的部件
 const (
 	SLOT_TYPE_INDEX = iota
 	SLOT_TYPE_INDEX_Head
@@ -39,7 +39,7 @@ const (
 	SLOT_TYPE_INDEX_MAX
 )
 
-//时装部分
+// 时装部分
 const (
 	FASHION_NONE        = iota
 	FASHION_HEAD_UP     = 1
@@ -53,7 +53,7 @@ const (
 	FASHION_MAX
 )
 
-//伙伴品质
+// 伙伴品质
 type HeroQualityType int32
 
 const (
@@ -64,7 +64,7 @@ const (
 	HeroQualityType_Read   HeroQualityType = 5 //红
 )
 
-//进阶石道具ID写死(....)
+// 进阶石道具ID写死(....)
 const Item_ID_Cost_Stone = 100
 
 const Quick_Battle_Time = 7200
@@ -86,8 +86,8 @@ const (
 	SystemmessageType_Divine           SystemMessageType = 12 //占星领奖
 	SystemmessageType_PetExchange      SystemMessageType = 13 //兑换
 	SystemmessageType_ActivityWheel    SystemMessageType = 14 //活动转盘
-	SystemmessageType_GuildDemon	   SystemMessageType = 15 //公会魔王播报
-	SystemmessageType_Idol			   SystemMessageType = 16 //偶像季播报
+	SystemmessageType_GuildDemon       SystemMessageType = 15 //公会魔王播报
+	SystemmessageType_Idol             SystemMessageType = 16 //偶像季播报
 	SystemmessageType_SmashEggs        SystemMessageType = 17 // BT砸蛋活动
 )
 
@@ -118,7 +118,7 @@ const (
 const Card_Up_Grade_Need_Num = 3
 const Card_Up_Grade_Add_Num = 1
 
-//账号验证模式1:PC模式,不做任何处理 2:激活码模式 3:第三方平台验证模式SDK
+// 账号验证模式1:PC模式,不做任何处理 2:激活码模式 3:第三方平台验证模式SDK
 const (
 	AUTHMODE_PC = iota + 1
 	AUTHMODE_ACTIVE
@@ -162,3 +162,5 @@ const (
 	Rush_Map_Fight_Score = 1 //战斗积分
 	Rush_Map_Bag_Score   = 2 //礼包积分
 )
+
+const BTJiaChangeDollar float32 = 0.14

+ 3 - 3
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role.go

@@ -1567,10 +1567,10 @@ func (this *Role) GetBTZhenDayRecharge() float32 {
 	return this.GetRoleBase().roleBase.BtZhenDayRecharge
 }
 func (this *Role) GetBTJiaDayRecharge() float32 {
-	return float32(this.GetRoleBase().roleBase.BtJiaDayRecharge)
+	return float32(this.GetRoleBase().roleBase.BtJiaDayRecharge) * BTJiaChangeDollar
 }
-func (this *Role) GetBTJiaTotalRecharge() uint64 {
-	return this.GetRoleBase().roleBase.BtJiaTotalRecharge
+func (this *Role) GetBTJiaTotalRecharge() float32 {
+	return float32(this.GetRoleBase().roleBase.BtJiaTotalRecharge) * BTJiaChangeDollar
 }
 
 // 添加通用资源

+ 24 - 24
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_bag.go

@@ -74,22 +74,22 @@ const (
 	AddFrom_RushSkill          //59 技能冲榜
 	AddFrom_CrossYuanHangTrial //60跨服远航试炼
 
-	AddFrom_SkillEquipStarLevel //61 神器升星
-	AddFrom_SkillEquipSoltLevel //62 神器槽位升级
-	AddFrom_SkillEquipDecompose //63 神器分解
-	AddFrom_DrawSkillEquip      //64
-	AddFrom_CrossTopTower       //65 跨服巅峰之塔
-	AddFrom_HeadActivate        //66 称号激活消耗
-	AddFrom_GuildDemon          //67 公会魔王
-	AddFrom_SkillEquipRefroge   //68 神器重铸
-	AddFrom_ActivitySummon      //69 活动召唤
-	AddFrom_ActivitySignIn      //70 活动签到
-	AddFrom_SkillEquipShift     //71 神器转移
-	AddFrom_IdolSeason          //72 偶像季
-	AddFrom_WishBox             //73 许愿宝箱解锁
-	AddFrom_WishBoxSpeed        //74 许愿宝箱加速
-	AddFrom_WishBoxUse          //75 许愿使用
-	AddFrom_PetJuexing          //76 宠物觉醒
+	AddFrom_SkillEquipStarLevel      //61 神器升星
+	AddFrom_SkillEquipSoltLevel      //62 神器槽位升级
+	AddFrom_SkillEquipDecompose      //63 神器分解
+	AddFrom_DrawSkillEquip           //64
+	AddFrom_CrossTopTower            //65 跨服巅峰之塔
+	AddFrom_HeadActivate             //66 称号激活消耗
+	AddFrom_GuildDemon               //67 公会魔王
+	AddFrom_SkillEquipRefroge        //68 神器重铸
+	AddFrom_ActivitySummon           //69 活动召唤
+	AddFrom_ActivitySignIn           //70 活动签到
+	AddFrom_SkillEquipShift          //71 神器转移
+	AddFrom_IdolSeason               //72 偶像季
+	AddFrom_WishBox                  //73 许愿宝箱解锁
+	AddFrom_WishBoxSpeed             //74 许愿宝箱加速
+	AddFrom_WishBoxUse               //75 许愿使用
+	AddFrom_PetJuexing               //76 宠物觉醒
 	AddFrom_CreditRecharge           // 77 充值钱包
 	AddFrom_SpecialPrivilege         // 78 特权卡商店
 	AddFrom_BT_Boli                  // 79 bt boli
@@ -126,7 +126,7 @@ func (this *RoleBag) Load(msg interface{}) bool {
 	proRole := msg.(*serverproto.Role)
 	if proRole.RoleBag == nil {
 		proRole.RoleBag = &serverproto.RoleBag{}
-		this.AddItemList(model.GlobalCreateItemList, AddItemST{AddFrom: AddFrom_System, Notify: false})
+		//this.AddItemList(model.GlobalCreateItemList, AddItemST{AddFrom: AddFrom_System, Notify: false})
 	} else {
 		for _, itemData := range proRole.RoleBag.ItemList {
 			this.itemList[itemData.Id] = itemData
@@ -190,7 +190,7 @@ func (this *RoleBag) emptyPosNum() uint32 {
 	}
 }
 
-//获取物品堆叠上限
+// 获取物品堆叠上限
 func (this *RoleBag) canAddCnt(itemCfgId int32, itemPileNum uint32) uint64 {
 	//itemPileNum := this.getItemPileNum(itemCfgId)
 	//itemCfg := GetItemCfg(itemCfgId)
@@ -206,7 +206,7 @@ func (this *RoleBag) canAddCnt(itemCfgId int32, itemPileNum uint32) uint64 {
 	return currCount
 }
 
-//根据动态ID获取道具
+// 根据动态ID获取道具
 func (this *RoleBag) getItemById(id uint64) *serverproto.ItemData {
 	item, ok := this.itemList[id]
 	if ok {
@@ -593,7 +593,7 @@ func (this *RoleBag) AddItemList(addItemList map[int32]int32, st AddItemST) {
 		}
 	}
 	this.itemAction.doAction(notify, st.Ignore)
-	if bBaseChange {
+	if bBaseChange && notify {
 		this.role.GetRoleBase().BaseChangeNtf()
 	}
 	if bKeepSakeItem { //如果有信物相关变化
@@ -741,7 +741,7 @@ func (this *RoleBag) DelItem(configId, count int32, delFrom AddItemST) {
 	}
 }
 
-//该结构只删除背包中的道具(在背包中显示的道具)
+// 该结构只删除背包中的道具(在背包中显示的道具)
 func (this *RoleBag) DelItemById(id uint64, count int32, delFrom AddFromType) {
 	if this.itemAction.delByID(id, count) {
 		this.SetDirty(true)
@@ -1028,7 +1028,7 @@ func (this *RoleBag) autoUseItem(itemCfgId int32, count uint32, notify bool, ite
 	return serverproto.ErrorCode_ERROR_OK
 }
 
-//是否能添加该列表物品(整体添加)
+// 是否能添加该列表物品(整体添加)
 func (this *RoleBag) CanAddItemList(addItemList map[int32]int32) serverproto.ErrorCode {
 	for key, value := range addItemList {
 		ret := this.CanAddItem(key, value)
@@ -1107,7 +1107,7 @@ func (this *RoleBag) CanDelItem(configId int32, count int32) bool {
 	return true
 }
 
-//打开礼包
+// 打开礼包
 func (this *RoleBag) openPackage(dropIdList []string, addItemList map[int32]int32, job bool) {
 	roleJobType := this.role.GetRoleBase().GetRoleJobType()
 	for idx := 0; idx < len(dropIdList); idx++ {
@@ -1127,7 +1127,7 @@ func (this *RoleBag) openPackage(dropIdList []string, addItemList map[int32]int3
 	}
 }
 
-//GM process
+// GM process
 func (this *RoleBag) GMClearBag() {
 	for _, data := range this.itemList {
 		cfgData, ok := serverproto.ItemCfgLoader[data.ConfigId]

+ 27 - 27
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_base.go

@@ -56,7 +56,7 @@ func (this *RoleBase) CopyData(base *serverproto.RoleBase) {
 	*base = *this.roleBase
 }
 
-//剧情//TODO wangzhaocan 后续放入RoleCommon
+// 剧情//TODO wangzhaocan 后续放入RoleCommon
 func (this *RoleBase) CopyStoryData(msgNtf *serverproto.SCRoleStoryNtf) {
 	for _, data := range this.roleBase.StoryId {
 		msgNtf.Story = append(msgNtf.Story, data)
@@ -175,7 +175,7 @@ func (this *RoleBase) Rename(name string) {
 	this.SetDirty(true)
 }
 
-//时效性头像刷新
+// 时效性头像刷新
 func (this *RoleBase) Update(ms uint64) {
 	if this.roleBase.Head_Info == nil || len(this.roleBase.Head_Info.HeadFrameList) <= 0 {
 		return
@@ -240,11 +240,11 @@ func (this *RoleBase) DailyReset(notify bool) uint64 {
 	this.SetDirty(true)
 	if notify {
 		ntfMsg := &serverproto.SCPayInfoNtf{
-			TotalRecharge: this.roleBase.TotalRecharge,
-			DayRecharge:   this.roleBase.DayRecharge,
+			TotalRecharge:      this.roleBase.TotalRecharge,
+			DayRecharge:        this.roleBase.DayRecharge,
 			BtZhenDayRecharge:  this.roleBase.BtZhenDayRecharge,
-			BtJiaDayRecharge:   this.roleBase.BtJiaDayRecharge,
-			BtJiaTotalRecharge: this.roleBase.BtJiaTotalRecharge,
+			BtJiaDayRecharge:   int32(float32(this.roleBase.BtJiaDayRecharge) * BTJiaChangeDollar),
+			BtJiaTotalRecharge: uint64(float32(this.roleBase.BtJiaTotalRecharge) * BTJiaChangeDollar),
 		}
 		this.role.ReplayGate(ntfMsg, true)
 
@@ -397,7 +397,7 @@ func (this *RoleBase) AddCruise(st AddItemST, add bool) bool {
 	return true
 }
 
-//获取资源
+// 获取资源
 func (this *RoleBase) GetCommonRes(resType int32) int32 {
 	for _, data := range this.roleBase.ResList {
 		if data.Key == resType {
@@ -407,7 +407,7 @@ func (this *RoleBase) GetCommonRes(resType int32) int32 {
 	return 0
 }
 
-//default true
+// default true
 func (this *RoleBase) ResetCommonRes(resType int32, notify bool) {
 	for _, data := range this.roleBase.ResList {
 		if data.Key == resType {
@@ -426,7 +426,7 @@ func (this *RoleBase) ResetCommonRes(resType int32, notify bool) {
 	}
 }
 
-//添加资源
+// 添加资源
 func (this *RoleBase) AddCommonRes(resType int32, st AddItemST, add bool) bool {
 	resValue := st.ItemCount
 	if resValue <= 0 || resValue >= math.MaxInt32 {
@@ -523,15 +523,15 @@ func (this *RoleBase) AddBtJiaRecharge(val int32) {
 		TotalRecharge:      this.roleBase.TotalRecharge,
 		DayRecharge:        this.roleBase.DayRecharge,
 		BtZhenDayRecharge:  this.roleBase.BtZhenDayRecharge,
-		BtJiaDayRecharge:   this.roleBase.BtJiaDayRecharge,
-		BtJiaTotalRecharge: this.roleBase.BtJiaTotalRecharge,
+		BtJiaDayRecharge:   int32(float32(this.roleBase.BtJiaDayRecharge) * BTJiaChangeDollar),
+		BtJiaTotalRecharge: uint64(float32(this.roleBase.BtJiaTotalRecharge) * BTJiaChangeDollar),
 	}
 	this.role.ReplayGate(ntfMsg, true)
 
 	TaskMagCheck(this.role, serverproto.TaskType_BT_ZhenJiaRecharge, val)
 }
 
-//增加累计充值
+// 增加累计充值
 func (this *RoleBase) AddPayRecharge(payRewardInfo *serverproto.PayOrderSaveInfo) {
 	amount := payRewardInfo.Amount
 	if amount <= 0.00001 {
@@ -560,8 +560,8 @@ func (this *RoleBase) AddPayRecharge(payRewardInfo *serverproto.PayOrderSaveInfo
 		TotalRecharge:      this.roleBase.TotalRecharge,
 		DayRecharge:        this.roleBase.DayRecharge,
 		BtZhenDayRecharge:  this.roleBase.BtZhenDayRecharge,
-		BtJiaDayRecharge:   this.roleBase.BtJiaDayRecharge,
-		BtJiaTotalRecharge: this.roleBase.BtJiaTotalRecharge,
+		BtJiaDayRecharge:   int32(float32(this.roleBase.BtJiaDayRecharge) * BTJiaChangeDollar),
+		BtJiaTotalRecharge: uint64(float32(this.roleBase.BtJiaTotalRecharge) * BTJiaChangeDollar),
 	}
 	this.role.ReplayGate(ntfMsg, true)
 	util.InfoF("uid=%v AddPayRecharge old=%v new=%v add=%v", this.role.GetUUid(), oldVal, this.roleBase.TotalRecharge, amount)
@@ -739,7 +739,7 @@ func (this *RoleBase) OnlineTimeReward() serverproto.ErrorCode {
 	return serverproto.ErrorCode_ERROR_OK
 }
 
-//离线时处理在线时间加成
+// 离线时处理在线时间加成
 func (this *RoleBase) OfflineOnlineTimeProcess() {
 	nowTime := util.GetTimeMilliseconds()
 	//计算当天累计在线时间
@@ -757,7 +757,7 @@ func (this *RoleBase) OfflineOnlineTimeProcess() {
 	}
 }
 
-//隔天领取之前天未领取的奖励
+// 隔天领取之前天未领取的奖励
 func (this *RoleBase) onlineTImeRewardAll(nowTime uint64) {
 	curDiffDay := util.GetDurationDay2(this.role.RegisterTime, nowTime) - 1
 	if curDiffDay <= 0 {
@@ -820,7 +820,7 @@ func (this *RoleBase) FashionChangeNtf() {
 	//this.role.ReplayGate(ntfMsg, true)
 }
 
-//更新玩家简介信息
+// 更新玩家简介信息
 func (this *RoleBase) UpdatePlayerBriefInfo(bOffline bool) {
 	ssMsg := &serverproto.SSRoleBriefInfoSaveReq{
 		BriefInfo: &serverproto.CommonPlayerBriefInfo{
@@ -856,7 +856,7 @@ func (this *RoleBase) UpdatePlayerBriefInfo(bOffline bool) {
 	this.role.SendDb(ssMsg)
 }
 
-//是否是可重置的属性点类型
+// 是否是可重置的属性点类型
 func (this *RoleBase) isAttrPointType(attrKey int32) bool {
 	key := serverproto.Attr(attrKey)
 	if key == serverproto.Attr_Str || key == serverproto.Attr_Agi || key == serverproto.Attr_Int ||
@@ -866,7 +866,7 @@ func (this *RoleBase) isAttrPointType(attrKey int32) bool {
 	return false
 }
 
-//主角经验 + 升级
+// 主角经验 + 升级
 func (this *RoleBase) AddBaseExp(st AddItemST) int32 {
 	exp := st.ItemCount
 	if exp <= 0 || exp >= math.MaxInt32 {
@@ -981,7 +981,7 @@ func (this *RoleBase) processLevelState(oldLevel int32, newLevel int32) {
 	}
 }
 
-//返回改变的等级
+// 返回改变的等级
 func (this *RoleBase) AddJobExp(st AddItemST) int32 {
 	exp := st.ItemCount
 	if exp <= 0 || exp >= math.MaxInt32 {
@@ -1061,7 +1061,7 @@ func (this *RoleBase) AddJobExp(st AddItemST) int32 {
 	return changLevel
 }
 
-//根据类型获得具体部位索引
+// 根据类型获得具体部位索引
 func (this *RoleBase) GetSlotIndexByType(slotType int32) int32 {
 	switch slotType {
 	case Equip_Type_Head:
@@ -1158,7 +1158,7 @@ func (this *RoleBase) EquipUp(heroId int32, slotIndex int32, equipId int32) serv
 	return serverproto.ErrorCode_ERROR_OK
 }
 
-//任意N件装备精炼等级达到X级
+// 任意N件装备精炼等级达到X级
 func (this *RoleBase) GetEquipSlotLevelNum(equipLevel int32) int32 {
 	var retNum int32 = 0
 
@@ -1171,7 +1171,7 @@ func (this *RoleBase) GetEquipSlotLevelNum(equipLevel int32) int32 {
 	return retNum
 }
 
-//任意N件装备精炼等级达到X级
+// 任意N件装备精炼等级达到X级
 func (this *RoleBase) GetEquipSlotLevelRoleCnt(equipLevel int32) int32 {
 	var retNum int32 = 0
 	all := false
@@ -1617,7 +1617,7 @@ func (this *RoleBase) SetFightPower(fightPower uint32) {
 	}
 }
 
-//设置头像
+// 设置头像
 func (this *RoleBase) SetRoleHeadPic(headId int32) serverproto.ErrorCode {
 	bRet := this.CheckHeadUnlock(headId)
 	if bRet && this.roleBase.RoleData.HeadId != headId && headId != 0 {
@@ -1628,7 +1628,7 @@ func (this *RoleBase) SetRoleHeadPic(headId int32) serverproto.ErrorCode {
 	return serverproto.ErrorCode_ERROR_FAIL
 }
 
-//请求头像信息
+// 请求头像信息
 func (this *RoleBase) HeadInfoReq() {
 	ackMsg := &serverproto.SCHeadInfoAck{}
 
@@ -1640,7 +1640,7 @@ func (this *RoleBase) HeadInfoReq() {
 	this.role.ReplayGate(ackMsg, true)
 }
 
-//请求激活头像
+// 请求激活头像
 func (this *RoleBase) ActiveHead(headId int32) serverproto.ErrorCode {
 	//检查headId是否已经被激活
 	if bRet := this.CheckHeadUnlock(headId); bRet {
@@ -1754,7 +1754,7 @@ func (this *RoleBase) HeadFrameChangeNtf(headFrame []*serverproto.HeadFrameData)
 	this.role.ReplayGate(ntfMsg, true)
 }
 
-//检查头像任务是否激活
+// 检查头像任务是否激活
 func (this *RoleBase) CheckHeadUnlock(headId int32) bool {
 	for _, data := range this.roleBase.Head_Info.HeadList {
 		if data == headId {

+ 2 - 2
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_bt.go

@@ -523,7 +523,7 @@ func (this *RoleBT) UnlockBTSystem() {
 	if this.baseData.FirstRechargeTime <= 0 && model.ConvertBTFirstRecharge != nil {
 		conditionList := model.ConvertBTFirstRecharge.OpenConditionList
 		unlockState := this.role.GetRoleBase().checkUnLockState(0, conditionList)
-		totalRecharge := this.role.GetTotalRecharge() + float32(this.role.GetBTJiaTotalRecharge())
+		totalRecharge := this.role.GetTotalRecharge() + this.role.GetBTJiaTotalRecharge()
 		if unlockState == serverproto.ErrorCode_ERROR_OK && model.ConvertBTFirstRecharge.RechargeAmount <= totalRecharge {
 			this.baseData.FirstRechargeTime = util.GetTimeMilliseconds()
 			this.SetDirty(true)
@@ -550,7 +550,7 @@ func (this *RoleBT) FirstRechargeReward(rewardIdx int32) serverproto.ErrorCode {
 		return serverproto.ErrorCode_ERROR_BT_FIRSTRECHARGE_REWARDED
 	}
 	//判断累计充值是否达到(花钱购买累计充值+免费充值额度使用) 配置是*100的,校验也*100
-	totalRecharge := (uint64(this.role.GetTotalRecharge()) + this.role.GetBTJiaTotalRecharge()) * 100
+	totalRecharge := (uint64(this.role.GetTotalRecharge()) + uint64(this.role.GetBTJiaTotalRecharge())) * 100
 
 	rewardCfgData := model.ConvertBTFirstRecharge.RewardList[rewardIdx-1]
 	if totalRecharge < uint64(rewardCfgData.RewardCondition) {

+ 1 - 1
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_head.go

@@ -229,7 +229,7 @@ func (this *RoleHead) HeadActivate(headId int32) (ret serverproto.ErrorCode) {
 	this.flushAttr()
 	this.sendHeadNtf(headId)
 	this.SetDirty(true)
-	util.InfoF("uid=%v HeadActivate  %v", this.role.GetUUid(), headId)
+	util.InfoF("uid=%v HeadActivate headId:%v cost:%v", this.role.GetUUid(), headId, db.ActivateItem)
 	return serverproto.ErrorCode_ERROR_OK
 }
 

+ 8 - 5
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_state.go

@@ -13,7 +13,7 @@ import (
 	"unsafe"
 )
 
-//状态机枚举
+// 状态机枚举
 const (
 	ROLE_STATE_ONLINE              = 1 //在线
 	ROLE_STATE_OFFLINE             = 2 //离线
@@ -30,8 +30,8 @@ const (
 	ROLE_STATE_ZOMBIE              = 13
 )
 
-//状态机执行信息
-//拉取角色信息
+// 状态机执行信息
+// 拉取角色信息
 var pullingRoleList = func(r *model.StateMachineCore, data interface{}) int32 {
 	parent := unsafe.Pointer(r)
 	return (*Role)(parent).pullingRoleList()
@@ -320,6 +320,7 @@ func (this *Role) RoleOnline(data interface{}) int32 {
 	//if data == nil || data.(bool) {
 	//	this.StartupProto()
 	//}
+
 	//暂时处理成全量下发
 	this.StartupProto()
 
@@ -431,7 +432,9 @@ func (this *Role) createRoleReward() {
 		this.GetRoleMail().AddMail(17, serverproto.MailType_MailType_System,
 			model.GlobalCreateRoleMailReward, nil, "", "")
 
-		this.roleBag.AddItemList(model.GlobalCreateItemList, AddItemST{AddFrom: AddFrom_CreateRole, Notify: true})
+		if this.roleBag != nil {
+			this.roleBag.AddItemList(model.GlobalCreateItemList, AddItemST{AddFrom: AddFrom_CreateRole, Notify: true})
+		}
 	}
 }
 
@@ -501,7 +504,7 @@ func (this *Role) registerServerList(headFrameId, level int32) {
 	}()
 }
 
-//礼包码获取奖励
+// 礼包码获取奖励
 func (this *Role) GetGiftReward(giftCode string) {
 
 }