| 1965 | } |
| 1966 | |
| 1967 | int RemoteServer::FindSectionByName(const rdcstr &name) |
| 1968 | { |
| 1969 | if(!Connected()) |
| 1970 | return -1; |
| 1971 | |
| 1972 | { |
| 1973 | WRITE_DATA_SCOPE(); |
| 1974 | SCOPED_SERIALISE_CHUNK(RemoteServerPacket::FindSectionByName); |
| 1975 | SERIALISE_ELEMENT(name); |
| 1976 | } |
| 1977 | |
| 1978 | int index = -1; |
| 1979 | |
| 1980 | { |
| 1981 | READ_DATA_SCOPE(); |
| 1982 | RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>(); |
| 1983 | |
| 1984 | if(type == RemoteServerPacket::FindSectionByName) |
| 1985 | { |
| 1986 | SERIALISE_ELEMENT(index); |
| 1987 | } |
| 1988 | else |
| 1989 | { |
| 1990 | RDCERR("Unexpected response to FindSectionByName"); |
| 1991 | } |
| 1992 | |
| 1993 | ser.EndChunk(); |
| 1994 | } |
| 1995 | |
| 1996 | return index; |
| 1997 | } |
| 1998 | |
| 1999 | int RemoteServer::FindSectionByType(SectionType sectionType) |
| 2000 | { |