Help with RPC Client/Server

Hello,

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

 @RPC
 function testrpc(){
    Debug.Log("Died");
 }

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: http://answers.unity3d.com/questions/8408/how-can-i-connect-unity-to-an-sql-database-in-order-to-implement-an-mmo