☁ Server

by Zro716
  scripts
  sprites
See inside
Notes and Credits

merry scratchmas
update 1/27/16: added list dropdowns

It's a work in progress, but I think it's usable by now.

How to set up your own server:
1. Put this in a project that you want a server on.
2. Create 8 cloud variables with names 1 thru 8.
3. Go to the Create Server script and add player variables in the space provided. These aren't like the orange variables as they are stored in a list.
4. When finished, click the script and a message should appear. Fix any errors that may occur.

How it works:
A user requests a connection with the virtual "server". It checks cloud variables until one is found unused. A timeout of 5 seconds means the previous player left the server without disconnecting and their spot gets reassigned. Once a player slot is assigned, Join initializes the player for live gameplay. In the detached forever loop of the main script, an Update Players block retrieves other player data and sends your data.

Since this is a library of sorts, it doesn't give you an example to play with (I'll share one soon enough). You'll have to have knowledge of what you're doing to set it up for your projects.

Shared: 25 Dec 2015 Modified: 2 Apr 2016
Favorite this project 82
Love this project 98
Total views 1531
View the remix tree  5
  
More projects by Zro716