[기타]이 소스를 봐도 어떻게 하라는지 모르겠어서 부탁드립니다.
member photo 이승모 1 1,797 0 2004-10-25 16:14:30
#include <구조.h>
#include <관리자.h>

inherit LIB_DAEMON;

#define DIR "/유저데이타/플레이어."
#define TRUE 1

mixed CMD(string str)
{
  object ob;
  string pl, dt, temp, stmp, *buf;
  int i, len, itmp, itmp1, itmp2, itmp3;
  
  if (sscanf(str, "%s %s", pl, dt) != 2)
    return "입력형식이 잘못되었습니다.";

  if (!ob = find_player(pl))
    return "플레이어("+pl+")가 접속해있지 않습니다.";
  
  temp = read_file(DIR+dt, 1, 1);
  if (!temp || !sizeof(temp))
    return "지정한 파일("+DIR+dt+")이 존재하지 않습니다.";
  
  if (!len = file_length(DIR+dt))
    return "지정한 화일("+DIR+dt+")을 읽는중 에러 발생";

  for (i = 0; i < len; i++)
  {
    temp = read_file(DIR+dt, i, 1);
    if (!temp || !sizeof(temp)) break;

    if (sscanf(temp, "NAME %s,TOTAL", stmp) != 1) continue;
    if (stmp != pl) continue;
    
    // 총수련치 셋팅
    sscanf(temp, ",TOTAL_10 %d,", itmp1);
    sscanf(temp, ",TOTAL_1 %d,", itmp2);
    sscanf(temp, ",TOTAL %d,", itmp3);
    ob->setTotalExp((itmp1*1000000000)+(itmp2*100000000)+itmp3);
    message("에러", "총수련치 셋팅 완료", creators());
            
    // 현수련치 셋팅
    sscanf(temp, ",REAL %d,", itmp);
    ob->setExp(itmp);
    message("에러", "현수련치 셋팅 완료", creators());
    
    // 명성 셋팅
    sscanf(temp, ",FAME %d,", itmp);
    ob->setFame(itmp);
    message("에러", "명성 셋팅 완료", creators());

    // 소지금 셋팅
    sscanf(temp, ",GOLD %d,", itmp);
    ob->setGold(itmp);
    message("에러", "소지금 셋팅 완료", creators());

    // 독문무기 셋팅
    sscanf(temp, ",WEAPON %d,", itmp);
    ob->setWeaponLevel("독문", itmp);
    message("에러", "독문무기 셋팅 완료", creators());

    // 특성치 셋팅
    sscanf(temp, ",HIM %d,", itmp);
    ob->setStat("힘", itmp);
    sscanf(temp, ",MIN %d,", itmp);
    ob->setStat("민첩", itmp);
    sscanf(temp, ",GI %d,", itmp);
    ob->setStat("기골", itmp);
    sscanf(temp, ",NAE %d,", itmp);
    ob->setStat("내공", itmp);
    sscanf(temp, ",JI %d,", itmp);
    ob->setStat("지혜", itmp);
    sscanf(temp, ",TOO %d,", itmp);
    ob->setStat("투지", itmp);
    message("에러", "특성치 셋팅 완료", creators());
    
    // 칠보갑주 셋팅
    sscanf(temp, ",CHILHIM %d,", itmp);
    ob->setChilboStat("힘", itmp);
    sscanf(temp, ",CHILMIN %d,", itmp);
    ob->setChilboStat("민첩", itmp);
    sscanf(temp, ",CHILGI %d,", itmp);
    ob->setChilboStat("기골", itmp);
    sscanf(temp, ",CHILNAE %d,", itmp);
    ob->setChilboStat("내공", itmp);
    sscanf(temp, ",CHILJI %d,", itmp);
    ob->setChilboStat("지혜", itmp);
    sscanf(temp, ",CHILTOO %d,", itmp);
    ob->setChilboStat("투지", itmp);
    sscanf(temp, ",CHILARMOR %d", itmp);
    ob->setChilboStat("방어력", itmp);
    message("에러", "칠보갑주 셋팅 완료", creators());
    
    // 기술 셋팅
    sscanf(temp, ",SKILL ([%s]),", stmp);
    buf = explode(stmp, ",");
    for (i = 0; i < sizeof(buf); i++)
    {
      if (sscanf(buf[i], "\"%s\":%d", stmp, itmp) != 2) continue;
      ob->setSkillData(stmp, itmp);
    }        
    message("에러", "기술 셋팅 완료", creators());

    message("에러", "복구 완료", creators());
    return 1;
  }
  
  message("에러", "지정된 유저데이터("+DIR+dt+")에 플레이어("+pl+") 데이터가 "
          "존재하지 않습니다", creators());
  return 1;
}


알려주시면 감사하겠습니다;; 이쪽은 잘 몰라서;
0
1Comments
member photo
미르 2004.10.25(월) 오후 11:45:21
뭘하시려는건데요?? 소스에대한 해석??
코멘트를 삭제할 비밀번호를 입력하세요.
비밀번호:
정회원 이상만 코멘트 쓰기가 가능합니다.
총 게시물 955개 / 검색된 게시물: 955개
쪽지를 전송하고 있습니다. 잠시 기다려주세요.
쪽지보내기
받는이(ID/닉네임)
내용
쪽지가 도착하였습니다.
쪽지 내용을 읽어오고 있습니다. 잠시 기다려주세요.
--