public static Task TypedBroadcast(this IConnection connection, object value) {
     return connection.Broadcast(new TypedMessage { Type = GetMessageType(value), Message = value });
 }
Exemplo n.º 2
0
        //public static void BroadcastUsedSkill(this ISceneHost scene, ushort shipId, ushort target, bool success, string weaponId, long timestamp)
        //{
        //    scene.Broadcast("ship.usedSkill", new UsedSkillMsg { shipId = target, origin = shipId, success = success, weaponId = weaponId, timestamp = timestamp });
        //}

        public static void BrodcastUsedSkill(this ISceneHost scene, IEnumerable<UsedSkillMsg> skills)
        {
            scene.Broadcast("ship.usedSkill", skills.ToArray());
        }
Exemplo n.º 3
0
 public static void BroadcastPvUpdate(this ISceneHost scene, ushort shipId, int diff)
 {
     scene.Broadcast("ship.pv", s =>
     {
         using (var writer = new BinaryWriter(s, Encoding.UTF8, true))
         {
             writer.Write(shipId);
             writer.Write(diff);
         }
     });
 }
Exemplo n.º 4
0
 public static void BroadcastStatusChanged(this ISceneHost scene, ushort shipId, ShipStatus status)
 {
     
     scene.Broadcast("ship.statusChanged", new StatusChangedMsg { shipId = shipId, status = status });
 }