From a058ffe8f5e21958a99526477637d54d67e8ef3f Mon Sep 17 00:00:00 2001 From: Teddy Date: Sat, 31 Aug 2013 17:34:41 +0800 Subject: ptp v2.0c std-compliant server --- server/piztor/mesg_sender.py | 6 +++--- server/piztor/ptp_send.py | 4 ++-- server/piztor/server.py | 2 +- 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): -- cgit v1.2.3-70-g09d2