Skip to content

Commit

Permalink
changes to allow running the code with Node tools for VisualStudio
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatH0r committed Aug 13, 2016
1 parent 0774301 commit 9d4145f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ XonStat.egg-info/
feeder/temp/
qlstats.ini
feeder/mycfg.json
feeder/_ReSharper.Caches
3 changes: 3 additions & 0 deletions feeder/feeder.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ sample-data\combined_stats_duel.json
<Content Include="sample-data\player_stats.json" />
<Content Include="sample-data\player_switchteam.json" />
<Content Include="sample-data\round_over.json" />
<Content Include="views\account.ejs" />
<Content Include="views\login.ejs" />
<TypeScriptCompile Include="typings\express\express.d.ts" />
<TypeScriptCompile Include="typings\graceful-fs\graceful-fs.d.ts" />
<TypeScriptCompile Include="typings\log4js\log4js.d.ts" />
Expand Down Expand Up @@ -115,6 +117,7 @@ sample-data\combined_stats_duel.json
<Folder Include="typings\pg" />
<Folder Include="typings\q" />
<Folder Include="typings\requirejs" />
<Folder Include="views\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
Expand Down
22 changes: 22 additions & 0 deletions feeder/feeder.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "feeder", "feeder.njsproj", "{E8A8D291-9163-4CDE-9AC1-B01E406DB719}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E8A8D291-9163-4CDE-9AC1-B01E406DB719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8A8D291-9163-4CDE-9AC1-B01E406DB719}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8A8D291-9163-4CDE-9AC1-B01E406DB719}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8A8D291-9163-4CDE-9AC1-B01E406DB719}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
10 changes: 5 additions & 5 deletions feeder/modules/gamerating.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const
var
fs = require("graceful-fs"),
pg = require("pg"),
zlib = require("zlib"),
Expand All @@ -9,10 +9,10 @@

// calculate a value for "c" so that an average RD value of 30 changes back to 350 when a player is inactive for 720 rating periods (=days)
// the default rating value must be kept in-sync with the value for the /elo API in player.py
const g2 = new glicko.Glicko({ rating: 1337, rd: 350, c: Math.sqrt((Math.pow(350, 2) - Math.pow(30, 2)) / 720) });
var g2 = new glicko.Glicko({ rating: 1337, rd: 350, c: Math.sqrt((Math.pow(350, 2) - Math.pow(30, 2)) / 720) });

// values for DB column games.g2_status
const
var
ERR_NOTRATEDYET = 0,
ERR_OK = 1,
ERR_ABORTED = 2,
Expand All @@ -26,7 +26,7 @@ const
ERR_UNRATED_SERVER = 10,
ERR_UNRATED_GAME = 11;

const rateEachSingleMatch = true;
var rateEachSingleMatch = true;
var _config;
var resetRating;
var updateDatabase;
Expand All @@ -45,7 +45,7 @@ exports.rateAllGames = rateAllGames;
exports.rateSingleGame = rateSingleGame;
exports.createGameTypeStrategy = createGameTypeStrategy;

const _logger = log4js.getLogger("gamerating");
var _logger = log4js.getLogger("gamerating");

function init() {
_config = JSON.parse(fs.readFileSync(__dirname + "/../cfg.json"));
Expand Down
4 changes: 2 additions & 2 deletions feeder/modules/geoip.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const
var
pg = require("pg"),
log4js = require("log4js"),
request = require("request"),
Expand All @@ -7,7 +7,7 @@
exports.fillAllServers = fillAllServers;
exports.fillServer = fillServer;

const _logger = log4js.getLogger("geoip");
var _logger = log4js.getLogger("geoip");

function fillAllServers(cli) {
return queryServers(cli)
Expand Down
4 changes: 2 additions & 2 deletions feeder/modules/webapi.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const
var
fs = require("graceful-fs"),
pg = require("pg"),
log4js = require("log4js"),
Expand All @@ -16,7 +16,7 @@ var DEBUG = false;
var _config;
var _logger = log4js.getLogger("webapi");

const GameTypes = { 0: "FFA", 1: "Duel", 2: "Race", 3: "TDM", 4: "CA", 5: "CTF", 6: "1Flag", 8: "Harv", 9: "FT", 10: "Dom", 11: "A&D", 12: "RR" };
var GameTypes = { 0: "FFA", 1: "Duel", 2: "Race", 3: "TDM", 4: "CA", 5: "CTF", 6: "1Flag", 8: "Harv", 9: "FT", 10: "Dom", 11: "A&D", 12: "RR" };

// interface for communication with the feeder.node.js module
var _feeder = {
Expand Down
4 changes: 2 additions & 2 deletions feeder/recalc-glicko.node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const
var
log4js = require("log4js"),
Q = require("q"),
rating = require("./modules/gamerating");

const _logger = log4js.getLogger("rating");
var _logger = log4js.getLogger("rating");

var options = {
full: { resetRating: true, updateDatabase: true, onlyProcessMatchesBefore: null, printResult: false },
Expand Down
2 changes: 1 addition & 1 deletion feeder/validate-glicko.node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const
var
pg = require("pg"),
fs = require("graceful-fs"),
log4js = require("log4js"),
Expand Down

0 comments on commit 9d4145f

Please sign in to comment.