-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from NebulaModTeam/0.10.x
0.10.x Update WIP
- Loading branch information
Showing
149 changed files
with
135,430 additions
and
18,841 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using NebulaAPI.Interfaces; | ||
|
||
namespace NebulaAPI.DataStructures | ||
{ | ||
public interface IMechaFightData | ||
{ | ||
// TODO: what about spaceSector? Will it be synced in dynamically? Or should it be stored? | ||
bool AutoReplenishFuel { get; set; } | ||
bool AutoReplenishAmmo { get; set; } | ||
bool AutoReplenishHangar { get; set; } | ||
int Hp { get; set; } | ||
long EnergyShieldEnergy { get; set; } | ||
int AmmoItemId { get; set; } | ||
int AmmoInc { get; set; } | ||
int AmmoBulletCount { get; set; } | ||
int AmmoSelectSlot { get; set; } | ||
int AmmoMuzzleFire { get; set; } | ||
int AmmoRoundFire { get; set; } | ||
int AmmoMuzzleIndex { get; set; } | ||
bool LaserActive { get; set; } | ||
bool LaserRecharging { get; set; } | ||
long LaserEnergy { get; set; } | ||
int LaserFire { get; set; } | ||
int BombFire { get; set; } | ||
StorageComponent AmmoStorage { get; set; } | ||
StorageComponent BombStorage { get; set; } | ||
EnemyHatredTarget AmmoHatredTarget { get; set; } | ||
EnemyHatredTarget LaserHatredTarget { get; set; } | ||
StorageComponent FighterStorage { get; set; } | ||
CombatModuleComponent GroundCombatModule { get; set; } | ||
CombatModuleComponent SpaceCombatModule { get; set; } | ||
public void Serialize(INetDataWriter writer); | ||
public void Deserialize(INetDataReader reader); | ||
public void UpdateMech(Player destination); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
// #pragma once | ||
// #ifndef INetDataReader.cs_H_ | ||
// #define INetDataReader.cs_H_ | ||
// | ||
// #endif | ||
|
||
using System; | ||
using System.Net; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace NebulaAPI.Interfaces; | ||
|
||
public interface INetDataReader | ||
{ | ||
byte[] RawData | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int RawDataSize | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int UserDataOffset | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int UserDataSize | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
bool IsNull | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int Position | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
bool EndOfData | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int AvailableBytes | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
void SkipBytes(int count); | ||
void SetPosition(int position); | ||
void SetSource(INetDataWriter dataWriter); | ||
void SetSource(byte[] source); | ||
void SetSource(byte[] source, int offset, int maxSize); | ||
IPEndPoint GetNetEndPoint(); | ||
byte GetByte(); | ||
sbyte GetSByte(); | ||
T[] GetArray<T>(int size); | ||
bool[] GetBoolArray(); | ||
ushort[] GetUShortArray(); | ||
short[] GetShortArray(); | ||
int[] GetIntArray(); | ||
uint[] GetUIntArray(); | ||
float[] GetFloatArray(); | ||
double[] GetDoubleArray(); | ||
long[] GetLongArray(); | ||
ulong[] GetULongArray(); | ||
string[] GetStringArray(); | ||
|
||
/// <summary> | ||
/// Note that "maxStringLength" only limits the number of characters in a string, not its size in bytes. | ||
/// Strings that exceed this parameter are returned as empty | ||
/// </summary> | ||
string[] GetStringArray(int maxStringLength); | ||
|
||
bool GetBool(); | ||
char GetChar(); | ||
ushort GetUShort(); | ||
short GetShort(); | ||
long GetLong(); | ||
ulong GetULong(); | ||
int GetInt(); | ||
uint GetUInt(); | ||
float GetFloat(); | ||
double GetDouble(); | ||
|
||
/// <summary> | ||
/// Note that "maxLength" only limits the number of characters in a string, not its size in bytes. | ||
/// </summary> | ||
/// <returns>"string.Empty" if value > "maxLength"</returns> | ||
string GetString(int maxLength); | ||
|
||
string GetString(); | ||
ArraySegment<byte> GetBytesSegment(int count); | ||
ArraySegment<byte> GetRemainingBytesSegment(); | ||
T Get<T>() where T : struct, INetSerializable; | ||
T Get<T>(Func<T> constructor) where T : class, INetSerializable; | ||
byte[] GetRemainingBytes(); | ||
void GetBytes(byte[] destination, int start, int count); | ||
void GetBytes(byte[] destination, int count); | ||
sbyte[] GetSBytesWithLength(); | ||
byte[] GetBytesWithLength(); | ||
byte PeekByte(); | ||
sbyte PeekSByte(); | ||
bool PeekBool(); | ||
char PeekChar(); | ||
ushort PeekUShort(); | ||
short PeekShort(); | ||
long PeekLong(); | ||
ulong PeekULong(); | ||
int PeekInt(); | ||
uint PeekUInt(); | ||
float PeekFloat(); | ||
double PeekDouble(); | ||
|
||
/// <summary> | ||
/// Note that "maxLength" only limits the number of characters in a string, not its size in bytes. | ||
/// </summary> | ||
string PeekString(int maxLength); | ||
|
||
string PeekString(); | ||
bool TryGetByte(out byte result); | ||
bool TryGetSByte(out sbyte result); | ||
bool TryGetBool(out bool result); | ||
bool TryGetChar(out char result); | ||
bool TryGetShort(out short result); | ||
bool TryGetUShort(out ushort result); | ||
bool TryGetInt(out int result); | ||
bool TryGetUInt(out uint result); | ||
bool TryGetLong(out long result); | ||
bool TryGetULong(out ulong result); | ||
bool TryGetFloat(out float result); | ||
bool TryGetDouble(out double result); | ||
bool TryGetString(out string result); | ||
bool TryGetStringArray(out string[] result); | ||
bool TryGetBytesWithLength(out byte[] result); | ||
void Clear(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// #pragma once | ||
// #ifndef INetDataWriter.cs_H_ | ||
// #define INetDataWriter.cs_H_ | ||
// | ||
// #endif | ||
|
||
using System; | ||
using System.Net; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace NebulaAPI.Interfaces; | ||
|
||
public interface INetDataWriter | ||
{ | ||
int Capacity | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
byte[] Data | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
int Length | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get; | ||
} | ||
|
||
void ResizeIfNeed(int newSize); | ||
void EnsureFit(int additionalSize); | ||
void Reset(int size); | ||
void Reset(); | ||
byte[] CopyData(); | ||
|
||
/// <summary> | ||
/// Sets position of NetDataWriter to rewrite previous values | ||
/// </summary> | ||
/// <param name="position">new byte position</param> | ||
/// <returns>previous position of data writer</returns> | ||
int SetPosition(int position); | ||
|
||
void Put(float value); | ||
void Put(double value); | ||
void Put(long value); | ||
void Put(ulong value); | ||
void Put(int value); | ||
void Put(uint value); | ||
void Put(char value); | ||
void Put(ushort value); | ||
void Put(short value); | ||
void Put(sbyte value); | ||
void Put(byte value); | ||
void Put(byte[] data, int offset, int length); | ||
void Put(byte[] data); | ||
void Put(bool value); | ||
void Put(IPEndPoint endPoint); | ||
void Put(string value); | ||
|
||
/// <summary> | ||
/// Note that "maxLength" only limits the number of characters in a string, not its size in bytes. | ||
/// </summary> | ||
void Put(string value, int maxLength); | ||
|
||
void Put<T>(T obj) where T : INetSerializable; | ||
void PutSBytesWithLength(sbyte[] data, int offset, int length); | ||
void PutSBytesWithLength(sbyte[] data); | ||
void PutBytesWithLength(byte[] data, int offset, int length); | ||
void PutBytesWithLength(byte[] data); | ||
void PutArray(Array arr, int sz); | ||
void PutArray(float[] value); | ||
void PutArray(double[] value); | ||
void PutArray(long[] value); | ||
void PutArray(ulong[] value); | ||
void PutArray(int[] value); | ||
void PutArray(uint[] value); | ||
void PutArray(ushort[] value); | ||
void PutArray(short[] value); | ||
void PutArray(bool[] value); | ||
void PutArray(string[] value); | ||
void PutArray(string[] value, int strMaxLength); | ||
} |
Oops, something went wrong.