コード例 #1
0
 static public NetWorkMgr Instance()
 {
     if (m_instance == null)
     {
         m_instance = new NetWorkMgr();
         m_instance.Awake();
         m_instance.InitThread();
         m_instance.RegisterAllMessage();
     }
     return(m_instance);
 }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        AppFacade.Instance.StartUp();
        NetWorkMgr networkMgr = AppFacade.Instance.GetManager <NetWorkMgr>(ManagerName.NetWorkMgr);

        sock = networkMgr.CreateTcpSocket(new TConfig()
        {
            ip = ip, name = "TSocketDemo", port = port
        }, this);
        sock.Start();
    }
コード例 #3
0
 void OnBtnSubmitClick()
 {
     if (inputField != null)
     {
         GameLoginReq req = new GameLoginReq();
         req.uin      = 1;
         req.password = "******";
         global::ProtoBuf.Serializer.Serialize <GameLoginReq>(new MemoryStream(), req);
         NetWorkMgr.GetInstance().SendReq(req.ToString());
     }
 }
コード例 #4
0
        static int Main(string[] args)
        {
            NetWorkMgr.GetInstance().Initialize();
            if (args == null)
            {
                Console.WriteLine("参数为空,启动svr失败");
                return(-1);
            }

            if (args.Length < 1)
            {
                Console.WriteLine("参数数量不正确,启动svr失败");
                return(-1);
            }
            int port = 0;

            if (!int.TryParse(args[0], out port))
            {
                Console.WriteLine("解析参数失败,启动svr失败");
                return(-1);
            }
            NetWorkMgr.GetInstance().StartListen(port);
            return(0);
        }
コード例 #5
0
ファイル: Entry.cs プロジェクト: Zachzx0/FrameSyncDemo
 void Start()
 {
     NetWorkMgr.GetInstance().Initialize();
 }
コード例 #6
0
 static public void DestoryIns()
 {
     m_instance.DestoryThread();
     m_instance = null;
 }
コード例 #7
0
 /// <summary>
 /// For Async load scene.
 /// </summary>
 private void Start()
 {
     _Instance = this;
     PhotonNetwork.AutomaticallySyncScene = true;
     PhotonNetwork.SendRate = 90;
 }