首页 > 代码库 > 程序记录3(设置机器人2,新)

程序记录3(设置机器人2,新)

    int userID = 50000;
    int mapID = 1005;

    for (int j = 0; j < 10000; ++j)
    {
        UserInfo uinfo = {0};
        uinfo.userID = userID + j;
        sprintf_s(uinfo.userName, MAX_NAME_LENGTH, "map%duser%04d", mapID, j);
        strcpy(uinfo.userPwd, "123");
        i->addUser_(uinfo);
        if(j < 5000)
        {
            ActorInfo ainfo = {0};
            ainfo.id = userID + uinfo.userID % userID * 2;
            sprintf_s(ainfo.name, "map%dplayer%04d", mapID, j * 2);
            ainfo.prof = Role_DS;
            ainfo.sex = DB::sex::MAN;
            i->addActor_(uinfo.userID, ainfo);

            memset(&ainfo, 0, sizeof(ActorInfo));
            ainfo.id = userID + uinfo.userID % userID * 2 + 1;
            sprintf_s(ainfo.name, "map%dplayer%04d", mapID, j * 2 + 1);
            ainfo.prof = Role_DS;
            ainfo.sex = DB::sex::MAN;
            i->addActor_(uinfo.userID, ainfo);
        }
    }
    //设置MapID
    int actidStart = 50000;
    int mapID = 1005;
    for (int j = actidStart; j < actidStart + 10000; ++j)
    {
        i->setActorMap(j, mapID);
    }