def handleChatMessage(sender_id, message_text): # pylint: disable=invalid-name """Called when this player receives a chat message. sender_id is the player who sent the message, and message_text is the text of the sent message.""" empire = fo.getEmpire() if empire.eliminated: print "This empire has been eliminated. Ignoring chat message" return # print "Received chat message from " + str(senderID) + " that says: " + messageText + " - ignoring it" # perhaps it is a debugging interaction if handle_debug_chat(sender_id, message_text): return if not diplomatic_corp: DiplomaticCorp.handle_pregame_chat(sender_id, message_text) else: diplomatic_corp.handle_midgame_chat(sender_id, message_text)
def handleChatMessage(sender_id, message_text): # pylint: disable=invalid-name """Called when this player receives a chat message. sender_id is the player who sent the message, and message_text is the text of the sent message.""" empire = fo.getEmpire() if empire is None: fatal("This client has no empire. Doing nothing to handle chat message.") return if empire.eliminated: debug("This empire has been eliminated. Ignoring chat message") return # debug("Received chat message from " + str(senderID) + " that says: " + messageText + " - ignoring it") # perhaps it is a debugging interaction if get_option_dict().get('allow_debug_chat', False) and handle_debug_chat(sender_id, message_text): return if not diplomatic_corp: DiplomaticCorp.handle_pregame_chat(sender_id, message_text) else: diplomatic_corp.handle_midgame_chat(sender_id, message_text)