Example #1
0
 def on_geo_response(self, companyid, appid, skillid, userid, account, name, grade, memo, geo_response):
     ip_parser = IpParserBaidu('')
     geo_info = ip_parser.doParse(geo_response.body)
     self.setGeoInfor(geo_info)
     ws_protocol = 'wss' if self.service_over_ssl() else 'ws'
     self.render("service/_chatbox.html", service_name='西山居游戏客服', companyid=companyid, appid=appid,
                 skillid=skillid, userid='', welcome='欢迎来到西山居游戏客服中心!',
                 hhost="%s://%s/customservice/ws" % (ws_protocol, self.request.host),
                 comet_url="%s://%s/customservice/comet_cmd" % (self.get_protocol(), self.request.host))
Example #2
0
 def on_query_ip_infor(self, cid, gid, response):
     ip_parser = IpParserBaidu('')
     geo_info = ip_parser.doParse(response.body)
     self.setGeoInfor(geo_info)
     ws_protocol = 'wss' if self.service_over_ssl() else 'ws'
     # 异步查看用户的信息
     self.render("service/_demo_visitor.html",
                 cid=cid,
                 gid=gid,
                 hhost="%s://%s/customservice/ws" % (ws_protocol, self.request.host),
                 comet_url="%s://%s/customservice/comet" % (self.get_protocol(), self.request.host))