Exemple #1
0
        void Start()
        {
            m_pRelayConnector  = null;
            m_pSocketManager   = null;
            m_pProcessUnit     = null;
            m_pProcessUnitBank = null;

            m_PUUID = 0;
            m_RPCID = 0;
        }
Exemple #2
0
        public void Test_ToString_MixedData_ReturnsCorrectUuid()
        {
            string expected = "00000000-0000-15b3-4006-000700000001";

            ushort subtype = 7;
            ulong  id      = 5555;
            uint   company = 1;

            PUUID uuid = new PUUID(id, company, PUUID.TypeDef.RECORD, subtype);

            string result = uuid.ToString();

            Assert.That(result, Is.StringMatching(expected));
        }
Exemple #3
0
        public bool ConnectServer(string ipAddr, UInt16 port, PUUID puUid)
        {
            Logger.MLNLOG_INFO("ipAddr=" + ipAddr + ", port=" + port + ", puUid=0x" + Utility.ToHex(puUid));

            m_pRelayConnector.SetDirectMode(true); // バトルサーバへは、リレーサーバを介さず直接繋げる
            Connector.CONNECTOR_RET_CODE ret = m_pRelayConnector.Setup(port, ipAddr);
            if (Connector.CONNECTOR_RET_CODE.OK != ret)
            {
                Logger.MLNLOG_WARNING("Fail Setup ret=" + (Int32)ret);
                return(false);
            }

            m_PUUID = puUid;
            return(true);
        }
Exemple #4
0
        public virtual void Start()
        {
            m_PUUID            = 0;
            m_IsUpdate         = false;
            m_pPU              = null;
            m_pProcessUnit     = null;
            m_pProcessUnitBank = new ProcessUnitBank();

            do
            {
                m_pSocketManager = new SocketManager();
                if (null == m_pSocketManager)
                {
                    Logger.MLNLOG_ERR("Error SocketManager");
                    break;
                }

                if (SocketManager.SOCKETMANAGER_RET_CODE.ERROR == m_pSocketManager.Initialize())
                {
                    Logger.MLNLOG_ERR("Error SocketManager Initialize");
                    break;
                }

                m_PUUID = CreatePU();
                if (ProcessUnitManager.INVALID_PUUID == m_PUUID)
                {
                    Logger.MLNLOG_ERR("Error CreatePU");
                    m_IsUpdate = false;
                    break;
                }

                m_pProcessUnit = m_pProcessUnitBank.GetProcessUnitFromId(m_PUUID);

                m_pPU = (BTL.PU_Client)m_pProcessUnit as BTL.PU_Client;
                m_pPU.Start();
                m_pPU.SetCharaId(m_CharaId);
                m_pPU.GetRpcConnector().SetSocketManager(m_pSocketManager);
                m_pPU.GetRpcConnector().SetProcessUnit(m_pProcessUnitBank.GetProcessUnitFromId(m_PUUID));
                m_pPU.GetRpcConnector().SetProcessUnitBank(m_pProcessUnitBank);
                m_pPU.GetRpcConnector().NewRelayConnector();

                m_IsUpdate = true;
            }while (false);
        }
Exemple #5
0
        public UInt64 ConnectRpc(BTL.INTFID interfaceId, PUUID dstPuUid, PUUID srcPuUid, UInt64 anyKey)
        {
            if (null == m_pRpcClient)
            {
                return(0);
            }

            m_pProcessUnit.SetRelayConnector(m_pRelayConnector);

            UInt64 rpcId = m_pRpcClient.Connect((UInt32)interfaceId, dstPuUid, srcPuUid, anyKey);

            if (0 == rpcId)
            {
                Logger.MLNLOG_WARNING("Fail Connect interfaceId=" + interfaceId
                                      + " dstPuUid=0x" + Utility.ToHex(dstPuUid) + " srcPuUid=0x" + Utility.ToHex(srcPuUid) + " anyKey=0x" + Utility.ToHex(anyKey));
                return(0);
            }

            m_RPCID = rpcId;
            return(rpcId);
        }
Exemple #6
0
 public void SetPUUID(PUUID puUid)
 {
     m_PUUID = puUid;
 }
Exemple #7
0
        public void Test_Id_validPUUID_correctId()
        {
            PUUID uuid = new PUUID("00000000-0000-15b3-4006-000700000001");

            Assert.That(uuid.Id, Is.EqualTo((ulong)5555));
        }
Exemple #8
0
        public void Test_Company_validPUUID_correctCompany()
        {
            PUUID uuid = new PUUID("00000000-0000-15b3-4006-000700000001");

            Assert.That(uuid.Company, Is.EqualTo((uint)1));
        }
Exemple #9
0
        public void Test_SubType_validPUUID_correctSubType()
        {
            PUUID uuid = new PUUID("00000000-0000-15b3-4006-000700000001");

            Assert.That(uuid.SubType, Is.EqualTo((ushort)7));
        }
Exemple #10
0
        public void Test_Type_validPUUID_correctType()
        {
            PUUID uuid = new PUUID("00000000-0000-15b3-4006-000700000001");

            Assert.That(uuid.Type, Is.EqualTo(PUUID.TypeDef.RECORD));
        }