SendModPacket (Server) added
This commit is contained in:
parent
48cbff2f11
commit
f6a49fe87f
@ -83,5 +83,22 @@ namespace CoopServer
|
|||||||
packet.PacketToNetOutGoingMessage(outgoingMessage);
|
packet.PacketToNetOutGoingMessage(outgoingMessage);
|
||||||
Server.MainNetServer.SendMessage(outgoingMessage, userConnection, NetDeliveryMethod.ReliableOrdered, 0);
|
Server.MainNetServer.SendMessage(outgoingMessage, userConnection, NetDeliveryMethod.ReliableOrdered, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendModPacket(string mod, byte customID, byte[] bytes)
|
||||||
|
{
|
||||||
|
NetConnection userConnection = Server.MainNetServer.Connections.Find(x => x.RemoteUniqueIdentifier == ID);
|
||||||
|
|
||||||
|
NetOutgoingMessage outgoingMessage = Server.MainNetServer.CreateMessage();
|
||||||
|
new ModPacket()
|
||||||
|
{
|
||||||
|
ID = -1,
|
||||||
|
Target = 0,
|
||||||
|
Mod = mod,
|
||||||
|
CustomPacketID = customID,
|
||||||
|
Bytes = bytes
|
||||||
|
}.PacketToNetOutGoingMessage(outgoingMessage);
|
||||||
|
Server.MainNetServer.SendMessage(outgoingMessage, userConnection, NetDeliveryMethod.ReliableOrdered, 0);
|
||||||
|
Server.MainNetServer.FlushSendQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,6 +151,21 @@ namespace CoopServer
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FUNCTIONS
|
#region FUNCTIONS
|
||||||
|
public static void SendModPacketToAll(string mod, byte customID, byte[] bytes)
|
||||||
|
{
|
||||||
|
NetOutgoingMessage outgoingMessage = Server.MainNetServer.CreateMessage();
|
||||||
|
new ModPacket()
|
||||||
|
{
|
||||||
|
ID = -1,
|
||||||
|
Target = 0,
|
||||||
|
Mod = mod,
|
||||||
|
CustomPacketID = customID,
|
||||||
|
Bytes = bytes
|
||||||
|
}.PacketToNetOutGoingMessage(outgoingMessage);
|
||||||
|
Server.MainNetServer.SendMessage(outgoingMessage, Server.MainNetServer.Connections, NetDeliveryMethod.ReliableOrdered, 0);
|
||||||
|
Server.MainNetServer.FlushSendQueue();
|
||||||
|
}
|
||||||
|
|
||||||
public static void SendNativeCallToAll(ulong hash, params object[] args)
|
public static void SendNativeCallToAll(ulong hash, params object[] args)
|
||||||
{
|
{
|
||||||
if (Server.MainNetServer.ConnectionsCount == 0)
|
if (Server.MainNetServer.ConnectionsCount == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user