public ApolloResult ReadUdpData(out byte[] buffer, out int realLength) { buffer = null; realLength = 0; if (!this.Connected) { } if (this.tempReadBuffer == null) { this.tempReadBuffer = new byte[ApolloCommon.ApolloInfo.MaxMessageBufferSize]; } int num = this.tempReadBuffer.Length; ApolloResult apolloResult = ApolloConnector.apollo_connector_readUdpData(base.ObjectId, this.tempReadBuffer, ref num); if (apolloResult == ApolloResult.Success) { if (num == 0) { ADebug.LogError("ReadUdpData empty len==0"); return(ApolloResult.Empty); } buffer = this.tempReadBuffer; realLength = num; } return(apolloResult); }
public override void DestroyApolloConnector(IApolloConnector connector) { ADebug.Log("DestroyApolloConnector"); if (connector != null) { ApolloConnector connector2 = connector as ApolloConnector; if (connector2 != null) { connector2.Destroy(); } } }
public ApolloResult WriteUdpData(byte[] data, int len = -1) { if (!this.Connected) { return(ApolloResult.NoConnection); } if (len == -1) { len = data.Length; } return(ApolloConnector.apollo_connector_writeUdpData(base.ObjectId, data, len)); }
public ApolloResult SetSecurityInfo(ApolloEncryptMethod encyptMethod, ApolloKeyMaking keyMakingMethod, string dhp) { ADebug.Log(string.Concat(new object[] { "SetSecurityInfo encyptMethod:", encyptMethod, " keyMakingMethod:", keyMakingMethod, " dh:", dhp })); return(ApolloConnector.apollo_connector_setSecurityInfo(base.ObjectId, encyptMethod, keyMakingMethod, dhp)); }
public override void DestroyApolloConnector(IApolloConnector connector) { ADebug.Log("DestroyApolloConnector"); if (connector == null) { return; } ApolloConnector apolloConnector = connector as ApolloConnector; if (apolloConnector != null) { apolloConnector.Destroy(); } }
public ApolloResult Initialize(ApolloPlatform platform, uint permission, string url) { ADebug.Log(string.Concat(new object[] { "Connector Initialize:", platform, " url:", url })); if (platform == ApolloPlatform.WTLogin) { } return((ApolloResult)ApolloConnector.apollo_connector_Initialize(base.ObjectId, platform, permission, url)); }
public ApolloResult SetRouteInfo(ApolloRouteInfoBase routeInfo) { if (routeInfo == null) { return(ApolloResult.InvalidArgument); } byte[] array; routeInfo.Encode(out array); if (array == null) { ADebug.LogError("WriteData Encode error!"); return(ApolloResult.InnerError); } return(ApolloConnector.apollo_connector_setRouteInfo(base.ObjectId, array, array.Length)); }
public override IApolloConnector CreateApolloConnection(ApolloPlatform platform, uint permission, string url) { ADebug.Log("CreateApolloConnection"); if (string.IsNullOrEmpty(url)) { throw new Exception("Argument Error: url can not be null or empty"); } if (ApolloCommon.ApolloInfo == null) { throw new Exception("IApollo.Instance.Initialize must be called first!"); } if (platform == ApolloPlatform.None) { } ApolloConnector apolloConnector = new ApolloConnector(); ApolloResult apolloResult = apolloConnector.Initialize(platform, permission, url); if (apolloResult != ApolloResult.Success) { throw new Exception("connector Initialize Error:" + apolloResult); } return(apolloConnector); }
public ApolloResult WriteData(byte[] data, int len, ApolloRouteInfoBase routeInfo, bool allowLost = false) { if (routeInfo == null) { return(ApolloResult.InvalidArgument); } if (!this.Connected) { return(ApolloResult.NoConnection); } if (len == -1) { len = data.Length; } byte[] array; routeInfo.Encode(out array); if (array == null) { ADebug.LogError("WriteData Encode error!"); return(ApolloResult.InnerError); } return(ApolloConnector.apollo_connector_writeData_with_route_info(base.ObjectId, data, len, array, array.Length, allowLost)); }
public void SetProtocolVersion(int headVersion, int bodyVersion) { ApolloConnector.apollo_connector_set_protocol_version(base.ObjectId, headVersion, bodyVersion); }
public void SetClientType(ClientType type) { ApolloConnector.apollo_connector_set_clientType(base.ObjectId, type); }
public ApolloResult ReportAccessToken(string accessToken, ulong expire) { return(ApolloConnector.apollo_connector_report_accesstoken(base.ObjectId, accessToken, (uint)expire)); }
public ApolloResult GetSessionStopReason(ref int result, ref int reason, ref int excode) { return(ApolloConnector.apollo_connector_getstopreason(base.ObjectId, ref result, ref reason, ref excode)); }
public ApolloResult Disconnect() { ADebug.Log("Disconnect"); return(ApolloConnector.apollo_connector_disconnect(base.ObjectId)); }
public ApolloResult Reconnect(uint timeout) { ADebug.Log("Reconnect"); return(ApolloConnector.apollo_connector_reconnect(base.ObjectId, timeout)); }