示例#1
0
 def usrLogout(self,request,context):
     if request.name not in self.loginDict:
         return DisStorage_pb2.logoutInfo(logoutFlag=0,
                                          mess = 'Login First!')
     self.loginDict.pop(request.name)
     return DisStorage_pb2.logoutInfo(logoutFlag=1,
                                      mess='')
示例#2
0
 def usrLogout(self, request, context):
     if request.name not in self.loginDict:
         return DisStorage_pb2.logoutInfo(logoutFlag=0, mess='Login First!')
     res = self.stubs[self.loginDict[request.name]].usrLogout(request)
     if res.logoutFlag == 1:
         self.DisServerStress[self.loginDict[request.name]] -= 1
         self.loginDict.pop(request.name)
         self.activeNum -= 1
     return res