2 文件已重命名
12个文件已修改
2个文件已删除
2个文件已添加
| | |
| | | bool connectedDetecting = false; |
| | | |
| | | NetworkReachability m_NetWorkReachability = NetworkReachability.ReachableViaCarrierDataNetwork;
|
| | | NetworkReachability netWorkReachability
|
| | | {
|
| | | NetworkReachability netWorkReachability {
|
| | | get { return m_NetWorkReachability; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (m_NetWorkReachability != value)
|
| | | {
|
| | | m_NetWorkReachability = value;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if ((DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > OVERTIME_THRESHOLD)
|
| | | if (GameNetSystem.Instance.timeSinceMainSocketLastProtocol > OVERTIME_THRESHOLD)
|
| | | {
|
| | | DetectConnected(3);
|
| | | }
|
| | | else if (!GameNetSystem.Instance.socketConnected)
|
| | | else if (!GameNetSystem.Instance.mainSocketConnected)
|
| | | {
|
| | | DetectConnected(3);
|
| | | }
|
| | |
| | |
|
| | | var isDisconnected = false;
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | isDisconnected = (DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > 3;
|
| | | isDisconnected = GameNetSystem.Instance.timeSinceMainSocketLastProtocol > 3f;
|
| | | #else
|
| | | isDisconnected = !GameNetSystem.Instance.socketConnected || (DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > OVERTIME_THRESHOLD;
|
| | | isDisconnected = !GameNetSystem.Instance.mainSocketConnected
|
| | | || GameNetSystem.Instance.timeSinceMainSocketLastProtocol > OVERTIME_THRESHOLD;
|
| | | #endif
|
| | |
|
| | | if (isDisconnected)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if ((DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > OVERTIME_THRESHOLD)
|
| | | if (GameNetSystem.Instance.timeSinceMainSocketLastProtocol > OVERTIME_THRESHOLD)
|
| | | {
|
| | | DetectConnected(3);
|
| | | }
|
| | | else if (!GameNetSystem.Instance.socketConnected)
|
| | | else if (!GameNetSystem.Instance.mainSocketConnected)
|
| | | {
|
| | | DetectConnected(3);
|
| | | }
|
| | |
| | |
|
| | | var isDisconnected = false;
|
| | | #if UNITY_IOS && !UNITY_EDITOR
|
| | | isDisconnected = (DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > 3;
|
| | | isDisconnected =GameNetSystem.Instance.timeSinceMainSocketLastProtocol > 3f;
|
| | | #else
|
| | | isDisconnected = !GameNetSystem.Instance.socketConnected || (DateTime.Now - GameNetSystem.Instance.lastPackageTime).TotalSeconds > OVERTIME_THRESHOLD;
|
| | | isDisconnected = !GameNetSystem.Instance.mainSocketConnected
|
| | | || GameNetSystem.Instance.timeSinceMainSocketLastProtocol > OVERTIME_THRESHOLD;
|
| | | #endif
|
| | |
|
| | | if (isDisconnected)
|
| | |
| | |
|
| | | public class PackageRegedit
|
| | | {
|
| | | static Dictionary<ushort, Type> packageTable = new Dictionary<ushort, Type>();
|
| | | static Dictionary<ushort, DtcBasic> packToBusinessTable = new Dictionary<ushort, DtcBasic>();
|
| | |
|
| | | static object lockojb1 = new object();
|
| | | static Dictionary<ushort, Type> m_PackageTable = new Dictionary<ushort, Type>();
|
| | | static Dictionary<ushort, Type> packageTable {
|
| | | get {
|
| | | lock (lockojb1) { return m_PackageTable; }
|
| | | }
|
| | | set {
|
| | | lock (lockojb1) { m_PackageTable = value; }
|
| | | }
|
| | | }
|
| | |
|
| | | static object lockojb2 = new object();
|
| | | static Dictionary<ushort, DtcBasic> m_PackToBusinessTable = new Dictionary<ushort, DtcBasic>();
|
| | | static Dictionary<ushort, DtcBasic> packToBusinessTable {
|
| | | get {
|
| | | lock (lockojb2) { return m_PackToBusinessTable; }
|
| | | }
|
| | | set {
|
| | | lock (lockojb2) { m_PackToBusinessTable = value; }
|
| | | }
|
| | | }
|
| | |
|
| | | public static void Init()
|
| | | {
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 722e5e3d30096674e811f5bd191246a0 |
| | | folderAsset: yes |
| | | timeCreated: 1539228128 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | /** 字节流的加解密 */ |
| | | public class GameNetEncode |
| | | { |
| | | static int[] gSendKeyDict = new int[1024] //发送加密用密钥 |
| | | { |
| | | int[] gSendKeyDict = new int[1024] //发送加密用密钥 |
| | | { |
| | | 0x3bc46229, 0x71463c13, 0x4df97c63, 0x20a6b7b6, 0x5cb0c110, 0x780d5397, 0x161f22f9, 0x71f1eda0, |
| | | 0x4c4797a4, 0x7b3d7177, 0x2679595a, 0x54c92286, 0x2af45923, 0x2e5cd5f4, 0x5bc860c7, 0x14929ca9, |
| | | 0x1fef64cf, 0x30a25d4c, 0x5daf8680, 0x4553de47, 0x787d45e5, 0x5631bfc0, 0x6de263c5, 0x3493e5a1, |
| | |
| | | 0x3749b51a, 0x2528dcc6, 0x15d6a9e0, 0x5350cd24, 0x1c842639, 0x649b2f61, 0x7c8cd7ed, 0x7f088866, |
| | | 0x7fbaf784, 0x3cf212da, 0x114b4a47, 0x7680c924, 0x3e68543c, 0x59dd5f6e, 0x1c023a2c, 0x18efad9f, |
| | | 0x7e33d39e, 0x6ba0095e, 0x35f16cdd, 0x70491015, 0x1f69b8ee, 0x506460eb, 0x594d739a, 0x1478c6c8 |
| | | }; |
| | | }; |
| | | |
| | | static byte[] gSendKeyBytes;//加工后的加密钥 |
| | | static int m_KeyEncodeIndex = 250; |
| | | public static int KeyEncodeIndex |
| | | { |
| | | byte[] gSendKeyBytes;//加工后的加密钥 |
| | | int m_KeyEncodeIndex = 250; |
| | | public int KeyEncodeIndex { |
| | | get { return m_KeyEncodeIndex; } |
| | | set { m_KeyEncodeIndex = value; } |
| | | } |
| | | |
| | | /** 解密用字串 */ |
| | | static byte[] gKeyBytes = new byte[] {184,187,199,191,32,195,241,214,247,32,206,196,195,247,32,186,205,208,179,32,215,212,211,201,32,198,189,181,200,32,185,171,213,253,32,183,168,214,206,32,176,174,185,250,32,190,180,210,181,32,179,207,208,197,32,211,209,201,198 |
| | | }; |
| | | byte[] gKeyBytes = new byte[] { 184, 187, 199, 191, 32, 195, 241, 214, 247, 32, 206, 196, 195, 247, 32, 186, 205, 208, 179, 32, 215, 212, 211, 201, 32, 198, 189, 181, 200, 32, 185, 171, 213, 253, 32, 183, 168, 214, 206, 32, 176, 174, 185, 250, 32, 190, 180, 210, 181, 32, 179, 207, 208, 197, 32, 211, 209, 201, 198 }; |
| | | |
| | | /// <summary> |
| | | /// 加密 |
| | | /// </summary> |
| | | /// <param name="vBuffer"></param> |
| | | /// <returns></returns> |
| | | public static byte[] BaseXorAdd(byte[] vBuffer) |
| | | public byte[] BaseXorAdd(byte[] vBuffer) |
| | | { |
| | | ConfigEncodeKey(); |
| | | return BaseXorAdd(vBuffer, gSendKeyBytes); |
| | |
| | | /// <param name="vBuffer"></param> |
| | | /// <param name="vPassword"></param> |
| | | /// <returns></returns> |
| | | static byte[] BaseXorAdd(byte[] vBuffer, byte[] vPassword) |
| | | byte[] BaseXorAdd(byte[] vBuffer, byte[] vPassword) |
| | | { |
| | | int i; |
| | | int l = vBuffer.Length; |
| | |
| | | /// </summary> |
| | | /// <param name="vBuffer"></param> |
| | | /// <returns></returns> |
| | | public static byte[] BaseXorSub(byte[] vBuffer) |
| | | public byte[] BaseXorSub(byte[] vBuffer) |
| | | { |
| | | return BaseXorSub(vBuffer, gKeyBytes); |
| | | } |
| | |
| | | /// <param name="vBuffer"></param> |
| | | /// <param name="vPassword"></param> |
| | | /// <returns></returns> |
| | | static byte[] BaseXorSub(byte[] vBuffer, byte[] vPassword) |
| | | byte[] BaseXorSub(byte[] vBuffer, byte[] vPassword) |
| | | { |
| | | int i; |
| | | byte ucByte = 0; |
| | |
| | | /// <summary> |
| | | /// 配置加密密钥 |
| | | /// </summary> |
| | | static void ConfigEncodeKey() |
| | | void ConfigEncodeKey() |
| | | { |
| | | int vIndex = KeyEncodeIndex % gSendKeyDict.Length; |
| | | gSendKeyBytes = BitConverter.GetBytes((int)(gSendKeyDict[vIndex] ^ Snxxz.UI.LoginModel.DwVersionNo)); |
| | | KeyEncodeIndex++; |
| | | } |
| | | |
| | | public static void ResetEncodeIndex() |
| | | { |
| | | KeyEncodeIndex = 250; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | /** 组合帧信息 */ |
| | | public void CombineDatas() |
| | | public void CombineDatas(GameNetEncode encoder) |
| | | { |
| | | try |
| | | { |
| | |
| | | vCmdAndBody = vExCmdAndBody; |
| | | } |
| | | |
| | | vCmdAndBody = GameNetEncode.BaseXorAdd(vCmdAndBody); // 加密 |
| | | vCmdAndBody = encoder.BaseXorAdd(vCmdAndBody); // 加密 |
| | | |
| | | _combineBytes = new byte[vCmdAndBody.Length + 6]; // 合并体 |
| | | byte[] vFrameHead = new byte[] { 255, 204 }; |
| | |
| | | DisconnectState disconnectState;
|
| | |
|
| | | NetState m_NetState;
|
| | | public NetState netState
|
| | | {
|
| | | public NetState netState {
|
| | | get { return this.m_NetState; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (this.m_NetState != value)
|
| | | {
|
| | | switch (m_NetState)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private ClientSocketController socketController;
|
| | | public bool socketConnected { get { return socketController == null ? false : socketController.Connected; } }
|
| | | private ClientSocket mainSocket;
|
| | | public bool mainSocketConnected { get { return mainSocket == null ? false : mainSocket.connected; } }
|
| | |
|
| | | Queue<GameNetPackBasic> packQueue = new Queue<GameNetPackBasic>();
|
| | | public float timeSinceMainSocketLastProtocol {
|
| | | get { return mainSocket == null ? 0f : (float)(DateTime.Now - mainSocket.lastPackageTime).TotalSeconds; }
|
| | | }
|
| | |
|
| | | DateTime m_LastPackageTime;
|
| | | public DateTime lastPackageTime { get { return m_LastPackageTime; } }
|
| | | private ClientSocket crossServerSocket;
|
| | | public bool crossServerSocketConnected { get { return crossServerSocket == null ? false : crossServerSocket.connected; } }
|
| | |
|
| | | Action onConnected;
|
| | | public event Action disconnectEvent;
|
| | | public event Action connectedEvent;
|
| | | public float timeSinceCrossServerSocketLastProtocol {
|
| | | get { return crossServerSocket == null ? 0f : (float)(DateTime.Now - crossServerSocket.lastPackageTime).TotalSeconds; }
|
| | | }
|
| | |
|
| | | Queue<GameNetPackBasic> mainProtocolQueue = new Queue<GameNetPackBasic>();
|
| | | Queue<GameNetPackBasic> crossSeverProtocolQueue = new Queue<GameNetPackBasic>();
|
| | |
|
| | | public GameNetSystem()
|
| | | {
|
| | |
| | | netState = NetState.NerverConnect;
|
| | | }
|
| | |
|
| | | public void BeginConnectGameServer(string _ip, int _port, Action _onConnected)
|
| | | public void BeginConnectGameServer(string ip, int port, Action onConnected)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (socketController != null && socketController.Connected)
|
| | | if (mainSocketConnected)
|
| | | {
|
| | | socketController.CloseConnect();
|
| | | mainSocket.CloseConnect();
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | |
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | socketController = new ClientSocketController();
|
| | | mainSocket = new ClientSocket(SocketType.Main);
|
| | | mainProtocolQueue.Clear();
|
| | |
|
| | | GameNetEncode.ResetEncodeIndex();
|
| | | lock (packQueue)
|
| | | mainSocket.Connect(ip, port, () =>
|
| | | {
|
| | | packQueue.Clear();
|
| | | }
|
| | |
|
| | | onConnected = _onConnected;
|
| | | socketController.Connect(_ip, _port, OnSocketConnected);
|
| | | if (onConnected != null)
|
| | | {
|
| | | onConnected();
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | public void SendInfo(GameNetPackBasic vNetPack)
|
| | | public void BeginConnectCrossServer(string ip, int port, Action onConnected)
|
| | | {
|
| | | if (socketController != null)
|
| | | try
|
| | | {
|
| | | socketController.SendInfo(vNetPack);
|
| | | DebugPkgCache.Push(vNetPack);
|
| | | if (crossServerSocketConnected)
|
| | | {
|
| | | crossServerSocket.CloseConnect();
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | crossServerSocket = new ClientSocket(SocketType.CrossSever);
|
| | | crossSeverProtocolQueue.Clear();
|
| | | this.crossServerSocket.Connect(ip, port, () =>
|
| | | {
|
| | | if (onConnected != null)
|
| | | {
|
| | | onConnected();
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | public void SendInfo(GameNetPackBasic protocol)
|
| | | {
|
| | | if (mainSocket != null)
|
| | | {
|
| | | mainSocket.SendInfo(protocol);
|
| | | DebugPkgCache.Push(protocol);
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendInfo(byte[] vBytes)
|
| | | {
|
| | | if (socketController != null)
|
| | | if (mainSocket != null)
|
| | | {
|
| | | socketController.SendInfo(vBytes);
|
| | | mainSocket.SendInfo(vBytes);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PushPackage(GameNetPackBasic _package)
|
| | | public void SendToCrossServer(GameNetPackBasic protocol)
|
| | | {
|
| | | if (_package == null)
|
| | | if (crossServerSocket != null)
|
| | | {
|
| | | return;
|
| | | crossServerSocket.SendInfo(protocol);
|
| | | DebugPkgCache.Push(protocol);
|
| | | }
|
| | | }
|
| | |
|
| | | m_LastPackageTime = DateTime.Now;
|
| | |
|
| | | lock (packQueue)
|
| | | public void PushPackage(GameNetPackBasic protocol, SocketType type)
|
| | | {
|
| | | lock (this)
|
| | | {
|
| | | lock (_package)
|
| | | if (protocol == null)
|
| | | {
|
| | | if (PackageRegedit.Contain(_package.cmd))
|
| | | {
|
| | | packQueue.Enqueue(_package);
|
| | | DebugPkgCache.Push(_package);
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.LogWarningFormat("数据包(cmd:{0})未登记!", _package.cmd);
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | if (PackageRegedit.Contain(protocol.cmd))
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case SocketType.Main:
|
| | | mainProtocolQueue.Enqueue(protocol);
|
| | | break;
|
| | | case SocketType.CrossSever:
|
| | | crossSeverProtocolQueue.Enqueue(protocol);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | DebugPkgCache.Push(protocol);
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.LogWarningFormat("数据包(cmd:{0})未登记!", protocol.cmd);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Disconnect()
|
| | | {
|
| | | try
|
| | | {
|
| | | if (socketController != null)
|
| | | if (mainSocket != null)
|
| | | {
|
| | | socketController.CloseConnect();
|
| | | mainSocket.CloseConnect();
|
| | | }
|
| | | GameNetEncode.ResetEncodeIndex();
|
| | |
|
| | | lock (packQueue)
|
| | | if (crossServerSocket != null)
|
| | | {
|
| | | packQueue.Clear();
|
| | | crossServerSocket.CloseConnect();
|
| | | }
|
| | |
|
| | | mainProtocolQueue.Clear();
|
| | | crossSeverProtocolQueue.Clear();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | finally
|
| | | {
|
| | | netState = NetState.DisConnected;
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | | loginModel.busy = false;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | if (socketController != null)
|
| | | if (mainSocket != null)
|
| | | {
|
| | | socketController.CloseConnect();
|
| | | mainSocket.CloseConnect();
|
| | | }
|
| | | GameNetEncode.ResetEncodeIndex();
|
| | | lock (packQueue)
|
| | |
|
| | | if (crossServerSocket != null)
|
| | | {
|
| | | packQueue.Clear();
|
| | | crossServerSocket.CloseConnect();
|
| | | }
|
| | |
|
| | | mainProtocolQueue.Clear();
|
| | | crossSeverProtocolQueue.Clear();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | finally
|
| | | {
|
| | | netState = NetState.AccountLogin;
|
| | |
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | | loginModel.busy = false;
|
| | | loginModel.ReAccountLogin();
|
| | |
| | | {
|
| | | try
|
| | | {
|
| | | if (socketController != null)
|
| | | if (mainSocket != null)
|
| | | {
|
| | | socketController.CloseConnect();
|
| | | mainSocket.CloseConnect();
|
| | | }
|
| | | GameNetEncode.ResetEncodeIndex();
|
| | | lock (packQueue)
|
| | |
|
| | | if (crossServerSocket != null)
|
| | | {
|
| | | packQueue.Clear();
|
| | | crossServerSocket.CloseConnect();
|
| | | }
|
| | |
|
| | | mainProtocolQueue.Clear();
|
| | | crossSeverProtocolQueue.Clear();
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | StageManager.Instance.LoadLoginStage();
|
| | | NetLinkWin.Hide();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void OnAccountLogin()
|
| | |
| | |
|
| | | void OnUpdate()
|
| | | {
|
| | | lock (packQueue)
|
| | | while (mainProtocolQueue.Count > 0)
|
| | | {
|
| | | if (packQueue != null)
|
| | | {
|
| | | while (packQueue.Count > 0)
|
| | | {
|
| | | PackageRegedit.Distribute(packQueue.Dequeue());
|
| | | }
|
| | | }
|
| | | PackageRegedit.Distribute(mainProtocolQueue.Dequeue());
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnSocketConnected()
|
| | | {
|
| | | m_LastPackageTime = DateTime.Now;
|
| | | if (onConnected != null)
|
| | | while (crossSeverProtocolQueue.Count > 0)
|
| | | {
|
| | | onConnected();
|
| | | onConnected = null;
|
| | | PackageRegedit.Distribute(crossSeverProtocolQueue.Dequeue());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | DisConnected = 6,
|
| | | }
|
| | |
|
| | | public enum SocketType
|
| | | {
|
| | | Main = 1,
|
| | | CrossSever = 2,
|
| | | }
|
| | |
|
| | | }
|
| File was renamed from Core/NetworkPackage/Socket/ClientSocketController.cs |
| | |
| | | using UnityEngine;
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Net;
|
| | | using System.Net.Sockets;
|
| | | using System.Threading;
|
| | |
|
| | | public class ClientSocketController
|
| | | {
|
| | | Socket m_Socket;
|
| | | public Socket socket {
|
| | | get { return m_Socket; }
|
| | | }
|
| | |
|
| | | private int connectWaitTime = 2000; // 10秒
|
| | | private Thread m_packageThread;
|
| | | private byte[] bufferBytes = new byte[4096]; // 4K,单包字节数组缓存
|
| | | private byte[] fragmentBytes; //留包后的内容
|
| | | private long getBytesTotal = 0; //发送的数据总量
|
| | | private long sendBytesTotal = 0; //发送的数据总量
|
| | |
|
| | | public bool Connected { get { return m_Socket == null ? false : m_Socket.Connected; } }
|
| | |
|
| | | public bool isStopTreading { get; private set; }
|
| | |
|
| | | string ip;
|
| | | int port;
|
| | | Action onConnected = null;
|
| | |
|
| | | public ClientSocketController()
|
| | | {
|
| | | }
|
| | |
|
| | | public void Connect(string _ip, int _port, Action _onConnected)
|
| | | {
|
| | | try
|
| | | {
|
| | | ip = _ip;
|
| | | port = _port;
|
| | | onConnected = _onConnected;
|
| | | Dns.BeginGetHostAddresses(_ip, OnGetHostAddresses, null);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.LogError(e.Message);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnGetHostAddresses(IAsyncResult _result)
|
| | | {
|
| | | var ipAddresses = Dns.EndGetHostAddresses(_result);
|
| | |
|
| | | if (ipAddresses[0].AddressFamily == AddressFamily.InterNetworkV6)
|
| | | {
|
| | | DebugEx.Log("当前使用的网络: IPV6");
|
| | | m_Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log("当前使用的网络: IPV4");
|
| | | m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
| | | }
|
| | |
|
| | | var ipEndPoint = new IPEndPoint(ipAddresses[0], port);
|
| | | if (ipEndPoint == null)
|
| | | {
|
| | | Debug.Log("IpEndPoint is null");
|
| | | }
|
| | |
|
| | | var state = new SocketAsyncState();
|
| | | state.IsAsync = true;
|
| | | m_Socket.BeginConnect(ipEndPoint, new AsyncCallback(ConnectCallBack), state);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 链接成功时的回调
|
| | | /// </summary>
|
| | | /// <param name="_result"></param>
|
| | | private void ConnectCallBack(IAsyncResult _result)
|
| | | {
|
| | | if (!_result.IsCompleted)
|
| | | {
|
| | | DebugEx.Log("链接超时!");
|
| | | CloseConnect();
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_Socket != null && m_Socket.Connected)
|
| | | {
|
| | | DebugEx.Log("确认的链接实现");
|
| | | OnConnectSuccess();
|
| | |
|
| | | if (onConnected != null)
|
| | | {
|
| | | onConnected();
|
| | | onConnected = null;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_Socket != null)
|
| | | {
|
| | | m_Socket.Disconnect(true);
|
| | | }
|
| | |
|
| | | onConnected = null;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 关闭链接
|
| | | /// </summary>
|
| | | public void CloseConnect()
|
| | | {
|
| | | try
|
| | | {
|
| | | isStopTreading = true;
|
| | | if (m_packageThread != null)
|
| | | {
|
| | | m_packageThread.Abort();
|
| | | }
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | try
|
| | | {
|
| | | if (m_Socket != null && m_Socket.Connected)
|
| | | {
|
| | | m_Socket.Shutdown(SocketShutdown.Both);
|
| | | m_Socket.Close();
|
| | | }
|
| | |
|
| | | }
|
| | | catch (System.Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | sendQueue.Clear();
|
| | | m_Socket = null;
|
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 链接成功
|
| | | /// </summary>
|
| | | private void OnConnectSuccess()
|
| | | {
|
| | | if (m_packageThread != null)
|
| | | {
|
| | | m_packageThread.Abort();
|
| | | m_packageThread = null;
|
| | | }
|
| | | m_packageThread = new Thread(new ThreadStart(ReceiveInfo)); // 启动线程接收信息
|
| | | m_packageThread.IsBackground = true;
|
| | | m_packageThread.Start();
|
| | | isStopTreading = false;
|
| | | }
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// 接收信息
|
| | | /// </summary>
|
| | | private void ReceiveInfo()
|
| | | {
|
| | | int vDataLeng;
|
| | | byte[] vBytes;
|
| | |
|
| | | while (!isStopTreading)
|
| | | {
|
| | | if (!m_Socket.Connected)
|
| | | {
|
| | | isStopTreading = true;
|
| | | m_Socket.Shutdown(SocketShutdown.Both);
|
| | | m_Socket.Close();
|
| | | break;
|
| | | }
|
| | |
|
| | | try
|
| | | {
|
| | | vDataLeng = m_Socket.Receive(bufferBytes);
|
| | | if (vDataLeng <= 0)
|
| | | {
|
| | | isStopTreading = true;
|
| | | m_Socket.Shutdown(SocketShutdown.Both);
|
| | | m_Socket.Close();
|
| | | break;
|
| | | }
|
| | | getBytesTotal += vDataLeng;
|
| | | vBytes = new byte[vDataLeng];
|
| | | Array.Copy(bufferBytes, 0, vBytes, 0, vDataLeng);
|
| | | ReadInfo(vBytes);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | static byte[] vCmdBytes = new byte[2];
|
| | | /// <summary>
|
| | | /// 阅读信息
|
| | | /// </summary>
|
| | | /// <param name="vBytes"></param>
|
| | | private void ReadInfo(byte[] vBytes)
|
| | | {
|
| | | try
|
| | | {
|
| | | byte[] fixBytes = vBytes;
|
| | | // 如果存在留包,则并包
|
| | | if (fragmentBytes != null && fragmentBytes.Length > 0)
|
| | | {
|
| | | Array.Resize(ref fixBytes, vBytes.Length + fragmentBytes.Length);
|
| | | Array.Copy(fragmentBytes, 0, fixBytes, 0, fragmentBytes.Length);
|
| | | Array.Copy(vBytes, 0, fixBytes, fragmentBytes.Length, vBytes.Length);
|
| | | }
|
| | | fragmentBytes = null; // 清理掉留包
|
| | | // 分包
|
| | | int vReadIndex = 0; // 初始指针
|
| | | byte[] vPackBytes;
|
| | | int vLeavingLeng = 0;
|
| | | int vBodyLeng = 0;
|
| | | int vTotalLeng = fixBytes.Length;
|
| | | GameNetPackBasic vNetpack;
|
| | |
|
| | | while (vReadIndex < vTotalLeng)
|
| | | {
|
| | | vLeavingLeng = vTotalLeng - vReadIndex;
|
| | | if (vLeavingLeng < 6) // 未符合包的最低限度字节量, 留包
|
| | | {
|
| | | fragmentBytes = new byte[vLeavingLeng];
|
| | | Array.Copy(fixBytes, vReadIndex, fragmentBytes, 0, vLeavingLeng);
|
| | | break;
|
| | | }
|
| | | vBodyLeng = BitConverter.ToInt32(fixBytes, vReadIndex + 2);
|
| | | if (vBodyLeng > vLeavingLeng - 6)// 未完整的包则留包
|
| | | {
|
| | | fragmentBytes = new byte[vLeavingLeng];
|
| | | Array.Copy(fixBytes, vReadIndex, fragmentBytes, 0, vLeavingLeng);
|
| | | break;
|
| | | }
|
| | | vPackBytes = new byte[vBodyLeng];
|
| | | Array.Copy(fixBytes, vReadIndex + 6, vPackBytes, 0, vBodyLeng); // 提取包的字节内容
|
| | | // 完整的包则读包
|
| | |
|
| | | vPackBytes = GameNetEncode.BaseXorSub(vPackBytes);
|
| | | Array.Copy(vPackBytes, 0, vCmdBytes, 0, 2);
|
| | | var cmd = (ushort)((ushort)(vCmdBytes[0] << 8) + vCmdBytes[1]);
|
| | | if (PackageRegedit.Contain(cmd))
|
| | | {
|
| | | vNetpack = PackageRegedit.TransPack(cmd, vPackBytes);
|
| | | if (vNetpack != null)
|
| | | {
|
| | | if (DebugEx.EnableNetLog)
|
| | | {
|
| | | DebugEx.NetLogFormat("收包:{0}", vNetpack.GetType().Name);
|
| | | }
|
| | |
|
| | | GameNetSystem.Instance.PushPackage(vNetpack);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | PackageRegedit.TransPack(cmd, vPackBytes);
|
| | | #endif
|
| | | CSharpCallLua.OnRecieveLuaNetPackage(cmd, vPackBytes);
|
| | | }
|
| | |
|
| | | vReadIndex += 6 + vBodyLeng;
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.LogFormat("收包异常:{0}", ex);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 发送信息
|
| | | /// </summary>
|
| | | /// <param name="vNetPack"></param>
|
| | | public void SendInfo(GameNetPackBasic vNetPack)
|
| | | {
|
| | | if (!Connected)
|
| | | return;
|
| | | if (vNetPack == null)
|
| | | {
|
| | | DebugEx.LogError("要发的信息对象为空");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (DebugEx.EnableNetLog)
|
| | | {
|
| | | DebugEx.NetLogFormat("发包:{0}", vNetPack.GetType().Name);
|
| | | }
|
| | |
|
| | | if (vNetPack.cmd == (ushort)0x03FE || vNetPack.cmd == (ushort)0x1801)
|
| | | {
|
| | | }
|
| | |
|
| | | if (vNetPack.combineBytes == null)
|
| | | {
|
| | | vNetPack.WriteToBytes();
|
| | | }
|
| | | vNetPack.CombineDatas();
|
| | | #if UNITY_EDITOR
|
| | | NetPkgCtl.AddNetPkg(vNetPack.vInfoCont, NetPkgType.Client, vNetPack.ToString(), FieldPrint.PrintFields(vNetPack), FieldPrint.PrintFieldsExpand(vNetPack, true));
|
| | | #endif
|
| | | sendBytesTotal += vNetPack.combineBytes.Length;
|
| | | SendBytes(vNetPack.combineBytes);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 发送信息
|
| | | /// </summary>
|
| | | /// <param name="vBytes"></param>
|
| | | public void SendInfo(byte[] vBytes)
|
| | | {
|
| | | if (!Connected)
|
| | | {
|
| | | DebugEx.LogError("尚未与该后端链接!无法发送信息");
|
| | | return;
|
| | | }
|
| | | if (vBytes == null || vBytes.Length < 2)
|
| | | {
|
| | | DebugEx.LogError("要发的信息数据为空或数据不足");
|
| | | return;
|
| | | }
|
| | |
|
| | | vBytes = GameNetEncode.BaseXorAdd(vBytes);
|
| | | byte[] vFrameHead = new byte[] { 255, 204 };
|
| | | byte[] vMsgBodyLength = BitConverter.GetBytes(vBytes.Length);
|
| | | byte[] vTotal = new byte[vBytes.Length + 6];
|
| | | Array.Copy(vFrameHead, 0, vTotal, 0, vFrameHead.Length);
|
| | | Array.Copy(vMsgBodyLength, 0, vTotal, 2, vMsgBodyLength.Length);
|
| | | Array.Copy(vBytes, 0, vTotal, 6, vBytes.Length);
|
| | |
|
| | | SendBytes(vTotal);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 发送已加密字节
|
| | | /// </summary>
|
| | | /// <param name="vBytes"></param>
|
| | | public void SendNoEncrypInfo(byte[] vBytes)
|
| | | {
|
| | | if (!Connected)
|
| | | {
|
| | | DebugEx.LogError("尚未与该后端链接!无法发送信息");
|
| | | return;
|
| | | }
|
| | | if (vBytes == null || vBytes.Length < 2)
|
| | | {
|
| | | DebugEx.LogError("要发的信息数据为空或数据不足");
|
| | | return;
|
| | | }
|
| | |
|
| | | SendBytes(vBytes);
|
| | | }
|
| | |
|
| | | Queue<byte[]> sendQueue = new Queue<byte[]>();
|
| | |
|
| | | private void SendBytes(byte[] bytes)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (sendQueue.Count > 0)
|
| | | {
|
| | | sendQueue.Enqueue(bytes);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(SendInfoCallBack), m_Socket);
|
| | | }
|
| | | }
|
| | | catch
|
| | | {
|
| | | DebugEx.LogError("发送时发生异常");
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 发送完成的回调
|
| | | /// </summary>
|
| | | /// <param name="vAsyncSend"></param>
|
| | | private void SendInfoCallBack(IAsyncResult vAsyncSend)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (sendQueue.Count > 0)
|
| | | {
|
| | | var bytes = sendQueue.Dequeue();
|
| | | m_Socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(SendInfoCallBack), m_Socket);
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | internal class SocketAsyncState
|
| | | {
|
| | | /// <summary>
|
| | | /// 是否完成。
|
| | | /// </summary>
|
| | | public bool Completed { get; set; }
|
| | |
|
| | | /// <summary>
|
| | | /// 数据
|
| | | /// </summary>
|
| | | public byte[] Data { get; set; }
|
| | | /// <summary>
|
| | | /// 是否异步
|
| | | /// </summary>
|
| | | public bool IsAsync { get; set; }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | using UnityEngine; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Net; |
| | | using System.Net.Sockets; |
| | | using System.Threading; |
| | | |
| | | public class ClientSocket |
| | | { |
| | | GameNetEncode encoder = new GameNetEncode(); |
| | | Socket m_Socket; |
| | | public Socket socket { get { return m_Socket; } } |
| | | |
| | | private Thread m_packageThread; |
| | | private byte[] bufferBytes = new byte[4096]; // 4K,单包字节数组缓存 |
| | | private byte[] fragmentBytes; //留包后的内容 |
| | | private long getBytesTotal = 0; //发送的数据总量 |
| | | private long sendBytesTotal = 0; //发送的数据总量 |
| | | |
| | | public bool connected { get { return m_Socket == null ? false : m_Socket.Connected; } } |
| | | |
| | | GameNetSystem.SocketType socketType = GameNetSystem.SocketType.Main; |
| | | DateTime m_LastPackageTime; |
| | | public DateTime lastPackageTime { get { return m_LastPackageTime; } } |
| | | |
| | | bool isStopTreading = false; |
| | | |
| | | string ip; |
| | | int port; |
| | | Action onConnected = null; |
| | | |
| | | public ClientSocket(GameNetSystem.SocketType type) |
| | | { |
| | | this.socketType = type; |
| | | } |
| | | |
| | | public void Connect(string _ip, int _port, Action _onConnected) |
| | | { |
| | | try |
| | | { |
| | | ip = _ip; |
| | | port = _port; |
| | | onConnected = _onConnected; |
| | | Dns.BeginGetHostAddresses(_ip, OnGetHostAddresses, null); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | DebugEx.LogError(e.Message); |
| | | } |
| | | } |
| | | |
| | | private void OnGetHostAddresses(IAsyncResult _result) |
| | | { |
| | | var ipAddresses = Dns.EndGetHostAddresses(_result); |
| | | |
| | | if (ipAddresses[0].AddressFamily == AddressFamily.InterNetworkV6) |
| | | { |
| | | DebugEx.Log("当前使用的网络: IPV6"); |
| | | m_Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp); |
| | | } |
| | | else |
| | | { |
| | | DebugEx.Log("当前使用的网络: IPV4"); |
| | | m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); |
| | | } |
| | | |
| | | var ipEndPoint = new IPEndPoint(ipAddresses[0], port); |
| | | if (ipEndPoint == null) |
| | | { |
| | | Debug.Log("IpEndPoint is null"); |
| | | } |
| | | |
| | | m_Socket.BeginConnect(ipEndPoint, new AsyncCallback(ConnectCallBack), null); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 链接成功时的回调 |
| | | /// </summary> |
| | | /// <param name="_result"></param> |
| | | private void ConnectCallBack(IAsyncResult _result) |
| | | { |
| | | if (!_result.IsCompleted) |
| | | { |
| | | DebugEx.Log("链接超时!"); |
| | | CloseConnect(); |
| | | } |
| | | else |
| | | { |
| | | if (m_Socket != null && m_Socket.Connected) |
| | | { |
| | | DebugEx.Log("确认的链接实现"); |
| | | OnConnectSuccess(); |
| | | |
| | | if (onConnected != null) |
| | | { |
| | | onConnected(); |
| | | onConnected = null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (m_Socket != null) |
| | | { |
| | | m_Socket.Disconnect(true); |
| | | } |
| | | |
| | | onConnected = null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 关闭链接 |
| | | /// </summary> |
| | | public void CloseConnect() |
| | | { |
| | | try |
| | | { |
| | | isStopTreading = true; |
| | | if (m_packageThread != null) |
| | | { |
| | | m_packageThread.Abort(); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (m_Socket != null && m_Socket.Connected) |
| | | { |
| | | m_Socket.Shutdown(SocketShutdown.Both); |
| | | m_Socket.Close(); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | |
| | | sendQueue.Clear(); |
| | | m_Socket = null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 链接成功 |
| | | /// </summary> |
| | | private void OnConnectSuccess() |
| | | { |
| | | if (m_packageThread != null) |
| | | { |
| | | m_packageThread.Abort(); |
| | | m_packageThread = null; |
| | | } |
| | | |
| | | m_LastPackageTime = DateTime.Now; |
| | | m_packageThread = new Thread(new ThreadStart(ReceiveInfo)); // 启动线程接收信息 |
| | | m_packageThread.IsBackground = true; |
| | | m_packageThread.Start(); |
| | | isStopTreading = false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 接收信息 |
| | | /// </summary> |
| | | private void ReceiveInfo() |
| | | { |
| | | while (!isStopTreading) |
| | | { |
| | | try |
| | | { |
| | | var shutdown = false; |
| | | if (!m_Socket.Connected) |
| | | { |
| | | shutdown = true; |
| | | } |
| | | |
| | | if (!shutdown) |
| | | { |
| | | var dataLength = m_Socket.Receive(bufferBytes); |
| | | if (dataLength <= 0) |
| | | { |
| | | shutdown = true; |
| | | } |
| | | else |
| | | { |
| | | getBytesTotal += dataLength; |
| | | var bytes = new byte[dataLength]; |
| | | Array.Copy(bufferBytes, 0, bytes, 0, dataLength); |
| | | ReadInfo(bytes); |
| | | } |
| | | } |
| | | |
| | | if (shutdown) |
| | | { |
| | | isStopTreading = true; |
| | | m_Socket.Shutdown(SocketShutdown.Both); |
| | | m_Socket.Close(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | DebugEx.Log(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | static byte[] vCmdBytes = new byte[2]; |
| | | /// <summary> |
| | | /// 阅读信息 |
| | | /// </summary> |
| | | /// <param name="vBytes"></param> |
| | | private void ReadInfo(byte[] vBytes) |
| | | { |
| | | try |
| | | { |
| | | byte[] fixBytes = vBytes; |
| | | // 如果存在留包,则并包 |
| | | if (fragmentBytes != null && fragmentBytes.Length > 0) |
| | | { |
| | | Array.Resize(ref fixBytes, vBytes.Length + fragmentBytes.Length); |
| | | Array.Copy(fragmentBytes, 0, fixBytes, 0, fragmentBytes.Length); |
| | | Array.Copy(vBytes, 0, fixBytes, fragmentBytes.Length, vBytes.Length); |
| | | } |
| | | |
| | | fragmentBytes = null; // 清理掉留包 |
| | | int vReadIndex = 0; // 初始指针 |
| | | byte[] vPackBytes; |
| | | int vLeavingLeng = 0; |
| | | int vBodyLeng = 0; |
| | | int vTotalLeng = fixBytes.Length; |
| | | GameNetPackBasic vNetpack; |
| | | |
| | | while (vReadIndex < vTotalLeng) |
| | | { |
| | | vLeavingLeng = vTotalLeng - vReadIndex; |
| | | if (vLeavingLeng < 6) // 未符合包的最低限度字节量, 留包 |
| | | { |
| | | fragmentBytes = new byte[vLeavingLeng]; |
| | | Array.Copy(fixBytes, vReadIndex, fragmentBytes, 0, vLeavingLeng); |
| | | break; |
| | | } |
| | | vBodyLeng = BitConverter.ToInt32(fixBytes, vReadIndex + 2); |
| | | if (vBodyLeng > vLeavingLeng - 6)// 未完整的包则留包 |
| | | { |
| | | fragmentBytes = new byte[vLeavingLeng]; |
| | | Array.Copy(fixBytes, vReadIndex, fragmentBytes, 0, vLeavingLeng); |
| | | break; |
| | | } |
| | | vPackBytes = new byte[vBodyLeng]; |
| | | Array.Copy(fixBytes, vReadIndex + 6, vPackBytes, 0, vBodyLeng); // 提取包的字节内容 |
| | | // 完整的包则读包 |
| | | |
| | | vPackBytes = encoder.BaseXorSub(vPackBytes); |
| | | Array.Copy(vPackBytes, 0, vCmdBytes, 0, 2); |
| | | var cmd = (ushort)((ushort)(vCmdBytes[0] << 8) + vCmdBytes[1]); |
| | | if (PackageRegedit.Contain(cmd)) |
| | | { |
| | | vNetpack = PackageRegedit.TransPack(cmd, vPackBytes); |
| | | if (vNetpack != null) |
| | | { |
| | | if (DebugEx.EnableNetLog) |
| | | { |
| | | DebugEx.NetLogFormat("收包:{0}", vNetpack.GetType().Name); |
| | | } |
| | | |
| | | m_LastPackageTime = DateTime.Now; |
| | | GameNetSystem.Instance.PushPackage(vNetpack, this.socketType); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | #if UNITY_EDITOR |
| | | PackageRegedit.TransPack(cmd, vPackBytes); |
| | | #endif |
| | | CSharpCallLua.OnRecieveLuaNetPackage(cmd, vPackBytes); |
| | | } |
| | | |
| | | vReadIndex += 6 + vBodyLeng; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogFormat("收包异常:{0}", ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送信息 |
| | | /// </summary> |
| | | public void SendInfo(GameNetPackBasic protocol) |
| | | { |
| | | if (!connected) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (protocol == null) |
| | | { |
| | | DebugEx.LogError("要发的信息对象为空"); |
| | | return; |
| | | } |
| | | |
| | | if (DebugEx.EnableNetLog) |
| | | { |
| | | DebugEx.NetLogFormat("发包:{0}", protocol.GetType().Name); |
| | | } |
| | | |
| | | if (protocol.combineBytes == null) |
| | | { |
| | | protocol.WriteToBytes(); |
| | | } |
| | | protocol.CombineDatas(encoder); |
| | | #if UNITY_EDITOR |
| | | NetPkgCtl.AddNetPkg(protocol.vInfoCont, NetPkgType.Client, protocol.ToString(), FieldPrint.PrintFields(protocol), FieldPrint.PrintFieldsExpand(protocol, true)); |
| | | #endif |
| | | sendBytesTotal += protocol.combineBytes.Length; |
| | | SendBytes(protocol.combineBytes); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送信息 |
| | | /// </summary> |
| | | /// <param name="vBytes"></param> |
| | | public void SendInfo(byte[] vBytes) |
| | | { |
| | | if (!connected) |
| | | { |
| | | DebugEx.LogError("尚未与该后端链接!无法发送信息"); |
| | | return; |
| | | } |
| | | |
| | | if (vBytes == null || vBytes.Length < 2) |
| | | { |
| | | DebugEx.LogError("要发的信息数据为空或数据不足"); |
| | | return; |
| | | } |
| | | |
| | | vBytes = encoder.BaseXorAdd(vBytes); |
| | | byte[] vFrameHead = new byte[] { 255, 204 }; |
| | | byte[] vMsgBodyLength = BitConverter.GetBytes(vBytes.Length); |
| | | byte[] vTotal = new byte[vBytes.Length + 6]; |
| | | Array.Copy(vFrameHead, 0, vTotal, 0, vFrameHead.Length); |
| | | Array.Copy(vMsgBodyLength, 0, vTotal, 2, vMsgBodyLength.Length); |
| | | Array.Copy(vBytes, 0, vTotal, 6, vBytes.Length); |
| | | |
| | | SendBytes(vTotal); |
| | | } |
| | | |
| | | Queue<byte[]> sendQueue = new Queue<byte[]>(); |
| | | private void SendBytes(byte[] bytes) |
| | | { |
| | | try |
| | | { |
| | | if (sendQueue.Count > 0) |
| | | { |
| | | sendQueue.Enqueue(bytes); |
| | | } |
| | | else |
| | | { |
| | | m_Socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(SendInfoCallBack), m_Socket); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | DebugEx.LogError("网络数据包发送异常"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送完成的回调 |
| | | /// </summary> |
| | | /// <param name="vAsyncSend"></param> |
| | | private void SendInfoCallBack(IAsyncResult vAsyncSend) |
| | | { |
| | | try |
| | | { |
| | | if (sendQueue.Count > 0) |
| | | { |
| | | var bytes = sendQueue.Dequeue(); |
| | | m_Socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(SendInfoCallBack), m_Socket); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | static object lockojb1 = new object(); |
| | | public static void OnRecieveLuaNetPackage(ushort cmd, byte[] bytes) |
| | | { |
| | | if (onRecieveLuaNetPackage != null) |
| | | lock (lockojb1) |
| | | { |
| | | onRecieveLuaNetPackage(cmd, bytes); |
| | | if (onRecieveLuaNetPackage != null) |
| | | { |
| | | onRecieveLuaNetPackage(cmd, bytes); |
| | | } |
| | | } |
| | | } |
| | | |
| | | static object lockojb2 = new object(); |
| | | public static void OnRecieveCSharpNetPackage(ushort cmd) |
| | | { |
| | | if (onCSharpNetPackage != null) |
| | | lock (lockojb2) |
| | | { |
| | | onCSharpNetPackage(cmd); |
| | | if (onCSharpNetPackage != null) |
| | | { |
| | | onCSharpNetPackage(cmd); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | #endif |
| | | } |
| | | |
| | | public PlayerTaskDatas __Gen_Delegate_Imp63(object p0) |
| | | public string __Gen_Delegate_Imp63(object p0, int p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | | { |
| | | #endif |
| | | RealStatePtr L = luaEnv.rawL; |
| | | int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); |
| | | ObjectTranslator translator = luaEnv.translator; |
| | | translator.PushAny(L, p0); |
| | | LuaAPI.xlua_pushinteger(L, p1); |
| | | |
| | | PCall(L, 2, 1, errFunc); |
| | | |
| | | |
| | | string __gen_ret = LuaAPI.lua_tostring(L, errFunc + 1); |
| | | LuaAPI.lua_settop(L, errFunc - 1); |
| | | return __gen_ret; |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public PlayerTaskDatas __Gen_Delegate_Imp64(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp64(object p0, int p1, int p2) |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp65(object p0, int p1, int p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public int __Gen_Delegate_Imp65(object p0, int p1, int p2) |
| | | public int __Gen_Delegate_Imp66(object p0, int p1, int p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp66(object p0, TreasureCategory p1) |
| | | public void __Gen_Delegate_Imp67(object p0, TreasureCategory p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.FlashSaleModel __Gen_Delegate_Imp67(object p0) |
| | | public Snxxz.UI.VipModel __Gen_Delegate_Imp68(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | | { |
| | | #endif |
| | | RealStatePtr L = luaEnv.rawL; |
| | | int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); |
| | | ObjectTranslator translator = luaEnv.translator; |
| | | translator.PushAny(L, p0); |
| | | |
| | | PCall(L, 1, 1, errFunc); |
| | | |
| | | |
| | | Snxxz.UI.VipModel __gen_ret = (Snxxz.UI.VipModel)translator.GetObject(L, errFunc + 1, typeof(Snxxz.UI.VipModel)); |
| | | LuaAPI.lua_settop(L, errFunc - 1); |
| | | return __gen_ret; |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.MarketModel __Gen_Delegate_Imp69(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | | { |
| | | #endif |
| | | RealStatePtr L = luaEnv.rawL; |
| | | int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); |
| | | ObjectTranslator translator = luaEnv.translator; |
| | | translator.PushAny(L, p0); |
| | | |
| | | PCall(L, 1, 1, errFunc); |
| | | |
| | | |
| | | Snxxz.UI.MarketModel __gen_ret = (Snxxz.UI.MarketModel)translator.GetObject(L, errFunc + 1, typeof(Snxxz.UI.MarketModel)); |
| | | LuaAPI.lua_settop(L, errFunc - 1); |
| | | return __gen_ret; |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp70(object p0, ItemWinBtnType p1, object p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | | { |
| | | #endif |
| | | RealStatePtr L = luaEnv.rawL; |
| | | int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); |
| | | ObjectTranslator translator = luaEnv.translator; |
| | | translator.PushAny(L, p0); |
| | | translator.Push(L, p1); |
| | | translator.PushAny(L, p2); |
| | | |
| | | PCall(L, 3, 0, errFunc); |
| | | |
| | | |
| | | |
| | | LuaAPI.lua_settop(L, errFunc - 1); |
| | | |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.FlashSaleModel __Gen_Delegate_Imp71(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp68(object p0, Snxxz.UI.OperationFlashSale.FlashSaleGift p1) |
| | | public void __Gen_Delegate_Imp72(object p0, Snxxz.UI.OperationFlashSale.FlashSaleGift p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.MysticalPurchaseModel __Gen_Delegate_Imp69(object p0) |
| | | public Snxxz.UI.MysticalPurchaseModel __Gen_Delegate_Imp73(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.ImpactRankModel __Gen_Delegate_Imp70(object p0) |
| | | public Snxxz.UI.ImpactRankModel __Gen_Delegate_Imp74(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.OSRedEnvelopeModel __Gen_Delegate_Imp71(object p0) |
| | | public Snxxz.UI.OSRedEnvelopeModel __Gen_Delegate_Imp75(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.FairyLeagueModel __Gen_Delegate_Imp72(object p0) |
| | | public Snxxz.UI.FairyLeagueModel __Gen_Delegate_Imp76(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.FairyGrabBossModel __Gen_Delegate_Imp73(object p0) |
| | | public Snxxz.UI.FairyGrabBossModel __Gen_Delegate_Imp77(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.OSGiftModel __Gen_Delegate_Imp74(object p0) |
| | | public Snxxz.UI.OSGiftModel __Gen_Delegate_Imp78(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public bool __Gen_Delegate_Imp75(object p0, ScrollerDataType p1, int p2, out float p3) |
| | | public bool __Gen_Delegate_Imp79(object p0, ScrollerDataType p1, int p2, out float p3) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp76(object p0, int p1, int p2) |
| | | public void __Gen_Delegate_Imp80(object p0, int p1, int p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp77(object p0, Snxxz.UI.Operation p1) |
| | | public void __Gen_Delegate_Imp81(object p0, Snxxz.UI.Operation p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.VipModel __Gen_Delegate_Imp78(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | | { |
| | | #endif |
| | | RealStatePtr L = luaEnv.rawL; |
| | | int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); |
| | | ObjectTranslator translator = luaEnv.translator; |
| | | translator.PushAny(L, p0); |
| | | |
| | | PCall(L, 1, 1, errFunc); |
| | | |
| | | |
| | | Snxxz.UI.VipModel __gen_ret = (Snxxz.UI.VipModel)translator.GetObject(L, errFunc + 1, typeof(Snxxz.UI.VipModel)); |
| | | LuaAPI.lua_settop(L, errFunc - 1); |
| | | return __gen_ret; |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.RealmModel __Gen_Delegate_Imp79(object p0) |
| | | public Snxxz.UI.RealmModel __Gen_Delegate_Imp82(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp80(object p0, object p1, bool p2) |
| | | public void __Gen_Delegate_Imp83(object p0, object p1, bool p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.MagicianModel __Gen_Delegate_Imp81(object p0) |
| | | public Snxxz.UI.MagicianModel __Gen_Delegate_Imp84(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.FuncSwitchModel __Gen_Delegate_Imp82(object p0) |
| | | public Snxxz.UI.FuncSwitchModel __Gen_Delegate_Imp85(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public System.Collections.Generic.Dictionary<int, Snxxz.UI.FuncSwitchModel.FuncSwithData> __Gen_Delegate_Imp83(object p0) |
| | | public System.Collections.Generic.Dictionary<int, Snxxz.UI.FuncSwitchModel.FuncSwithData> __Gen_Delegate_Imp86(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public bool __Gen_Delegate_Imp84(object p0, int p1) |
| | | public bool __Gen_Delegate_Imp87(object p0, int p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.TestModel __Gen_Delegate_Imp85(object p0) |
| | | public Snxxz.UI.TestModel __Gen_Delegate_Imp88(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UIEffect __Gen_Delegate_Imp86(object p0) |
| | | public UIEffect __Gen_Delegate_Imp89(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp87(object p0, object p1, object p2) |
| | | public void __Gen_Delegate_Imp90(object p0, object p1, object p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Treasure3DConfig __Gen_Delegate_Imp88(object p0) |
| | | public Treasure3DConfig __Gen_Delegate_Imp91(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.AchievementModel __Gen_Delegate_Imp89(object p0) |
| | | public Snxxz.UI.AchievementModel __Gen_Delegate_Imp92(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp90(object p0, int p1) |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp93(object p0, int p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp91(object p0, UnityEngine.Vector3 p1) |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp94(object p0, UnityEngine.Vector3 p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp92(object p0, float p1) |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp95(object p0, float p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp93(object p0, bool p1, bool p2) |
| | | public void __Gen_Delegate_Imp96(object p0, bool p1, bool p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp94(object p0, Snxxz.UI.TreasureAnimation.TreasureShowStep p1) |
| | | public void __Gen_Delegate_Imp97(object p0, Snxxz.UI.TreasureAnimation.TreasureShowStep p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp95(object p0, bool p1, int p2) |
| | | public void __Gen_Delegate_Imp98(object p0, bool p1, int p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp96(object p0, object p1, int p2) |
| | | public void __Gen_Delegate_Imp99(object p0, object p1, int p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp97(object p0, PackType p1, int p2, int p3) |
| | | public void __Gen_Delegate_Imp100(object p0, PackType p1, int p2, int p3) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public int __Gen_Delegate_Imp98(object p0, int p1) |
| | | public int __Gen_Delegate_Imp101(object p0, int p1) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp99(object p0, int p1, int p2, bool p3) |
| | | public void __Gen_Delegate_Imp102(object p0, int p1, int p2, bool p3) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.Camera __Gen_Delegate_Imp100(object p0) |
| | | public UnityEngine.Camera __Gen_Delegate_Imp103(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.Transform __Gen_Delegate_Imp101(object p0) |
| | | public UnityEngine.Transform __Gen_Delegate_Imp104(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public float __Gen_Delegate_Imp102(object p0) |
| | | public float __Gen_Delegate_Imp105(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp103(object p0) |
| | | public UnityEngine.Vector3 __Gen_Delegate_Imp106(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Treasure3DConfig.TreasureParam __Gen_Delegate_Imp104(object p0) |
| | | public Treasure3DConfig.TreasureParam __Gen_Delegate_Imp107(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.UI3DTreasureSelectStage __Gen_Delegate_Imp105() |
| | | public Snxxz.UI.UI3DTreasureSelectStage __Gen_Delegate_Imp108() |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public TreasureCategory __Gen_Delegate_Imp106(object p0) |
| | | public TreasureCategory __Gen_Delegate_Imp109(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public UnityEngine.GameObject __Gen_Delegate_Imp107(object p0) |
| | | public UnityEngine.GameObject __Gen_Delegate_Imp110(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp108(object p0, bool p1, TreasureCategory p2) |
| | | public void __Gen_Delegate_Imp111(object p0, bool p1, TreasureCategory p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp109(object p0, TreasureCategory p1, object p2) |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp112(object p0, TreasureCategory p1, object p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public void __Gen_Delegate_Imp110(object p0, TreasureCategory p1, bool p2) |
| | | public void __Gen_Delegate_Imp113(object p0, TreasureCategory p1, bool p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp111(object p0, object p1, float p2) |
| | | public System.Collections.IEnumerator __Gen_Delegate_Imp114(object p0, object p1, float p2) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | #endif |
| | | } |
| | | |
| | | public Snxxz.UI.SignInModel __Gen_Delegate_Imp112(object p0) |
| | | public Snxxz.UI.SignInModel __Gen_Delegate_Imp115(object p0) |
| | | { |
| | | #if THREAD_SAFE || HOTFIX_ENABLE |
| | | lock (luaEnv.luaEnvLock) |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(GameNetSystem); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 10, 3, 1); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 10, 5, 1); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "BeginConnectGameServer", _m_BeginConnectGameServer); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "BeginConnectCrossServer", _m_BeginConnectCrossServer); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SendInfo", _m_SendInfo); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SendToCrossServer", _m_SendToCrossServer); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "PushPackage", _m_PushPackage); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Disconnect", _m_Disconnect); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Reconnect", _m_Reconnect); |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnAccountLogin", _m_OnAccountLogin); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnEnterWorld", _m_OnEnterWorld); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "disconnectEvent", _e_disconnectEvent); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "connectedEvent", _e_connectedEvent); |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "netState", _g_get_netState); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "socketConnected", _g_get_socketConnected); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "lastPackageTime", _g_get_lastPackageTime); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "mainSocketConnected", _g_get_mainSocketConnected); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "timeSinceMainSocketLastProtocol", _g_get_timeSinceMainSocketLastProtocol); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "crossServerSocketConnected", _g_get_crossServerSocketConnected); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "timeSinceCrossServerSocketLastProtocol", _g_get_timeSinceCrossServerSocketLastProtocol); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "netState", _s_set_netState); |
| | | |
| | |
| | | |
| | | |
| | | { |
| | | string __ip = LuaAPI.lua_tostring(L, 2); |
| | | int __port = LuaAPI.xlua_tointeger(L, 3); |
| | | System.Action __onConnected = translator.GetDelegate<System.Action>(L, 4); |
| | | string _ip = LuaAPI.lua_tostring(L, 2); |
| | | int _port = LuaAPI.xlua_tointeger(L, 3); |
| | | System.Action _onConnected = translator.GetDelegate<System.Action>(L, 4); |
| | | |
| | | gen_to_be_invoked.BeginConnectGameServer( __ip, __port, __onConnected ); |
| | | gen_to_be_invoked.BeginConnectGameServer( _ip, _port, _onConnected ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_BeginConnectCrossServer(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | string _ip = LuaAPI.lua_tostring(L, 2); |
| | | int _port = LuaAPI.xlua_tointeger(L, 3); |
| | | System.Action _onConnected = translator.GetDelegate<System.Action>(L, 4); |
| | | |
| | | gen_to_be_invoked.BeginConnectCrossServer( _ip, _port, _onConnected ); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | if(gen_param_count == 2&& translator.Assignable<GameNetPackBasic>(L, 2)) |
| | | { |
| | | GameNetPackBasic _vNetPack = (GameNetPackBasic)translator.GetObject(L, 2, typeof(GameNetPackBasic)); |
| | | GameNetPackBasic _protocol = (GameNetPackBasic)translator.GetObject(L, 2, typeof(GameNetPackBasic)); |
| | | |
| | | gen_to_be_invoked.SendInfo( _vNetPack ); |
| | | gen_to_be_invoked.SendInfo( _protocol ); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_SendToCrossServer(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | GameNetPackBasic _protocol = (GameNetPackBasic)translator.GetObject(L, 2, typeof(GameNetPackBasic)); |
| | | |
| | | gen_to_be_invoked.SendToCrossServer( _protocol ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_PushPackage(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | |
| | | |
| | | { |
| | | GameNetPackBasic __package = (GameNetPackBasic)translator.GetObject(L, 2, typeof(GameNetPackBasic)); |
| | | GameNetPackBasic _protocol = (GameNetPackBasic)translator.GetObject(L, 2, typeof(GameNetPackBasic)); |
| | | GameNetSystem.SocketType _type;translator.Get(L, 3, out _type); |
| | | |
| | | gen_to_be_invoked.PushPackage( __package ); |
| | | gen_to_be_invoked.PushPackage( _protocol, _type ); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_socketConnected(RealStatePtr L) |
| | | static int _g_get_mainSocketConnected(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.socketConnected); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.mainSocketConnected); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_lastPackageTime(RealStatePtr L) |
| | | static int _g_get_timeSinceMainSocketLastProtocol(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.lastPackageTime); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.timeSinceMainSocketLastProtocol); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_crossServerSocketConnected(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.crossServerSocketConnected); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_timeSinceCrossServerSocketLastProtocol(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.timeSinceCrossServerSocketLastProtocol); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_disconnectEvent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3); |
| | | if (gen_delegate == null) { |
| | | return LuaAPI.luaL_error(L, "#3 need System.Action!"); |
| | | } |
| | | |
| | | if (gen_param_count == 3) |
| | | { |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { |
| | | gen_to_be_invoked.disconnectEvent += gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { |
| | | gen_to_be_invoked.disconnectEvent -= gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | LuaAPI.luaL_error(L, "invalid arguments to GameNetSystem.disconnectEvent!"); |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_connectedEvent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | GameNetSystem gen_to_be_invoked = (GameNetSystem)translator.FastGetCSObj(L, 1); |
| | | System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3); |
| | | if (gen_delegate == null) { |
| | | return LuaAPI.luaL_error(L, "#3 need System.Action!"); |
| | | } |
| | | |
| | | if (gen_param_count == 3) |
| | | { |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { |
| | | gen_to_be_invoked.connectedEvent += gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { |
| | | gen_to_be_invoked.connectedEvent -= gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | LuaAPI.luaL_error(L, "invalid arguments to GameNetSystem.connectedEvent!"); |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c7db64a06c1063c449738fbe1dd9eeb1 |
| | | timeCreated: 1543808666 |
| | | timeCreated: 1544413151 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a545fb3dcf719304fa74180c10219375 |
| | | folderAsset: yes |
| | | timeCreated: 1542357825 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(StoreModel); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 59, 27, 10); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 65, 27, 10); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnBeforePlayerDataInitialize", _m_OnBeforePlayerDataInitialize); |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetShopRedpoint", _m_SetShopRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateFreeShopRedpoint", _m_UpdateFreeShopRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateCanBuyRedpoint", _m_UpdateCanBuyRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateFairyEquipRedpoint", _m_UpdateFairyEquipRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearFairyEquipRedpoint", _m_ClearFairyEquipRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SwitchFuncTitleClearRedpoint", _m_SwitchFuncTitleClearRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetFairySaveKey", _m_TryGetFairySaveKey); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdateMustBuyRedpoint", _m_UpdateMustBuyRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearMustBuyRedpoint", _m_ClearMustBuyRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetIsMustBuyDay", _m_SetIsMustBuyDay); |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UpdatePetAndMountPutAwayRedpoint", _m_UpdatePetAndMountPutAwayRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearPetAndMountRedpoint", _m_ClearPetAndMountRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearAllPetAndMountRedpoint", _m_ClearAllPetAndMountRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "CloseRedPoint", _m_CloseRedPoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "CloseAllRedpoint", _m_CloseAllRedpoint); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPushPetAndMountWinState", _m_SetPushPetAndMountWinState); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "CheckIsShowPush", _m_CheckIsShowPush); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ClearPushData", _m_ClearPushData); |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_UpdateFairyEquipRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | gen_to_be_invoked.UpdateFairyEquipRedpoint( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_ClearFairyEquipRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | TableConfig.StoreConfig _storeConfig = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig)); |
| | | |
| | | gen_to_be_invoked.ClearFairyEquipRedpoint( _storeConfig ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_SwitchFuncTitleClearRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | StoreFunc _storeFunc;translator.Get(L, 2, out _storeFunc); |
| | | |
| | | gen_to_be_invoked.SwitchFuncTitleClearRedpoint( _storeFunc ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_TryGetFairySaveKey(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | TableConfig.StoreConfig _config = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig)); |
| | | string _fairySaveKey; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetFairySaveKey( _config, out _fairySaveKey ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | LuaAPI.lua_pushstring(L, _fairySaveKey); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_UpdateMustBuyRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_CloseRedPoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | TableConfig.StoreConfig _storeConfig = (TableConfig.StoreConfig)translator.GetObject(L, 2, typeof(TableConfig.StoreConfig)); |
| | | |
| | | gen_to_be_invoked.CloseRedPoint( _storeConfig ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_CloseAllRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | StoreModel gen_to_be_invoked = (StoreModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | StoreFunc _storeFunc;translator.Get(L, 2, out _storeFunc); |
| | | |
| | | gen_to_be_invoked.CloseAllRedpoint( _storeFunc ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_SetPushPetAndMountWinState(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11479d6613f53454b9f092ed34c058f8 |
| | | timeCreated: 1543808656 |
| | | timeCreated: 1544413150 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |