63 lines
1.4 KiB
C#
63 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BallanceStalkerCore {
|
|
|
|
public enum BmmoClientStatus : UInt32 {
|
|
Ready,
|
|
Initializing,
|
|
Running,
|
|
Stopping,
|
|
Stopped
|
|
}
|
|
|
|
public struct VxVector {
|
|
float x, y, z;
|
|
}
|
|
public struct VxQuaternion {
|
|
float x, y, z, w;
|
|
}
|
|
public struct VxBallState {
|
|
UInt32 player_id;
|
|
VxVector pos;
|
|
VxQuaternion quad;
|
|
}
|
|
|
|
public class PlayerEntity {
|
|
public string mPlayerName;
|
|
public UInt32 mPlayerGnsUid;
|
|
public bool mPlayerCheated;
|
|
}
|
|
|
|
public class BmmoClient {
|
|
public BmmoClient(LogManager logger) {
|
|
mLogger = logger;
|
|
}
|
|
|
|
// receive message in godot, you should use call_defer functions to
|
|
// reflact data delivered by event on engine
|
|
#region event system
|
|
public event Action<VxBallState[]> EventBallState;
|
|
public event Action<string, string> EventChat;
|
|
|
|
public event Action<PlayerEntity> EventPlayerConnect;
|
|
public event Action<UInt32> EventPlayerDisconnect;
|
|
#endregion
|
|
|
|
private LogManager mLogger;
|
|
private Dictionary<UInt32, PlayerEntity> mPlayersDict;
|
|
|
|
public void Start(string host, UInt16 port) {
|
|
|
|
}
|
|
|
|
public void Stop() {
|
|
|
|
}
|
|
|
|
}
|
|
}
|