本文整理汇总了C++中reader::read方法的典型用法代码示例。如果您正苦于以下问题:C++ reader::read方法的具体用法?C++ reader::read怎么用?C++ reader::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reader
的用法示例。
在下文中一共展示了reader::read方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_sent_chat_message
void handle_sent_chat_message(vector<char> packet, reader r){
Bot* my_bot = Bot::instance();
string message;
r.read(U);
r.read(message);
// create stream with message
stringstream stream;
stream.str(message);
// process
string command;
stream >> command;
if (command == "/start"){
my_bot->state = E_STATE_NOENEMY;
// store star coords to save starting coords
my_bot->start_X = my_bot->X;
my_bot->start_Y = my_bot->Y;
//GET FIRST PARAMETER
//int whatever;
//stream >> whatever;
//cout << "Started with parameter " << whatever << endl;
}
else if (command == "/stop"){
my_bot->state = E_STATE_STOPPED;
}
else if (command == "/monsters"){
cout << "MONSTERS:" << endl;
for each(auto mob in my_bot->monsters){
cout << "Mob ID:" << mob.second.ID << ", coords: [" << mob.second.X << ", " << mob.second.Y << "]" << endl;
}
}
示例2: handle_rest_packet
void handle_rest_packet(vector<char> packet, reader r){
byte param;
r.read(U);
r.read(param);
cout << "Rest packet sent with param: " << dec << (int)param << endl;
}
示例3: handle_load_player
void handle_load_player(vector<char> packet, reader r){
DWORD player_ID, p1, p2;
r.read(U);
r.read(player_ID);
r.read(p1);
r.read(p2);
//cout << "Selected player ID = " << player_ID << endl;
}
示例4: handle_use_item_packet
void handle_use_item_packet(vector<char> packet, reader r){
DWORD param;
r.read(U);
r.read(param);
cout << "used item ID: " << hex << (int)param << endl;
}
示例5: handle_skill_attack
void handle_skill_attack(vector<char> packet, reader r){
DWORD monster_ID;
byte skill_ID, p1;
r.read(U);
r.read(skill_ID);
r.read(p1);
r.read(monster_ID);
cout << dec << "sent: Attack with Skill: skill_id=" << (int)skill_ID << ", p1 = " << (int)p1 << ", monster_id = " << (int)monster_ID << "time: " << GetTickCount() << endl;
}
示例6: handle_preskill
void handle_preskill(vector<char> packet, reader r){
DWORD monster_id;
byte skill_id;
r.read(U);
r.read(skill_id);
r.read(monster_id);
cout << dec << "sent: Preskill with skill_id = " << (int)skill_id << ", monster_id = " << (int)monster_id << "time: " << GetTickCount() << endl;
}
示例7: handle_attack
void handle_attack(vector<char> packet, reader r){
DWORD monster_ID, p2;
byte p1;
r.read(U);
r.read(p1);
r.read(monster_ID);
r.read(p2);
cout << dec << "sent: Attack, p1=" << (int)p1 << ", monster_id=" << (int)monster_ID << ", p3=" << (int)p2 << "time: " << GetTickCount() << endl;
}
示例8: handle_move_end_packet
void handle_move_end_packet(vector<char> packet, reader r){
Bot* my_bot = Bot::instance();
signed char dX, dY, dZ;
r.read(U);
r.read(dX);
r.read(dY);
r.read(dZ);
my_bot->X += dX;
my_bot->Y += dY;
my_bot->Z += dZ;
cout << "sent move end packet" << endl;
}
示例9: handle_check_version_packet
void handle_check_version_packet(vector<char> packet, reader r){
// init maps in bot
Bot* my_bot = Bot::instance();
my_bot->setup();
//read U
r.read(U);
// send login
send_login_packet();
//cout << "sent login packet" << endl;
}
示例10: identify
symbol * assembler::read(symbol & ans)
{ string s = rdr.read();
return identify(s, ans); }