| | |
| | | /// </summary>
|
| | | /// <param name="vBytes"></param>
|
| | | /// <returns></returns>
|
| | | public static GameNetPackBasic TransPack(ushort cmd, byte[] vBytes)
|
| | | public static GameNetPackBasic TransPack(GameNetSystem.SocketType socketType, ushort cmd, byte[] vBytes)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | int length = vBytes.Length;
|
| | |
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | NetPkgCtl.AddNetPkg(vStr, NetPkgType.Server, packageInstance.ToString(), FieldPrint.PrintFields(packageInstance), FieldPrint.PrintFieldsExpand(packageInstance, true));
|
| | | NetPkgCtl.AddNetPkg(socketType, vStr, NetPkgType.Server, packageInstance.ToString(), FieldPrint.PrintFields(packageInstance), FieldPrint.PrintFieldsExpand(packageInstance, true));
|
| | | #endif
|
| | | return packageInstance;
|
| | | }
|
| | | else
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | NetPkgCtl.AddNetPkg(vStr, NetPkgType.Server, string.Empty, string.Empty, null);
|
| | | NetPkgCtl.AddNetPkg(socketType, vStr, NetPkgType.Server, string.Empty, string.Empty, null);
|
| | | #endif
|
| | | }
|
| | | return null;
|
| | |
| | | //修改技能快捷设置发包顺序
|
| | | PlayerDatas.Instance.skill.CheckQuickSet();
|
| | |
|
| | | if (StageManager.Instance.StageType == Stage.E_StageType.Dungeon
|
| | | && StageManager.Instance.isServerPreparing == false)
|
| | | if (vNetData.socketType == GameNetSystem.SocketType.Main
|
| | | && GameNetSystem.Instance.crossServerData.crossState == GameNetSystem.CrossServerState.Yes)
|
| | | {
|
| | | C0107_tagCInitMapOK mapOk = new C0107_tagCInitMapOK();
|
| | | mapOk.MapID = PlayerDatas.Instance.baseData.MapID;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogFormat("Recieve 0109,would not send0107,Current Stage:{0},Server Preparing:{1}", StageManager.Instance.StageType, StageManager.Instance.isServerPreparing);
|
| | | if (StageManager.Instance.StageType == Stage.E_StageType.Dungeon
|
| | | && StageManager.Instance.isServerPreparing == false)
|
| | | {
|
| | | C0107_tagCInitMapOK mapOk = new C0107_tagCInitMapOK();
|
| | | mapOk.MapID = PlayerDatas.Instance.baseData.MapID;
|
| | | mapOk.Type = 0;
|
| | | GameNetSystem.Instance.SendInfo(mapOk);
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogFormat("Recieve 0109,would not send0107,Current Stage:{0},Server Preparing:{1}", StageManager.Instance.StageType, StageManager.Instance.isServerPreparing);
|
| | | }
|
| | | }
|
| | |
|
| | | StageManager.Instance.isServerPreparing = false;
|
| | |
| | | /// </summary>
|
| | | /// <param name="gameNetPkg"></param>
|
| | | /// <param name="typeLst"></param>
|
| | | public static void AddNetPkg(string pkgByte, NetPkgType netPkgType, string _packName, string _fields, List<string> _fieldDetails)
|
| | | public static void AddNetPkg( GameNetSystem.SocketType socketType, string pkgByte, NetPkgType netPkgType, string _packName, string _fields, List<string> _fieldDetails)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | if (_typeLst == null)
|
| | |
| | | getNewPackage = true;
|
| | |
|
| | | NetPkg netPkg = new NetPkg();
|
| | | netPkg.socketType = socketType;
|
| | | netPkg.SendOrGetTime = DateTime.Now.ToString("HH:mm:ss:fff");
|
| | | netPkg.NetPkgTp = netPkgType;
|
| | |
|
| | |
| | |
|
| | | public class NetPkg
|
| | | {
|
| | | public GameNetSystem.SocketType socketType;
|
| | | public string SendOrGetTime;
|
| | | public string GameNetPkgStr;
|
| | | public string GameNetName;
|
| | |
| | | var cmd = (ushort)((ushort)(vCmdBytes[0] << 8) + vCmdBytes[1]); |
| | | if (PackageRegedit.Contain(cmd)) |
| | | { |
| | | vNetpack = PackageRegedit.TransPack(cmd, vPackBytes); |
| | | vNetpack = PackageRegedit.TransPack(socketType,cmd, vPackBytes); |
| | | if (vNetpack != null) |
| | | { |
| | | if (DebugEx.EnableNetLog) |
| | |
| | | else |
| | | { |
| | | #if UNITY_EDITOR |
| | | PackageRegedit.TransPack(cmd, vPackBytes); |
| | | PackageRegedit.TransPack(socketType, cmd, vPackBytes); |
| | | #endif |
| | | CSharpCallLua.OnRecieveLuaNetPackage(cmd, vPackBytes); |
| | | } |
| | |
| | | } |
| | | protocol.CombineDatas(encoder); |
| | | #if UNITY_EDITOR |
| | | NetPkgCtl.AddNetPkg(protocol.vInfoCont, NetPkgType.Client, protocol.ToString(), FieldPrint.PrintFields(protocol), FieldPrint.PrintFieldsExpand(protocol, true)); |
| | | NetPkgCtl.AddNetPkg(socketType, protocol.vInfoCont, NetPkgType.Client, protocol.ToString(), FieldPrint.PrintFields(protocol), FieldPrint.PrintFieldsExpand(protocol, true)); |
| | | #endif |
| | | sendBytesTotal += protocol.combineBytes.Length; |
| | | SendBytes(protocol.combineBytes); |