lt 11 mesi fa
parent
commit
67af90cf7c

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

@@ -7,6 +7,7 @@ import (
 	"roserver/baseserver/model"
 	"roserver/baseserver/set"
 	"roserver/serverproto"
+	"strconv"
 	"sync"
 )
 
@@ -107,6 +108,10 @@ func (this *RoleBase) Load(msg interface{}) bool {
 			}
 			this.SetDirty(true)
 		}
+		if this.roleBase.NickName == "" {
+			this.roleBase.NickName = "初心者" + strconv.FormatUint(this.roleBase.Id%10000, 10)
+			this.SetDirty(true)
+		}
 		if this.role.roleTask != nil {
 			this.role.roleTask.OnlineCheckNewHead()
 		}

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

@@ -86,7 +86,7 @@ func (this *RoleManager) Update(ms uint64) {
 			delete(this.uuidRoleList, chRole.GetUUid())
 			//放到离线处理中
 			this.addOfflineRole(chRole.GetUUid(), chRole)
-			util.DebugF("Role delete ROLE_STATE_OFFLINE clid=%v uid=%v", key, chRole.GetUUid())
+			util.ErrorF("Role delete ROLE_STATE_OFFLINE clid=%v uid=%v", key, chRole.GetUUid())
 		case ROLE_STATE_ZOMBIE:
 			//需要做删除操作
 			delete(this.channelRoleList, key)

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

@@ -9,6 +9,7 @@ import (
 	"roserver/baseserver/model"
 	"roserver/serverproto"
 	"runtime/debug"
+	"strconv"
 	"time"
 	"unsafe"
 )
@@ -143,7 +144,7 @@ func (this *Role) createRole() int32 {
 	}
 
 	RoleMag.Resolve(this)
-
+	name := "初心者" + strconv.FormatUint(this.uuid%10000, 10)
 	data := this.base.roleBase
 	msg := &serverproto.SSAddRoleBaseReq{}
 	//初始化创建角色数据
@@ -151,7 +152,7 @@ func (this *Role) createRole() int32 {
 		Id:       this.uuid,
 		Coin:     0, //默认值通过配置表处理
 		Rmb:      0,
-		NickName: "",
+		NickName: name,
 
 		Sex:     data.Sex,
 		Country: data.Country,