~cpp
# -*- coding: UTF-8 -*-
ID_OK = 200
ID_SENTENCE = 201
ID_TEXT = 202
ID_SAYNICK = 203
ID_SCOREBOARD = 204
MSG_OK = 'OKAY'
MSG_SENTENCE = 'SENTENCE'
class Message:
def __init__(self, msgType, sNum, msgBody, msgInfo=None):
self.messageType = msgType
self.seqNum = sNum
self.messageBody = msgBody
self.delimiter = '\r\n'
self.msgInfo = msgInfo
def __str__(self):
return 'MessageType : %d\nSequence Number : %d\nMessage Body : %s\nmsgInfo : %s\n' \
% (self.messageType, self.seqNum, self.messageBody, self.msgInfo)