Fishing Simulator II - online match server
|The online match server has been
updated to make it more tolerant to network problems that
may occur, which are out of the control of fishsim. This
still though doesn't mean that it is guaranteed to work
reliably on the Internet, as there are so many external
factors involved. In tests though it has proved to be
very stable and reliable.
When you first use the new online server, your intial reaction may be that a lot of the features have gone, where in fact, the new server has most of the features of the old server, plus a lot more as well. The features that have been removed were never, if ever used. It is now a lot simpler to run online fishing sessions with the new server, it's just a case of click the icon and go. To run organised matches though, does, like the old server require some setting up. These instructions below explain this set up.
|The Server.ini file|
|With the new server comes a file
in the INF folder of fishsim 2 called server.ini.
This contains settings that are loaded by the
server when it is run. The default server.ini file is
shown below :
It contains two main sections [Server] and [Match] with a collection of settings in each section, both of these sections and settings are explained below : There are also more optional sections which are used in conjunction with different values in the match section.
|Maxcon : The
value of this setting ( default is 20 ), indicates how
many anglers at most you will allow to be fishing on the
server at any one time. The maximum value you can set
this to is 100, but high amounts of anglers like this
should definately be only used on local networks. This
value doesn't indicate that a maximum of 20 anglers, for
example, can compete in a match, it means that there can
only be 20 anglers connected to the server at any one
point in time. The maximum number of anglers that can
compete in an online match is fixed at 200. Anglers can
leave and return to matches at any time, so even though
only, say 20 can be connected at one time, it is possible
to have more anglers competing in a match.
Trace : This is a debug feature that can be used to detect and trace any problems that may occur. It should be left at the default setting of 0 unless advised otherwise.
Sleep : The sleep setting should be left at the default value of 20. An explanation, would be meaningless of this setting, however if you are running the server on the same computer as fishsim 2 at the same time and notice that fishsim 2 slows slightly ( probably only on very slow computers ) then this value can be increased to say 30.
Increcs : This setting can be used to set whether or not client anglers can view your clubs all time records or not on there screens. It has a default setting of 0, which means they will not be able to view the club records. The reason why the default is set to off is because this feature generates a lot of traffic and can clog and slow the server down if used a lot by client anglers. On a local area network this is okay as they are fast, but on the Internet, it should be left off as transfer rates are slow. To turn it on, set the value of this setting to 1.
Sendwait : This value should be left at the default of 1000, unless advised otherwise.
Disconwait : This value should be left at the default of 0, unless advised otherwise.
Savestatus : As the server is running, the match and record catch state is periodically saved, just in case of a computer crash or power failure. This means that in the event of a crash or power failure the match results and records can be recovered. The default value for this setting is 20000 milliseconds ( 20 seconds ), this means that every 20 seconds the state of the match and record catches will be saved. It should be left at this default value though.
Eventson : This setting can be used to allow anglers to see and hear other anglers events if they are fishing on the same peg. Typical events, are casts, groundbait and loosefeed. If this setting is set to the default of 1809, anglers will see each others events as they happen. A setting of 0 turns this feature off. It is advisable to have this setting turned off, if fishing matches with a lot of anglers or where for example, fly fishing is going to be the most used tactic, as it generates a lot of network traffic.
Updatetime : Every so often, all anglers in the match can be sent updates on how they are getting on, this setting sets if they will get these updates, and if so how often they will get them. If it is set to 0, then the anglers will not recieve any updates. If it is set to any other value, then they will be sent updates after every minute indicated by this value. The default is 5, which means that after every five minutes of fishing, anglers will get an update.
Alltimehtm : This setting determines whether or not a records.htm file will be produced when the server is stopped. The default setting is 1, which means a records.htm file will be generated in the HTML folder of fishsim 2. A setting of 0 means that it won't. The records.htm file can be uploaded to a web-site, if you have one, to display your club records.
Venrechtm : This setting is the same as the setting above, apart from a records.htm file will be generated for venue records. The records.htm file will be produced in the VENUES folder of FS2. For example, the river lot club records will be stored in the records.htm file in the VENUES/LOT folder of FS2.
Members : This setting can be set to either 0 or 1. By default it is set to 1, which means that the server will keep a track of members personal records and catches. It will also monitor how long each member has fished on the server for in all sessions. Note though, that members should have names made up of letter and number characters only for there information to be stored, if there names contain any other characters, the informatioin won't be logged for them.
Filereq : This line is optional and the default value if the line isn't included is 0. It is not advised to set this value to anything other than 0 unless guided otherwise. A setting of 1 will allow anyone connected to your server to download any file from your PC. While it may seem mad to enable this, it can be useful in certain situations, for example, if an angler is missing a fishsim file that is required, instead of going to the trouble of downloading and importing, the angler can take the file straight off the server PC. Only small file transfers are recommended, and this feature is not guaranteed to work, nor has been tested extensively, therefore it is strictly used at own risk. For an angler to recieve a file, they type a message .file filename where the file name corresponds to the relative path and file from the servers FS2 folder. Eg, .file species/ruffe.sp will transfer the Ruffe species file from the server computer to the client ( note : in this case the client will still have to restart FS for the species to be recognised ). This feature can also be useful in debugging problems.
Txtres : This setting will force the server to generate a formatted text file for the match results as well as the htm file automatically produced. This text file can then be parsed by external result decoder programs to automatically produce the results output or update league tables. The text files produced will be named exactly the same as the corresponding htm files, apart from have a txt extension. To enable this, add the line Txtres = 1 to the [Server] section of the server.ini file. There is more information at the end of this document on the format of the text file for developers wishing to write code to parse these files.
Welcome : This line can be included to instruct the server to send out a single line specified welcome message to each angler joining the server. You may want to use this out of courtesy, to provide info on the purpose of the server, or even supply a tip of the day. It is advised that this message is kept as short as possible so that it will fit onto a single displayed line on the FS2 screens, without running out of the edges. You can include smilie codes in the welcome message, and if the line is left out no message will be sent to joining anglers. Please remember your possible audience when setting this up, and that in particular it may include minors.
|Duration : This
setting sets the duration of the match or session in
minutes. The default setting is 0 minutes, which means
the session will run forever, until the server is stopped
by the operator. If a value other than 0 is used, this
doesn't mean that the server will stop after this period,
just that any fish caught by anglers fishing longer than
this period will not be counted in there final total. As
the period expires for the angler, they will be informed
by the server at some point after, that all fish caught
will not be counted and they will now be
"funfishing". Fish caught will still be counted
in the records though, just not in the final results
total. If anglers leave the server and come back, or the
server operator loses the internet connection, this won't
matter as the time fished by each angler will be
remembered when they or the server resumes. Any angler in
the match can find out how long they have been fishing,
by sending the .t ( dot followed by 't'
) message. The server will then respond with how many
minutes and seconds the angler has been fishing for so
far. This arrangement means that all anglers do not have
to congregate at the start of the match. A match server
for a match lasting for an hour can be run for three
hours for example, and anglers then will have the
flexibility to fish an hours worth in that time.
Pegmode : This can be set at one of three settings ( 0, 1, 2 or 3 ), and it determines how much control the angler has in selecting the peg (s)he is going to be fishing from. The default is a setting of 2, which means that the connecting angler will be able to choose the venue and peg (s)he is going to be fishing. If this is set to a value of 0 then the server will give all anglers connected the same venue and peg to fish ( see later ). If this value is set to 1 then the server will only set the venue ( see later ) and allocate out pegs on that venue at random to arriving anglers. There is more on this later, below. A setting of 3 has been added, where it is exactly the same as a funfish ( setting 2 ), but only catches on any peg on the specified venue (below) will count towards the weight, any catches on a different venue will be disqualified ( "nabbed by the balif" ). Anglers joining the server must select the correct venue in FS2 before joining the server, the server will not set this automatically.
Venue and peg : These settings can be used to set the venue and peg that anglers will fish from in a match. If the pegmode setting above is set to 2 ( anglers free choice of venue and peg ), then these two settings are not used. If the pegmode setting is set to 0 ( venue and peg set by the server ), then both of these settings are used. If the pegmode setting is set to 1 ( server selects venue ), then only the venue setting is used. The venue setting must be set to a venue reference, not the venue name, this applies to the peg setting as well. There is a file generated by the server in the INF folder, called venues.txt which contains all the installed venue references as well as each associated peg reference number ( for example, the river lot, peg 2 is : venue ref = LOT, peg ref = 4 ). There is a section below dedicated to how to organise matches on venues and pegs.
Timemode : This setting determines what time of year and day each angler connecting to the server will fish. The default is 1, which means that the connecting anglers will have a free choice of the date and time they will be fishing ( whatever is set in fishsim 2 for them ). If this is set to a value of 0, then the server sets the date and time for all connecting anglers. If this is set to a value of 2, then all anglers will be fishing the real date and time ( as set on the server PC, not there own clients PC's ). There is more on the timemode setting below :
Year, month, day, hour and min : These settings are only used if the timemode setting above is set to 0 ( server sets date and time ), and are used to determine the date and time that all anglers will fish. They don't require a lot of explanation, apart from the server uses a 24 hour clock, so for example, 4:15 pm would be set to, hour = 16, min = 15. To set a match up where all anglers will fish at midday on the 21st of may 2002, you would use the following settings :
If the server has been running for 5 minutes with these settings above, and an angler joins, they will be fishing at 12:05, this doesn't mean they've lost 5 mins fishing though, as the duration they are connected is calculated seperately to ensure that all anglers fish the same amount of time.
Tworods : This can be set to either 0 or 1. If it is set to 1 ( default ), fish caught on the second rod will be counted in the final total. If this is set to 0, then only fish caught on the first rod ( ie. the rod which can be used for all styles of fishing ), will count. If a fish is caught on the second rod in a one rod only match, it will be 'nabbed by the balif' automatically, it's not a crime to fish with tworods in a single rod match though, it may make it more fun, especially on realistic venues.
Float, ledger, fly and lure : These setting can be set to either 0 or 1 to disable or enable these particular styles of fishing. If a client angler catches a fish on a style that is not permitted, it will not count towards the final result and be nabbed by the balif automatically.
Results : This setting can be set to either 0 or 1. By default it is set to 1, which means connected anglers will be able to view the results of other anglers currently connected on the results page in the clubhouse on FS2. On this server, it will not matter, where it's a match or fun fish, if the setting is set to 1, then client anglers will be able to view other anglers results.
Sessiontime : The server can operate in two modes to set the time of day the anglers fish. These settings are represented by a value of 0 and 1 here. With a value of 0, the time each angler joins a match will be relative to how long the server has been running for. EG, if the match time is set by the server to be 13:00 (1pm) and an angler joins the server 30 minutes after the server was started, they will start fishing at 13:30 (1-30pm). Note : This is only true if the venue hasn't got a time increase mulitplier set for it, in which case, the offset in time can be calculated by multiplying the time the server has been running by the time multiplier. With a setting of 0, each angler will still recieve the same amount of time ( set by match duration ), even though starting at different times. With a setting of 1 ( default ), all anglers joining the server will always join the match at the time specified by the server, irrespective of how long the server has been running for. Note, that this even applies, if an angler leaves a server and rejoins, so match organisers with this setting should be weary of this being used to gain an advantage. The trace file produced by the server and a broadcast message will show up anglers, leaving via the clubhouse, and also anglers leaving because of connection problems. It is not possible to have a session where the amount of time an angler has already fished is added to the start time yet.
Usevalfish : Some matches may want to be run where only certain species are fish are considered "valid" catches, all other species will not count towards each anglers final totals ( they will stand for records still though ). This is now possible with this and future versions of the network server, by setting this this value to 1. This will instruct the server to look for a [Valfish] section in the server.ini file to find the species that are considered valid catches. The valfish section can only be used to specify valid fish species, it can't be used to specify invalid fish. The reference names of the valid species are listed as variables in this section with a value of 1. If a species isn't listed, then it will be considered invalid. To get a list of loaded fish species reference names, create a folder in FS2 called cgi then run the server, a species.txt file will be created containing a list of all the loaded species, and there associated reference names.
Usevalbait : As well as valid species, match organiser may also want to restrict the baits that are used in a match. This can be achieved by setting this value to 1 to force the server to look for a [Valbait] section in the server.ini file to get a list of valid baits. Like the valfish section, the valbait section can only be used to specify valid baits that can be used. The variable names have to be named B1, B2, B3 and so on, in order ( no gaps ), the values of these variables have to be set to the reference name of valid baits, any baits not listed are classed as illegal baits. Note, it is easy enough to change the bait file refrences in FS, but this can be checked in each anglers wsock.txt files, as now a validation code for the bait is included with every catch, this should match everyones.
Showcatches : With this value set, other anglers in a match will be able to see the size of each others fish that are caught. The default setting of 0 blocks this for matches, instead just showing the species caught.
Showbaitchange : If this value is set to 1 anglers connected to a server will be able to see the baits that other anglers are changing to. As each angler changes there bait they will send out a message to everyone informing them of what bait they are changing to.
Usemembers : This value can be set to 1 to restrict servers to just a subset of members, or actively block members. It will instruct the server to look for a [Members] section in the server.ini file to perform a name check on arriving members. Any members names that do not conform to the criteria and join the server, will be disconnected from the server automatically on arrival. The [Members] section can be used to list a set of members names to allow onto the server, or not allow on or both as the case may be. Simply list the members name with a value of 0 to disallow a member on to the server, or 1 to allow a member on. Eg Jase = 1 will allow anyone joining the server with the name "Jase" onto the server. It is impossible to know every member or list every possible member in certain situations, so you can use the "_others_" variable to set a rule for any members name not listed. Eg if the lines :
This will only allow people with the name "Jase" to join the server, everyone else will be disconnected from the server on arrival.
|Setting up a match - two examples|
|This section describes how you
would go about setting up an organised match using the
server. The match will last for 1 hour 30 minutes, and
will take place on the serpentine venue. Anglers pegs
will be chosen at random by the server. The match will
take place on the 16th June 2002 and start at 10 am. Only
float fishing and ledgering will be allowed on one rod,
and anglers won't be able to see each others results. All
the settings changed from the default are in bold
The following match setup also takes place on the serpentine, but this time, all anglers will fish from the same peg ( peg three ) and will fish real time. The differences from the settings above will be marked in bold ( note that the serp reference name and the peg code 10 has been obtained from the venues.txt file in the INF folder of FS2.
|Notes on running servers|
|There is quite a bit more to the
server than what is on this page, and this section
describes some helpful tips and notes on running servers
1) After the first time you run the server, you will be asked a question when it first runs, "whether or not you want to start a new session or resume a previous one". If it is a new match that is being run, then click the yes button. If you are continuing a match in another session, for example, you may have lost your internet connection, then restart the server and click the No button when asked to start a new session. Doing this will force the server to load the state of the match, so that it can be resumed where it left off. More than likely though, you will have been allocated a different IP address by your ISP when re-connected, so it's important to notify anglers of this new IP address.
2) You must have a network connection before starting the server. If you are running the server on a LAN, then you will always have this, if you're only network is the Internet, then you must connect to the Internet before starting the server. The IP address displayed on the server may not necessarily be you Internet IP address, it may be the IP address of your local area network. In your windows folder you should have a program called winipcfg.exe, this program can be used to find out the IP addresse's of both your local network and the Internet IP, if connected.
3) After the server is stopped ( by clicking the close cross at the top right of the window ), a file will be generated in the HTML folder of fishsim 2. This file will be in the form, res0.htm, res1.htm, res2.htm etc.. Each time the server is stopped and there has been at least one client joining the server a results htm file is generated. After a while these files will build up, it is your responsibility to delete the ones which are no longer required. These files can be uploaded to a web site to display results or viewed with MS Internet Explorer or any other browser software. If for example you lose your Internet connection while running a server, when you close the server, it will generate a RESx.htm file for the results to that point automatically. If when you restart the server and choose No to resume the match, the next time the server is ended another res htm file will be generated, which will contain the final match results. Do not manually add the two results files up, the second one generated will contain the results of the first automatically.
4) The settings in the server.ini file are loaded when the server starts, changing them whilst the server is running will have no effect at all, for the changes to take place, the server should be restarted. NOTE : Some settings may now be changed while the server is running, pressing the R key on the keyboard will reload them, a beep will be heard when the settings are reloaded. Most of the settings though will only affect anglers who join the session, the anglers already connected and fishing, for most part will see no change until they rejoin.
5) With this new server clients can retreive individual all time club records as well as club venue records. Whilst a client is fishing, (s)he can send a message, for example, .rec tench , the server will then respond with the all time tench record to the client. It isn't necessary to enter the full name of the fish, just the first few characters in some examples. For example, the message .rec cruc will return the all time crucian carp record. There is a similar arrangement for club venue records also, if a client types .vr tench this will return the club record for the tench on the venue that (s)he is fishing. The same rules apply with naming, the full name isn't required, just the first few unique characters. You can also find out about the numbers of a species caught and average size, by typing .rav carp for example, to get the number of carp caught on all venues, and the average size. To get the same information for the venue you are fishing enter .vav carp. These are just a few common ones, a full list is shown below, and they are added to all the time :
|Client control code summary for messages|
|.t = will report
back to the client the time (s)he has been fishing in the
current session, and if it is a timed match, will also
display the time remaining.
.n = will display a "Nice one" catch acknowledgement to all anglers.
.. = will display a "brb .. fish on" message to all anglers.
.u = will send the client angler session update information.
.c = will broadcast a message to everyone connected, informing of the checksum for the peg, this can be used for cross checking.
.ty = will broadcast a thank you message
.ct = will display the amount of time the angler has been fishing on the club server, note the club server must have the members = 1 line in the [Server] section in the server.ini file
.ms = will display member stats, containing information about all sessions they have fished on the club server ( eg total number of fish caught, average size, and the biggest fish the member has ever caught ), note the club server must have the members = 1 line in the [Server] section in the server.ini file.
.rec fish name = will display the all time club record for the fish species specified, note that the full fish species name doesn't have to be entered, eg ten could be entered for tench.
.rav fish name = will display average all time catch stats for the passed fish species.
.vr fish name = will display the venue record for the entered fish species for the venue that is currently being fished by the client
.vav fish name = will display the average venue catch stats for the passed fish species on the venue the client is currently fishing.
.mr fish name = will display the members personal club record and where it was caught for the passed fish species.note the club server must have the members = 1 line in the [Server] section in the server.ini file.
.mav fish name = will display the members personal average catch stats for the fish species specified.note the club server must have the members = 1 line in the [Server] section in the server.ini file.
|Format of produced results txt files|
|This information is only intended
for developers of programs to parse the text results
files produced by this server, reading is not essential
for any other purpose.
Each text file will contain 3 sections, a Fileheader section, a match header section and a results section for each anglers results. The file header section will always contain 4 lines, the number of lines in the other sections may vary in future, but how many each has is specified in the fileheader lines. The file names of the produce txt files will be the same as the htm filenames, apart from with a txt extension. To get the server ( fsserv.exe ) to generate the txt files, the line :
Txtres = 1
Should be added to the [Server] section of the server.ini file, and appropriate version of the fsserv.exe should be used.
(FILE HEADER BLOCK)
FILE VALIDATION CHECK
FIELDS IN THE MATCH HEADER SECTION
FIELDS PER RESULT
NUMBER OF ANGLERS RESULTS
(MATCH HEADER BLOCK)
ACTUAL DATE AND TIME
MATCH DATE AND TIME
TOTAL NUMBER OF FISH CAUGHT IN THE MATCH
TOTAL WEIGHT CAUGHT IN THE MATCH (DRAMS)
TOTAL WEIGHT CAUGHT IN THE MATCH (STRING)
BIGGEST FISH WEIGHT, SPECIES AND ANGLER.
BIGGEST FISH ANGLER NAME
NOTE : These will always be displayed in correct position order.
AVERAGE CATCH SIZE (DRAMS)
AVERAGE CATCH SIZE (STRING)
TOTAL WEIGHT (DRAMS)
TOTAL WEIGHT (STRING)
BIGGEST FISH WEIGHT (DRAMS)
BIGGEST FISH WEIGHT SPECIES NAME
BIGGEST FISH (STRING)
Descriptions in brief
Please excuse any possible grammar and spelling errors