public IEnumerator regAndLog() { Debug.Log("LoginInit::regAndlog: start Register"); PacketHolder packet = new PacketHolder(); { CGAutoRegisterAccount.Builder auto = CGAutoRegisterAccount.CreateBuilder(); var data = auto.Build(); Bundle bundle = new Bundle(); bundle.newMessage(typeof(CGAutoRegisterAccount)); uint fid = bundle.writePB(data); yield return(StartCoroutine(bundle.sendCoroutine(KBEngineApp.app.networkInterface(), fid, packet))); } { var newAccount = packet.packet.protoBody as GCAutoRegisterAccount; CGRegisterAccount.Builder reg = CGRegisterAccount.CreateBuilder(); reg.Username = newAccount.Username; reg.Password = "******"; var data = reg.BuildPartial(); Debug.Log("LoginInit::regAndLog: " + newAccount + " : " + data); Debug.Log("LoginInit::regAndLog: username pass " + newAccount.Username + " " + data.Password); Bundle bundle = new Bundle(); bundle.newMessage(data.GetType()); var fid = bundle.writePB(data); yield return(StartCoroutine(bundle.sendCoroutine(KBEngineApp.app.networkInterface(), fid, packet))); if (packet.packet.responseFlag == 0) { SaveGame.saveGame.AddNewAccount(newAccount.Username, data.Password); SaveGame.saveGame.SaveFile(); } else { Log.Sys(Util.GetString("autoRegError")); } } yield return(StartCoroutine(loginCoroutine())); Debug.Log("LoginInit::regAndlog: finish register"); }