Commit 11abbb30 authored by 神楽坂玲奈's avatar 神楽坂玲奈

init

parents
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
config.json
#################
## JetBrains
#################
/.idea/
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
{
"ip": "112.124.4.110",
"port": 7911,
"version": 4896
}
\ No newline at end of file
{
"NETWORK": {
"29736": "SERVER_ID",
"57078": "CLIENT_ID"
},
"NETPLAYER": {
"0": "TYPE_PLAYER1",
"1": "TYPE_PLAYER2",
"2": "TYPE_PLAYER3",
"3": "TYPE_PLAYER4",
"4": "TYPE_PLAYER5",
"5": "TYPE_PLAYER6",
"7": "TYPE_OBSERVER"
},
"CTOS": {
"1": "RESPONSE",
"2": "UPDATE_DECK",
"3": "HAND_RESULT",
"4": "TP_RESULT",
"16": "PLAYER_INFO",
"17": "CREATE_GAME",
"18": "JOIN_GAME",
"19": "LEAVE_GAME",
"20": "SURRENDER",
"21": "TIME_CONFIRM",
"22": "CHAT",
"32": "HS_TODUELIST",
"33": "HS_TOOBSERVER",
"34": "HS_READY",
"35": "HS_NOTREADY",
"36": "HS_KICK",
"37": "HS_START"
},
"STOC": {
"1": "GAME_MSG",
"2": "ERROR_MSG",
"3": "SELECT_HAND",
"4": "SELECT_TP",
"5": "HAND_RESULT",
"6": "TP_RESULT",
"7": "CHANGE_SIDE",
"8": "WAITING_SIDE",
"17": "CREATE_GAME",
"18": "JOIN_GAME",
"19": "TYPE_CHANGE",
"20": "LEAVE_GAME",
"21": "DUEL_START",
"22": "DUEL_END",
"23": "REPLAY",
"24": "TIME_LIMIT",
"25": "CHAT",
"32": "HS_PLAYER_ENTER",
"33": "HS_PLAYER_CHANGE",
"34": "HS_WATCH_CHANGE"
},
"PLAYERCHANGE":{
"8": "OBSERVE",
"9": "READY",
"10": "NOTREADY",
"11": "LEAVE"
},
"ERRMSG": {
"1": "JOINERROR",
"2": "DECKERROR",
"3": "SIDEERROR",
"4": "VERERROR"
},
"MODE": {
"0": "SINGLE",
"1": "MATCH",
"2": "TAG"
}
}
{
"1": [
{"card": 55586621, "count": 10},
{"card": 6061630, "count": 1},
{"card": 423585, "count": 1},
{"card": 29088922, "count": 1},
{"card": 87608852, "count": 1},
{"card": 19613556, "count": 1},
{"card": 25123082, "count": 1},
{"card": 52105192, "count": 1},
{"card": 53129443, "count": 1},
{"card": 68663748, "count": 1},
{"card": 75500286, "count": 1},
{"card": 81439173, "count": 1},
{"card": 83764718, "count": 1},
{"card": 89739383, "count": 1},
{"card": 98645731, "count": 1},
{"card": 14087893, "count": 1},
{"card": 88616795, "count": 1},
{"card": 9622164, "count": 1},
{"card": 52628687, "count": 1},
{"card": 67775894, "count": 1},
{"card": 33981008, "count": 1},
{"card": 97077563, "count": 1},
{"card": 1992816, "count": 1},
{"card": 64332231, "count": 1},
{"card": 91949988, "count": 1},
{"card": 10000030, "count": 1},
{"card": 29669359, "count": 1},
{"card": 770365, "count": 1},
{"card": 39987164, "count": 1},
{"card": 56840427, "count": 1},
{"card": 84013237, "count": 1},
{"card": 54719828, "count": 1},
{"card": 51735257, "count": 1},
{"card": 37926346, "count": 1},
{"card": 25341652, "count": 1},
{"card": 34086406, "count": 1},
{"card": 12014404, "count": 1}
],
"2": [
{"card": 4392470, "count": 10},
{"card": 40200834, "count": 1},
{"card": 69780745, "count": 1},
{"card": 10538007, "count": 1},
{"card": 82293134, "count": 1},
{"card": 20546916, "count": 1},
{"card": 33951077, "count": 1},
{"card": 89631139, "count": 1},
{"card": 95788410, "count": 1},
{"card": 39111158, "count": 1},
{"card": 42129512, "count": 1},
{"card": 74677424, "count": 1},
{"card": 47660516, "count": 1},
{"card": 96765646, "count": 1},
{"card": 48995978, "count": 1}
]
}
\ No newline at end of file
{
"CTOS":{
"PLAYER_INFO": "CTOS_PlayerInfo",
"JOIN_GAME":"CTOS_JoinGame",
"UPDATE_DECK": "deck"
},
"STOC":{
"JOIN_GAME":"STOC_JoinGame",
"HS_WATCH_CHANGE":"STOC_HS_WatchChange",
"TYPE_CHANGE":"STOC_TypeChange",
"HS_PLAYER_CHANGE":"STOC_HS_PlayerChange",
"HS_PLAYER_ENTER":"STOC_HS_PlayerEnter",
"ERROR_MSG": "STOC_ErrorMsg",
"CHAT": "STOC_Chat"
}
}
{
"HostInfo": [
{"name": "lflist", "type": "unsigned int"},
{"name": "rule", "type": "unsigned char"},
{"name": "mode", "type": "unsigned char"},
{"name": "enable_priority", "type": "bool"},
{"name": "no_check_deck", "type": "bool"},
{"name": "no_shuffle_deck", "type": "bool"},
{"name": "start_lp", "type": "unsigned int"},
{"name": "start_hand", "type": "unsigned char"},
{"name": "draw_count", "type": "unsigned char"},
{"name": "time_limit", "type": "unsigned short"}
],
"HostPacket": [
{"name": "identifier", "type": "unsigned short"},
{"name": "version", "type": "unsigned short"},
{"name": "port", "type": "unsigned short"},
{"name": "ipaddr", "type": "unsigned int"},
{"name": "name", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"},
{"name": "host", "type": "HostInfo"}
],
"HostRequest": [
{"name": "identifier", "type": "unsigned short"}
],
"CTOS_HandResult": [
{"name": "res", "type": "unsigned char"}
],
"CTOS_TPResult": [
{"name": "res", "type": "unsigned char"}
],
"CTOS_PlayerInfo": [
{"name": "name", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"}
],
"CTOS_CreateGame": [
{"name": "info", "type": "HostInfo"},
{"name": "name", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"},
{"name": "pass", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"}
],
"CTOS_JoinGame": [
{"name": "version", "type": "unsigned short"},
{"name": "gameid", "type": "unsigned int"},
{"name": "some_unknown_mysterious_fucking_thing", "type": "unsigned short"},
{"name": "pass", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"}
],
"CTOS_Kick": [
{"name": "pos", "type": "unsigned char"}
],
"STOC_ErrorMsg": [
{"name": "msg", "type": "unsigned char"},
{"name": "code", "type": "word32Ube"}
],
"STOC_HandResult": [
{"name": "res1", "type": "unsigned char"},
{"name": "res2", "type": "unsigned char"}
],
"STOC_CreateGame": [
{"name": "gameid", "type": "unsigned int"}
],
"STOC_JoinGame": [
{"name": "info", "type": "HostInfo"}
],
"STOC_TypeChange": [
{"name": "type", "type": "unsigned char"}
],
"STOC_ExitGame": [
{"name": "pos", "type": "unsigned char"}
],
"STOC_TimeLimit": [
{"name": "player", "type": "unsigned char"},
{"name": "left_time", "type": "unsigned short"}
],
"STOC_Chat": [
{"name": "player", "type": "unsigned short"},
{"name": "msg", "type": "unsigned short", "length": 255, "encoding": "UTF-16LE"}
],
"STOC_HS_PlayerEnter": [
{"name": "name", "type": "unsigned short", "length": 20, "encoding": "UTF-16LE"},
{"name": "pos", "type": "unsigned char"}
],
"STOC_HS_PlayerChange": [
{"name": "status", "type": "unsigned char"}
],
"STOC_HS_WatchChange": [
{"name": "watch_count", "type": "unsigned short"}
],
"deck": [
{"name": "mainc", "type": "unsigned int"},
{"name": "sidec", "type": "unsigned int"},
{"name": "deckbuf", "type": "unsigned int", "length": 75}
]
}
\ No newline at end of file
util = require "util"
net = require "net"
spawn = require('child_process').spawn
freeport = require 'freeport'
Struct = require('struct').Struct
structs_declaration = require './structs.json' #结构体声明
typedefs = require './typedefs.json' #类型声明
proto_structs = require './proto_structs.json' #消息与结构体的对应,未完成,对着duelclient.cpp加
constants = require './constants.json' #network.h里定义的常量
settings = require './config.json' #本机IP端口设置
#结构体定义
structs = {}
for name, declaration of structs_declaration
result = Struct()
for field in declaration
if field.encoding
switch field.encoding
when "UTF-16LE" then result.chars field.name, field.length*2, field.encoding
else throw "unsupported encoding: #{file.encoding}"
else
type = field.type
type = typedefs[type] if typedefs[type]
if field.length
result.array field.name, field.length, type #不支持结构体
else
if structs[type]
result.struct field.name, structs[type]
else
result[type] field.name
structs[name] = result
stoc_follows = {}
ctos_follows = {}
stoc_follow = (proto, synchronous, callback)->
if typeof proto == 'string'
for key, value of constants.STOC
if value == proto
proto = key
break
throw "unknown proto" if !constants.STOC[proto]
stoc_follows[proto] = {callback: callback, synchronous: synchronous}
ctos_follow = (proto, synchronous, callback)->
if typeof proto == 'string'
for key, value of constants.CTOS
if value == proto
proto = key
break
throw "unknown proto" if !constants.CTOS[proto]
ctos_follows[proto] = {callback: callback, synchronous: synchronous}
stoc_send = (socket, proto, info)->
#console.log proto, proto_structs.STOC[proto], structs[proto_structs.STOC[proto]]
if typeof info == 'undefined'
buffer = ""
else if Buffer.isBuffer(info)
buffer = info
else
struct = structs[proto_structs.STOC[proto]]
struct.allocate()
struct.set info
buffer = struct.buffer()
if typeof proto == 'string' #需要重构
for key, value of constants.STOC
if value == proto
proto = key
break
throw "unknown proto" if !constants.STOC[proto]
header = new Buffer(3)
header.writeUInt16LE buffer.length + 1, 0
header.writeUInt8 proto, 2
socket.write header
socket.write buffer if buffer.length
console.log 'stoc_sent:', buffer
ctos_send = (socket, proto, info)->
#console.log proto, proto_structs.CTOS[proto], structs[proto_structs.CTOS[proto]]
if typeof info == 'undefined'
buffer = ""
else if Buffer.isBuffer(info)
buffer = info
else
struct = structs[proto_structs.CTOS[proto]]
struct.allocate()
struct.set info
buffer = struct.buffer()
if typeof proto == 'string' #需要重构
for key, value of constants.CTOS
if value == proto
proto = key
break
throw "unknown proto" if !constants.CTOS[proto]
header = new Buffer(3)
header.writeUInt16LE buffer.length + 1, 0
header.writeUInt8 proto, 2
socket.write header
socket.write buffer if buffer.length
console.log 'ctos_sent:', buffer
server_listener = (pass, port, client, server)->
client.connected = true
rooms[pass] = port
console.log "connected #{port}"
stoc_buffer = new Buffer(0)
stoc_message_length = 0
stoc_proto = 0
for buffer in client.pre_connecion_buffers
server.write buffer
server.on "data", (data) ->
console.log 'server: ', data
stoc_buffer = Buffer.concat([stoc_buffer, data], stoc_buffer.length + data.length)
#buffer的错误使用方式,好孩子不要学
while true
if stoc_message_length == 0
if stoc_buffer.length >= 2
stoc_message_length = stoc_buffer.readUInt16LE(0)
else
break
else if stoc_proto == 0
if stoc_buffer.length >= 3
stoc_proto = stoc_buffer.readUInt8(2)
else
break
else
if stoc_buffer.length >= 2 + stoc_message_length
console.log constants.STOC[stoc_proto]
if stoc_follows[stoc_proto]
b = stoc_buffer.slice(3, stoc_message_length - 1 + 3)
if struct = structs[proto_structs.STOC[constants.STOC[stoc_proto]]]
struct._setBuff(b)
setTimeout stoc_follows[stoc_proto].callback, 0, b, struct.fields, client, server
else
setTimeout stoc_follows[stoc_proto].callback, 0, b, null, client, server
stoc_buffer = stoc_buffer.slice(2 + stoc_message_length)
stoc_message_length = 0
stoc_proto = 0
else
break
unless stoc_follows[stoc_proto] and stoc_follows[stoc_proto].synchronous
client.write data
server.on "error", (e) ->
console.log "server error #{e}"
client.end()
server.on "close", (had_error) ->
console.log "server closed #{had_error}"
client.end()
#main
rooms = {}
rooms_players = {}
net.createServer (client) ->
client.connected = false
ctos_buffer = new Buffer(0)
ctos_message_length = 0
ctos_proto = 0
client.pre_connecion_buffers = new Array()
server = new net.Socket()
client.on "data", (data) ->
console.log 'client: ', data
ctos_buffer = Buffer.concat([ctos_buffer, data], ctos_buffer.length + data.length) #buffer的错误使用方式,好孩子不要学
while true
if ctos_message_length == 0
if ctos_buffer.length >= 2
ctos_message_length = ctos_buffer.readUInt16LE(0)
else
break
else if ctos_proto == 0
if ctos_buffer.length >= 3
ctos_proto = ctos_buffer.readUInt8(2)
else
break
else
if ctos_buffer.length >= 2 + ctos_message_length
console.log constants.CTOS[ctos_proto]
if ctos_follows[ctos_proto]
b = ctos_buffer.slice(3, ctos_message_length-1+3)
if struct = structs[proto_structs.CTOS[constants.CTOS[ctos_proto]]]
struct._setBuff(b)
setTimeout ctos_follows[ctos_proto].callback, 0, b, struct.fields, client, server
else
setTimeout ctos_follows[ctos_proto].callback, 0, b, null, client, server
ctos_buffer = ctos_buffer.slice(2 + ctos_message_length)
ctos_message_length = 0
ctos_proto = 0
else
break
unless ctos_follows[ctos_proto] and ctos_follows[ctos_proto].synchronous
if client.connected
server.write data
else
client.pre_connecion_buffers.push data
client.on "error", (e) ->
console.log "client error #{e}"
server.end()
client.on "close", (had_error) ->
console.log "client closed #{had_error}"
server.end()
.listen settings.port
ctos_follow 'PLAYER_INFO', true, (buffer, info, client, server)->
client.player = info.name
console.log 'PLAYER_INFO', info
ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
console.log 'JOIN_GAME', info
if info.version != settings.version
stoc_send client, 'ERROR_MSG',{
msg: 4
code: settings.version
}
client.end()
else if !info.pass.length
stoc_send client, 'JOIN_GAME', {}
stoc_send client, 'HS_PLAYER_ENTER', {
name: '提示: 房间为空,请修改房间名'
pos: 0
}
else if info.pass == '[INCORRECT]' #房间密码验证
stoc_send client, 'ERROR_MSG',{
msg: 1
code: 1 #这返错有问题,直接双ygopro直连怎么都正常,在服务器上就经常弹不出提示
}
client.end()
else
if client.player != '[INCORRECT]' #用户验证
if rooms[info.pass]
if typeof rooms[info.pass] == 'number' #already connected
server.connect rooms[info.pass], '127.0.0.1', ->
server_listener(info.pass, rooms[info.pass], client, server)
else
rooms[info.pass].push client
else
freeport (err, port)->
if(err)
stoc_send client, 'ERROR_MSG',{
msg: 1
code: 2
}
client.end()
else
room = spawn './ygopro', [port, 0, 0, 0, 'F', 'T', 'F', 8000, 5, 1], cwd: 'ygocore'
rooms[info.pass] = [client]
room.on 'exit', (code)->
delete rooms[info.pass]
room.stdout.once 'data', (data)->
rooms[info.pass].forEach (client)->
server.connect port, '127.0.0.1', ->
server_listener(info.pass, port, client, server)
else
stoc_send client, 'ERROR_MSG',{
msg: 1
code: 2
}
client.end()
stoc_follow 'JOIN_GAME', false, (buffer, info, client, server)->
console.log 'JOIN_GAME', info
stoc_follow 'HS_PLAYER_CHANGE', false, (buffer, info, client, server)->
console.log 'HS_PLAYER_CHANGE', info
stoc_follow 'HS_PLAYER_ENTER', false, (buffer, info, client, server)->
stoc_send client, 'CHAT', {
player: 8
msg: "这里是测试用的新直连服\n ˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉ\0"
}
stoc_send client, 'CHAT', {
player: 8
msg: "现在这个还不稳定,随时可能崩溃或者关闭服务哦\0"
}
stoc_send client, 'CHAT', {
player: 8
msg: "喵喵喵喵\0"
}
stoc_follow 'CHAT', false, (buffer, info, client, server)->
console.log info, buffer
###
# 开包大战
packs_weighted_cards = {}
for pack, cards of require './packs.json'
packs_weighted_cards[pack] = []
for card in cards
for i in [0..card.count]
packs_weighted_cards[pack].push card.card
console.log packs_weighted_cards
ctos_follow 'UPDATE_DECK', false, (buffer, info, client, server)->
ctos_send server, 'HS_NOTREADY'
deck = []
for pack in client.player
for i in [0...5]
deck.push packs_weighted_cards[pack][Math.floor(Math.random()*packs_weighted_cards[pack].length)]
ctos_send server, 'UPDATE_DECK', {
mainc: deck.length,
sidec: 0,
deckbuf: deck
}
ctos_send server, 'HS_READY'
###
\ No newline at end of file
// Generated by CoffeeScript 1.6.3
(function() {
var Struct, constants, ctos_follow, ctos_follows, ctos_send, declaration, field, freeport, name, net, proto_structs, result, rooms, rooms_players, server_listener, settings, spawn, stoc_follow, stoc_follows, stoc_send, structs, structs_declaration, type, typedefs, util, _i, _len;
util = require("util");
net = require("net");
spawn = require('child_process').spawn;
freeport = require('freeport');
Struct = require('struct').Struct;
structs_declaration = require('./structs.json');
typedefs = require('./typedefs.json');
proto_structs = require('./proto_structs.json');
constants = require('./constants.json');
settings = require('./config.json');
structs = {};
for (name in structs_declaration) {
declaration = structs_declaration[name];
result = Struct();
for (_i = 0, _len = declaration.length; _i < _len; _i++) {
field = declaration[_i];
if (field.encoding) {
switch (field.encoding) {
case "UTF-16LE":
result.chars(field.name, field.length * 2, field.encoding);
break;
default:
throw "unsupported encoding: " + file.encoding;
}
} else {
type = field.type;
if (typedefs[type]) {
type = typedefs[type];
}
if (field.length) {
result.array(field.name, field.length, type);
} else {
if (structs[type]) {
result.struct(field.name, structs[type]);
} else {
result[type](field.name);
}
}
}
}
structs[name] = result;
}
stoc_follows = {};
ctos_follows = {};
stoc_follow = function(proto, synchronous, callback) {
var key, value, _ref;
if (typeof proto === 'string') {
_ref = constants.STOC;
for (key in _ref) {
value = _ref[key];
if (value === proto) {
proto = key;
break;
}
}
if (!constants.STOC[proto]) {
throw "unknown proto";
}
}
return stoc_follows[proto] = {
callback: callback,
synchronous: synchronous
};
};
ctos_follow = function(proto, synchronous, callback) {
var key, value, _ref;
if (typeof proto === 'string') {
_ref = constants.CTOS;
for (key in _ref) {
value = _ref[key];
if (value === proto) {
proto = key;
break;
}
}
if (!constants.CTOS[proto]) {
throw "unknown proto";
}
}
return ctos_follows[proto] = {
callback: callback,
synchronous: synchronous
};
};
stoc_send = function(socket, proto, info) {
var buffer, header, key, struct, value, _ref;
if (typeof info === 'undefined') {
buffer = "";
} else if (Buffer.isBuffer(info)) {
buffer = info;
} else {
struct = structs[proto_structs.STOC[proto]];
struct.allocate();
struct.set(info);
buffer = struct.buffer();
}
if (typeof proto === 'string') {
_ref = constants.STOC;
for (key in _ref) {
value = _ref[key];
if (value === proto) {
proto = key;
break;
}
}
if (!constants.STOC[proto]) {
throw "unknown proto";
}
}
header = new Buffer(3);
header.writeUInt16LE(buffer.length + 1, 0);
header.writeUInt8(proto, 2);
socket.write(header);
if (buffer.length) {
socket.write(buffer);
}
return console.log('stoc_sent:', buffer);
};
ctos_send = function(socket, proto, info) {
var buffer, header, key, struct, value, _ref;
if (typeof info === 'undefined') {
buffer = "";
} else if (Buffer.isBuffer(info)) {
buffer = info;
} else {
struct = structs[proto_structs.CTOS[proto]];
struct.allocate();
struct.set(info);
buffer = struct.buffer();
}
if (typeof proto === 'string') {
_ref = constants.CTOS;
for (key in _ref) {
value = _ref[key];
if (value === proto) {
proto = key;
break;
}
}
if (!constants.CTOS[proto]) {
throw "unknown proto";
}
}
header = new Buffer(3);
header.writeUInt16LE(buffer.length + 1, 0);
header.writeUInt8(proto, 2);
socket.write(header);
if (buffer.length) {
socket.write(buffer);
}
return console.log('ctos_sent:', buffer);
};
server_listener = function(pass, port, client, server) {
var buffer, stoc_buffer, stoc_message_length, stoc_proto, _j, _len1, _ref;
client.connected = true;
rooms[pass] = port;
console.log("connected " + port);
stoc_buffer = new Buffer(0);
stoc_message_length = 0;
stoc_proto = 0;
_ref = client.pre_connecion_buffers;
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
buffer = _ref[_j];
server.write(buffer);
}
server.on("data", function(data) {
var b, struct;
console.log('server: ', data);
stoc_buffer = Buffer.concat([stoc_buffer, data], stoc_buffer.length + data.length);
while (true) {
if (stoc_message_length === 0) {
if (stoc_buffer.length >= 2) {
stoc_message_length = stoc_buffer.readUInt16LE(0);
} else {
break;
}
} else if (stoc_proto === 0) {
if (stoc_buffer.length >= 3) {
stoc_proto = stoc_buffer.readUInt8(2);
} else {
break;
}
} else {
if (stoc_buffer.length >= 2 + stoc_message_length) {
console.log(constants.STOC[stoc_proto]);
if (stoc_follows[stoc_proto]) {
b = stoc_buffer.slice(3, stoc_message_length - 1 + 3);
if (struct = structs[proto_structs.STOC[constants.STOC[stoc_proto]]]) {
struct._setBuff(b);
setTimeout(stoc_follows[stoc_proto].callback, 0, b, struct.fields, client, server);
} else {
setTimeout(stoc_follows[stoc_proto].callback, 0, b, null, client, server);
}
}
stoc_buffer = stoc_buffer.slice(2 + stoc_message_length);
stoc_message_length = 0;
stoc_proto = 0;
} else {
break;
}
}
}
if (!(stoc_follows[stoc_proto] && stoc_follows[stoc_proto].synchronous)) {
return client.write(data);
}
});
server.on("error", function(e) {
console.log("server error " + e);
return client.end();
});
return server.on("close", function(had_error) {
console.log("server closed " + had_error);
return client.end();
});
};
rooms = {};
rooms_players = {};
net.createServer(function(client) {
var ctos_buffer, ctos_message_length, ctos_proto, server;
client.connected = false;
ctos_buffer = new Buffer(0);
ctos_message_length = 0;
ctos_proto = 0;
client.pre_connecion_buffers = new Array();
server = new net.Socket();
client.on("data", function(data) {
var b, struct;
console.log('client: ', data);
ctos_buffer = Buffer.concat([ctos_buffer, data], ctos_buffer.length + data.length);
while (true) {
if (ctos_message_length === 0) {
if (ctos_buffer.length >= 2) {
ctos_message_length = ctos_buffer.readUInt16LE(0);
} else {
break;
}
} else if (ctos_proto === 0) {
if (ctos_buffer.length >= 3) {
ctos_proto = ctos_buffer.readUInt8(2);
} else {
break;
}
} else {
if (ctos_buffer.length >= 2 + ctos_message_length) {
console.log(constants.CTOS[ctos_proto]);
if (ctos_follows[ctos_proto]) {
b = ctos_buffer.slice(3, ctos_message_length - 1 + 3);
if (struct = structs[proto_structs.CTOS[constants.CTOS[ctos_proto]]]) {
struct._setBuff(b);
setTimeout(ctos_follows[ctos_proto].callback, 0, b, struct.fields, client, server);
} else {
setTimeout(ctos_follows[ctos_proto].callback, 0, b, null, client, server);
}
}
ctos_buffer = ctos_buffer.slice(2 + ctos_message_length);
ctos_message_length = 0;
ctos_proto = 0;
} else {
break;
}
}
}
if (!(ctos_follows[ctos_proto] && ctos_follows[ctos_proto].synchronous)) {
if (client.connected) {
return server.write(data);
} else {
return client.pre_connecion_buffers.push(data);
}
}
});
client.on("error", function(e) {
console.log("client error " + e);
return server.end();
});
return client.on("close", function(had_error) {
console.log("client closed " + had_error);
return server.end();
});
}).listen(settings.port);
ctos_follow('PLAYER_INFO', true, function(buffer, info, client, server) {
client.player = info.name;
return console.log('PLAYER_INFO', info);
});
ctos_follow('JOIN_GAME', false, function(buffer, info, client, server) {
console.log('JOIN_GAME', info);
if (info.version !== settings.version) {
stoc_send(client, 'ERROR_MSG', {
msg: 4,
code: settings.version
});
return client.end();
} else if (!info.pass.length) {
stoc_send(client, 'JOIN_GAME', {});
return stoc_send(client, 'HS_PLAYER_ENTER', {
name: '提示: 房间为空,请修改房间名',
pos: 0
});
} else if (info.pass === '[INCORRECT]') {
stoc_send(client, 'ERROR_MSG', {
msg: 1,
code: 1
});
return client.end();
} else {
if (client.player !== '[INCORRECT]') {
if (rooms[info.pass]) {
if (typeof rooms[info.pass] === 'number') {
return server.connect(rooms[info.pass], '127.0.0.1', function() {
return server_listener(info.pass, rooms[info.pass], client, server);
});
} else {
return rooms[info.pass].push(client);
}
} else {
return freeport(function(err, port) {
var room;
if (err) {
stoc_send(client, 'ERROR_MSG', {
msg: 1,
code: 2
});
return client.end();
} else {
room = spawn('./ygopro', [port, 0, 0, 0, 'F', 'T', 'F', 8000, 5, 1], {
cwd: 'ygocore'
});
rooms[info.pass] = [client];
room.on('exit', function(code) {
return delete rooms[info.pass];
});
return room.stdout.once('data', function(data) {
return rooms[info.pass].forEach(function(client) {
return server.connect(port, '127.0.0.1', function() {
return server_listener(info.pass, port, client, server);
});
});
});
}
});
}
} else {
stoc_send(client, 'ERROR_MSG', {
msg: 1,
code: 2
});
return client.end();
}
}
});
stoc_follow('JOIN_GAME', false, function(buffer, info, client, server) {
return console.log('JOIN_GAME', info);
});
stoc_follow('HS_PLAYER_CHANGE', false, function(buffer, info, client, server) {
return console.log('HS_PLAYER_CHANGE', info);
});
stoc_follow('HS_PLAYER_ENTER', false, function(buffer, info, client, server) {
stoc_send(client, 'CHAT', {
player: 8,
msg: "这里是测试用的新直连服\n ˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉ\0"
});
stoc_send(client, 'CHAT', {
player: 8,
msg: "现在这个还不稳定,随时可能崩溃或者关闭服务哦\0"
});
return stoc_send(client, 'CHAT', {
player: 8,
msg: "喵喵喵喵\0"
});
});
stoc_follow('CHAT', false, function(buffer, info, client, server) {
return console.log(info, buffer);
});
/*
# 开包大战
packs_weighted_cards = {}
for pack, cards of require './packs.json'
packs_weighted_cards[pack] = []
for card in cards
for i in [0..card.count]
packs_weighted_cards[pack].push card.card
console.log packs_weighted_cards
ctos_follow 'UPDATE_DECK', false, (buffer, info, client, server)->
ctos_send server, 'HS_NOTREADY'
deck = []
for pack in client.player
for i in [0...5]
deck.push packs_weighted_cards[pack][Math.floor(Math.random()*packs_weighted_cards[pack].length)]
ctos_send server, 'UPDATE_DECK', {
mainc: deck.length,
sidec: 0,
deckbuf: deck
}
ctos_send server, 'HS_READY'
*/
}).call(this);
/*
//@ sourceMappingURL=tunnel.map
*/
{
"version": 3,
"file": "tunnel.js",
"sourceRoot": "",
"sources": [
"tunnel.coffee"
],
"names": [],
"mappings": ";AAAA;CAAA,KAAA,6QAAA;;CAAA,CAAA,CAAO,CAAP,EAAO,CAAA;;CAAP,CACA,CAAA,EAAM,EAAA;;CADN,CAEA,CAAQ,EAAR,EAAQ,QAAA;;CAFR,CAGA,CAAW,IAAA,CAAX,EAAW;;CAHX,CAIA,CAAS,GAAT,CAAS,CAAA;;CAJT,CAMA,CAAsB,IAAA,SAAA,GAAtB;;CANA,CAOA,CAAW,IAAA,CAAX,SAAW;;CAPX,CAQA,CAAgB,IAAA,MAAhB,SAAgB;;CARhB,CASA,CAAY,IAAA,EAAZ,SAAY;;CATZ,CAWA,CAAW,IAAA,CAAX,OAAW;;CAXX,CAcA,CAAU,IAAV;;AACA,CAAA,MAAA,oBAAA;6CAAA;CACE,EAAS,CAAT,EAAA;AACA,CAAA,QAAA,yCAAA;+BAAA;CACE,GAAG,CAAK,CAAR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;;;;;;;CApTA;CAAA"
}
\ No newline at end of file
{
"unsigned int": "word32Ule",
"unsigned short": "word16Ule",
"unsigned char": "word8",
"bool": "bool2"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment