forked from JJoriping/KKuTu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server with extremely simple features / publish web&game server&clien…
…t code
- Loading branch information
Showing
648 changed files
with
609,813 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
Client/node_modules | ||
Server/node_modules | ||
Server/run.bat | ||
Server/node_modules | ||
Server/lib/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ html | |
head | ||
title= locals.title | ||
body | ||
p Hello, World! | ||
p KKuTu Client is under construction... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This is an error log file of the game server. | ||
You may use like `tail -f KKUTU_ERROR.log` to watch this. | ||
:8496 [2017-02-14 18:45:19] ERROR: TypeError: Cannot read property 'getSurround' of undefined | ||
TypeError: Cannot read property 'getSurround' of undefined | ||
at D:\KKuTu\Server\lib\Game\kkutu.js:1197:22 | ||
at then (D:\KKuTu\Server\lib\sub\lizard.js:32:8) | ||
at my.roundEnd (D:\KKuTu\Server\lib\Game\kkutu.js:1191:19) | ||
at exports.roundReady (D:\KKuTu\Server\lib\Game\games\classic.js:129:6) | ||
at my.route.my.routeSync (D:\KKuTu\Server\lib\Game\kkutu.js:1306:13) | ||
at Timeout.my.roundReady (D:\KKuTu\Server\lib\Game\kkutu.js:1112:13) | ||
at ontimeout (timers.js:365:14) | ||
at tryOnTimeout (timers.js:237:5) | ||
at Timer.listOnTimeout (timers.js:207:5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var Cluster = require("cluster"); | ||
var Const = require('../const'); | ||
var JLog = require('../sub/jjlog'); | ||
var SID = Number(process.argv[2]); | ||
var CPU = Number(process.argv[3]); //require("os").cpus().length; | ||
|
||
if(isNaN(SID)){ | ||
if(process.argv[2] == "test"){ | ||
global.test = true; | ||
CPU = 1; | ||
}else{ | ||
console.log(`Invalid Server ID ${process.argv[2]}`); | ||
process.exit(1); | ||
} | ||
} | ||
if(isNaN(CPU)){ | ||
console.log(`Invalid CPU Number ${process.argv[3]}`); | ||
process.exit(1); | ||
} | ||
if(Cluster.isMaster){ | ||
var channels = {}, chan; | ||
var i; | ||
|
||
for(i=0; i<CPU; i++){ | ||
chan = i + 1; | ||
channels[chan] = Cluster.fork({ SERVER_NO_FORK: true, KKUTU_PORT: Const.MAIN_PORTS[SID] + 416 + i, CHANNEL: chan }); | ||
} | ||
Cluster.on('exit', function(w){ | ||
for(i in channels){ | ||
if(channels[i] == w){ | ||
chan = Number(i); | ||
break; | ||
} | ||
} | ||
JLog.error(`Worker @${chan} ${w.process.pid} died`); | ||
channels[chan] = Cluster.fork({ SERVER_NO_FORK: true, KKUTU_PORT: Const.MAIN_PORTS[SID] + 416 + (chan - 1), CHANNEL: chan }); | ||
}); | ||
process.env['KKUTU_PORT'] = Const.MAIN_PORTS[SID]; | ||
require("./master.js").init(SID.toString(), channels); | ||
}else{ | ||
require("./slave.js"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
var Const = require('../../const'); | ||
var Lizard = require('../../sub/lizard'); | ||
var DB; | ||
var DIC; | ||
var ROOM; | ||
|
||
exports.init = function(_DB, _DIC, _ROOM){ | ||
DB = _DB; | ||
DIC = _DIC; | ||
ROOM = _ROOM; | ||
}; | ||
exports.getTitle = function(){ | ||
var R = new Lizard.Tail(); | ||
var my = this; | ||
|
||
return R; | ||
}; | ||
exports.roundReady = function(){ | ||
var my = this; | ||
|
||
}; | ||
exports.turnStart = function(){ | ||
var my = this; | ||
|
||
}; | ||
exports.turnEnd = function(){ | ||
var my = this; | ||
|
||
}; | ||
exports.submit = function(client, text, data){ | ||
var my = this; | ||
|
||
}; | ||
exports.getScore = function(text, delay){ | ||
var my = this; | ||
|
||
|
||
|
||
return 0; | ||
}; |
Oops, something went wrong.