public void SendBeginCommand(Dictionary <string, int> participants) { if (serverConnection != null && serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)CommandType.Accept); AppendParticipants(msg, participants); serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.UserMessageChannelStart); } }
public void SendUserReady() { if (!IsConnected()) { return; } // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)GameMessageID.UserReady); this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.Reliable, MessageChannel.Avatar); }
public void SendAcceptCommand(UserData userData) { if (serverConnection != null && serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)CommandType.Accept); AppendTargetUserId(msg, userData); serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.UserMessageChannelStart); } }
public void SendExplodeTarget() { if (!IsConnected()) { return; } // Create an outgoing network message to contain all the info we want to send. NetworkOutMessage msg = CreateMessage((byte)GameMessageID.ExplodeTarget); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); }
public void SendClearGazeMarkerMessage() { if (this.serverConnection != null && this.serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.ClearGazeMarker); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); Debug.Log("Clear gaze marker message was sent"); } }
//===================================================================================================================================================== public void SendInt32(int val) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.SharingAnimation); AppendInt32(msg, val); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
public void SendPositionRotationData() { // If we are connected to a session, broadcast our head info if (serverConnection != null && serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.HeadTransform); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendSpawnTarget(Vector3 spawnPosition, Quaternion spawnRotation) { if (serverConnection != null && serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.SpawnTarget); AppendTransform(msg, spawnPosition, spawnRotation); //msg.Write(userID); serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendExplodeTarget() { // If we are connected to a session, broadcast that the target exploded. if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send. NetworkOutMessage msg = CreateMessage((byte)TestMessageID.ExplodeTarget); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
/// <summary> /// Broadcasts out the health of the user. /// </summary> /// <param name="playerHealth">The health of the user</param> public void UpdatePlayerHealth(int playerHealth) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.PlayerHealth); msg.Write(playerHealth); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
/// <summary> /// 发送image的array /// </summary> /// <param name="imageBytes"></param> public void SendIRImage(byte[] imageBytes) { if (serverConnection != null && serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)CustomMessageID.IRImage); msg.Write(imageBytes.Length); for (int i = 0; i < imageBytes.Length; i++) { msg.Write(imageBytes[i]); } serverConnection.Broadcast(msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Default); } }
/// <summary> /// Broadcasts out that we have picked up an orb, indentified by the orb index /// </summary> /// <param name="index">Index of the orb that we have picked up</param> public void SendOrbPickedUpMessage(int index) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.OrbPickedUp); msg.Write(index); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.Reliable, MessageChannel.Avatar); } }
public void SendTurn(Quaternion turn) { // If we are connected to a session, broadcast our head info if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.Turn); AppendQuaternion(msg, turn); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
public void SendBaseTransform(Vector3 position, Quaternion rotation) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.BaseTransform); AppendTransform(msg, position, rotation); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
/// <summary> /// Sends the Kinect processed RGB32. /// Ignores the alpha channel. /// </summary> /// <param name="colorData"> array of color data in RGB32 </param> public void SendColorData(byte[] colorData) { // If we are connected to a session, broadcast our info if (this.serverConnection != null && this.serverConnection.IsConnected()) { // RED message NetworkOutMessage rMsg = CreateMessage((int)TestMessageID.StartID); rMsg.Write((byte)MsgID.RED); rMsg.Write(colorData.Length / BYTES_PER_PIXEL); // GREEN message NetworkOutMessage gMsg = CreateMessage((int)TestMessageID.StartID); gMsg.Write((byte)MsgID.GREEN); gMsg.Write(colorData.Length / BYTES_PER_PIXEL); // BLUE message NetworkOutMessage bMsg = CreateMessage((int)TestMessageID.StartID); bMsg.Write((byte)MsgID.BLUE); bMsg.Write(colorData.Length / BYTES_PER_PIXEL); // 4) Add message for (int i = 0; i < colorData.Length; i += BYTES_PER_PIXEL) { rMsg.Write(colorData[i + 0]); gMsg.Write(colorData[i + 1]); bMsg.Write(colorData[i + 2]); // ignore alpha channel } // Send the message as a broadcast this.serverConnection.Broadcast( rMsg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); this.serverConnection.Broadcast( gMsg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); this.serverConnection.Broadcast( bMsg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendNewAnchorNotification(string anchorName) { // If we are connected to a session, broadcast our head info if (serverConnection != null && serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)AppShareControlMessageID.NewAnchorPlacement); AppendString(msg, anchorName); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendTryToReturnIsolatedStructureMessage(string structureName) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.TryToReturnIsolatedStructure); msg.Write(structureName); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); Debug.Log("Try to return isolated structure message was sent for structure " + structureName); } }
public void SendSelectedCubeNumbers(int start, int end) { if (serverConnection != null && serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.Cube); AppendCubePositions(msg, start, end); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendHeadTransform(Vector3 position, Quaternion rotation, Vector3 scale, byte HasAnchor) { if (CanBeSent) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.HeadTransform); AddTransform(msg, position, rotation, scale); msg.Write(HasAnchor); serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendTransform(Vector3 position, Quaternion rotation, Vector3 scale, string tag = "", bool sendAnyway = false) { if (sendAnyway || CanBeSent) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.Transform); AddVal(msg, tag); // write tag first AddTransform(msg, position, rotation, scale); // then write value serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
private NetworkOutMessage CreateMessage(byte messageType, string msgKey, IReadOnlyCollection <float> values) { NetworkOutMessage msg = _serverConnection.CreateMessage(messageType); msg.Write(messageType); msg.Write(LocalUserId); msg.Write(msgKey); msg.Write(values.Count); foreach (var value in values) { msg.Write(value); } return(msg); }
public void MonsterFoundPlayer(long enemyId) { if (!IsConnected()) { return; } NetworkOutMessage msg = CreateMessage((byte)GameMessageID.PlayerFound); msg.Write(enemyId); this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.Reliable, MessageChannel.Avatar); }
public void SendUpdatedIPs(string spectatorViewIP) { // If we are connected to a session, broadcast our head info if (this.serverConnection != null && this.serverConnection.IsConnected() && HolographicCameraManager.Instance != null) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.UpdateSpectatorViewIP); AppendIP(msg, spectatorViewIP); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableSequenced, MessageChannel.Avatar); } }
public void SendToggleOpacityMessage(byte lastState) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { NetworkOutMessage msg = CreateMessage((byte)TestMessageID.ToggleOpacity); msg.Write(lastState); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); Debug.Log("Toggle opacity message was sent"); } }
public void SendCount(MessageReliability?reliability = MessageReliability.ReliableOrdered) { if (serverConnection != null && serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)CustomMessageID.Count); CountComp = CountObject.GetComponent <GetTransform>().count; msg.Write(CountComp); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. serverConnection.Broadcast(msg, MessagePriority.Immediate, reliability.Value, MessageChannel.Default); // default channel } }
public void SendUserHit(long HitUserID) { // If we are connected to a session, broadcast our head info if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.UserHit); msg.Write(HitUserID); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Medium, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
/* * public void SendObjectTransform(Vector3 position, Vector3 direction) * { * // If we are connected to a session, broadcast our head info * if (serverConnection != null && serverConnection.IsConnected()) * { * // Create an outgoing network message to contain all the info we want to send * NetworkOutMessage msg = CreateMessage((byte)TestMessageID.ObjectTransform); * * AppendVector3(msg, position); * AppendVector3(msg, direction); * * // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. * serverConnection.Broadcast( * msg, * MessagePriority.Immediate, * MessageReliability.UnreliableSequenced, * MessageChannel.Avatar); * } * } */ public void SendButtonClick(string i) { // If we are connected to a session, broadcast our head info if (serverConnection != null && serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.Clicked); // I added the value "Clicked" on the ThestMessageID enum but I'm not sure if it's helping. AddButtonClick(msg, i); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.UnreliableSequenced, MessageChannel.Avatar); } }
public void SendMazeTransform(int direction) { // If we are connected to a session if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send NetworkOutMessage msg = CreateMessage((byte)TestMessageID.Direction); msg.Write(direction); // send the difficulty message // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
/// <summary> /// 发送生成物体消息 /// </summary> /// <param name="name_id"></param> /// <param name="pos"></param> public void SendSpawnCommand(string name_id, Vector3 pos) { if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send. XString xs = new XString(name_id); NetworkOutMessage msg = CreateMessage((byte)TestMessageID.SpawnCommands); msg.Write(xs); AppendVector3(msg, pos); this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); } }
public void SendToggleHighlightMessage(int index) { // If we are connected to a session, send the test message if (this.serverConnection != null && this.serverConnection.IsConnected()) { // Create an outgoing network message to contain all the info we want to send. NetworkOutMessage msg = CreateMessage(index); // Send the message as a broadcast, which will cause the server to forward it to all other users in the session. this.serverConnection.Broadcast( msg, MessagePriority.Immediate, MessageReliability.ReliableOrdered, MessageChannel.Avatar); Debug.Log("Toggle message " + index + " was sent"); } }
public virtual void ReturnMessage(NetworkOutMessage msg) { SharingClientPINVOKE.NetworkConnection_ReturnMessage(swigCPtr, NetworkOutMessage.getCPtr(msg)); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(NetworkOutMessage obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
public virtual void Send(NetworkOutMessage msg, MessagePriority priority, MessageReliability reliability, MessageChannel channel) { SharingClientPINVOKE.NetworkConnection_Send__SWIG_1(swigCPtr, NetworkOutMessage.getCPtr(msg), (int)priority, (int)reliability, (int)channel); }
public virtual void Send(NetworkOutMessage msg, MessagePriority priority) { SharingClientPINVOKE.NetworkConnection_Send__SWIG_3(swigCPtr, NetworkOutMessage.getCPtr(msg), (int)priority); }
public virtual void Send(NetworkOutMessage msg) { SharingClientPINVOKE.NetworkConnection_Send__SWIG_4(swigCPtr, NetworkOutMessage.getCPtr(msg)); }
public virtual void SendTo(User user, ClientRole deviceRole, NetworkOutMessage msg, MessagePriority priority, MessageReliability reliability) { SharingClientPINVOKE.NetworkConnection_SendTo__SWIG_2(swigCPtr, User.getCPtr(user), (int)deviceRole, NetworkOutMessage.getCPtr(msg), (int)priority, (int)reliability); }
public virtual void Broadcast(NetworkOutMessage msg, MessagePriority priority, MessageReliability reliability) { SharingClientPINVOKE.NetworkConnection_Broadcast__SWIG_2(swigCPtr, NetworkOutMessage.getCPtr(msg), (int)priority, (int)reliability); }
public virtual void Broadcast(NetworkOutMessage msg, MessagePriority priority, MessageReliability reliability, MessageChannel channel, bool releaseMessage) { SharingClientPINVOKE.NetworkConnection_Broadcast__SWIG_0(swigCPtr, NetworkOutMessage.getCPtr(msg), (int)priority, (int)reliability, (int)channel, releaseMessage); }
public virtual void SendTo(User user, ClientRole deviceRole, NetworkOutMessage msg) { SharingClientPINVOKE.NetworkConnection_SendTo__SWIG_4(swigCPtr, User.getCPtr(user), (int)deviceRole, NetworkOutMessage.getCPtr(msg)); }