summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-08-31 17:34:41 +0800
committerTeddy <[email protected]>2013-08-31 17:34:41 +0800
commita058ffe8f5e21958a99526477637d54d67e8ef3f (patch)
treec5edbedcfe1528077afbc9ed4dfd583a042d27b1 /server
parent0517abaf483d79905dce118331348610c7239315 (diff)
ptp v2.0c std-compliant server
Diffstat (limited to 'server')
-rw-r--r--server/piztor/mesg_sender.py6
-rw-r--r--server/piztor/ptp_send.py4
-rw-r--r--server/piztor/server.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/server/piztor/mesg_sender.py b/server/piztor/mesg_sender.py
index fb9b5a5..80232ec 100644
--- a/server/piztor/mesg_sender.py
+++ b/server/piztor/mesg_sender.py
@@ -4,8 +4,8 @@ from time import sleep
from sys import argv
from ptp_send import *
-username = "hello"
-password = "world"
+username = "yg"
+password = "yg"
mesg = "niu x push!"
#username = "1234567890123456789012"
#password = "world12345678901234567890"
@@ -21,7 +21,7 @@ if len(argv) == 4:
token = user_auth(username, password)
set_marker(token, username, 123.456, 456.123, 0x7fffffff)
-#send_text_mesg(token, username, mesg)
+send_text_mesg(token, username, mesg)
#send_text_mesg(token, username, "a")
#send_text_mesg(token, username, "the last")
#update_location(token, username, 31.028616, 121.434661)
diff --git a/server/piztor/ptp_send.py b/server/piztor/ptp_send.py
index 42a566d..6c3b476 100644
--- a/server/piztor/ptp_send.py
+++ b/server/piztor/ptp_send.py
@@ -24,8 +24,8 @@ class _SectionSize:
LOCATION_ENTRY = USER_ID + LATITUDE + LONGITUDE
PADDING = 1
-#host = "202.120.7.4"
-host = "localhost"
+host = "202.120.7.4"
+#host = "localhost"
port = 2223
def pack_data(optcode, data):
diff --git a/server/piztor/server.py b/server/piztor/server.py
index 51cf649..ec70566 100644
--- a/server/piztor/server.py
+++ b/server/piztor/server.py
@@ -90,7 +90,7 @@ class PushLocationData(PushData):
class PushMarkerData(PushData):
def __init__(self, perm, lat, lng, deadline):
- self.pack(0x02, struct.pack("!Bddl", lat, lng, deadline))
+ self.pack(0x02, struct.pack("!Bddl", perm, lat, lng, deadline))
class PushTunnel(object):
def __init__(self, uid):