引用 | 編輯
ebolaman
2011-08-13 18:42 |
32樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-13 13:00 發表的 : MD5 是 CS_Update 資料夾中 壓縮檔 內 "原本檔案的 MD5" 是為了和客戶端的檔案作比較 如果 "客戶端的 X 檔案" 與 "伺服器 Index.txt 內提供的 Md5" 不相符(也就是兩個檔案不一樣),才會下載這個檔案,然後更新 否則就略過不下載 連結到的資料夾是 CS_Update 例如 ftp://1.2.3.4/ 則在 FTP伺服端的 根資料夾(最上層的資料夾,Root Folder) 中放置 CS_Update 我後來懂 SkY★NeT 的意思了 是要類似以 URL 來取得檔案吧,其實也可以 看大大你的選擇吧,反正 下載檔案 的函數只有一個,修改起來也很方便 (就是在 cls_net.vb 中的那個唯一的函數) 我後來想一想,用檔名來當作 Index.txt 內的網址下載會不太好 萬一是特殊語系,例如中文,FTP 就會不接受那個網址,而無法下載 應該要改成 01.rar, 02.rar, 03.rar 這樣子 聽說 CSO 的 Launcher 下載回來的檔案是以 Temp01.rar Temp02.rar .... 的型式存在的 x0 |
引用 | 編輯
n3ph223172
2011-08-13 20:39 |
33樓
▲ ▼ |
引用 | 編輯
ebolaman
2011-08-13 22:50 |
34樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-13 20:39 發表的 : 恩,關於 MD5,我推薦 HashMyFiles 這個軟體 官方頁面:http://www.nirsoft.net/utils/hash_my_files.html 直接下載:http://www.nirsoft.net/utils/hashmyfiles_u.zip 就能快速輕鬆地建立 Md5 清單 另外一款 ExactFile 也可以參考 你也可以將 Md5 驗證弄成另外一個部分 (例如 checksum.md5 檔案) 修改一下函數,與 Index.txt 的型式,可以方便伺服端檔案操作 x1 |
引用 | 編輯
ebolaman
2011-08-14 14:28 |
35樓
▲ ▼ |
我忽然想到一個 嚴重的錯誤
在 cls_net.vb 中 的 ftp_download 函數 裡面有一個 Dim buffer(1024) As Byte 請把它修正為 Dim buffer(1023) As Byte 這樣才是 0~1023 總共 1024 個,否則之前是 1025 個,這樣對下載速率顯示雖然沒什麼影響 但是還是要修正過來 真是被 C++ 的陣列用法搞混了 x0 |
引用 | 編輯
n3ph223172
2011-08-14 17:28 |
36樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-17 02:56 |
37樓
▲ ▼ |
另外的問題是:
下載更新及剛開啟程式時,程式呈現無回應狀態,等有動靜才會有回應。 以及,點擊開始遊戲按鈕後,會先跑出遊戲才關閉登錄器。 小弟記得可以弄me.close(),但源碼還不熟悉,並不知道加在哪裡。 x0 |
引用 | 編輯
ebolaman
2011-08-21 19:58 |
38樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-17 02:56 發表的 : 就如你開 VB2010 看到的一般,在 frm_main 是沒有任何控制項的 唯一的控制項是上面宣告的 wb_back 這個程式啟動後才會載入的控制項 (Public WithEvents wb_back As New WebBrowser) 啟動時並不是 無回應,而是模擬 CSO Launcher 在 WebBrowser 還沒連結網頁完成之前,先把 WebBrowser 藏起來 而顯示 "白色" 的表單背景 下載更新時會無回應嗎? 我這邊試過是不會 以及 先跑出遊戲才關閉 Launcher 可能是 Shell 呼叫還沒有返回數值,所以等到 遊戲開始一陣子才會返回數值給 Launcher 而 Launcher 接著才會關閉 你可以到 frm_main 表單的 local_event_wb_back_nav 函數查看 複製程式 ..... Select Case wb_back.Document.ActiveElement.Id Case "startGame" If wb_back.Document.GetElementById("agreement").GetAttribute("checked") = True Then If wb_back.Document.InvokeScript("get_CanStart") = 1 Then Shell(exe.gameExe, AppWinStyle.NormalFocus) Me.Close() End If End If .......... 至於 CSO 的 Launcher 為什麼會先消失,是因為他先去呼叫 檢查外掛的程式,然後再來呼叫主程式 要解決很簡單,在 Shell(...) 上一行 加入 Me.Hide() 先把表單隱藏起來,讓人覺得已經關閉即可 x0 |
引用 | 編輯
n3ph223172
2011-08-21 21:18 |
39樓
▲ ▼ |
引用 | 編輯
ebolaman
2011-08-21 23:20 |
40樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-21 21:18 發表的 : 是指 "取得更新資料" 後嗎 程序之後主要在 frm_main 中的程序 timer_delay_Tick 我懷疑有可能 造成無回應的程式碼有三行: rep = cNet.ftp_download(ftp.address & "CS_Update/index.txt", dataDir & "index.txt", New NetworkCredential(ftp.id, ftp.pass)) cData.data_load_index(My.Computer.FileSystem.ReadAllText(dataDir & "index.txt")) local_new_dl() 這三行都設中斷點,然後執行看看,如果前兩行的執行時間都很短,那就不是這邊程序的問題 接下來就要進入 local_new_dl() 繼續偵錯 可能是這個程序內的迴圈,加上要檢查更新的項目太多 可以試著加入 以下程式碼 讓程式有回應 (不過相對地會減慢檢查的程序) Application.DoEvents() 不過沒偵錯過,我其實也不太掌握 會造成無回應的原因在哪,以及如何修正 看來實作是必要的 x0 |
引用 | 編輯
n3ph223172
2011-08-24 13:20 |
41樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-24 16:44 |
43樓
▲ ▼ |
下面是引用 ebolaman 於 2011-08-24 14:47 發表的 : 哦哦… 關於[remove] 小弟設定了一下 [Remove] "cstrike\addons\amxmodx\configs\pass.txt"但似乎沒效果? 這個功能不是移除用戶這邊的檔案嗎? 怎麼沒移除呢? 是路徑打錯還是…? x0 |
引用 | 編輯
ebolaman
2011-08-24 17:01 |
44樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-24 16:44 發表的 : 關於 Remove 的,程序在 frm_main.vb 中的 Sub local_new_removeFile 將這一行設定中斷點: My.Computer.FileSystem.DeleteFile(curDir & cData.listRemove(l)) 然後看看路徑是不是有打錯, curDir 是目前的資料夾,cData.listRemove(l) 是 index.txt 內的內容 我看好像還有很多 BUG,看看你要不要給我 你那邊編輯後的整個 VB 2010 專案,我來一次修正 x0 |
引用 | 編輯
n3ph223172
2011-08-24 17:08 |
45樓
▲ ▼ |
下面是引用 ebolaman 於 2011-08-24 17:01 發表的 : 那需不需要加一個"\"呢,還是單純的"cstrike\"? x0 |
引用 | 編輯
ebolaman
2011-08-24 18:26 |
46樓
▲ ▼ |
原來是 NST 的更新~
現在已經把大部分 BUG 去除掉 找到的 BUG 如下: (1) Index.txt 上傳到 FTP 後,好像會把 Cr 吃掉 (Cr & Lf 構成 NewLine 就是換行的符號,一般在記事本按下 Enter 就會輸出 Cr & Lf 兩個字元,代表換行,用軟體 Notepad++ 就能看得比較清楚) (2) 程式結束後沒有刪除 暫存檔案 (3) 沒有東西要更新時狀態顯示不正確 以上 BUG 已經都修正,你之前提到,取得更新資料時會 無回應,的確是一行程式碼造成的 在 cls_net.vb 中的 這一行 Using response As System.Net.FtpWebResponse = CType(ftpRequest.GetResponse, System.Net.FtpWebResponse) 目前沒有解決辦法 [Remove] 也能正常刪除 還有 index.txt 內容,正確的範例如下,"原始檔案路徑" 必須用 雙括號 夾起來,必須在前面加 \ 接著 38038 是 "壓縮檔檔案" 檔案大小,後面是 "原始檔案" 的Md5 Index.txt : 複製程式 [Update] "\cstrike\models\nst_wpn\p_ak47l.mdl" 38038 999240BDA7C6003D25EAC61619B062B7 [Remove] "\cstrike\addons\amxmodx\configs\pass.txt" 還有要注意,以上任何一行結束後,都要接上換行符號(尤其是最後一行),程式才能正確偵測 The attachment has been removed by the owner. x1 |
引用 | 編輯
n3ph223172
2011-08-24 22:19 |
47樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-24 22:42 |
49樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-24 23:15 |
51樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-28 11:13 |
52樓
▲ ▼ |
引用 | 編輯
n3ph223172
2011-08-28 13:46 |
54樓
▲ ▼ |
||||||||||
下面是引用 ebolaman 於 2011-08-28 12:56 發表的 : 請接收。 小弟有幾位朋友是可以正常下載的
x0 |
引用 | 編輯
ebolaman
2011-08-28 14:28 |
55樓
▲ ▼ |
下面是引用 n3ph223172 於 2011-08-28 13:46 發表的 : 那麼應該是 WinRAR 的問題了,看看那幾位朋友有沒有裝 WinRAR ? 還有,index.txt 中的 Update 那兩行中間不要用 一行空的隔開,程式好像會偵測不到下一個文件 (cstrike_english.txt) 我已經幫你修正 index.txt 了 WinRAR 的方式我是用 外部呼叫的,這缺點是偶爾會出問題 (沒裝 WinRAR,或登錄檔值不正確),優點是撰寫方便 要把 WinRAR 解壓縮的東西 弄成內部的應該也是可以,之前我用 ZIP 方式時,就是內部的,所以很難出問題 x0 |
引用 | 編輯
n3ph223172
2011-08-28 18:09 |
56樓
▲ ▼ |
下面是引用 ebolaman 於 2011-08-28 14:28 發表的 : 有個則是 複製程式 See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException() at CSO_Launcher_Simulation.frm_main.local_new_dl() at CSO_Launcher_Simulation.frm_main.timer_delay_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- CSO-NST Ultimate Edition Launcher Assembly Version: 1.0.0.1 Win32 Version: 1.0.0.1 CodeBase: file:///C:/Program%20Files/CSO-NST%20Ultimate%20Edition/CSO-NST%20Ultimate%20Edition%20Launcher.exe ---------------------------------------- Microsoft.VisualBasic Assembly Version: 10.0.0.0 Win32 Version: 10.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Runtime.Remoting Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll ---------------------------------------- Microsoft.mshtml Assembly Version: 7.0.3300.0 Win32 Version: 7.0.3300.0 CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 (RTMRel.030319-0100) CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.1 built by: RTMRel CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. x0 |
引用 | 編輯
ebolaman
2011-08-29 09:10 |
57樓
▲ ▼ |
無法複製檔案的錯誤我真的不知道是錯在哪...
第二個錯誤,索引超出範圍的,應該是解析 Md5 碼時發生錯誤,因為在 local_new_dl() 程序中只有那部分我沒有設立 On Error ... 但是好好的 解析 Md5 碼怎麼會出錯呢? 這也是我不理解的地方 或許測試的人的電腦環境有所不同,造成程式某些程式碼無法運行 目前只能看看發生錯誤的人的電腦,是否有共通點 (例:作業系統、有無裝 WinRAR ...) 目前真的是很難偵錯 x0 |
引用 | 編輯
n3ph223172
2011-08-29 14:47 |
58樓
▲ ▼ |
下面是引用 ebolaman 於 2011-08-29 09:10 發表的 : 小弟測試了2台電腦,皆為正常。 小弟也曾聽說過Windows XP SP3才支援.NET 4.0。 不曉得是不是因為這個? x0 |