In this section you will learn how to setup your server and client.
Server configuration
The server setup is stored in the file lib/config.php as PHP defines (if you are new to PHP, "define" is the equivalent of "const" in C#):
-
URL_ROOT: it is the absolute URL path to the root of Combu (e.g.: /combu/)
-
DEFAULT_TIMEZONE: this property has been deprecated in 2.1.10 (timestamps are saved in UTC)
-
GAME_DB_SERVER: it is the hostname or IP address of MySQL server
-
GAME_DB_NAME: it is name of MySQL database
-
GAME_DB_USER: it is the user name of MySQL connection
-
GAME_DB_PASS: it is the user password of MySQL connection
-
REGISTER_EMAIL_REQUIRED: it will require a valid email address upon new user creation
-
REGISTER_EMAIL_MULTIPLE: it allows to use the same email address for multiple accounts
-
REGISTER_EMAIL_ACTIVATION: it will create an activation code during user creation and sends it by email, then will require to activate the account before being able to login
-
REGISTER_EMAIL_SUBJECT: the subject text of the user registration email
-
REGISTER_EMAIL_MESSAGE: the full path to the html/text fle that contains the text of the user registration email; the message text can contain the following special words:
-
{ACTIVATION_URL}: it will be replaced with the URL to activate the account (if REGISTER_EMAIL_ACTIVATION is TRUE)
-
{USERNAME}: it will be replaced with the chosen username
-
REGISTER_EMAIL_HTML: it establishes if the user registration email is in HTML or text
-
FRIENDS_REQUIRE_ACCEPT: if set to TRUE then the friend add action will require the destination user to accept or decline the request before it appears in the friends list
-
ONLINE_SECONDS: time interval in seconds to consider a user online from last action registered
-
CLEAR_PLAYER_SESSIONS: if set to TRUE then every time a player logs in, the system will delete older login sessions to maintain the sessions table cleaned and as smaller as possible
-
EMAIL_SENDER_ADDRESS: the sender address of outgoing mail
-
EMAIL_SENDER_NAME: the sender name of outgoing mail
-
NEWSLETTER_SENDER_ADDRESS: the sender address of outgoing newsletters
-
NEWSLETTER_SENDER_NAME: the sender name of outgoing newsletters
-
DEFAULT_LIST_LIMIT: it sets the default number of results fetched for pagination
-
LOG_FILEPATH: it is the physical path to the log fle used by the class AppLog
-
LOG_MAXFILESIZE: it is the maximum size in bytes of the log fle
-
URL_UPLOAD: root folder for uploads to be used as URL
-
UPLOAD: physical root folder for uploads
-
GUEST_PREFIX: the prefix string attached to the id for guest accounts (ex.: "Guest-")
-
EXPIRE_CLIENT_SESSION: expire account sessions (must be a valid parameter for DateInterval constructor: http://php.net/manual/en/class.dateinterval.php)
Client configuration
In the inspector of CombuManager script (the prefab is just a GameObject with CombuManager script attached) you will find the following properties:
-
Dont Destroy On Load: if checked, this GameObject will be alive for the whole lifetime of your game/app; if you want to login in one scene (for example main menu) and last until the game quits then you should enable this flag
-
Set As Default Social Platform: since Combu 2.x implements the Unity ISocialPlatform interface, if you enable this flag the Combu will be set as current platform on Unity and you will be able to use it also through Social.Active
-
Secret Key: it is used to secure your webservices from spoofng attacks by signing each request; if you haven't a secure SSL connection on your server then we suggest to use a secret key, it must be the same as you defne on your webservice confg.php (please read the Server Documentation to defne one on your server)
-
Url Root Production: is the URL to the folder where you installed the web services on your production server (e.g.: http://www.yourserver.com/combu/)
-
Url Root Stage: is the URL to the folder where you installed the web services on your stage/development server, usually local machine (e.g.: http://localhost/combu/)
-
Use Stage: if checked, the web services calls will be directed to the stage server instead of production
-
Log Debug Info: if checked, all the calls to webservices will add the result text in the console window
-
Ping Interval Seconds: it's the interval in seconds to send auto-ping to server in order to maintain the online state of local user; to disable auto-ping set this to 0
-
Online Seconds: it's the time in seconds from last action registered to be considered as Online (last action and online state are cached in User class, you will need to reload over time if you need a precise info)
-
Playing Seconds: it's the time in seconds from last action to be considered as Playing
-
Timezone: this property has been deprecated in 2.1.10 (timestamps are saved in UTC)
-
Achievement UI Object: the GameObject that handles the user interface of Achievements
-
Achievement UI Function: the name of method to call on Achievement UI Object as result to Social.ShowAchievementsUI
-
Leaderboard UI Object: the GameObject that handles the user interface of Leaderboard
-
Leaderboard UI Function: the name of method to call on Leaderboard UI Object as result to Social.ShowLeaderboardUI