Exemplo n.º 1
0
        private byte[] CallRemote <TMsg>(TMsg message) where TMsg : IMessage
        {
            var rpc = new RPCCall();

            switch (message)
            {
            case OnEventCall m:
                rpc.OnEvent = m;
                break;

            case GetTeamInfoCall m:
                rpc.GetTeamInfo = m;
                break;

            case GetInstructionCall m:
                rpc.GetInstruction = m;
                break;

            case GetPlacementCall m:
                rpc.GetPlacement = m;
                break;

            default:
                throw new NotImplementedException();
            }
            return(client.Call(rpc.ToByteArray(), Timeout, RetryInterval));
        }
Exemplo n.º 2
0
    public Guid Call(string method, params KeyValuePair <Message.MString, Message>[] param)
    {
        if (null == _stream)
        {
            throw new SocketException();
        }

        RPCCall call = new RPCCall();

        call.Method  = method;
        call.Session = Guid.NewGuid().ToString();
        foreach (var p in param)
        {
            call.Params.Add(p);
        }
        _stream.Send(call);

        return(new Guid(call.Session));
    }
Exemplo n.º 3
0
    void CreatePlayer()
    {
        GameObject go = PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs", "PlayerUnit"), Vector3.zero, Quaternion.identity);

        MyView = go.GetComponent <RPCCall>();
    }