Example #1
0
        public void GetData(string stringDataset)
        {
            // This is where you'd have to do something to call out specific objects?

            FrontiersData dataset = NetworkManager.FrontiersData.FromString(stringDataset);

            var responseData = new FrontiersData();

            switch (dataset.Data)
            {
            case "GetColor":
                responseData.Data = "Blue";
                break;
            }


            responseData.ResponsePlayerID = dataset.ResponsePlayerID;
            responseData.ResponseTargetID = dataset.ResponseTargetID;

            // I dont like this, cause it means its not direct to the player
            if (dataset.ResponsePlayerID != 0)
            {
                tno.Send("ResponseData", Target.Others, responseData.ToString());
            }
        }
Example #2
0
 /// <summary>
 /// Send a raw dataset around to all other connected players in the channel.
 /// </summary>
 /// <param name="dataset">Dataset.</param>
 public void SendSerializedData(FrontiersData dataset)
 {
     tno.Send("ReceiveSerializedData", Target.Others, dataset.ToString());
 }