public void OnEnterGameClick() { if (string.IsNullOrWhiteSpace(Roles.captionText.text)) { Debug.Log("没有角色"); return; } var rolename = Roles.captionText.text; var uuid = string.Empty; foreach (var role in player.RoleList) { if (rolename == role.Name) { uuid = role.RoleUUID; } } if (string.IsNullOrEmpty(uuid)) { Debug.LogError("没有找到这个角色"); return; } var msg = new ClientToLogin(); msg.EnterGame = new CLRoleEnterGame(); msg.EnterGame.RoleUUID = uuid; NetworkMgr.Instance.Login.Send(msg.ToByteArray()); }
public void OnLogonClick() { Debug.Log("LogonClick"); var msg = new ClientToLogin(); msg.Logon = new CLLogon(); msg.Logon.Name = Name.text; msg.Logon.PasswordHash = GetHashString(Name.text + Password.text); NetworkMgr.Instance.Login.Send(msg.ToByteArray()); }
public void OnConfirmCreateRoleClick() { CreateRoleRoot.SetActive(false); if (string.IsNullOrWhiteSpace(RoleName.text)) { Debug.Log("不能为空"); return; } var msg = new ClientToLogin(); msg.CreateRole = new CLCreateRole(); msg.CreateRole.RoleName = RoleName.text; msg.CreateRole.Zone = Zones.value; NetworkMgr.Instance.Login.Send(msg.ToByteArray()); }