void OnReceiveStartSession(int node, PacketId id, byte[] data) { Debug.Log("ReceiveStartSession"); #if UNUSE_MATCHING_SERVER SessionData response = new SessionData(); { int memberNum = NetConfig.PLAYER_MAX; string hostname = Dns.GetHostName(); IPAddress[] adrList = Dns.GetHostAddresses(hostname); response.endPoints = new EndPointData[memberNum]; response.result = MatchingResult.Success; response.playerId = GlobalParam.get().global_account_id; response.members = memberNum; for (int i = 0; i < memberNum; ++i) { response.endPoints[i] = new EndPointData(); response.endPoints[i].ipAddress = adrList[0].ToString(); response.endPoints[i].port = NetConfig.GAME_PORT; } } #else SessionPacket packet = new SessionPacket(data); SessionData response = packet.GetPacket(); #endif playerId = response.playerId; SetSessionMembers(response.result, response.members, response.endPoints); matchingState = State.MatchingEnded; }
void OnReceiveStartSession(int node, PacketId id, byte[] data) { Debug.Log("ReceiveStartSession"); SessionPacket packet = new SessionPacket(data); SessionData response = packet.GetPacket(); playerId = response.playerId; SetSessionMembers(response.result, response.members, response.endPoints); matchingState = State.MatchingEnded; }