mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-23 05:07:47 +00:00
Cleaned up some warnings.
This commit is contained in:
parent
1e4a1cf263
commit
10017b7e8c
27 changed files with 68 additions and 98 deletions
|
@ -60,7 +60,7 @@ namespace FFXIVClassic.Common
|
|||
// Calculate a bitmask of the desired length
|
||||
long mask = 0;
|
||||
for (int i = 0; i < fieldLength; i++)
|
||||
mask |= 1 << i;
|
||||
mask |= 1L << i;
|
||||
|
||||
r |= ((UInt32)f.GetValue(t) & mask) << offset;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic.Common
|
||||
{
|
||||
|
@ -64,7 +60,7 @@ namespace FFXIVClassic.Common
|
|||
public static bool operator ==(Vector3 lhs, Vector3 rhs)
|
||||
{
|
||||
return (lhs?.X == rhs?.X && lhs?.Y == rhs?.Y && lhs?.Z == rhs?.Z);
|
||||
}
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
|
@ -141,5 +137,23 @@ namespace FFXIVClassic.Common
|
|||
//If the relative angle is less than the total angle of the cone, the target is inside the cone
|
||||
return angleToTarget >= 0 && angleToTarget <= (coneAngle * Math.PI);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var vector = obj as Vector3;
|
||||
return vector != null &&
|
||||
X == vector.X &&
|
||||
Y == vector.Y &&
|
||||
Z == vector.Z;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCode = -307843816;
|
||||
hashCode = hashCode * -1521134295 + X.GetHashCode();
|
||||
hashCode = hashCode * -1521134295 + Y.GetHashCode();
|
||||
hashCode = hashCode * -1521134295 + Z.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
socket.Send(packetBytes);
|
||||
}
|
||||
catch(Exception e)
|
||||
{ Program.Log.Error("Weird case, socket was d/ced: {0}", e); }
|
||||
{ Program.Log.Error(e, "Weird case, socket was d/ced: {0}"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual void ResetMoveSpeeds()
|
||||
{
|
||||
this.moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP;
|
||||
|
@ -121,12 +121,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
this.moveState = this.oldMoveState;
|
||||
this.updateFlags |= ActorUpdateFlags.Speed;
|
||||
}
|
||||
|
||||
public SubPacket CreateAddActorPacket(byte val)
|
||||
|
||||
public SubPacket CreateAddActorPacket(byte val)
|
||||
{
|
||||
return AddActorPacket.BuildPacket(actorId, val);
|
||||
}
|
||||
|
||||
|
||||
public SubPacket CreateNamePacket()
|
||||
{
|
||||
return SetActorNamePacket.BuildPacket(actorId, customDisplayName != null ? 0 : displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 | customDisplayName != null ? customDisplayName : "");
|
||||
|
@ -284,7 +284,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
public SubPacket CreateIsZoneingPacket()
|
||||
{
|
||||
return SetActorIsZoningPacket.BuildPacket(actorId, false);
|
||||
return SetActorIsZoningPacket.BuildPacket(actorId, false);
|
||||
}
|
||||
|
||||
public virtual SubPacket CreateScriptBindPacket(Player player)
|
||||
|
@ -292,13 +292,13 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams);
|
||||
}
|
||||
|
||||
public virtual SubPacket CreateScriptBindPacket()
|
||||
public virtual SubPacket CreateScriptBindPacket()
|
||||
{
|
||||
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams);
|
||||
}
|
||||
|
||||
|
||||
public virtual List<SubPacket> GetSpawnPackets(Player player, ushort spawnType)
|
||||
{
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(CreateAddActorPacket(8));
|
||||
subpackets.AddRange(GetEventConditionPackets());
|
||||
|
@ -509,7 +509,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
className = className.Substring(0, 20 - zoneName.Length);
|
||||
}
|
||||
catch (ArgumentOutOfRangeException e)
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{ }
|
||||
|
||||
//Convert actor number to base 63
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
byte byteOut = (Byte)(byteIn ^ 0x73);
|
||||
binWriter.Write((Byte)byteOut);
|
||||
}
|
||||
catch (EndOfStreamException e) { break; }
|
||||
catch (EndOfStreamException) { break; }
|
||||
}
|
||||
|
||||
binReader.Close();
|
||||
|
@ -88,7 +88,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
}
|
||||
catch(FileNotFoundException e)
|
||||
catch(FileNotFoundException)
|
||||
{ Program.Log.Error("Could not find staticactors file."); return false; }
|
||||
|
||||
Program.Log.Info("Loaded {0} static actors.", mStaticActors.Count());
|
||||
|
|
|
@ -2,20 +2,13 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.area;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using MoonSharp.Interpreter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai.controllers;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
|
@ -388,35 +381,35 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
|
||||
// todo: for zones override this to search contentareas (assuming flag is passed)
|
||||
// todo: for zones override this to search contentareas (assuming flag is passed)
|
||||
public virtual List<T> GetAllActors<T>() where T : Actor
|
||||
{
|
||||
lock (mActorList)
|
||||
{
|
||||
List<T> actorList = new List<T>(mActorList.Count);
|
||||
actorList.AddRange(mActorList.Values.OfType<T>());
|
||||
actorList.AddRange(mActorList.Values.OfType<T>());
|
||||
return actorList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int GetActorCount()
|
||||
{
|
||||
lock (mActorList)
|
||||
{
|
||||
return mActorList.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual List<Actor> GetAllActors()
|
||||
{
|
||||
return GetAllActors<Actor>();
|
||||
}
|
||||
|
||||
|
||||
public virtual List<Player> GetPlayers()
|
||||
{
|
||||
return GetAllActors<Player>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public virtual List<BattleNpc> GetMonsters()
|
||||
{
|
||||
return GetAllActors<BattleNpc>();
|
||||
|
@ -425,8 +418,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public virtual List<Ally> GetAllies()
|
||||
{
|
||||
return GetAllActors<Ally>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void BroadcastPacketsAroundActor(Actor actor, List<SubPacket> packets)
|
||||
{
|
||||
foreach (SubPacket packet in packets)
|
||||
|
@ -669,13 +662,13 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
lock (mActorList)
|
||||
{
|
||||
foreach (Actor a in mActorList.Values.ToList())
|
||||
a.Update(tick);
|
||||
|
||||
a.Update(tick);
|
||||
|
||||
if ((tick - lastUpdateScript).TotalMilliseconds > 1500)
|
||||
{
|
||||
//LuaEngine.GetInstance().CallLuaFunctionForReturn(LuaEngine.GetScriptPath(this), "onUpdate", true, this, tick);
|
||||
lastUpdateScript = tick;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,33 +1,28 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MoonSharp.Interpreter;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.packets.send.group;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
using FFXIVClassic_Map_Server.actors.group;
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai.controllers;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.battle;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai.utils;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai.state;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.actors.chara;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.battle;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
|
|
|
@ -241,7 +241,7 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
{
|
||||
className = className.Substring(0, 20 - zoneName.Length);
|
||||
}
|
||||
catch (ArgumentOutOfRangeException e)
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{ }
|
||||
|
||||
//Convert actor number to base 63
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||
socket.Send(packetBytes);
|
||||
}
|
||||
catch (Exception e)
|
||||
{ Program.Log.Error("Weird case, socket was d/ced: {0}", e); }
|
||||
{ Program.Log.Error(e, "Weird case, socket was d/ced: {0}"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class AddActorPacket
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class DeleteAllActorsPacket
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
|
|
|
@ -5,8 +5,6 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorPropetyPacket
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusAllPacket
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusPacket
|
||||
|
|
|
@ -3,7 +3,6 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class _0x132Packet
|
||||
|
|
|
@ -4,8 +4,6 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetEmoteEventCondition
|
||||
|
|
|
@ -3,8 +3,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX08Packet
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using FFXIVClassic.Common;
|
||||
using System.IO;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.player
|
||||
{
|
||||
class SetCompletedAchievementsPacket
|
||||
|
|
|
@ -3,8 +3,6 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.player
|
||||
{
|
||||
class SetCutsceneBookPacket
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.player
|
||||
{
|
||||
class SetPlayerDreamPacket
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.player
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.supportdesk
|
||||
{
|
||||
class GMTicketSentResponsePacket
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace FFXIVClassic_Map_Server.utils
|
|||
name = matches[2].Value.Trim(',');
|
||||
|
||||
}
|
||||
catch (FormatException e)
|
||||
catch (FormatException)
|
||||
{ continue; }
|
||||
|
||||
placenames.Add(id, name);
|
||||
|
@ -72,7 +72,7 @@ namespace FFXIVClassic_Map_Server.utils
|
|||
id = UInt32.Parse(matches[0].Value.Trim(','));
|
||||
pId = UInt32.Parse(matches[1].Value.Trim(','));
|
||||
}
|
||||
catch (FormatException e)
|
||||
catch (FormatException)
|
||||
{ continue; }
|
||||
|
||||
cmd.Parameters["@id"].Value = id;
|
||||
|
@ -131,7 +131,7 @@ namespace FFXIVClassic_Map_Server.utils
|
|||
nameId = UInt32.Parse(matches[6].Value.Trim(','));
|
||||
|
||||
}
|
||||
catch (FormatException e)
|
||||
catch (FormatException)
|
||||
{ continue; }
|
||||
|
||||
cmd.Parameters["@id"].Value = id;
|
||||
|
@ -198,7 +198,7 @@ namespace FFXIVClassic_Map_Server.utils
|
|||
|
||||
|
||||
}
|
||||
catch (FormatException e)
|
||||
catch (FormatException)
|
||||
{ continue; }
|
||||
|
||||
cmd.Parameters["@id"].Value = id;
|
||||
|
@ -260,7 +260,7 @@ namespace FFXIVClassic_Map_Server.utils
|
|||
name = matches2[9].Value.Trim(',');
|
||||
points = UInt32.Parse(matches[3].Value.Trim(','));
|
||||
}
|
||||
catch (FormatException e)
|
||||
catch (FormatException)
|
||||
{ continue; }
|
||||
|
||||
if (id == 100)
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace FFXIVClassic_World_Server
|
|||
socket.Send(packetBytes);
|
||||
}
|
||||
catch (Exception e)
|
||||
{ Program.Log.Error("Weird case, socket was d/ced: {0}", e); }
|
||||
{ Program.Log.Error(e, "Weird case, socket was d/ced: {0}"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace FFXIVClassic_World_Server.DataObjects
|
|||
throw new ApplicationException("Error occured starting listeners, check inner exception", e);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{ Program.Log.Error("Failed to connect"); return false; }
|
||||
|
||||
return true;
|
||||
|
@ -76,7 +76,7 @@ namespace FFXIVClassic_World_Server.DataObjects
|
|||
zoneServerConnection.Send(packetBytes);
|
||||
}
|
||||
catch (Exception e)
|
||||
{ Program.Log.Error("Weird case, socket was d/ced: {0}", e); }
|
||||
{ Program.Log.Error(e, "Weird case, socket was d/ced: {0}"); }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue