Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "type": "Program",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "Literal",
- "value": "use strict"
- }
- },
- {
- "type": "VariableDeclaration",
- "declarations": [
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "http"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "http"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "socketio"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "socket.io"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "config"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "../shared/config.js"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "EventHandler"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "./event_handler.js"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "RoomManager"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "./room_manager.js"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "Client"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "./client.js"
- }
- ]
- }
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "Ticker"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "Identifier",
- "name": "require"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "./ticker.js"
- }
- ]
- }
- }
- ],
- "kind": "var"
- },
- {
- "type": "FunctionDeclaration",
- "id": {
- "type": "Identifier",
- "name": "Server"
- },
- "params": [],
- "defaults": [],
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "inc"
- }
- },
- "right": {
- "type": "Literal",
- "value": 0
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "clients"
- }
- },
- "right": {
- "type": "ObjectExpression",
- "properties": []
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "ticker"
- }
- },
- "right": {
- "type": "NewExpression",
- "callee": {
- "type": "Identifier",
- "name": "Ticker"
- },
- "arguments": [
- {
- "type": "Literal",
- "value": 50
- }
- ]
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "ticker"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "setMaxListeners"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": 0
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "roomManager"
- }
- },
- "right": {
- "type": "NewExpression",
- "callee": {
- "type": "Identifier",
- "name": "RoomManager"
- },
- "arguments": [
- {
- "type": "ThisExpression"
- }
- ]
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "listen"
- }
- },
- "arguments": [
- {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "config"
- },
- "property": {
- "type": "Identifier",
- "name": "SERVER_PORT"
- }
- }
- ]
- }
- }
- ]
- },
- "rest": null,
- "generator": false,
- "expression": false
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "module"
- },
- "property": {
- "type": "Identifier",
- "name": "exports"
- }
- },
- "right": {
- "type": "Identifier",
- "name": "Server"
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "Server"
- },
- "property": {
- "type": "Identifier",
- "name": "prototype"
- }
- },
- "right": {
- "type": "ObjectExpression",
- "properties": [
- {
- "type": "Property",
- "key": {
- "type": "Identifier",
- "name": "listen"
- },
- "value": {
- "type": "FunctionExpression",
- "id": null,
- "params": [
- {
- "type": "Identifier",
- "name": "port"
- }
- ],
- "defaults": [],
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "VariableDeclaration",
- "declarations": [
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "server"
- },
- "init": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "http"
- },
- "property": {
- "type": "Identifier",
- "name": "createServer"
- }
- },
- "arguments": []
- }
- }
- ],
- "kind": "var"
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "right": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "socketio"
- },
- "property": {
- "type": "Identifier",
- "name": "listen"
- }
- },
- "arguments": [
- {
- "type": "Identifier",
- "name": "server"
- },
- {
- "type": "ObjectExpression",
- "properties": [
- {
- "type": "Property",
- "key": {
- "type": "Identifier",
- "name": "log"
- },
- "value": {
- "type": "Literal",
- "value": false
- },
- "kind": "init"
- }
- ]
- }
- ]
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "browser client etag"
- },
- {
- "type": "Literal",
- "value": true
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "browser client gzip"
- },
- {
- "type": "Literal",
- "value": true
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "browser client minification"
- },
- {
- "type": "Literal",
- "value": true
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "transports"
- },
- {
- "type": "ArrayExpression",
- "elements": [
- {
- "type": "Literal",
- "value": "websocket"
- }
- ]
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "close timeout"
- },
- {
- "type": "Literal",
- "value": 10
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "set"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "heartbeat timeout "
- },
- {
- "type": "Literal",
- "value": 10
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "io"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "sockets"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "on"
- }
- },
- "arguments": [
- {
- "type": "Literal",
- "value": "connection"
- },
- {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "addClient"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "bind"
- }
- },
- "arguments": [
- {
- "type": "ThisExpression"
- }
- ]
- }
- ]
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "server"
- },
- "property": {
- "type": "Identifier",
- "name": "listen"
- }
- },
- "arguments": [
- {
- "type": "Identifier",
- "name": "port"
- }
- ]
- }
- }
- ]
- },
- "rest": null,
- "generator": false,
- "expression": false
- },
- "kind": "init"
- },
- {
- "type": "Property",
- "key": {
- "type": "Identifier",
- "name": "addClient"
- },
- "value": {
- "type": "FunctionExpression",
- "id": null,
- "params": [
- {
- "type": "Identifier",
- "name": "socket"
- }
- ],
- "defaults": [],
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "VariableDeclaration",
- "declarations": [
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "client"
- },
- "init": null
- },
- {
- "type": "VariableDeclarator",
- "id": {
- "type": "Identifier",
- "name": "id"
- },
- "init": {
- "type": "UpdateExpression",
- "operator": "++",
- "argument": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "inc"
- }
- },
- "prefix": true
- }
- }
- ],
- "kind": "var"
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "Identifier",
- "name": "client"
- },
- "right": {
- "type": "NewExpression",
- "callee": {
- "type": "Identifier",
- "name": "Client"
- },
- "arguments": [
- {
- "type": "Identifier",
- "name": "id"
- },
- {
- "type": "ThisExpression"
- },
- {
- "type": "Identifier",
- "name": "socket"
- }
- ]
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "client"
- },
- "property": {
- "type": "Identifier",
- "name": "eventHandler"
- }
- },
- "right": {
- "type": "NewExpression",
- "callee": {
- "type": "Identifier",
- "name": "EventHandler"
- },
- "arguments": [
- {
- "type": "ThisExpression"
- },
- {
- "type": "Identifier",
- "name": "client"
- },
- {
- "type": "Identifier",
- "name": "socket"
- }
- ]
- }
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "AssignmentExpression",
- "operator": "=",
- "left": {
- "type": "MemberExpression",
- "computed": true,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "clients"
- }
- },
- "property": {
- "type": "Identifier",
- "name": "id"
- }
- },
- "right": {
- "type": "Identifier",
- "name": "client"
- }
- }
- }
- ]
- },
- "rest": null,
- "generator": false,
- "expression": false
- },
- "kind": "init"
- },
- {
- "type": "Property",
- "key": {
- "type": "Identifier",
- "name": "removeClient"
- },
- "value": {
- "type": "FunctionExpression",
- "id": null,
- "params": [
- {
- "type": "Identifier",
- "name": "client"
- }
- ],
- "defaults": [],
- "body": {
- "type": "BlockStatement",
- "body": [
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "CallExpression",
- "callee": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "client"
- },
- "property": {
- "type": "Identifier",
- "name": "destruct"
- }
- },
- "arguments": []
- }
- },
- {
- "type": "ExpressionStatement",
- "expression": {
- "type": "UnaryExpression",
- "operator": "delete",
- "argument": {
- "type": "MemberExpression",
- "computed": true,
- "object": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "ThisExpression"
- },
- "property": {
- "type": "Identifier",
- "name": "clients"
- }
- },
- "property": {
- "type": "MemberExpression",
- "computed": false,
- "object": {
- "type": "Identifier",
- "name": "client"
- },
- "property": {
- "type": "Identifier",
- "name": "id"
- }
- }
- }
- }
- }
- ]
- },
- "rest": null,
- "generator": false,
- "expression": false
- },
- "kind": "init"
- }
- ]
- }
- }
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement