Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
edc03cf9
Commit
edc03cf9
authored
Aug 14, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
서버 안정화 및 GPU 비용줄임
parent
9c3f21f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
main.js
js/main.js
+1
-1
server.js
server.js
+9
-4
No files found.
js/main.js
View file @
edc03cf9
var
config
=
{
type
:
Phaser
.
AUTO
,
type
:
Phaser
.
CANVAS
,
width
:
1920
,
height
:
1080
,
scale
:
{
...
...
server.js
View file @
edc03cf9
...
...
@@ -16,7 +16,7 @@ app.get('/', function(req, res) {
server
.
listen
(
80
,
function
()
{
console
.
log
(
'
[SERVER] Listening on port
'
+
server
.
address
().
port
);
GameServer
.
serverNumber
=
Math
.
floor
(
Math
.
random
()
*
1000
+
1
);
console
.
log
(
'
[SERVER] server number is
${GameServer.serverNumber}
'
);
console
.
log
(
'
[SERVER] server number is
'
+
GameServer
.
serverNumber
);
});
...
...
@@ -148,18 +148,23 @@ io.on('connection', function(socket)
{
GameServer
.
disconnectCount
++
;
let
data
=
socket
.
playerData
;
if
(
typeof
data
===
undefined
)
if
(
data
===
undefined
)
{
console
.
error
(
'
[ERROR] data is undefined
'
);
console
.
table
(
GameServer
.
currentPlayer
);
GameServer
.
disconnectCount
--
;
}
else
// data.id is not undefined
{
disconnectUser
(
data
,
reason
);
}
const
connectDiff
=
GameServer
.
connectCount
-
GameServer
.
disconnectCount
;
const
playerCount
=
GameServer
.
currentPlayer
.
length
console
.
log
({
connectDiff
,
playerCount
});
const
playerCount
=
GameServer
.
currentPlayer
.
length
;
if
(
connectDiff
!=
playerCount
)
{
console
.
log
({
connectDiff
,
playerCount
});
console
.
table
(
GameServer
.
currentPlayer
);
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment