def sendReadyMessage(self, message):
     request = self.buildRequestPackage(self.CODE_READY_MSG)
     request.addInt32(message)
     ServerConnection.sendMessage(self,request)
 def sendChatMessage(self,message):
     request = self.buildRequestPackage(self.CODE_SEND_MSG)
     request.addString(message)
     ServerConnection.sendMessage(self,request)
 def sendMessage(self,pos,h):
     request = self.buildRequestPackage(self.CODE_SEND_SAVE)
     request.addString(str(pos[0])+","+str(pos[1])+","+str(pos[2])+","+str(h))
     ServerConnection.sendMessage(self,request)
 def sendQueueMessage(self,message):
     request = self.buildRequestPackage(self.CODE_SEND_MSG)
     request.addInt32(message)
     ServerConnection.sendMessage(self,request)
 def sendRegisterRequest(self,username,password):
     request = self.buildRequestPackage(self.CODE_SEND_REG)
     request.addString(username)
     request.addString(password)
     ServerConnection.sendMessage(self,request)
 def sendHeartbeat(self):
     request = self.buildRequestPackage(self.CODE_SEND_MSG)
     ServerConnection.sendMessage(self,request)
 def sendFriendListRequest(self):
     request = self.buildRequestPackage(self.CODE_SEND_LIST_MSG)
     ServerConnection.sendMessage(self,request)
 def sendInviteMessage(self,recipient):
     print "Sending invite to", recipient
     request = self.buildRequestPackage(self.CODE_SEND_MSG)
     request.addString(recipient)
     ServerConnection.sendMessage(self,request)
 def sendRequestMessage(self,username):
     request = self.buildRequestPackage(self.CODE_SEND_REQUEST_MSG)
     request.addString(username)
     ServerConnection.sendMessage(self,request)
 def sendUpdateMessage(self,username, status):
     #status is 0 if accepting a request, 1 if removing a friend or rejecting request
     request = self.buildRequestPackage(self.CODE_SEND_UPDATE_MSG)
     request.addString(username)
     request.addInt32(status)
     ServerConnection.sendMessage(self,request)
 def sendNull(self):
     request = self.buildRequestPackage(self.CODE_SEND_NULL)
     ServerConnection.sendMessage(self,request)
 def sendCurrency(self):
     request = self.buildRequestPackage(self.CODE_SEND_CURRENCY)
     ServerConnection.sendMessage(self,request)
 def sendPurchase(self,carId,typeId):
     request = self.buildRequestPackage(self.CODE_SEND_PURCHASE)
     request.addInt32(carId)
     request.addInt32(typeId)
     ServerConnection.sendMessage(self,request)
 def sendDetail(self,carId,typeId):
     request = self.buildRequestPackage(self.CODE_SEND_DETAILS)
     request.addInt32(carId)
     request.addInt32(typeId)
     ServerConnection.sendMessage(self,request)
 def sendCar(self,carId,paintId,tiresId):
     request = self.buildRequestPackage(self.CODE_SEND_CAR)
     request.addInt32(carId)
     request.addInt32(paintId)
     request.addInt32(tiresId)
     ServerConnection.sendMessage(self,request)