public void Init(int platf, string openid) { this.mAppID = "guest100023"; if (platf == 3) { this.mAppID = "1105309683"; } else if (platf == 4) { this.mAppID = "wxfdab5af74990787a"; } this.mOpenID = openid; this.SetGSDKUserName(platf, openid); if (ApolloManager.ApolloVoiceMgr != null) { Debug.Log("ApolloVoiceMgr Created"); } else { ApolloManager.ApolloVoiceMgr = new CApolloVoiceSys(); ApolloManager.ApolloVoiceMgr.SysInitial(); } if (ApolloManager.ApolloVoiceMgr != null) { ApolloVoiceErr apolloVoiceErr = (ApolloVoiceErr)ApolloManager.ApolloVoiceMgr.CallApolloVoiceSDK._CreateApolloVoiceEngine(this.mAppID, openid); if (apolloVoiceErr == ApolloVoiceErr.APOLLO_VOICE_SUCC) { ApolloManager.m_bCreateEngine = true; XSingleton <XDebug> .singleton.AddLog("CreateApolloVoiceEngine Succ", null, null, null, null, null, XDebugColor.XDebug_None); } else { string message = string.Format("CreateApolloVoiceEngine Err is {0}", apolloVoiceErr); Debug.Log(message); } } }
private void EnterRoomReal(SCPKG_CREATE_TVOIP_ROOM_NTF roomInfoSvr) { if (this.m_bInRoom) { this.PrintLog("***reconnect enter room***", null, false); } this.PrintLog("EnterRoom", null, false); this.m_bInRoom = false; this.LeaveRoom(); this.UpdateHeroSelectVoiceBtnState(false); this.m_RoomMateList.Clear(); string openId = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false).OpenId; this.m_MyRoomInfo = new ROOMINFO(); if (this.m_ApolloVoiceMgr == null) { this.m_ApolloVoiceMgr = new CApolloVoiceSys(); this.m_ApolloVoiceMgr.SysInitial(); if (this.m_ApolloVoiceMgr != null) { this.PrintLog("ApolloVoiceMgr Created", null, false); } this.CreateEngine(); } if (this.ApolloVoiceMgr != null) { string[] strArray = new string[3]; for (int i = 0; i < 3; i++) { strArray[i] = string.Empty; } if (MonoSingleton <CTongCaiSys> .instance.IsCanUseTongCai() && MonoSingleton <CTongCaiSys> .instance.IsLianTongIp()) { string str2 = "16285"; for (int k = 0; k < roomInfoSvr.wAccessIPCount; k++) { strArray[k] = "udp://" + MonoSingleton <CTongCaiSys> .instance.TongcaiIps[2] + ":" + str2; } } else { for (int m = 0; m < roomInfoSvr.wAccessIPCount; m++) { uint num5 = (uint)IPAddress.NetworkToHostOrder((int)roomInfoSvr.astAccessIPList[m].dwIP); strArray[m] = "udp://" + IPAddress.Parse(num5.ToString()).ToString() + ":" + roomInfoSvr.astAccessIPList[m].wPort.ToString(); this.PrintLog("host_ip : " + strArray[m], null, false); } } this.m_MyRoomInfo.roomid = roomInfoSvr.ullRoomID; this.m_MyRoomInfo.ullRoomKey = roomInfoSvr.ullRoomKey; this.m_MyRoomInfo.openid = openId; bool flag = false; for (int j = 0; j < roomInfoSvr.dwRoomUserCnt; j++) { if (Utility.UTF8Convert(roomInfoSvr.astRoomUserList[j].szOpenID) == openId) { flag = true; this.m_MyRoomInfo.memberid = roomInfoSvr.astRoomUserList[j].dwMemberID; this.m_MyRoomInfo.uuid = roomInfoSvr.astRoomUserList[j].ullUid; } else { ROOMMate item = new ROOMMate { openID = Utility.UTF8Convert(roomInfoSvr.astRoomUserList[j].szOpenID), memID = roomInfoSvr.astRoomUserList[j].dwMemberID, uuid = roomInfoSvr.astRoomUserList[j].ullUid }; this.m_RoomMateList.Add(item); this.PrintLog(string.Format("memList idx = {0}, id = {1} , openid = {2}", j.ToString(), item.memID, item.openID), null, false); } } if (!flag) { this.PrintLog("matelist error", null, false); } object[] args = new object[] { this.m_MyRoomInfo.roomid, this.m_MyRoomInfo.ullRoomKey, this.m_MyRoomInfo.openid, this.m_MyRoomInfo.memberid, strArray[0], strArray[1], strArray[2] }; string message = string.Format("roomid is {0}, roomkey is {1}, openid is {2}, memberid is {3}, accIP is {4}, {5}, {6}\n", args); this.PrintLog(message, null, false); if ((this.JoinVoiceRoom(strArray[0], strArray[1], strArray[2], (long)this.m_MyRoomInfo.roomid, (long)this.m_MyRoomInfo.ullRoomKey, (short)this.m_MyRoomInfo.memberid, this.m_MyRoomInfo.openid, 0x1770) == 0) && !this.m_bUpdateEnterRoomState) { this.m_bUpdateEnterRoomState = true; this.PrintLog("UpdateEnterRoomState", null, false); base.StartCoroutine(this.UpdateEnterRoomState()); } } }