Networking When Offline

So I tried to set up a system in my game where we check to see if we’re connected to a Network before calling an RPC function. Basically, a function would be called to first check if we’re connected, and then the second - RPC - function would be called to tell the Network what it is we’re doing.

As you can imagine, having two functions for each RPC call can be a little cumbersome, so I tried something else. I just left the RPC calls as one function, removing the one before it that checks if we’re on a Network. I then turned off my internet and was still able to make a server and send RPC functions without any errors. Mind you, this wouldn’t actually work if somebody tried connecting to my server, but it does seem like you don’t have to make the check to see if you’re actually connected to a Network or not.

So my question is, can we always host a server on our local IP, even if we are playing offline? Thank you to anybody willing to clear up a few of my questions.

You can setup a local server, if you point your network client to, it will attempt to connect to the local host. Obviously you will have to have the server running, but that is the technique behind it.