you use "-cl" command line to start a client. -ip only gives an ip to that client, it won'T make the engine start as client.

"-sv" starts a dedicated server.

you can combine both "-sv -cl" to create a server that is also a client on his own system.
be aware however that usually its easier to have a dedicated server, because you only need one client code, as for "-sv -cl" you often need to adjust the client code just for this one client.

EDIT: Btw if you want a to connect in code, check out the multiplayer plugins.

"ANet" isn't free, but it has most features and is well tested.
"GstNet" is free, but is used a little less often.

Both are (in my eyes) a lot better than the build in multiplayer.

Last edited by SchokoKeks; 10/12/11 23:20.