版本比较
Night-局域网联机版V1.0.0
正文
增加 18 行删除 1 行
386 行未改动全部展开38738838939039139239339480 行未改动47547647747847948048148248348448548671 行未改动558559560561562563564565270 行未改动全部展开8368378388398408418428439 行未改动853854855856857858859860114 行未改动全部展开975976977978979980386 行未改动全部展开Send_message(make_message(Connect_id,client_connect_ids[i],val0));}Send_message(make_message(Connect_id,client_connect_ids[i],k0));}}bool Game_over_check(){if(Task_finish>=Task_sum){game_end_send("船员完成所有任务,船员胜利!");80 行未改动if(msg.Information[0]=="Finish_task"){Task_finish++;recv_client_num++;}if(msg.Information[0]=="Kill_player"){Kill(stoi(msg.Information[1]),stoi(msg.Information[2]));recv_client_num++;}}for(int i=0;i<PL_player_num;i++){vector<string> k0;k0.push_back("Night_end");Send_message(make_message(Connect_id,client_connect_ids[i],k0));71 行未改动Game();while(true);return 0;}~~~## GameClient.cpp~~~cpp#include"client.h"270 行未改动全部展开vector<string> k0;k0.push_back("Finish_task");Send_message(make_message(Connect_id,Room_id,k0));cout<<"你完成了一个任务\n";}}if(PL_prof=="内鬼"||PL_prof=="间谍"||PL_prof=="摄魂怪"||PL_prof=="狙击手"||PL_prof=="忍者"){bool can_kill=Random(1,100)<=Kill_percent;9 行未改动k0.push_back(to_string(kill_num));Send_message(make_message(Connect_id,Room_id,k0));}else{cout<<"你今天不能杀人\n";}}}void Vote_PL(int k){114 行未改动全部展开while(true) Game();while(true);return 0;}~~~## [使用的server.cpp、client.cpp、client.h](https://www.luogu.com.cn/article/b49glkaz)386 行未改动全部展开38738838939039139239339439539639780 行未改动47847948048148248348448548648748848949049149271 行未改动564565566567568569570571572270 行未改动全部展开8438448458468478488498508518528538548559 行未改动865866867868869870871872873874875876114 行未改动全部展开991992993994995996997386 行未改动全部展开Send_message(make_message(Connect_id,client_connect_ids[i],val0));}Send_message(make_message(Connect_id,client_connect_ids[i],k0));}for(int i=1;i<=player_num;i++){cout<<players[i].Name<<'-'<<players[i].Prof<<' '<<players[i].Alive?"存活\n":"死亡\n";}}bool Game_over_check(){if(Task_finish>=Task_sum){game_end_send("船员完成所有任务,船员胜利!");80 行未改动if(msg.Information[0]=="Finish_task"){Task_finish++;recv_client_num++;}if(msg.Information[0]=="Nothing_happened"){Kill(stoi(msg.Information[1]),stoi(msg.Information[2]));recv_client_num++;}if(msg.Information[0]=="Check_player"){recv_client_num++;}}for(int i=0;i<PL_player_num;i++){vector<string> k0;k0.push_back("Night_end");Send_message(make_message(Connect_id,client_connect_ids[i],k0));71 行未改动Game();while(true);return 0;}~~~## GameClient.cpp~~~cpp#include"client.h"270 行未改动全部展开vector<string> k0;k0.push_back("Finish_task");Send_message(make_message(Connect_id,Room_id,k0));cout<<"你完成了一个任务\n";}else if(choose=='Q'){vector<string> k0;k0.push_back("Nothing_happened");Send_message(make_message(Connect_id,Room_id,k0));cout<<"你什么也没做\n";}}if(PL_prof=="内鬼"||PL_prof=="间谍"||PL_prof=="摄魂怪"||PL_prof=="狙击手"||PL_prof=="忍者"){bool can_kill=Random(1,100)<=Kill_percent;9 行未改动k0.push_back(to_string(kill_num));Send_message(make_message(Connect_id,Room_id,k0));}else{cout<<"你今天不能杀人\n";vector<string> k0;k0.push_back("Nothing_happened");Send_message(make_message(Connect_id,Room_id,k0));cout<<"你什么也没做\n";}}}void Vote_PL(int k){114 行未改动全部展开while(true) Game();while(true);return 0;}~~~## [使用的server.cpp、client.cpp、client.h](https://www.luogu.com.cn/article/b49glkaz)