Help with RPC Client/Server


I have a problem understanding the RPC functions.

Do I need to define them on Client, Server or both?

And how do I run them? I currently have

 function testrpc(){

But the function is working without a server, why? Can you please give me an example for the following scene?:

Client sends accname+password

Server is searching in Database and return OK or Failed.

Client is getting the OK or Failed and display it.

I dont need the code how to connect to an Database, I only need a example for the use of the RPC functions with Send/return/....

Thank you very much

RPCs are mainly used to replicate state for the same game object attached to a given network view. So if a player jumps, the client sends its network view a RPC to tell that particular game object that represents the player on other people's machines to jump as well.

For this kind of database connection stuff, RPCs aren't really the appropriate way of doing things. You probably want to use sockets. Or, if you're making a web game, some kind of javascript intermediate layer on the web site itself.

More information here: