Skip to content

Commit 6862a4d

Browse files
committed
Update font xnb, some solution cleanup.
Readme for server is now in FSO.Server.Core.
1 parent 2ef694a commit 6862a4d

File tree

10 files changed

+159
-6807
lines changed

10 files changed

+159
-6807
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Volcanic is an extension of FreeSO that allows users to view, modify and save ga
3131
You can contribute to FreeSO by testing cutting edge features in the latest releases, filing bugs, and joining in the discussion on our forums!
3232

3333
* [Getting Started](https://github.com/riperiperi/FreeSO/wiki)
34+
* [Project Structure](https://github.com/riperiperi/FreeSO/wiki/Project-structure)
3435
* [Coding Standards](https://github.com/riperiperi/FreeSO/wiki/Coding-standards)
3536
* [Pull Requests](https://github.com/riperiperi/FreeSO/pulls): [Open](https://github.com/riperiperi/FreeSO/pulls)/[Closed](https://github.com/riperiperi/FreeSO/issues?q=is%3Apr+is%3Aclosed)
3637
* [Translation](http://forum.freeso.org/forums/translations.32/)
@@ -40,12 +41,11 @@ You can contribute to FreeSO by testing cutting edge features in the latest rele
4041

4142
Looking for something to do? Check out the issues tagged as [help wanted](https://github.com/riperiperi/FreeSO/labels/help%20wanted) to get started.
4243

43-
Regarding translations, full object and UI translations should currently be released on the forums. An improved system for distribution and organisation will be set up in a month or two. Stay tuned!
44+
Regarding translations, full object and UI translations should currently be released on the forums. This is far from perfect and is due to be reworked. Stay tuned!
4445

4546
## Prerequisites
46-
* [Visual Studio 2015](https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx)
47+
* [Visual Studio 2019](https://visualstudio.microsoft.com/vs/)
4748
* [MonoGame](http://www.monogame.net): 3.5 for the iOS and Android VS2015 project types. (optional)
48-
* [Xamarin for Visual Studio](https://www.xamarin.com/visual-studio): For iOS and Android builds. (optional)
4949

5050
# License
5151
> This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.

TSOClient/FSO.Server.Core/README.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Getting started #
2+
## Prerequisites ##
3+
1. MySQL database server (preferrably MariaDB)
4+
2. .NET Core 2.2 SDK or Runtime
5+
6+
## Configure database ##
7+
Create a database within your MySQL server. You can use an existing database (tables are namespaced) but making a new one is recommended.
8+
9+
CREATE DATABASE `fso`
10+
11+
Create a user on the database server with full access to the new database. Make sure you change the password for a production system.
12+
13+
CREATE USER 'fsoserver'@'localhost' IDENTIFIED BY 'password';
14+
GRANT ALL PRIVILEGES ON fso.* TO 'fsoserver'@'localhost';
15+
16+
Setup config.json to connect to the new database. It should look something like this (with your updated password).
17+
18+
{
19+
"database": {
20+
"connectionString": "server=127.0.0.1;uid=fsoserver;pwd=password;database=fso;"
21+
}
22+
}
23+
24+
Finally, install the fso tables and database scripts. There is a tool built into the server that automates this process. Never do this manually unless you know what you are doing. Run the following command:
25+
26+
dotnet exec FSO.Server.Core.dll db-init
27+
28+
The tool will show you the differences between your database and the expected structure. Press Y to install all the tables and scripts.
29+
30+
You can use this tool to update your database as new features are added. It will only apply the changes. In these cases you should backup your database first.
31+
32+
The server itself can be run with the following command
33+
34+
dotnet exec FSO.Server.Core.dll run
35+
36+
Note that there are a few other useful tools in there, such as import-nhood and restore-lots. You can find more information on these on the wiki.
37+
38+
## Configure api ##
39+
The API is a http web server which provides the following services:
40+
41+
1. Authentication - Consistent with Maxis protocol
42+
2. Shard (city) selection - Consistent with Maxis protocol
43+
3. User registration
44+
4. System administration
45+
46+
This API can be used with fso and with the original tso game (with host file entries and after trusting a self signed CA).
47+
48+
### SSL configuration for the server (currently disabled) ###
49+
Ingame communications are currently done entirely in plaintext, so the following information is outdated. The game server will run correctly with However, if you would like to revive the SSL mode, you should use the below information to help set it all up.
50+
51+
Note that this does *NOT* mean that you should run the API server on plain HTTP - the current recommended method is to use a nginx or IIS reverse proxy with letsencrypt, which is the easiest way to
52+
53+
#### SSL with self signed certificates (Windows) ####
54+
This approach is the easiest for development and has a side benefit of allowing the original TSO game client to connect to this API (with host file entries). NOTE: This wont work for other people unless they install your certificates into their trust stores.
55+
56+
First you will need to make sure you have the makecert command. It is available in the Visual Studio command prompt.
57+
58+
Next you need to create a self signed certificate authority cert. Below is an example command you can run:
59+
60+
makecert -r -pe -n "CN=My Root Authority" -ss CA -sr CurrentUser -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer
61+
62+
This should produce two files, CA.cer and CA.pvk.
63+
64+
Next, you need to issue the certificate itself. For compatibility with the original TSO game use a CN value of auth.east.ea.com.
65+
66+
makecert -pe -n "CN=auth.east.ea.com" -a sha1 -sky Exchange ^
67+
-eku 1.3.6.1.5.5.7.3.1 -ic CA.cer -iv CA.pvk ^
68+
-sp "Microsoft RSA SChannel Cryptographic Provider" ^
69+
-sy 12 -sv auth.east.ea.com.pvk auth.east.ea.com.cer
70+
71+
Convert the certificate into a pfx file.
72+
73+
pvk2pfx -pvk auth.east.ea.com.pvk -spc auth.east.ea.com.cer -pfx auth.east.ea.com.pfx
74+
75+
Install the CA.cer into your trusted root certificate authorities.
76+
77+
1. Double click on CA.cer
78+
2. Click Install certificate
79+
3. Click Next
80+
4. Choose "Place all certificates in the following store". Browse and select "Trusted Root Certificate Authorities".
81+
82+
Install auth.east.ea.com.pfx onto your PC
83+
84+
1. Run mmc.exe
85+
2. Go to File => Add / Remove snap in. Add the Certificates snap in choosing Computer Account.
86+
3. Navigate to Personal / Certificates.
87+
4. Right click on the Certificates folder in the tree and run All Tasks => Import.
88+
5. Follow the wizard to import your pfx file (it may not have a password).
89+
90+
Configure windows to use this certificate on port 443 for fso server.
91+
92+
1. Get the thumbprint of the certificate you just generated. Instructions can be found [here](https://msdn.microsoft.com/en-us/library/ms734695(v=vs.110).aspx). When you copy the value paste ti into notepad, press home and press delete twice and reenter the first character. The certificate GUI tool adds non-printable characters which break the next step.
93+
2. Run the command below, replacing the certhash with your hash. The app id refers to the Assembly id found in AssemblyInfo.cs in FSO.server. You do not need to change this.
94+
95+
Example command:
96+
97+
netsh http add sslcert ipport=0.0.0.0:443 certhash=c28d66a5d109e9a44afe47cd3d529d9a87ee7a75 appid={8f125201-fdf0-4a13-886f-19662707d34d}
98+
99+
You should now be able to update your config.json so the API has the following bindings:
100+
101+
"bindings": ["https://*:443/"],
102+
103+
Finally, add a host file entry for auth.east.ea.com pointing to 127.0.0.1.
104+
105+
#### SSL with real certificates (Windows) ####
106+
Install your certificate into the computer's personal certificates.
107+
108+
1. Run mmc.exe
109+
2. Go to File => Add / Remove snap in. Add the Certificates snap in choosing Computer Account.
110+
3. Navigate to Personal / Certificates.
111+
4. Right click on the Certificates folder in the tree and run All Tasks => Import.
112+
5. Follow the wizard to import your pfx file (it may not have a password).
113+
114+
Configure windows to use this certificate on port 443 for fso server.
115+
116+
1. Get the thumbprint of the certificate you just generated. Instructions can be found [here](https://msdn.microsoft.com/en-us/library/ms734695(v=vs.110).aspx). When you copy the value paste it into notepad, press home and press delete twice and reenter the first character. The certificate GUI tool adds non-printable characters which break the next step.
117+
2. Run the command below, replacing the certhash with your hash. The app id refers to the Assembly id found in AssemblyInfo.cs in FSO.server. You do not need to change this.
118+
119+
Example command:
120+
121+
netsh http add sslcert ipport=0.0.0.0:443 certhash=c28d66a5d109e9a44afe47cd3d529d9a87ee7a75 appid={8f125201-fdf0-4a13-886f-19662707d34d}
122+
123+
You should now be able to update your config.json so the API has the following bindings:
124+
125+
"bindings": ["https://*:443/"],
126+
127+
128+
If you want to use this setup with the original TSO game you will need to update the config files within TSO to repoint them.
129+
130+
Update TSOClient\sys\gameentry.ini so that Server=yourserver.com
131+
132+
Also update TSOClient\sys\cityselector.ini so that ServerName = yourserver.com
133+
134+
#### SSL with letsencrypt.org ####
135+
TODO
136+
137+
### HTTP only ###
138+
Running in a HTTP only mode as your main endpoint is strongly discouraged. However there are circumstances where this is valid and thus it is a supported option.
139+
140+
Specifically, you can put another tool such as NGINX, IIS or an Amazon Load Balancer in front of the API to handle SSL. In these cases the tool in front would provide SSL and make HTTP requests to the API. For the first two, there are many methods to set up free letsencrypt certificates with periodic renewals.
141+
142+
For this configuration, set the API bindings to something like this:
143+
144+
"bindings": ["http://*:8080/"],

TSOClient/FSO.Server/FSO.Server.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{8F125201-FDF0-4A13-886F-19662707D34D}</ProjectGuid>
8-
<OutputType>Exe</OutputType>
8+
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>FSO.Server</RootNamespace>
1111
<AssemblyName>server</AssemblyName>
@@ -66,6 +66,9 @@
6666
<PropertyGroup>
6767
<RunPostBuildEvent>Always</RunPostBuildEvent>
6868
</PropertyGroup>
69+
<PropertyGroup>
70+
<StartupObject />
71+
</PropertyGroup>
6972
<ItemGroup>
7073
<Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
7174
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>

TSOClient/FSO.Server/README.md

+3-131
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,5 @@
1-
# Getting started #
2-
## Prerequisites ##
3-
1. MySQL database server
4-
2. .NET or Mono runtime
1+
# Migration Note #
52

6-
## Configure database ##
7-
Create a database within your MySQL server. You can use an existing database (tables are namespaced) but making a new one is recommended.
3+
Please see FSO.Server.Core for the full information on how to run the server.
84

9-
CREATE DATABASE `fso`
10-
11-
Create a user on the database server with full access to the new database. Make sure you change the password for a production system.
12-
13-
CREATE USER 'fsoserver'@'localhost' IDENTIFIED BY 'password';
14-
GRANT ALL PRIVILEGES ON fso.* TO 'fsoserver'@'localhost';
15-
16-
Setup config.json to connect to the new database. It should look something like this (with your updated password).
17-
18-
{
19-
"database": {
20-
"connectionString": "server=127.0.0.1;uid=fsoserver;pwd=password;database=fso;"
21-
}
22-
}
23-
24-
Finally, install the fso tables and database scripts. There is a tool built into the server that automates this process. Never do this manually unless you know what you are doing. Run the following command:
25-
26-
server.exe db-init
27-
28-
The tool will show you the differences between your database and the expected structure. Press Y to install all the tables and scripts.
29-
30-
You can use this tool to update your database as new features are added. It will only apply the changes. In these cases you should backup your database first.
31-
32-
## Configure api ##
33-
The API is a http web server which provides the following services:
34-
35-
1. Authentication - Consistent with Maxis protocol
36-
2. Shard (city) selection - Consistent with Maxis protocol
37-
3. User registration
38-
4. System administration
39-
40-
This API can be used with fso and with the original tso game (with host file entries and after trusting a self signed CA).
41-
42-
### SSL with self signed certificates (Windows) ###
43-
This approach is the easiest for development and has a side benefit of allowing the original TSO game client to connect to this API (with host file entries). NOTE: This wont work for other people unless they install your certificates into their trust stores.
44-
45-
First you will need to make sure you have the makecert command. It is available in the Visual Studio command prompt.
46-
47-
Next you need to create a self signed certificate authority cert. Below is an example command you can run:
48-
49-
makecert -r -pe -n "CN=My Root Authority" -ss CA -sr CurrentUser -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer
50-
51-
This should produce two files, CA.cer and CA.pvk.
52-
53-
Next, you need to issue the certificate itself. For compatibility with the original TSO game use a CN value of auth.east.ea.com.
54-
55-
makecert -pe -n "CN=auth.east.ea.com" -a sha1 -sky Exchange ^
56-
-eku 1.3.6.1.5.5.7.3.1 -ic CA.cer -iv CA.pvk ^
57-
-sp "Microsoft RSA SChannel Cryptographic Provider" ^
58-
-sy 12 -sv auth.east.ea.com.pvk auth.east.ea.com.cer
59-
60-
Convert the certificate into a pfx file.
61-
62-
pvk2pfx -pvk auth.east.ea.com.pvk -spc auth.east.ea.com.cer -pfx auth.east.ea.com.pfx
63-
64-
Install the CA.cer into your trusted root certificate authorities.
65-
66-
1. Double click on CA.cer
67-
2. Click Install certificate
68-
3. Click Next
69-
4. Choose "Place all certificates in the following store". Browse and select "Trusted Root Certificate Authorities".
70-
71-
Install auth.east.ea.com.pfx onto your PC
72-
73-
1. Run mmc.exe
74-
2. Go to File => Add / Remove snap in. Add the Certificates snap in choosing Computer Account.
75-
3. Navigate to Personal / Certificates.
76-
4. Right click on the Certificates folder in the tree and run All Tasks => Import.
77-
5. Follow the wizard to import your pfx file (it may not have a password).
78-
79-
Configure windows to use this certificate on port 443 for fso server.
80-
81-
1. Get the thumbprint of the certificate you just generated. Instructions can be found [here](https://msdn.microsoft.com/en-us/library/ms734695(v=vs.110).aspx). When you copy the value paste ti into notepad, press home and press delete twice and reenter the first character. The certificate GUI tool adds non-printable characters which break the next step.
82-
2. Run the command below, replacing the certhash with your hash. The app id refers to the Assembly id found in AssemblyInfo.cs in FSO.server. You do not need to change this.
83-
84-
Example command:
85-
86-
netsh http add sslcert ipport=0.0.0.0:443 certhash=c28d66a5d109e9a44afe47cd3d529d9a87ee7a75 appid={8f125201-fdf0-4a13-886f-19662707d34d}
87-
88-
You should now be able to update your config.json so the API has the following bindings:
89-
90-
"bindings": ["https://*:443/"],
91-
92-
Finally, add a host file entry for auth.east.ea.com pointing to 127.0.0.1.
93-
94-
### SSL with real certificates (Windows) ###
95-
Install your certificate into the computer's personal certificates.
96-
97-
1. Run mmc.exe
98-
2. Go to File => Add / Remove snap in. Add the Certificates snap in choosing Computer Account.
99-
3. Navigate to Personal / Certificates.
100-
4. Right click on the Certificates folder in the tree and run All Tasks => Import.
101-
5. Follow the wizard to import your pfx file (it may not have a password).
102-
103-
Configure windows to use this certificate on port 443 for fso server.
104-
105-
1. Get the thumbprint of the certificate you just generated. Instructions can be found [here](https://msdn.microsoft.com/en-us/library/ms734695(v=vs.110).aspx). When you copy the value paste ti into notepad, press home and press delete twice and reenter the first character. The certificate GUI tool adds non-printable characters which break the next step.
106-
2. Run the command below, replacing the certhash with your hash. The app id refers to the Assembly id found in AssemblyInfo.cs in FSO.server. You do not need to change this.
107-
108-
Example command:
109-
110-
netsh http add sslcert ipport=0.0.0.0:443 certhash=c28d66a5d109e9a44afe47cd3d529d9a87ee7a75 appid={8f125201-fdf0-4a13-886f-19662707d34d}
111-
112-
You should now be able to update your config.json so the API has the following bindings:
113-
114-
"bindings": ["https://*:443/"],
115-
116-
117-
If you want to use this setup with the original TSO game you will need to update the config files within TSO to repoint them.
118-
119-
Update TSOClient\sys\gameentry.ini so that Server=yourserver.com
120-
121-
Also update TSOClient\sys\cityselector.ini so that ServerName = yourserver.com
122-
123-
### SSL with letsencrypt.org ###
124-
The service is not live yet. However, when it is live this will be the easiest way for people to setup their servers.
125-
126-
### HTTP only ###
127-
Running in a HTTP only mode is strongly discouraged. However there are circumstances where this is valid and thus it is a supported option.
128-
129-
Specifically, you can put another tool such as NGINX or an Amazon Load Balancer in front of the API to handle SSL. In these cases the tool in front would provide SSL and make HTTP requests to the API.
130-
131-
For this configuration, set the API bindings to something like this:
132-
133-
"bindings": ["http://*:8080/"],
5+
The server software is currently being migrated to run on .NET Core. Due to framework version restrictions (and target OS support), most projects are still in .NET framework, including the majority of the server. In future, shared projects will use .NET Standard and will be easily shared between the .NET Framework client project and .NET Core server, but that day is not today.

TSOClient/FSOFacadeWorker/FacadeConfig.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class FacadeConfig
1111
public string Api_Url;
1212
public string User;
1313
public string Password;
14+
public string Game_Path;
1415
public int Limit = 2000;
1516
public int Sleep_Time = 30000;
1617
}

TSOClient/FSOFacadeWorker/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void Main(string[] args)
7979
GameThread.NoGame = true;
8080
GameThread.UpdateExecuting = true;
8181

82-
var path = gameLocator.FindTheSimsOnline();
82+
var path = Config.Game_Path ?? gameLocator.FindTheSimsOnline();
8383

8484
if (path != null)
8585
{

0 commit comments

Comments
 (0)