浏览代码

Announce handicap in welcome message

Laserlicht 1 年之前
父节点
当前提交
afd580b76a
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      server/CVCMIServer.cpp

+ 11 - 0
server/CVCMIServer.cpp

@@ -1034,6 +1034,17 @@ void CVCMIServer::multiplayerWelcomeMessage()
 
 	gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
 
+	for (const auto & pi : si->playerInfos)
+		if(pi.second.isControlledByHuman() && !pi.second.handicap.empty())
+		{
+			MetaString str;
+			str.appendTextID("vcmi.lobby.handicap");
+			str.appendRawString(" ");
+			str.appendName(pi.first);
+			str.appendRawString(": " + pi.second.handicap.toString());
+			announceTxt(str);
+		}
+
 	std::vector<std::string> optionIds;
 	if(si->extraOptionsInfo.cheatsAllowed)
 		optionIds.emplace_back("vcmi.optionsTab.cheatAllowed.hover");