Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   CacheD C1 (https://postpacific.loc-online.com/showthread.php?t=3033)

SolarWind 19.01.2006 13:09

CacheD C1
 
I can't decrase quantity of user items through 2009 port of CashD (C1).
Somebody help me with "DelItem"=>"13;charName;warehouse;itemId;itemAmoun t"

12\t
4\t
5\t
working, but not 13\t

What's wrong?

some cut of code..
Code:

function cached($command){
global $cached_ip,$cached_port;
  $fp=fsockopen("127.0.0.1", 2009, $errno, $errstr);
  if(!$fp)return 0;
  else{
    fwrite($fp, $command);
    stream_set_timeout($fp, 2);
    $answ=fgets($fp,8);
    return "$answ";
  }
}

function delete_item($char_name,$item_id,$amount){
global $cached_errors;
  kick_char($char_name);
  $command="13\t$char_name\t0\t$item_id\t$amount\t\n";
  $answ=cached($command);
  if($answ==="1")return "...";
  else return "<font color=red>Error:</font><font color=red>$cached_errors[$answ]</font>...";
}

...

      echo "<form method=post action='solarwind_cached_cmd.php'>";
      echo "Char name<input type='text' name='char_name'> ";
      echo "Amount<input type='text' name='amount'> ";
      echo "<input type='submit' value='...'>";
      echo "</form>";
      if ( isset( $_REQUEST['char_name'] ) and isset( $_REQUEST['amount'] ) ){
              $char_name = trim($_REQUEST['char_name']);
        $amount = intval($_REQUEST['amount']);
        $result = delete_item($char_name,57,$amount);
        echo "
".$result;
        log_it("[...]: $result",$ip);
      }

russian replaced...

10x 2 darkagent 4:
Code:

"AddItem"=>"12;charName;warehouse;itemType;itemAmount;enchant;eroded;bless;ident;wished",
"AddSkill"=>"6;charName;skillid;skilllevel",
"BanCharacter"=>"39;charName;banHour",
"ChangeCharacterName"=>"4;oldCharName;newCharName",
"ChangePledgeLevel"=>"46;pledgeName;pledgeLevel",
"ChangePledgeOwner"=>"37;pledgeName;newOwnerName",
"CopyCharacter"=>"43;srcCharName;newCharName;destAccountId",
"CreatePet"=>"44;charName;petCollarClassId;npcClassId;exp;level;hp;mp;meal",
"CreatePledge"=>"47;pledgeName;ownerCharName",
"DelBookmark"=>"24;charId;bookmarkName",
"DeleteCharacter"=>"34;charName",
"DeleteComment"=>"33;commentId;option",
"DeletePledge"=>"38;pledgeName",
"DelItem"=>"13;charName;warehouse;itemId;itemAmount",
"DelItem2"=>"54;itemId",
"DelPledgeCrest"=>"25;pledgeName",
"DelQuest"=>"11;charName;questId",
"DelSkill"=>"7;charName;skillId",
"DisableCharacter"=>"20;charName;option",
"EnableCharacter"=>"21;charName;accountId",
"KickCharacter"=>"5;charName",
"ManageAnnounce"=>"50;action;announceId;announceMsg",
"ManageIntervalAnnounce"=>"51;action;interval;announceId;announceMsg",
"ModifyCharacter"=>"15;charName;newSp;newExp;newAlign;newPk;newPkPardon;newDuel",
"ModifyCharacter2"=>"16;charName;newGender;newRace;newClass;newFace;newHairShape;newHairColor",
"ModifyCharacterDelta"=>"29;charName;deltaSp;deltaExp;deltaAlign;deltaPk;deltaPkPardon;deltaDuel",
"ModifyCharacterPledge"=>"17;charName;nickName",
"ModifyItem"=>"14;charName;warehouse;itemId;newItemType;newItemAmount;newEnchant;newEroded;newBless;newIdent;newWished",
"ModifyPledgeName"=>"26;pledgeName;newPledgeName",
"ModifySkill"=>"8;charName;skillId;newSkillLevel",
"ModifyWeeklyPlay"=>"52;charName;type;minute",
"MoveCharacter"=>"31;charName;newAccountId;newAccountName",
"MoveItem"=>"30;charName;warehouse;itemId;receiverCharId;receiverWareHouse",
"MoveItem2"=>"40;charName;itemId;receiverCharId;receiverWareHouse",
"OustPledge"=>"36;charName",
"PunishCharacter"=>"18;charName;punishId;remainTime",
"RestoreCharacter"=>"35;charId;accountId;accountName",
"RestoreCharacter2"=>"49;charId;newCharName;accountId;accountName",
"SeizeFreeItem"=>"53;2;itemId",
"SeizeItem"=>"53;1;itemId",
"SeizeItem2"=>"28;option;charName;warehouse;itemId",
"SendHome"=>"45;charName",
"SetBookmark"=>"23;charId;bookmarkName;worldId;xLoc;yLoc;zLoc",
"SetBuilderAccount"=>"19;accountName;builderLevel",
"SetBuilderCharacter"=>"3;charName;builderLevel",
"SetCharacterLocation"=>"2;charName;worldId;xLoc;yLoc;zLoc",
"SetOneTimeQuest"=>"9;charName;questId;questState",
"SetProhibited"=>"27;option;charName",
"SetQuest"=>"10;charName;questId;questState",
"SetSkillAll"=>"48;charName",
"WriteComment"=>"32;charName;comment;writer"


SolarWind 19.01.2006 16:01

Re: CacheD C1
 
darkagent 10x again
"DelItem"=>"13;charName;warehouse;itemId;itemAmoun t"
itemId <> type_id

that's uniq item id in user_item :(


All times are GMT. The time now is 16:03.