Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timothy Pratama
IF3230-Tugas-Besar-Sister-2015
Commits
6dd0c9ef
Commit
6dd0c9ef
authored
Apr 25, 2015
by
opelhoward
Browse files
fix bug
parent
aa44dcdb
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/server/.idea/workspace.xml
View file @
6dd0c9ef
...
...
@@ -24,11 +24,11 @@
</component>
<component
name=
"FileEditorManager"
>
<leaf>
<file
leaf-file-name=
"sconnectionhandler.py"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
leaf-file-name=
"sconnectionhandler.py"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/sconnectionhandler.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.
0
"
vertical-offset=
"3
440
"
max-vertical-offset=
"8823"
>
<caret
line=
"
221
"
column=
"
22
"
selection-start-line=
"
221
"
selection-start-column=
"
22
"
selection-end-line=
"
221
"
selection-end-column=
"
22
"
/>
<state
vertical-scroll-proportion=
"
-
0.
76623374
"
vertical-offset=
"3
525
"
max-vertical-offset=
"8823"
>
<caret
line=
"
190
"
column=
"
56
"
selection-start-line=
"
190
"
selection-start-column=
"
56
"
selection-end-line=
"
190
"
selection-end-column=
"
56
"
/>
<folding>
<element
signature=
"e#21#32#0"
expanded=
"true"
/>
</folding>
...
...
@@ -80,11 +80,11 @@
</provider>
</entry>
</file>
<file
leaf-file-name=
"market.py"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
leaf-file-name=
"market.py"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/market.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.
74371856
"
vertical-offset=
"
775
"
max-vertical-offset=
"1
173
"
>
<caret
line=
"6
3
"
column=
"
58
"
selection-start-line=
"6
3
"
selection-start-column=
"
58
"
selection-end-line=
"6
3
"
selection-end-column=
"
58
"
/>
<state
vertical-scroll-proportion=
"0.
0
"
vertical-offset=
"
520
"
max-vertical-offset=
"1
224
"
>
<caret
line=
"6
4
"
column=
"
31
"
selection-start-line=
"6
4
"
selection-start-column=
"
31
"
selection-end-line=
"6
4
"
selection-end-column=
"
31
"
/>
<folding>
<element
signature=
"e#22#53#0"
expanded=
"true"
/>
</folding>
...
...
@@ -106,7 +106,7 @@
<entry
file=
"file://$PROJECT_DIR$/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.0"
vertical-offset=
"809"
max-vertical-offset=
"1207"
>
<caret
line=
"1
0
"
column=
"
7
"
selection-start-line=
"1
0
"
selection-start-column=
"
7
"
selection-end-line=
"1
0
"
selection-end-column=
"
7
"
/>
<caret
line=
"1
4
"
column=
"
0
"
selection-start-line=
"1
4
"
selection-start-column=
"
0
"
selection-end-line=
"1
4
"
selection-end-column=
"
0
"
/>
<folding
/>
</state>
</provider>
...
...
@@ -122,9 +122,9 @@
<option
value=
"$PROJECT_DIR$/tradebox.py"
/>
<option
value=
"$PROJECT_DIR$/sclient.py"
/>
<option
value=
"$PROJECT_DIR$/ssocketio.py"
/>
<option
value=
"$PROJECT_DIR$/market.py"
/>
<option
value=
"$PROJECT_DIR$/user.py"
/>
<option
value=
"$PROJECT_DIR$/sconnectionhandler.py"
/>
<option
value=
"$PROJECT_DIR$/market.py"
/>
</list>
</option>
</component>
...
...
@@ -812,24 +812,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/sconnectionhandler.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.0"
vertical-offset=
"3440"
max-vertical-offset=
"8823"
>
<caret
line=
"221"
column=
"22"
selection-start-line=
"221"
selection-start-column=
"22"
selection-end-line=
"221"
selection-end-column=
"22"
/>
<folding>
<element
signature=
"e#21#32#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.0"
vertical-offset=
"809"
max-vertical-offset=
"1207"
>
<caret
line=
"10"
column=
"7"
selection-start-line=
"10"
selection-start-column=
"7"
selection-end-line=
"10"
selection-end-column=
"7"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/tradebox.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.0"
vertical-offset=
"877"
max-vertical-offset=
"1275"
>
...
...
@@ -868,13 +850,31 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/market.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.
74371856
"
vertical-offset=
"
775
"
max-vertical-offset=
"1
173
"
>
<caret
line=
"6
3
"
column=
"
58
"
selection-start-line=
"6
3
"
selection-start-column=
"
58
"
selection-end-line=
"6
3
"
selection-end-column=
"
58
"
/>
<state
vertical-scroll-proportion=
"0.
0
"
vertical-offset=
"
520
"
max-vertical-offset=
"1
224
"
>
<caret
line=
"6
4
"
column=
"
31
"
selection-start-line=
"6
4
"
selection-start-column=
"
31
"
selection-end-line=
"6
4
"
selection-end-column=
"
31
"
/>
<folding>
<element
signature=
"e#22#53#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"0.0"
vertical-offset=
"809"
max-vertical-offset=
"1207"
>
<caret
line=
"14"
column=
"0"
selection-start-line=
"14"
selection-start-column=
"0"
selection-end-line=
"14"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/sconnectionhandler.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
vertical-scroll-proportion=
"-0.76623374"
vertical-offset=
"3525"
max-vertical-offset=
"8823"
>
<caret
line=
"190"
column=
"56"
selection-start-line=
"190"
selection-start-column=
"56"
selection-end-line=
"190"
selection-end-column=
"56"
/>
<folding>
<element
signature=
"e#21#32#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
src/server/market.py
View file @
6dd0c9ef
...
...
@@ -61,4 +61,7 @@ class Market:
@
staticmethod
def
dirty
(
item
):
print
(
int
(
time
.
time
())
-
Market
.
__time
[
item
])
print
(
int
(
time
.
time
()))
print
(
Market
.
__time
[
item
])
return
int
(
time
.
time
())
-
Market
.
__time
[
item
]
>
20
\ No newline at end of file
src/server/sconnectionhandler.py
View file @
6dd0c9ef
...
...
@@ -187,13 +187,13 @@ class ConnectionHandler:
# do something
user
=
User
(
token
)
if
user
.
time
<
time
.
time
():
(
user
.
location
.
x
,
user
.
location
.
y
)
=
(
x
,
y
);
user
.
time
=
int
(
time
.
time
())
+
User
.
MOVE_TIME
*
(
abs
(
int
(
user
.
location
.
x
)
-
x
)
+
abs
(
int
(
user
.
location
.
y
)
-
y
))
(
user
.
location
.
x
,
user
.
location
.
y
)
=
(
x
,
y
);
user
.
save
()
data
=
json
.
dumps
({
'status'
:
'ok'
,
'time'
:
user
.
time
})
else
:
data
=
json
.
dumps
({
'status'
:
'fail'
,
'description'
:
'need time'
+
str
(
user
.
time
-
time
.
time
())})
data
=
json
.
dumps
({
'status'
:
'fail'
,
'description'
:
'need time
'
+
str
(
user
.
time
-
time
.
time
())})
try
:
self
.
_socketio
.
write_to_socket
(
data
.
encode
(
'ascii'
))
...
...
src/server/user.py
View file @
6dd0c9ef
...
...
@@ -15,7 +15,7 @@ class Location:
class
User
:
MOVE_TIME
=
2
0
MOVE_TIME
=
6
0
__users
=
MongoClient
(
'localhost'
,
27017
)[
'sister'
].
get_collection
(
'users'
)
def
__init__
(
self
,
id
):
...
...
Write
Preview
Supports
Markdown
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