Kết quả 1 đến 10 của 17
Chủ đề: Code Fix Lỗi VPoint SWeb
-
08-10-14, 08:53 PM #1
- Ngày tham gia
- Jun 2014
- Đang ở
- 0x00000000
- Bài viết
- 1,135
- Thanks
- 151
- Thanked 952 Times in 465 Posts
Code Fix Lỗi VPoint SWeb
tôi đã xem sơ qua và có đoạn này
Code:$general1 = "UPDATE MEMB_INFO SET vpoint = $check WHERE memb___id='$login'"; $msgeneral1 = $db->Execute($general1);
for($j=0;$j<$slg;$j++) ==> bug here
do đoạn code - vpoin nằm dưới vòng lặp for, vậy khi mình mua với số lượng là 1 thì ko sao, nhưng nếu mua số lượng > 1 mà trong hành trang ko đủ chổ trống thì nó bị bắt lỗi ngay đoạn
Code:if ( empty($reponse) ) { $notice = "Server bảo trì vui lòng liên hệ Admin để FIX"; exit(); } else { $info = read_TagName($reponse, 'info'); if ($info == "OK") { $inventory_rec= read_TagName($reponse, 'inventory'); if(strlen($inventory_rec) ==0) { echo "Dữ liệu trả về lỗi. Vui lòng liên hệ Admin để FIX"; $arr_view = "\nDataSend:\n"; foreach($getcontent_data as $k => $v) { $arr_view .= "\t". $k ."\t=>\t". $v .",\n"; } writelog("log_api.txt", $arr_view . $reponse); exit(); } }else if($info=="Error"){ echo read_TagName($reponse, 'msg'); exit(); } else { echo "Kết nối API gặp sự cố. Vui lòng liên hệ nhà cung cấp SWebMU để kiểm tra."; writelog("log_api.txt", $reponse); exit(); } }
vậy chúng ta có cách giải quyết như sau:
Cách 1: trừ tiền theo vòng lặp. Ví dụ mình add 1 thì trừ tiền 1 lần với giá = chính giá của vật phẩm mua. (chú ý là ko nhân với số lượng)
Cách 2: Tạo thêm 1 biến để kiểm tra khi thùng đồ đầy item. và đã add được bao nhiêu vào thùng đồ
Ở đây tôi làm theo cách 2. Vì cách 1 nó request lên SQL Server quá nhiều.
File: shop_item.php
Code:<?php include_once("security.php"); include_once("config.php"); include_once("function.php"); include('config/config_chucnang.php'); include('config/config_webshop_promotions.php'); $login=$_POST["login"]; $name=$_POST["name"]; $act = $_POST['act']; $item=$_POST["item"]; //ID Load $slg=$_POST["slg"]; $pass2 = $_POST['pass2']; $passtransfer = $_POST["passtransfer"]; if ($passtransfer == $transfercode) { $string_login = $_POST['string_login']; checklogin($login,$string_login); kiemtra_pass2($login,$pass2); kiemtra_doinv($login,$name); if(check_nv($login, $name) == 0) { echo "Nhân vật <b>{$name}</b> không nằm trong tài khoản <b>{$login}</b>. Vui lòng kiểm tra lại."; exit(); } switch ($act) { case 'shop_taphoa': $file_shop = 'config/shop_taphoa.txt'; $file_log = 'shop_taphoa.php'; break; case 'shop_event': $file_shop = 'config/shop_event.txt'; $file_log = 'shop_event.php'; break; case 'shop_acient': $file_shop = 'config/shop_acient.txt'; $file_log = 'shop_acient.php'; break; case 'shop_kiem': $file_shop = 'config/shop_kiem.txt'; $file_log = 'shop_kiem.php'; break; case 'shop_gay': $file_shop = 'config/shop_gay.txt'; $file_log = 'shop_gay.php'; break; case 'shop_cung': $file_shop = 'config/shop_cung.txt'; $file_log = 'shop_cung.php'; break; case 'shop_vukhikhac': $file_shop = 'config/shop_vukhikhac.txt'; $file_log = 'shop_vukhikhac.php'; break; case 'shop_khien': $file_shop = 'config/shop_khien.txt'; $file_log = 'shop_khien.php'; break; case 'shop_mu': $file_shop = 'config/shop_mu.txt'; $file_log = 'shop_mu.php'; break; case 'shop_ao': $file_shop = 'config/shop_ao.txt'; $file_log = 'shop_ao.php'; break; case 'shop_quan': $file_shop = 'config/shop_quan.txt'; $file_log = 'shop_quan.php'; break; case 'shop_tay': $file_shop = 'config/shop_tay.txt'; $file_log = 'shop_tay.php'; break; case 'shop_chan': $file_shop = 'config/shop_chan.txt'; $file_log = 'shop_chan.php'; break; case 'shop_trangsuc': $file_shop = 'config/shop_trangsuc.txt'; $file_log = 'shop_trangsuc.php'; break; case 'shop_canh': $file_shop = 'config/shop_canh.txt'; $file_log = 'shop_canh.php'; break; default: $file_shop = ''; break; } $item_read = shop_load($file_shop); $item_true = $item-1; $itemcode = $item_read[$item_true]['code']; if(($Use_Promotion_Webshop==1) && strtotime($Promotion_Webshop_Start)<time() && strtotime($Promotion_Webshop_End.' 23:59:00')>time()){ $price = $item_read[$item_true][price]-($item_read[$item_true][price]*($Promotion_Webshop/100)); }else{ $price = $item_read[$item_true]['price']; } $item_name = $item_read[$item_true]['des']; $item_hsd = $item_read[$item_true]['hsd']; if($item_hsd>1 && $slg>1){ echo "Đối với Item có thời hạn bạn chỉ được phép mua 1 lần 1 Item"; exit(); } if(strlen($itemcode)<=0){ echo "Trên server không tồn tại Item bạn mua. Vui lòng liên hệ admin để fix"; exit(); } $query = "select vpoint from MEMB_INFO WHERE memb___id='$login'"; $result = $db->Execute( $query ); $row = $result->fetchrow(); $gias = $slg*$price; $check=$row[0]-$gias; if( $check < 0 ){ echo "Bạn đang có $row[0] Vpoint. $slg đồ $item_name giá $gias Vpoint.<br>Bạn còn thiếu $check Vpoint"; exit(); } $count = 0; $bRet = 0; for($j=0;$j<$slg;$j++) { $bRet = 0; $item_seri_send = serial_gen(); $inventory=inventory($name); include_once('config_license.php'); include_once('func_getContent.php'); $getcontent_url = $url_license . "/api_webshop_buy.php"; $getcontent_data = array( 'acclic' => $acclic, 'key' => $key, 'name' =>$name, 'inventory' =>$inventory, 'itemcode' =>$itemcode, 'item_seri_send' =>$item_seri_send, //'slg' => $slg, ==> Stupid code 'item_hsd' => $item_hsd ); $reponse = _getContent($getcontent_url, $getcontent_data, $getcontent_method, $getcontent_curl); if ( empty($reponse) ) { $bRet = 1; //exit(); break; } else { $info = read_TagName($reponse, 'info'); if ($info == "OK") { $inventory_rec= read_TagName($reponse, 'inventory'); if(strlen($inventory_rec) ==0) { $bRet = 2; //exit(); break; } }else if($info=="Error"){ $bRet = 3; //exit(); break; } else { $bRet = 4; //exit(); break; } } $general = "UPDATE Character SET [inventory]=0x$inventory_rec WHERE name='$name'"; $msgeneral = $db->Execute($general) or die("Loi query: $general"); $count++; } if ($bRet > 0 && $count <= 0) { if ($bRet == 1){ $notice = "Server bảo trì vui lòng liên hệ Admin để FIX"; }else if ($bRet == 2) { echo "Dữ liệu trả về lỗi. Vui lòng liên hệ Admin để FIX"; $arr_view = "\nDataSend:\n"; foreach($getcontent_data as $k => $v) { $arr_view .= "\t". $k ."\t=>\t". $v .",\n"; } writelog("log_api.txt", $arr_view . $reponse); }else if ($bRet == 3) { echo read_TagName($reponse, 'msg'); }else if ($bRet == 4) { echo "Kết nối API gặp sự cố. Vui lòng liên hệ nhà cung cấp SWebMU để kiểm tra."; writelog("log_api.txt", $reponse); }else{ $notice = "Loi chua biet liên hệ Admin để FIX"; } exit(); } $PricePay = $count * $price; if ($count > 0){ $strQuery = "UPDATE MEMB_INFO SET vpoint = vpoint - $PricePay WHERE memb___id = '$login'"; $pResult = $db->Execute($strQuery) or die("Query Error: $strQuery"); } //Ghi vào Log nhung nhan vat mua Item $info_log_query = "SELECT gcoin, gcoin_km, vpoint FROM MEMB_INFO WHERE memb___id='$login'"; $info_log_result = $db->Execute($info_log_query); check_queryerror($info_log_query, $info_log_result); $info_log = $info_log_result->fetchrow(); $log_acc = "$login"; $log_gcoin = $info_log[0]; $log_gcoin_km = $info_log[1]; $log_vpoint = $info_log[2]; $log_price = "- $PricePay Vpoint"; $log_Des = "Mua $count vật phẩm $item_name .Seri: $log_seri"; $log_time = $timestamp; $insert_log_query = "INSERT INTO Log_TienTe (acc, gcoin, gcoin_km, vpoint, price, Des, time) VALUES ('$log_acc', $log_gcoin, $log_gcoin_km, $log_vpoint, '$log_price', '$log_Des', $log_time)"; $insert_log_result = $db->execute($insert_log_query); check_queryerror($insert_log_query, $insert_log_result); //End Ghi vào Log nhung nhan vat mua Item echo "OK<nbb>$PricePay<nbb>Bạn đã mua thành công $count Item $item_name. Bạn đã bị trừ $PricePay V.Point"; } $db->Close(); ?>
Code:<?php include('checklic.php'); include('func_item.php'); $Name = $_POST['name']; $inventory = $_POST['inventory']; $itemcode = $_POST['itemcode']; $item_seri_send = $_POST['item_seri_send']; //$slg = $_POST['slg']; ==> Stupid code $item_hsd = $_POST['item_hsd']; $item_hsd = abs(intval($item_hsd)); if($item_hsd!=0){ $invetory_after = item_charactersweb_thue($itemcode,$inventory,$item_seri_send,$item_hsd); }else{ $invetory_after = item_charactersweb($itemcode,$inventory,$item_seri_send); } if(isset($invetory_after)){ echo " <info>OK</info> <inventory>$invetory_after</inventory> "; }else{ $Content = "Thùng đồ của $Name không còn chỗ trống"; echo " <info>Error</info> <msg>$Content</msg> "; } ?>
Đây là code mẫu mình chỉ làm ở file đó. Còn chỗ nào thì các bạn tự xem code và thêm vào nhé.
Tôi có xem qua 1 số file. Và cũng thấy nhiều đoạn code lũng cũng, ko cần thiêt, hoặc có thể viết 1 cách ngắn gọn hơn. Và có nhiều cái rất hài hước như
Đoạn serial của bless nén level 0 (10 cục) như sau
1E0000001234560000C0000000000000
trong code php đã có GenSerial, mà trong code item lại để 123456.
Code bless no Serial: 1E0000000000000000C000FFFFFFFFFF
Code bless have serial: 1E0000000046510000C000FFFFFFFFFF
Nếu như dùng tool check dupe quét thì chắc chắn sẽ bị xóa. vì trùng serial. Nếu ai xài GS của tôi thì ko cần dùng tool. GS tự quét. Mà GS tự quét thì MU chắc đóng cửa sớm.
Thường thì những ngọc này ko check serial. nên nó là lý do vì sao bị dupe
P/S: Ai xài thì xài, không xài thì đừng có ném đã.
À, Bạn thiensu_muvn xài là dog nhé. Nói thẳng luôn.
-
The Following 9 Users Say Thank You to BladeKnight109 For This Useful Post:
babykute (06-12-14),
freepro921(08-10-14),gauyeutho(08-10-14), huntersun (09-10-14), lequangvu (08-10-14), nampro (09-10-14), nyD-vEnus (08-10-14), The Gamer (08-10-14), vn55594555 (09-10-14)
-
08-10-14, 08:56 PM #2
Ðề: Code Fix Lỗi VPoint SWeb
Cái này NBB không sao chứ ????????
Khách viếng thăm hãy cùng nyD-vEnus xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
08-10-14, 08:59 PM #3
- Ngày tham gia
- Jun 2014
- Đang ở
- 0x00000000
- Bài viết
- 1,135
- Thanks
- 151
- Thanked 952 Times in 465 Posts
Ðề: Code Fix Lỗi VPoint SWeb
-
08-10-14, 09:58 PM #4
- Ngày tham gia
- Aug 2007
- Đang ở
- Cung trăng
- Bài viết
- 2,274
- Thanks
- 797
- Thanked 824 Times in 593 Posts
Ðề: Code Fix Lỗi VPoint SWeb
NBB thì không hề bị như vậy đâu, chỉ sweb lôi về viết lại code và không test kỹ nên mới để lỗi tè le ra vậy thôi.
Đã có hướng dẫn fix chi tiết rồi các bạn vào tự ngâm cứu mà fix đi nhé.
@BladeKnight109: cười nhất bạn chỗ này
//'slg' => $slg, ==> Stupid code
Người viết đoạn này gốc là nbb thì không Stupid code đâu bạn, mà người lấy code nbb về dev thành cái web này đã thêm bớt code lại làm không đúng nên đoạn code mới Stupid như bạn thấy thôi
-
08-10-14, 11:23 PM #5
Ðề: Code Fix Lỗi VPoint SWeb
Làm phép tính sau để cho ra kết quả: 1 + 1 x 2 = ? (gợi ý câu trả lời: 3)
NBB v.5.14.0601 mình đang dùng thì k bị , không biết những ver trước có k !Khách viếng thăm hãy cùng nyD-vEnus xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
09-10-14, 12:43 AM #6
- Ngày tham gia
- Jun 2014
- Đang ở
- 0x00000000
- Bài viết
- 1,135
- Thanks
- 151
- Thanked 952 Times in 465 Posts
Ðề: Code Fix Lỗi VPoint SWeb
-
09-10-14, 08:19 AM #7
-
09-10-14, 09:03 AM #8
Ðề: Code Fix Lỗi VPoint SWeb
Khách viếng thăm hãy cùng nyD-vEnus xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
09-10-14, 09:03 AM #9
- Ngày tham gia
- Sep 2008
- Đang ở
- Virtual World
- Bài viết
- 401
- Thanks
- 80
- Thanked 191 Times in 84 Posts
Ðề: Code Fix Lỗi VPoint SWeb
lót chiếu nằm chờ server của bác Bladenight tung ra [-O
Khách viếng thăm hãy cùng vn55594555 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
09-10-14, 09:45 AM #10
- Ngày tham gia
- Jul 2012
- Đang ở
- https://t.me*********
- Bài viết
- 976
- Thanks
- 520
- Thanked 471 Times in 280 Posts
Ðề: Code Fix Lỗi VPoint SWeb
Khách viếng thăm hãy cùng YouTobe xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
Các Chủ đề tương tự
-
[MU] Lỗi khi đổi Item Vpoint ra Vpoint web NBB v5.12
Bởi bluesky089 trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 4Bài viết cuối: 24-04-13, 02:02 AM -
[MU] Xin code tặng vpoint sau khi reset
Bởi The Gamer trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 6Bài viết cuối: 15-02-13, 09:07 PM -
[MU] Xin đoạn code query tặng Vpoint
Bởi duyanh12285 trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 1Bài viết cuối: 15-02-13, 08:52 PM -
[MU] Hỏi về code web đổi từ SCFPCPoint sang Vpoint của TV3.5
Bởi phusang trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 11Bài viết cuối: 24-10-12, 11:54 AM