- Home /
Network RCP between client server projects
Hi all
I have been playing about with unity networking RPC calls and I’m a little lost on how this is all supposed to roll out.
I have sent an RPC message to the server and got a response, no problems there took me 2 hours to roll out. All seemed good, but when I tried to create a RPC call that was separated between two projects/builds I got no response. After further investigation I believe this is not possible as the @RPC function for the server has to also be within the client code. See code below, I will try to make it more clear on what I’m aiming to achieve. *Not working code
Send and RPC return In the client, request data from server.
function sendMessage(){
networkView.RPC("getDataFromServer", RPCMode.Server, “Hello im a client”);
}
@RPC
function dataFromServer(dataFromServer:String){
Debug.Log(dataFromServer);
}
RPC, function in the server, send data back to client
@RPC
function sendDataFromServer(dataFromClient:String){
Debug.Log(dataFromClient);
networkView.RPC("dataFromServer", RPCMode.AllBuffered, “Hello im the sever?”);
}
Thats not working code but it should clearly illustrate the problem I’m looking at.
It seems to me that all the above rpc network architecture needs to be within both the client and the server to work.. So in other words is it possible to call an RPC function from one project to another without the RPC function having to be within both projects/builds?
Your answer
Follow this Question
Related Questions
RPCMode.Server works in one spot but not another 0 Answers
ClientRpc not called on Client 1 Answer
Networking: RPC To Specific Player? 1 Answer
Im not being able to fill up variables with RPCs 1 Answer
Networking: Players being "Perma-hit" 0 Answers