feat: add gated CH5 quiver support and unified regression runner
This commit is contained in:
@@ -942,7 +942,13 @@ bool FakeLoginServer::ServeGame(Connection& c, int index)
|
||||
return c.Send(chat)&&c.Send(cmd.c_str(),cmd.size()+1);
|
||||
};
|
||||
const std::string r=std::to_string(request);
|
||||
if(kind=="cap") {if(!reply("MTF1 cap "+r+" 1 63 1700000000"))return Fail(name+": feature cap");}
|
||||
if(kind=="cap") {if(!reply("MTF1 cap "+r+" 1 "+(std::getenv("MT_TEST_QUIVER")?"2111":"63")+" 1700000000"))return Fail(name+": feature cap");}
|
||||
else if(kind=="quiver" && std::getenv("MT_TEST_QUIVER")) {
|
||||
if(!reply("MTF1 begin "+r+" quiver 0 0 0 0 1700000000") || !reply("MTF1 end "+r+" 0"))return Fail(name+": quiver ack");
|
||||
std::uint8_t state[6]={219,0,0,0,0,9};std::uint32_t vid=kMainVID;
|
||||
std::memcpy(state+1,&vid,4);
|
||||
if(!c.Send(state,sizeof(state)))return Fail(name+": quiver state");
|
||||
}
|
||||
else if(kind=="calendar") {
|
||||
if(!reply("MTF1 begin "+r+" calendar 1 0 2 0 1700000000") ||
|
||||
!reply("MTF1 event "+r+" 0 1 1 1700000000 1700003600 0 0 1") ||
|
||||
@@ -976,6 +982,13 @@ bool FakeLoginServer::ServeGame(Connection& c, int index)
|
||||
if(!reply("MTF1 end "+r+" "+std::to_string(sent)))return Fail(name+": feature end");
|
||||
}
|
||||
}
|
||||
else if (std::getenv("MT_TEST_QUIVER") && text.rfind("/quiver_test ",0)==0) {
|
||||
unsigned type=0;
|
||||
if(sscanf(text.c_str()+13,"%u",&type)!=1 || (type!=0 && type!=6 && type!=9))return Fail(name+": invalid test quiver");
|
||||
std::uint8_t state[6]={219,0,0,0,0,std::uint8_t(type)};std::uint32_t vid=kMainVID;
|
||||
std::memcpy(state+1,&vid,4);
|
||||
if(!c.Send(state,sizeof(state)))return Fail(name+": test quiver state");
|
||||
}
|
||||
else if (text == "/server_bonuses") {
|
||||
const std::string cmd = "ServerBonuses 200 200 200 200 200 0 200 0";
|
||||
GCChatHead chat = {HDR_GC_CHAT, static_cast<std::uint16_t>(sizeof(GCChatHead) + cmd.size() + 1), 5, 0, 1};
|
||||
|
||||
Reference in New Issue
Block a user