資源簡介
unity幀同步demo版,其中包括客戶端和服務端,客戶端是unity,服務端是skynet的
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.IO;
using?System.Linq;
using?System.Text;
public?class?KCP
{
????public?const?int?IKCP_RTO_NDL?????=?30;??//?no?delay?min?rto
????public?const?int?IKCP_RTO_MIN?????=?100;?//?normal?min?rto
????public?const?int?IKCP_RTO_DEF?????=?200;
????public?const?int?IKCP_RTO_MAX?????=?60000;
????public?const?int?IKCP_CMD_PUSH????=?81;?//?cmd:?push?data
????public?const?int?IKCP_CMD_ACK?????=?82;?//?cmd:?ack
????public?const?int?IKCP_CMD_WASK????=?83;?//?cmd:?window?probe?(ask)
????public?const?int?IKCP_CMD_WINS????=?84;?//?cmd:?window?size?(tell)
????public?const?int?IKCP_ASK_SEND????=?1;??//?need?to?send?IKCP_CMD_WASK
????public?const?int?IKCP_ASK_TELL????=?2;??//?need?to?send?IKCP_CMD_WINS
????public?const?int?IKCP_WND_SND?????=?32;
????public?const?int?IKCP_WND_RCV?????=?32;
????public?const?int?IKCP_MTU_DEF?????=?1400;
????public?const?int?IKCP_ACK_FAST????=?3;
????public?const?int?IKCP_INTERVAL????=?100;
????public?const?int?IKCP_OVERHEAD????=?24;
????public?const?int?IKCP_DEADlink????=?10;
????public?const?int?IKCP_THRESH_INIT?=?2;
????public?const?int?IKCP_THRESH_MIN??=?2;
????public?const?int?IKCP_PROBE_INIT??=?7000;???//?7?secs?to?probe?window?size
????public?const?int?IKCP_PROBE_LIMIT?=?120000;?//?up?to?120?secs?to?probe?window
????//?encode?8?bits?unsigned?int
????public?static?int?ikcp_encode8u(byte[]?p?int?offset?byte?c)
????{
????????p[0?+?offset]?=?c;
????????return?1;
????}
????//?decode?8?bits?unsigned?int
????public?static?int?ikcp_decode8u(byte[]?p?int?offset?ref?byte?c)
????{
????????c?=?p[0?+?offset];
????????return?1;
????}
?????/*?encode?16?bits?unsigned?int?(lsb)?*/
????public?static?int?ikcp_encode16u(byte[]?p?int?offset?UInt16?w)?
????{
????????p[0?+?offset]?=?(byte)(w?>>?0);
????????p[1?+?offset]?=?(byte)(w?>>?8);
????????return?2;
????}
????/*?decode?16?bits?unsigned?int?(lsb)?*/
????public?static?int?ikcp_decode16u(byte[]?p?int?offset?ref?UInt16?c)??
????{
????????UInt16?result?=?0;
????????result?|=?(UInt16)p[0?+?offset];
????????result?|=?(UInt16)(p[1?+?offset]?<8);
????????c?=?result;
????????return?2;
????}
????/*?encode?32?bits?unsigned?int?(lsb)?*/
????public?static?int?ikcp_encode32u(byte[]?p?int?offset?UInt32?l)
????{
????????p[0?+?offset]?=?(byte)(l?>>?0);
????????p[1?+?offset]?=?(byte)(l?>>?8);
????????p[2?+?offset]?=?(byte)(l?>>?16);
????????p[3?+?offset]?=?(byte)(l?>>?24);
????????return?4;
????}
????/*?decode?32?bits?unsigned?int?(lsb)?*/
????public?static?int?ikcp_decode32u(byte[]?p?int?offset?ref?UInt32?c)?
????{
????????UInt32?result?=?0;
????????result?|=?(UInt32)p[0?+?offset];
????????result?|=?(UInt32)(p[1?+?offset]?<8);
????????result?|=?(UInt32)(p[2?+?offset]?<16);
????????result?|=?(UInt32)(p[3?+?offset]?<24);
????????c?=?result;
????????return?4;
????}
????public?static?byte[]?slice(byte[]?p?int?start?int?stop)?{
????????var?bytes?=
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-30?09:26??BrickAndBall-master\
?????文件?????????336??2018-10-21?21:52??BrickAndBall-master\.gitignore
?????目錄???????????0??2018-11-19?11:02??BrickAndBall-master\.vs\
?????目錄???????????0??2018-11-19?11:02??BrickAndBall-master\.vs\BrickAndBall-master\
?????目錄???????????0??2018-11-19?17:59??BrickAndBall-master\.vs\BrickAndBall-master\v15\
?????文件??????153600??2018-11-26?16:48??BrickAndBall-master\.vs\BrickAndBall-master\v15\.suo
?????文件??????921600??2018-11-19?17:59??BrickAndBall-master\.vs\BrickAndBall-master\v15\Browse.VC.db
?????目錄???????????0??2018-11-19?11:02??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\
?????目錄???????????0??2018-11-19?11:02??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\sqlite3\
?????文件???????????0??2018-11-19?11:02??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\sqlite3\db.lock
?????文件????????4096??2018-11-19?11:02??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\sqlite3\storage.ide
?????文件???????32768??2018-11-26?09:49??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\sqlite3\storage.ide-shm
?????文件?????3180672??2018-11-26?16:48??BrickAndBall-master\.vs\BrickAndBall-master\v15\Server\sqlite3\storage.ide-wal
?????目錄???????????0??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\
?????目錄???????????0??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\AutoPCH\
?????目錄???????????0??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\AutoPCH\18c2aa80e3abc177\
?????文件?????1114112??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\AutoPCH\18c2aa80e3abc177\LUTIL.ipch
?????目錄???????????0??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\AutoPCH\b3cde4fa0f6eda43\
?????文件?????1114112??2018-11-19?17:08??BrickAndBall-master\.vs\BrickAndBall-master\v15\ipch\AutoPCH\b3cde4fa0f6eda43\LKCP.ipch
?????目錄???????????0??2018-10-21?21:52??BrickAndBall-master\Assets\
?????目錄???????????0??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\
?????目錄???????????0??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\
?????文件??????190677??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.xm
?????文件?????????200??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.xm
?????文件??????143872??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.dll
?????文件???????55846??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.dll.mdb
?????文件?????????197??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.dll.mdb.me
?????文件?????????693??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween.dll.me
?????文件????????9728??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween43.dll
?????文件????????1789??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween43.dll.mdb
?????文件?????????197??2018-10-21?21:52??BrickAndBall-master\Assets\3rd\DOTween\DOTween43.dll.mdb.me
............此處省略2826個文件信息
評論
共有 條評論