MCPcopy Create free account
hub / github.com/bwapi/bwapi / processCommands

Method processCommands

bwapi/BWAPI/Source/BWAPI/Server.cpp:755–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753 }
754 }
755 void Server::processCommands()
756 {
757 for(int i = 0; i < data->commandCount; ++i)
758 {
759 BWAPIC::CommandType::Enum c = data->commands[i].type;
760 int v1 = data->commands[i].value1;
761 int v2 = data->commands[i].value2;
762 switch (c)
763 {
764 case BWAPIC::CommandType::SetScreenPosition:
765 if (Broodwar->isInGame())
766 Broodwar->setScreenPosition(v1,v2);
767 break;
768 case BWAPIC::CommandType::PingMinimap:
769 if (Broodwar->isInGame())
770 Broodwar->pingMinimap(v1,v2);
771 break;
772 case BWAPIC::CommandType::EnableFlag:
773 if (Broodwar->isInGame())
774 Broodwar->enableFlag(v1);
775 break;
776 case BWAPIC::CommandType::Printf:
777 if (Broodwar->isInGame())
778 Broodwar->printf("%s", data->strings[v1]);
779 break;
780 case BWAPIC::CommandType::SendText:
781 if (Broodwar->isInGame())
782 Broodwar->sendTextEx(v2 != 0, "%s", data->strings[v1]);
783 break;
784 case BWAPIC::CommandType::PauseGame:
785 if (Broodwar->isInGame())
786 Broodwar->pauseGame();
787 break;
788 case BWAPIC::CommandType::ResumeGame:
789 if (Broodwar->isInGame())
790 Broodwar->resumeGame();
791 break;
792 case BWAPIC::CommandType::LeaveGame:
793 if (Broodwar->isInGame())
794 Broodwar->leaveGame();
795 break;
796 case BWAPIC::CommandType::RestartGame:
797 if (Broodwar->isInGame())
798 Broodwar->restartGame();
799 break;
800 case BWAPIC::CommandType::SetLocalSpeed:
801 if (Broodwar->isInGame())
802 Broodwar->setLocalSpeed(v1);
803 break;
804 case BWAPIC::CommandType::SetLatCom:
805 Broodwar->setLatCom(v1 == 1);
806 break;
807 case BWAPIC::CommandType::SetGui:
808 Broodwar->setGUI(v1 == 1);
809 break;
810 case BWAPIC::CommandType::SetFrameSkip:
811 if (Broodwar->isInGame())
812 Broodwar->setFrameSkip(v1);

Callers

nothing calls this directly

Calls 15

printfMethod · 0.80
sendTextExMethod · 0.80
UnitCommandClass · 0.50
isInGameMethod · 0.45
setScreenPositionMethod · 0.45
pingMinimapMethod · 0.45
enableFlagMethod · 0.45
pauseGameMethod · 0.45
resumeGameMethod · 0.45
leaveGameMethod · 0.45
restartGameMethod · 0.45
setLocalSpeedMethod · 0.45

Tested by

no test coverage detected