- Như tiêu đề, em có thử build unity client ra android app. Em chạy thử bằng giả lập ld player, nhập tài khoản mật khẩu như bình thường và bấm login thì không có gì xảy ra hết. Em nghĩ nó không gửi được các command đến BE ezyfox server vì ở bên Server cũng không thấy có session nào gửi request đến hết.
- Khi e build ra exe thì vẫn hoạt động bình thường.
- Vậy có phải là do LD player k ạ nhỉ? A giúp em với.
Share & grow the worlds knowledge!
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
[Ezyfox Server] Unity game client không gửi được command khi build ra android
Em cảm ơn ạ!
question
×
Remain: 5
2 Answers
monkey
Enlightened
monkey
Enlightened
Em có thấy log của android print gì không em? Em đang dùng webview hay là native nhỉ?
-
0
- Reply
Tú Trần Anh
Beginner
Tú Trần Anh
Beginner
- Khi vừa run thì nó có lỗi này: Autoconnected Player Curl error 7: Failed to connect to cdp.cloud.unity3d.com port 443: Connection refused
Nhưng cái lỗi này em nghĩ k ảnh hưởng vì build exe cũng có nhưng vẫn chạy bình thường.
- Còn đây là log lỗi bên ezyfox client print ra khi đăng nhập:
<img src="https://stackask.com/wp-content/uploads/2022/05/Untitled.png" alt="" class="alignnone size-full wp-image-5794" />
- Đăng nhập thì em gọi api đến springboot server để tạo login token. xong thì client unity gửi request đăng nhập đến ezyfox server bằng login token. Restful thì vẫn gọi đc bt a ạ.
- Em có sử dụng asset webview 4: https://assetstore.unity.com/packages/tools/network/uniwebview-4-175993
này để thực hiện chức năng thanh toán paypal bên gamescene.
-
0
- Reply
Nhìn lỗi này là do nó không kết nối được đến server em ạ, em đang chạy localhost hay là em đã deploy server lên cloud rồi? Client unity sử dụng csharp sdk sẽ gọi vào cổng 3005 nên em sẽ cần mở cổng 3005 trên firewall nếu em dùng cloud em ạ.
–
tvd12
1652081239000
Nếu em đang dùng localhost thử thay localhost bằng 127.0.0.1, nếu em đang dùng 127.0.0.1 em thử thay bằng localhost xem sao. Ý anh là ở hàm connect ý em ạ.
–
tvd12
1652088577000
Nếu vẫn ko đc, em thử sử dụng IP LAN xem sao nhé, có thể android nó ko sử dụng đc ở dạng localhost
–
dungtv
1652089344000
Em đã thử đổi host trong SocketInitializer sang "localhost" và "192.168.1.12" nhưng đều k đc.
Khi đổi sang những cái kia thì build exe hay chạy trên editor đều được cả a ạ. Còn cứ build ra apk là chỉ gọi được mỗi restful còn tcp call đều bị refuse
Em cũng thử mở file apk bằng điện thoại cùng wifi thay vì giả lập nhưng vẫn thế.
–
Tú Trần Anh
1652093567000
Em thử thay host bằng tvd12.com, port vẫn là 3305 xem có khác biệt gì không nhé.
–
monkey
1652119310000
em đã thử k được a ạ @@ test trên editor thì ok còn cứ build apk là lỗi. Em cũng thử thêm inbound rule mở cổng 3005 cũng k có gì khác biệt.
A có project unity nào đã build ra apk chưa cho em tham khảo với ạ.
–
Tú Trần Anh
1652123045000
- Em thêm log <code>logger.error("connect to server error: " + ex.Message + ", " + ex.GetType());</code> ở đoạn này: https://github.com/youngmonkeys/ezyfox-server-csharp-client/blob/master/socket/EzyTcpSocketClient.cs#L76để xem lỗi thực tế là gì nhé, em cũng <a href="https://youngmonkeys.org/ezyfox-csharp-client-sdk/" target="_blank" rel="nofollow ugc">cần code 1 xíu để logger hoạt động trên unity</a> nhé.
- Game này anh đã từng build ra android rồi em ạ: https://github.com/tvd12/space-shooter,đây là lớp socket của nó: https://github.com/tvd12/space-shooter/blob/master/unity/Assets/Done/Scripts/SocketClientProxy.cs
Nó log ra lỗi như này a ạ:
Autoconnected Player com.tvd12.ezyfoxserver.client.socket.EzyTcpSocketClient - connect to server error: Connection refused, System.Net.Sockets.SocketException
Hay do giả lập a nhỉ. Game kia build ra a chạy thử bằng giả lập nào vậy ạ
–
Tú Trần Anh
1652148415000
Anh build ra máy thật em ạ. Em đã setup quyền internet rồi nhỉ? https://stackoverflow.com/questions/37493936/android-internet-permission-in-unity
–
monkey
1652152393000
- Question(s) 1.1K
- Answer(s) 2.2K
- Best answer(s) 136
- User(s) 541
-
Lâm Tấn Lộc added an answer <ul class="markdown-list"><li class="markdown-list-item"> Đầ... 1768014969000 -
-
Related Questions
Recent Activities
-
Voted up question. January 9, 2023 at 2:54 pm
-
Voted up question. January 9, 2023 at 2:54 pm
-
Voted up question. January 9, 2023 at 2:54 pm
-
Voted up question. January 9, 2023 at 2:54 pm
-
Voted up question. January 9, 2023 at 2:54 pm
Top Members
Trending Tags
.net
.net core
.net oop
#formatdate
abstract class
access app
access token
ai
android
ansible
anti-flooding
apache poi
api
app
architecture
artificial intelligence
assembly
async
asyncawait
atomicboolean
authentication
backend
backend nestjs
background
bash script
batch
bean
big project
binding
bitcoin
blockchain
blog
boot-nodes
branch
btree
bucket4j
buffered
build
bundle
c#
c# .net
cache
caching
callback
career
career path
cast
câu hỏi
centos
chat
cloud
cloud reliability
combobox
commit
communication
computer science
concurrent
config-css
connection pool
content-disposition
contract
controllerservice
convert date to number
cookie
cors
cosmos
cosmos-sdk
crawl data
cron
css
database
database migration
datasource
datastructure
datetime
deadlock
debug
decentralized exchange
deep learning
deploy contract
design patterns
design-pattern
dev
devops
dex
di
distraction programing
dns
đồ án tốt nghiệp
docker
download
draw.io
du học
dữ liệu lớn
duration
eclip
editor
elasticsearch
email
erc20
erc721
error
estimation
eth
ethereum
ethereum login
excel
excel-object-mapper
exception
exception handle
exception handler
executor
export compliance
extensions
exyfox
ezydata
ezyfox
ezyfox-boot
ezyfox-server
ezyfoxserver
ezyhttp
ezyjpa
ezymq-kafka
ezyplatform
ezyredis
facebook
fe
filter
floating point
flutter
format json
freetank
front-end
frontend
fullstack
fulltextsearch
future
gallery
game
game-box
game-room
game-server
gateway
get
get file zip
git
glide
go
golang
gorilla
graduation thesis
graphql
grapql
grpc
guide
h2 database
handy terminal
hazelcast
hibernate
hibernateconfig
html
http
https
hyperloglog
image
index
indexing
integration-test
intellij
interface
io
ioc
ipfs
isolate
issue
it
java
java core
java spring
java web
javacore
javascript
javaw
jenkins
jetbrains
job
join
jotform
jpa
jpql
jquery
js
json
json file
json to object
jsonproperty
jsp
jsp & servlet
junit-test
jvm
jwt
kafka
keep promise
kerberos
keycloak
kotlin
languague
laravel
library
list
load balancer
load-balancing
lock
log
log4j
log4j-core
login
lỗi font
lưu trữ
machine learning
macos
mail
mail template
main
map
maria db
markdown
math
maven
merge
mermaid
message queue
messaging
metamask
microservice
microservices
migration
mobile
model
mongo
monitoring
mq
msgpack
multi-threading
multiple tenant
multithread
multithreading
mysql
n
naming
naming convention
nan
netcore
netty
network
networking
nft
nft game
nginx
nio
node.js
nodejs
non-blocking io
null
odoo
oop
opensource
optimize
oracle
orm
otp message
paginaiton
pagination
pancakeswap
panic
partition
pdf
pgpool
phỏng vấn
php
plugin
pointer
postgresql
postman
pre
private_key
procedure
profile
programming
programming-language
project management
promise
properties
push message android
push notification
push-noti
python
python unicode
qr
qrcode
question
queue
rabbitmq
react-native
reactive
reactjs
reactjs download
readmoretextview
recyclerview
redis
refactor
refresh token
regex
replica
repository
request
resilence4j
resource
rest
restful
resttemplate
roadmap
room database
ropssten
ropsten
round robin
rust
rxjava
s3
schedule
scheduled
scheduled spring boot
search
security
send email
send mail
serialization
server
servlet
session
shift jis
singleton
sjis
slack
smart contract
soap
socket
socket server
soft delete
solution
sosanh
spring
spring aop
spring boot
spring data jpa
spring redis
spring security
spring websocket
spring websocket cors
spring-boot-test
spring-jpa
springboot
springsecurity
springwebflux mysql
sql
sql server
sse
ssl
ssl email
stackask
storage
stream
stream api
stress test
stresstest
structure trong spring boot
study
synchronize
synchronized
system environment variables
tcp
test
thiết kế tầng trong dự án
thread
thread pool
threadjava
threadpool
thymeleaf
tomcat
totp
tracking location
transaction
transfer
transfer git
udp
ui
uniswap
unit test
unity
upload
upload file
utf-8 file
validate
validate date
vector
video call
vietqr
view
volatile
vue
vue cli
vuejs
watermark
web
web3
web3 client
webassembly
webflux
webpack
webrtc
websocket
windows 11
winforms
wordpress
work
xss
zip file
zookeeper