Playmaker Forum

PlayMaker Help & Tips => PlayMaker Tutorials => Topic started by: cmvrgr on November 01, 2013, 08:47:19 PM

Title: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 01, 2013, 08:47:19 PM
Hi friends of playmaker.

I am trying to make an app that it will run on a pc that will act as a server and also on another pc will be the controlling unit that will be the client.

For example I will have 3 cameras that will change to server pc by pressing 1, 2 ,3 keys on client pc.

Any Idea on how I can do it ?

Best Regards
Title: Re: Networking - How to send a key down from client to server ?
Post by: jeanfabre on November 04, 2013, 01:39:20 AM
Hi,

 For this, you'll need to dive into Photon networking. Have you tried already?

bye,

 Jean
Title: Re: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 04, 2013, 04:05:52 AM
Do you know if I can do it with out photon and just with standard networking;
Title: Re: Networking - How to send a key down from client to server ?
Post by: jeanfabre on November 04, 2013, 04:40:33 AM
Hi,

 Yes, you can do it with Unity Networking... I strongly discourage you to do so... what kind of server are you going to run and who's going to maintain the server? With Photon Cloud, there is no server, it's done for you and for your needs, you only need basic communication from what I can see.

If you are in control of both pc, then you may be able to get away with Unity networking and without a server ( peer to peer connection on a same network).

Could you tell us more about the contact of this? Maybe a dedicated server is required, but we need more infos before stating this.

Have you tried the various samples on Unity networking do they work on your machine setup?

Bye,

Jean
Title: Re: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 04, 2013, 10:51:56 AM
Both PCs will be in the same room. The one will be the server machine that will run the application and the client will be something like a remote control of the server.
Title: Re: Networking - How to send a key down from client to server ?
Post by: jeanfabre on November 05, 2013, 02:12:38 AM
Hi,

 Then you can get away with Unity Networking solution with a peer to peer system.

bye,

 Jean
Title: Re: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 07, 2013, 06:32:07 PM
Any example on how I can sent a key pressed to server ?

Your help will be appreciated
Title: Re: Networking - How to send a key down from client to server ?
Post by: jeanfabre on November 08, 2013, 01:03:45 AM
Hi,

 you use the action "SendRemoteEvent", which sends a RPC call and then you implement your server to respond to that RPC event.
 
BUT, From what I understand you are using a peer to peer connection, so you don't have a server... Am I correct? Or Are you using now a server? in which case, which one are you using and how did you configured it?

bye,

 Jean
Title: Re: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 08, 2013, 06:21:22 AM
I am using a peer to peer connection on a local network.  My application will act as:  server will have the demo application and client will be the controller.  Both PC's will be in the same room.
Title: Re: Networking - How to send a key down from client to server ?
Post by: jeanfabre on November 08, 2013, 06:34:10 AM
Hi,

Ok, then simply use the SendRemoteEvent Action, it's straight forward.

Bye,

Jean
Title: Re: Networking - How to send a key down from client to server ?
Post by: cmvrgr on November 08, 2013, 06:32:54 PM
can you send me a demo on how I can sent a pressed key ?

Thanks