// Update is called once per frame void Update() { if (clientActivatedEnterWorld) //if is entering { worldServerConnection.EstablishConnection("127.0.0.1", 3435); // EnterWorldPacket packet = new EnterWorldPacket() int characterId = Utils.GetCharacter(CharacterSelect.selectedSlot).CharId; var characterIdBytes = BitConverter.GetBytes(characterId); if (!BitConverter.IsLittleEndian) { Array.Reverse(characterIdBytes); } SubPacket packetToSend = new SubPacket(GamePacketOpCode.Handshake, 0, 0, characterIdBytes, SubPacketTypes.GamePacket); BasePacket test = BasePacket.CreatePacket(packetToSend, PacketProcessor.isAuthenticated, false); test.header.connectionType = (ushort)BasePacketConnectionTypes.Generic; worldServerConnection.Send(test); genericBoxHandler.InstantiateMessageOnlyStatusBox(); var boxText = genericBoxHandler.GetPrefab().GetComponentInChildren <Text>(); boxText.text = "Handshaking with server.."; StartCoroutine(WaitForServerResponse()); clientActivatedEnterWorld = false; } }