public void DoRequest(Operation.OperationCode opCode, byte[] bytes) { Dictionary <byte, object> customParameters = new Dictionary <byte, object>(); customParameters[0] = bytes; PhotonEngine.Instance.Peer.OpCustom((byte)opCode, customParameters, true); }
public void DoRequest <T>(Operation.OperationCode opCode, T obj) { byte[] data = PackageHelper.Serialize <T>(obj); Dictionary <byte, object> customParameters = new Dictionary <byte, object>(); customParameters[0] = data; PhotonEngine.Instance.Peer.OpCustom((byte)opCode, customParameters, true); }
public BaseHandler GetHandler(Operation.OperationCode opCode) { BaseHandler handler; if (!handlers.TryGetValue(opCode, out handler)) { return(null); } return(handler); }
public void SendEvent <T>(Operation.OperationCode opCode, T obj) { EventData data = new EventData(); data.Code = (byte)opCode; byte[] bytes = PackageHelper.Serialize <T>(obj); Dictionary <byte, object> paramter = new Dictionary <byte, object>(); paramter.Add(0, bytes); data.Parameters = paramter; SendEvent(data, new SendParameters()); }
private void UnregistRequest(Operation.OperationCode opCode) { handlers.Remove(opCode); }
public void UnregisterHandler(Operation.OperationCode opCode) { handlers.Remove(opCode); }