Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Problem in send and receive messages from server !

Author
Message
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 28th Jun 2015 22:04
hi , I created a client and a server,
the client connects to the server and sends the message of the X and Y sprite!
however, when it sends the server receives several messages. and sends to all connected clients, more does not move the sprite!

below the codes I made : >

Client :


print of Client works : http://prntscr.com/7mey5r


Code of server to receive message of client :




Print of Server working : http://prntscr.com/7mf0x4

PrintC("Hello EveryOne !&quot
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jun 2015 01:45 Edited at: 29th Jun 2015 01:47
i think you want send x,y not msg
newMsg = CreateNetworkMessage()
AddNetworkMessageFloat(newMsg, msg)
AddNetworkMessageFloat(newMsg, msg)

and here too, u print the message id u got from client
print ("msg x# :" + Str(msg))
print ("msg y# :" + Str(msg))

btw, the client just send the server i want,
the server get this message and send a new position or not back to client. u should also add a message name.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 29th Jun 2015 02:20
I do not understand very kkk ... you have skype?

PrintC("Hello EveryOne !&quot
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jun 2015 19:39
AddNetworkMessageFloat(newMsg, msg)
AddNetworkMessageFloat(newMsg, msg)
=
AddNetworkMessageFloat(newMsg, x#)
AddNetworkMessageFloat(newMsg, y#)

print ("msg x# :" + Str(msg))
print ("msg y# :" + Str(msg))
=
print ("msg x# :" + Str(x#))
print ("msg y# :" + Str(y#))

i mean it make no sense set the position local and
send it to the server, and the server send the position back
and you set the position again.

if u want send other messages u can use a select case at the message name.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-03-29 13:57:31
Your offset time is: 2024-03-29 13:57:31