Free Console with networking example

I’m going through the process of understanding how multi-player works. I decided to create an empty project and make a basic console to use while developing it since the server will most likely be console controlled anyway. I’m going to be giving the code away as I go along, as well as instructions on how to use it if you are interested. At this stage, I intend to progress it to at least a level of having a couple of characters running around, probably shooting at each other.

Release #1:

Basic Console
Basic server with RPC functions
Basic client with RPC functions

http://www.fingerbait.com/Assets/BasicConsole.unitypackage

Quick Start:

  1. Create new project
  2. Import the above package
  3. Goto build settings, make sure to setup run in background to true (Unity - Manual: Player - search for run in background here if you are not sure)
  4. Build the project with only the Main scene - Note: this build will be your server
  5. Run the built exe. Allow the software to go through your firewall
  6. (In server). Hit ~ key (standard console)
  7. type ‘create server’
  8. type ‘start server’

At this stage you should hopefully have a server that is up and running. Leave the server running and go back to your Unity instance and hit play. This will be your client.

  1. Bring up console
  2. type ‘create client’
  3. type ‘connect’

The client should connect to the server.

On you server application, go into the console and type ‘load terrain0’ or ‘load terrain1’. The server should load the map, and the client should also.

The other RPC function available to both the client and the server app is ‘send [insert message]’

This is definitely WIP code, and should be treated more as a guide rather than anything greater. There may be and probably is better ways of doing stuff.

Just as i’m posting this I’ve realized the code isn’t as commented as it could be. Might improve on that in later releases.

JL

1 Like

reserved

Haven’t downloaded and tested your code, but just a tip: Use application.runInBackground to force the server (and client if you wish) to run while in the background.

I just tested it, its just crap dont download. Better to use Photon or Unet.

So what are the reasons why it’s crap? If you really tested it share your findings with us. Saying it’s just crap isn’t a valid argument but you’re only here to mess with people. I actually do have arguments for this want me to lay them out?

This is quite old and should possibly only be used as a guideline. Considering both GUI and Networking have been re-worked in U5, this is a somewhat redundant script.

Close thread close thread